Protected Member Functions | Friends

SCH::LIB_SOURCE Class Reference

Class LIB_SOURCE is an abstract class from which implementation specific LIB_SOURCEs may be derived, one for each kind of library type allowed in the library table. More...

#include <sch_lib.h>

Inheritance diagram for SCH::LIB_SOURCE:

List of all members.

Protected Member Functions

const STRINGGetSourceType ()
 < derived classes must implement
const STRINGGetSourceURI ()
 Function GetSourceURI returns absolute location of the library source.
virtual void ReadPart (STR_UTF *aResult, const STRING &aPartName, const STRING &aRev="")=0 throw ( IO_ERROR )
 Function ReadPart fetches aPartName's s-expression into aResult after clear()ing aResult.
virtual void ReadParts (STR_UTFS *aResults, const STRINGS &aPartNames)=0 throw ( IO_ERROR )
 Function ReadParts fetches the s-expressions for each part given in aPartNames, into aResults, honoring the array indices respectfully.
virtual void GetCategories (STRINGS *aResults)=0 throw ( IO_ERROR )
 Function GetCategories fetches all categories present in the library source into aResults.
virtual void GetCategoricalPartNames (STRINGS *aResults, const STRING &aCategory="")=0 throw ( IO_ERROR )
 Function GetCategoricalPartNames fetches all the part names for aCategory, which was returned by GetCategories().
virtual void GetRevisions (STRINGS *aResults, const STRING &aPartName)=0 throw ( IO_ERROR )
 Function GetRevisions fetches all revisions for aPartName into aResults.
virtual void FindParts (STRINGS *aResults, const STRING &aQuery)=0 throw ( IO_ERROR )
 Function FindParts fetches part names for all parts matching the criteria given in aQuery, into aResults.

Friends

class LIBS
 the LIB factory is thru LIB_TABLE::LookupPart()
class LIB
 the LIB uses these functions.

Detailed Description

Class LIB_SOURCE is an abstract class from which implementation specific LIB_SOURCEs may be derived, one for each kind of library type allowed in the library table.

The class name stems from the fact that this interface only provides READ ONLY functions.

Author:
Dick Hollenbeck

Definition at line 48 of file sch_lib.h.


Member Function Documentation

const STRING& SCH::LIB_SOURCE::GetSourceType (  )  [inline, protected]

< derived classes must implement

Function GetSourceType returns the library table entry's type for this library source.

Definition at line 59 of file sch_lib.h.

{ return sourceType; }

virtual void SCH::LIB_SOURCE::ReadParts ( STR_UTFS aResults,
const STRINGS aPartNames 
) throw ( IO_ERROR ) [protected, pure virtual]

Function ReadParts fetches the s-expressions for each part given in aPartNames, into aResults, honoring the array indices respectfully.

Parameters:
aPartNames is a list of part names, one name per list element. If a part name does not have a version string, then the most recent version is fetched.
aResults receives the s-expressions
virtual void SCH::LIB_SOURCE::GetCategoricalPartNames ( STRINGS aResults,
const STRING aCategory = "" 
) throw ( IO_ERROR ) [protected, pure virtual]

Function GetCategoricalPartNames fetches all the part names for aCategory, which was returned by GetCategories().

Parameters:
aCategory is a subdividing navigator within the library source, but may default to empty which will be taken to mean all categories.
aResults is a place to put the fetched result, one category per STRING.

Implemented in SCH::DIR_LIB_SOURCE.

virtual void SCH::LIB_SOURCE::GetRevisions ( STRINGS aResults,
const STRING aPartName 
) throw ( IO_ERROR ) [protected, pure virtual]

Function GetRevisions fetches all revisions for aPartName into aResults.

Revisions are strings like "rev12", "rev279", and are library source agnostic. These do not have to be in a contiguous order, but the first 3 characters must be "rev" and subsequent characters must consist of at least one decimal digit. If the LIB_SOURCE does not support revisions, it is allowed to return a single "" string as the only result. This means aPartName is present in the libsource, only once without a revision. This is a special case.

Implemented in SCH::DIR_LIB_SOURCE.

virtual void SCH::LIB_SOURCE::FindParts ( STRINGS aResults,
const STRING aQuery 
) throw ( IO_ERROR ) [protected, pure virtual]

Function FindParts fetches part names for all parts matching the criteria given in aQuery, into aResults.

The query string is designed to be easily marshalled, i.e. serialized, so that long distance queries can be made with minimal overhead. The library source needs to have an intelligent friend on the other end if the actual library data is remotely located, otherwise it will be too slow to honor this portion of the API contract.

Parameters:
aQuery is a string holding a domain specific query language expression. One candidate here is an s-expression that uses (and ..) and (or ..) operators and uses them as RPN. For example "(and (footprint 0805)(value 33ohm)(category passives))". The UI can shield the user from this if it wants.
aResults is a place to put the fetched part names, one part per STRING.

Implemented in SCH::DIR_LIB_SOURCE.


The documentation for this class was generated from the following file: