oaLibDef Class Reference

Inheritance diagram for oaLibDef:

oaLibDefListMem oaSessionObject oaObject


Public Methods

void getLibName (oaScalarName &libName) const
void getLibPath (oaString &path) const
void getLibWritePath (oaString &writePath) const
void setLibWritePath (const oaString &writePath)
oaLibMode getLibMode () const
void setLibMode (oaLibMode libMode)
void getLibAttributes (oaDMAttrArray &attrs) const
void addLibAttribute (const oaString &attrName, const oaString &attrVal)
void removeLibAttribute (const oaString &attrName)

Static Public Methods

oaLibDef * create (oaLibDefList *defList, const oaScalarName &libName, const oaString &libPath, const oaString &writePath="", oaLibMode libMode=oacSharedLibMode, const oaDMAttrArray *libAttrs=NULL, oaLibDefListMem *followingMem=NULL)
oaLibDef * find (const oaLibDefList *defList, const oaScalarName &libName)

Detailed Description

oaLibDef is a derived class of oaLibDefListMem. It represents a library definition included in the owning library definition list (oaLibDefList).


Member Function Documentation

void oaLibDef::addLibAttribute const oaString &    attrName,
const oaString &    attrVal
 

This function adds a new library attribute to this oaLibDef object. The attribute is a name/value pair. If an attribute with the provided name already exists, it is overwritten.

Parameters:
attrName The name for the attribute.
attrVal The value for the attribute.

oaLibDef * oaLibDef::create oaLibDefList *    defList,
const oaScalarName &    libName,
const oaString &    libPath,
const oaString &    writePath = "",
oaLibMode    libMode = oacSharedLibMode,
const oaDMAttrArray *    libAttrs = NULL,
oaLibDefListMem *    followingMem = NULL
[static]
 

This function creates an oaLibDef object and places it in the specified defList with the specified parameters. The libDef will be positioned in the owning defList before the followingMem if it is specified; otherwise it will positioned at the end of defList.

Note that the writePath and libMode parameters as well as any attributes contained in the optional libAttrs oaDMAttrArray will be written out to the top file associated with the owning defList when a save operation is performed on the oaLibDefList. Each attribute will be written in the file in a separate ASSIGN statement (see oaLibDefList for more information on the format of the ASSIGN statement used in library definition files).

Parameters:
defList - required input parameter. The owning oaLibDefList object in which this object will be placed.
libName - required input parameter. The logical name of the library
libPath - required input parameter. The physical path to the library. A Relative path is supported, which should be specified relative to the path of the file associated with the owning defList.
writePath - optional input parameter. The write path of the library. A relative path is supported, which should relative to the path of the associated with the owning defList. When a subsequent save is performed on the owning defList, this attribute value will be saved with the "writePath" attribute name in a library definition file ASSIGN statement.
libMode - optional input parameter. The mode of the library. The default value is oacSharedLibMode. When a subsequent save is performed on the owning defList, this attribute value will be saved with the "libMode" attribute name in a library definition file ASSIGN statement.
libAttrs - optional input parameter array. An oaDMAttrArray of library attributes. When a subsequent save is performed on the owning defList, each attribute name and value will be saved in the library definition file in a separate ASSIGN statement.
followingMem - optional input parameter. The member in the ordered defList that this libDef will be positioned before. If NULL is specified, this libDef will be positioned at the end of the owning defList.
Exceptions:
oacLibDefExists 
oacInvalidLibDefListMemCreate 

oaLibDef * oaLibDef::find const oaLibDefList *    defList,
const oaScalarName &    libName
[static]
 

This function finds the libDef object in the specified defList list with the given libName. Users can create only one library definition in a libDefList with a library name (see oaLibDef::create).

Note also, if oaLibDefList::openLibs() finds library definitions library definition file hierarchy with the same logical library name, it will open the last of the multiply-defined libraries.

Parameters:
defList The oaLibDefList object which this object is in.
libName The logical name of the library.

void oaLibDef::getLibAttributes oaDMAttrArray &    attrs const
 

This function fills in the library attributes array of this libDef object. If there are no attributes in this definition, an empty array is returned.

Parameters:
attrs output parameter - the attributes array of the library that this libDef object defines.

oaLibMode oaLibDef::getLibMode   const
 

This function returns the access mode of the library that this libDef object defines (see oaLibMode for further information).

void oaLibDef::getLibName oaScalarName &    libName const
 

This function fills in the library name of the library that this libDef object defines.

Parameters:
libName output parameter - the logical name of the library.

void oaLibDef::getLibPath oaString &    path const
 

This function fills in the library path of the library that this libDef object defines.

Parameters:
path output parameter - the physical path to the library.

void oaLibDef::getLibWritePath oaString &    writePath const
 

This function gets the write path of the library associated with this libDef object.

Parameters:
writePath output parameter - the write path of the library associated with this libDef.

void oaLibDef::removeLibAttribute const oaString &    attrName
 

This function removes the specified attribute from this oaLibDef object. If the named attribute does not exist, the operation is ignored.

Parameters:
attrName The name of the attribute to be removed.

void oaLibDef::setLibMode oaLibMode    mode
 

This function sets the mode for this oaLibDef object.

Parameters:
mode The mode indicates whether the library specified by this oaLibDef object will have shared, non-shared (only the current process can access and write to the library), or read-only mode when the library is opened during the oaLibDefList::openLibs process. see oaLibMode for further information.
See also:
oaLib::getMode

void oaLibDef::setLibWritePath const oaString &    writePath
 

This function specifies the writePath for the library defined in this oaLibDef object. The writePath specifies the path to a directory that the oaLib can use to create temporary files.

See also:
oaDMObject::getTempFile

oaLib::getWritePath

Parameters:
writePath The path to the directory in which to create temporary files.


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

Return to top of page