oaLib Class Reference

Inheritance diagram for oaLib:

oaDMContainer oaDMObject oaObject


Public Methods

void close ()
void getName (oaScalarName &name) const
void getName (const oaNameSpace &ns, oaString &out) const
void getPath (oaString &path) const
void getFullPath (oaString &fullPath) const
void getWritePath (oaString &writePath) const
oaLibMode getMode () const
void getDMSystemName (oaString &dmSystem) const
void getAttributes (oaDMAttrArray &attrs) const
oaBoolean isReadable () const
oaBoolean isWritable () const
oaBoolean isMarkedToBeClosed () const
void setAttributes (const oaDMAttrArray &attrs)
oaBoolean getAccess (oaLibAccess accessType, oaUInt4 timeout=0)
void releaseAccess ()
oaLibAccessLevel getAccessLevel () const
oaBoolean hasVC () const
oaUInt8 calcVMSize () const
oaDMObjectIter getControlledObjects (oaVCQueryDepth depth=oacCellViewFileVCQueryDepth, oaDMObject *top=NULL, oaBoolean localOnly=false)
oaDMObjectVersionRefIter getWorkingVersions (oaVCQueryDepth depth=oacCellViewFileVCQueryDepth) const
oaCollection< oaCell, oaLib > getCells () const
oaCollection< oaView, oaLib > getViews () const
oaCollection< oaView, oaLib > getViewsByName (const oaScalarName &name) const
oaCollection< oaCellView, oaLib > getCellViews () const
oaCollection< oaGroup, oaLib > getGroups () const
oaCollection< oaGroup, oaLib > getGroups (oaGroupDef *def) const
oaCollection< oaGroup, oaLib > getGroupsByName (const oaString &name) const

Static Public Methods

oaLib * create (const oaScalarName &name, const oaString &libPath, oaLibMode mode=oacSharedLibMode, const oaString &dmSystem="oaDMSystem", const oaDMAttrArray *dmAttrList=NULL)
oaLib * open (const oaScalarName &name, const oaString &libPath, const oaString &writePath="", oaLibMode mode=oacSharedLibMode)
oaLib * find (const oaScalarName &name)
oaBoolean exists (const oaString &libPath)
oaCollection< oaLib, oaLib > getOpenLibs ()

Public Types

enum  { dtIndex = oacLibDataType }

Detailed Description

An oaLib is a collection of design data represented as a library database and library data.

The library database contains all information about the on-disk library including the cells, views, cellViews, associated data files on disk, and associated information about this data.

Libraries have several different roles and purposes:

It is possible to store all these types of data in a single library. Usually, however, the reference data and technology parameters are stored in a single library.

A library is also a logical container object that contains cells, views, cellViews, and files, as follows:

The oaLib class can be observed by deriving from oaObserver<oaLib>.

Library Access

Before any library structure data -- such as oaCells, oaViews, oaCellViews, oaDMFiles, and their attributes -- is accessed, the application must obtain read library access. Before changing anything in the library structure, the application must obtain write library access. Read and write library access is obtained through the appropriate oaLib::getAccess call.

For example, read-only oaLib functions, such as oaLib::getCells, oaLib::getViews, and oaLib::getCellViews, require read access to the library, and set() functions, such as oaLib::setAttributes, require write access to the library. However, oaLib static functions and oaLib functions that access static data on an oaLib, such as oaLib::create, oaLib::open, or oaLib::find, do not require library access.

Note: If an oaLib function requires library access, this requirement is noted in the function description. If the library access must be write access, this requirement also is noted.

You can use oaLib::hasAccess(), oaLib::hasWriteAccess and oaLib::getAccessType() to obtain information about library access status. Library access persists until ended through an oaLib::releaseAccess call.

The OpenAccess design, wafer, tech, and parasitic database functions have library access built in -- users do not have to obtain library access to open or modify the oaDesign, oaWafer, oaTech, and parasitics databases. Before opening any of these database objects, OpenAccess first looks to see if the user has obtained library access; if not, OpenAccess will attempt to get access. If Open Access cannot get library access, an exception is thrown. When OA obtains library access, it is held for as short a time as possible within the span of the API call.

For more Information on accessing and working with OpenAccess libraries, see OpenAccess 2.2 Libraries and Design Management in the Programmers Guide.


Member Function Documentation

oaUInt8 oaLib::calcVMSize   const
 

This function calculates and returns the amount of virtual memory this library database is currently using.

Note: This function does not require library access. For more information on library access, see Library Access in the detailed description for oaLib.

void oaLib::close  
 

This function closes the library. All of its contents become inaccessible, all its library access calls are released, and its non-committed changes are lost.

Note: This function does not require library access. For more information on library access, see classoaLib.html Library Access in the detailed description for oaLib. classoaLib.html classoaLib.html

oaLib * oaLib::create const oaScalarName &    name,
const oaString &    libPath,
oaLibMode    mode = oacSharedLibMode,
const oaString &    dmSystem = "oaDMSystem",
const oaDMAttrArray *    dmAttrList = NULL
[static]
 

This function creates the library using the specified name and attributes. The directory specified by libPath will be created to hold the library files.

Example: If libPath is specified as usr1/mylibs/project1/cells, the /usr1/mylibs/project1/ parent directory must exist and /usr1/mylibs/project1/cells must not exist.

Note that the creator of a library is responsible for adding the library definition (library name and path) of the newly-created library in the library definition file used by OpenAccess applications (see oaLibDefFile::addLib for more information).

Note: This function does not require library access. For more information on library access, see Library Access in the detailed description for oaLib.

Parameters:
name the name of the library to create
libPath an absolute or relative path to the library directory. The specified directory will be created to hold the library files.
mode the access mode of the library to create
dmSystem the dmSystem name of the library to create
dmAttrList A list of persistent attributes to be given to the new library. The set of valid attribute names and values are defined by a specific DM system and the Version Control system that it uses.
Exceptions:
oacLibNameExists - a library with the specified name already exists
oacLibCouldNotCreate - libPath is an empty string; it specifies the name of an existing file or a non-empty directory; or the directory specified by libPath is not writeable
Note: This function also throws an oaOSError if the libPath is not a syntactically valid directory name or the parent directory specified in libPath -- up to but not including the library name -- does not exist.

oaBoolean oaLib::exists const oaString &    libPath [static]
 

This function returns true if a library directory exists at the given libPath.

Note: This function does not require library access. For more information on library access, see Library Access in the detailed description for oaLib.

Parameters:
libPath an absolute or relative path to the library directory.

oaLib * oaLib::find const oaScalarName &    name [static]
 

This function attempts to find an open library with the specified name. If found, a pointer to the library is returned. If the library cannot be found, NULL is returned.

Note: This function does not require library access. For more information on library access, see Library Access in the detailed description for oaLib.

Parameters:
name the name of the library to be found.

oaBoolean oaLib::getAccess oaLibAccess    accessType,
oaUInt4    timeout = 0
 

This function tries to get the requested access for the library. A boolean is returned which indicates success or failure. Library access cannot be upgraded (changed from read to write), so an exception is thrown if this is attempted.

Parameters:
accessType the type of access requested on this library
timeout an optional timeout in seconds for the function to wait to obtain the requested access
Exceptions:
oacLibAccessCannotUpgrade 

oaLibAccessLevel oaLib::getAccessLevel   const
 

This function returns the level of access that the user has on the library. There are three levels of access: no access, read access, and write access.

void oaLib::getAttributes oaDMAttrArray &    attrs const
 

This function returns the attributes defined for this library and its Design Management (DM) and Version Control (VC) systems when the library was created.

Note: This function requires access to this library (through oaLib::getAccess). An oacLibAccessDenied exception is thrown if access to the library does not exist.

For more information on library access, see Library Access in the detailed description for oaLib.

Parameters:
attrs Contains the list of attributes associated with the library and its DM and VC systems.
Exceptions:
oacLibAccessDenied 

oaCollection< oaCell, oaLib > oaLib::getCells   const
 

This function returns a collection of cells in this library.

Note: This function requires access to this library (through oaLib::getAccess). An oacLibAccessDenied exception is thrown if access to this library does not exist. For more information on library access, see Library Access in the detailed description for oaLib.

Exceptions:
oacLibAccessDenied 

oaCollection< oaCellView, oaLib > oaLib::getCellViews   const
 

This function returns a collection of cellViews in this library.

Note: This function requires access to this library (through oaLib::getAccess). An oacLibAccessDenied exception is thrown if access to this library does not exist. For more information on library access, see Library Access in the detailed description for oaLib.

Exceptions:
oacLibAccessDenied 

oaDMObjectIter oaLib::getControlledObjects oaVCQueryDepth    depth = oacCellViewFileVCQueryDepth,
oaDMObject *    top = NULL,
oaBoolean    localOnly = false
 

This function returns an array of the objects that the version control system reports as being controlled in this library.

Note: This function requires access to this library (through oaLib::getAccess). An oacLibAccessDenied exception is thrown if access to this library does not exist.

For more information on library access, see Library Access in the detailed description for oaLib.

Parameters:
depth this parameter is used to control the depth that this function will go in the hierarchy when applying this operation. The enum values have the following meanings:
oacFileVCQueryDepth: query only the immediate children files of this container

oacCellVCQueryDepth: stop the query at the Cell level, not including "cell files"

oacViewVCQueryDepth: stop the query at the View level, not including "view files"

oacCellViewVCQueryDepth: stop the query at the CellView level, not including "cellView" files

oacCellViewFileVCQueryDepth: stop the query at the CellView file level. This is currently the lowest level

oacMaxQueryDepth: query to the bottom of the hierarchy

Parameters:
top the object that represents the top of the query hierarchy. NULL indicates to start from the top of the library.
localOnly only return objects that also exist in the local directory
Exceptions:
oacLibAccessDenied 

void oaLib::getDMSystemName oaString &    dmSystem const
 

This function returns the name of the DMSystem associated with this library.

Note: This function does not require library access. For more information on library access, see Library Access in the detailed description for oaLib.

Parameters:
dmSystem output parameter - the returned name of the DMSystem associated with this file

void oaLib::getFullPath oaString &    fullPath const
 

This function returns the full (absolute) path to this library.

Note: This function does not require library access. For more information on library access, see Library Access in the detailed description for oaLib.

Parameters:
fullPath output parameter - the returned full (absolute) path to this library

oaCollection< oaGroup, oaLib > oaLib::getGroups oaGroupDef *    def const
 

This functions return a collection of groups in this lib database with the specified group definition.

Parameters:
def input group definition

oaCollection< oaGroup, oaLib > oaLib::getGroups   const
 

This function returns a collection of groups in this lib database.

Note: This function requires access to this library (through oaLib::getAccess). An oacLibAccessDenied exception is thrown if access to this library does not exist.

For more information on library access, see Library Access in the detailed description for oaLib.

Exceptions:
oacLibAccessDenied 

oaCollection< oaGroup, oaLib > oaLib::getGroupsByName const oaString &    name const
 

This function returns a collection of groups in this library database with the specified name.

Note: This function requires access to this library (through oaLib::getAccess). An oacLibAccessDenied exception is thrown if access to the library does not exist.

For more information on library access, see Library Access in the detailed description for oaLib.

Exceptions:
oacLibAccessDenied 

oaLibMode oaLib::getMode   const
 

This function returns the access mode of this library. This is the mode that was passed in when the library was opened or created.

Note: This function does not require library access. For more information on library access, see Library Access in the detailed description for oaLib.

void oaLib::getName const oaNameSpace &    ns,
oaString &    out
const
 

This function returns the name of this library. The name is returned as an oaString mapped to the specified namespace.

Note: This function does not require library access. For more information on library access, see Library Access in the detailed description for oaLib.

void oaLib::getName oaScalarName &    name const
 

This function returns the name of this library. The name is returned as an oaScalarName.

Note: This function does not require library access. For more information on library access, see Library Access in the detailed description for oaLib.

oaCollection< oaLib, oaLib > oaLib::getOpenLibs   [static]
 

This function returns a collection of open library databases.

Note: This function does not require library access. For more information on library access, see Library Access in the detailed description for oaLib.

void oaLib::getPath oaString &    path const
 

This function returns the path to this library.

Note: This function does not require library access. For more information on library access, see Library Access in the detailed description for oaLib.

Parameters:
path the path to the library directory is returned in this oaString.

oaCollection< oaView, oaLib > oaLib::getViews   const
 

This function returns a collection of views in this library.

Note: This function requires access to this library (through oaLib::getAccess). An oacLibAccessDenied exception is thrown if access to this library does not exist. For more information on library access, see Library Access in the detailed description for oaLib.

Exceptions:
oacLibAccessDenied 

oaCollection< oaView, oaLib > oaLib::getViewsByName const oaScalarName &    name const
 

This function returns a collection of views in this library database with the specified name.

Note: This function requires access to this library (through oaLib::getAccess). An oacLibAccessDenied exception is thrown if access to this library does not exist. For more information on library access, see Library Access in the detailed description for oaLib.

Exceptions:
oacLibAccessDenied 

oaDMObjectVersionRefIter oaLib::getWorkingVersions oaVCQueryDepth    depth = oacCellViewFileVCQueryDepth const
 

This function retrieves the version information of this library. The version information reported back is the version of the file that is currently visible in the user's workspace. The objects in the array must all be versionable and belong to this library.

Note: This function requires access to this library (through oaLib::getAccess). An oacLibAccessDenied exception is thrown if access to this library does not exist. For more information on library access, see Library Access in the detailed description for oaLib.

Parameters:
depth this parameter is used to control the depth that this function will go in the hierarchy when applying this operation. The enum values have the following meanings:
oacFileVCQueryDepth: query only the immediate children files of this container

oacCellVCQueryDepth: stop the query at the Cell level, not including "cell files"

oacViewVCQueryDepth: stop the query at the View level, not including "view files"

oacCellViewVCQueryDepth: stop the query at the CellView level, not including "cellView" files

oacCellViewFileVCQueryDepth: stop the query at the CellView file level. This is currently the lowest level

oacMaxQueryDepth: query to the bottom of the hierarchy

Exceptions:
oacLibAccessDenied 

void oaLib::getWritePath oaString &    writePath const
 

This function returns the write path to this library. This is the path to the directory that may be used as a place to create temporary files (using oaDMObject::getTempFile). The writePath is a non-persistent attribute of the library.

If the library is opened using oaLib::create, the writePath is the same as the library path. If the library is opened using oaLib::open, the writePath can be specified through the oaLib::open API.

When a library is specified in the library definition file (see oaLibDefList Detailed Description), the writePath may be specified as an attribute using the ASSIGN syntax, with the library attribute name of "writePath". If the writePath is not specified, it will default to the library path.

Note: This function does not require library access. For more information on library access, see Library Access in the detailed description for oaLib.

Parameters:
writePath the returned write path for this library

oaBoolean oaLib::hasVC   const
 

This function returns a boolean that indicates whether or not the library has a version control system associated with it.

Note: This function does not require library access. For more information on library access, see Library Access in the detailed description for oaLib.

oaBoolean oaLib::isMarkedToBeClosed   const
 

This function returns a boolean indicating whether or not this library is marked to be closed. Libraries can be marked "to be closed" when the current session's library definitions are being reloaded from the library definitions file.

Note: This function does not require library access. For more information on library access, see Library Access in the detailed description for oaLib.

oaBoolean oaLib::isReadable   const
 

This function returns true if the library is readable; false if not.

Note: This function does not require library access. For more information on library access, see Library Access in the detailed description for oaLib.

oaBoolean oaLib::isWritable   const
 

This function returns true if the library is writable; false if not.

Note: This function does not require library access. For more information on library access, see Library Access in the detailed description for oaLib.

oaLib * oaLib::open const oaScalarName &    name,
const oaString &    libPath,
const oaString &    writePath = "",
oaLibMode    mode = oacSharedLibMode
[static]
 

This function opens an existing library at the given path, using the specified name and attributes. An oacCannotOpenOpenedLib exception is thrown if the library is open.

Note: This function does not require library access. For more information on library access, see Library Access in the detailed description for oaLib.

Parameters:
name the name of the library to open
libPath an absolute or relative path to the library directory
writePath the path that is writable for the opened library
mode the mode of the library to open
Exceptions:
oacCannotOpenOpenedLib 

void oaLib::releaseAccess  
 

This function requests that the current access on this library be released. An exception is thrown if the library is not currently being accessed.

Exceptions:
oacLibReleaseNoAccess 

void oaLib::setAttributes const oaDMAttrArray &    attrs
 

This function sets the attributes specified in the given attrList array for this library and its associated Design Management (DM) and Version Control (VC) systems. The attributes are specific to the DM and VC systems, which may impose restrictions on what attributes may be changed.

Note: This function requires write access to this library (through oaLib::getAccess). An oacLibAccessDenied exception is thrown if write access to this library does not exist.

For more information on library access, see Library Access in the detailed description for oaLib.

Parameters:
attrs Contains the attributes to set for the library and its associated DM and VC systems.
Exceptions:
oacLibAccessDenied 


Member Enumeration Documentation

anonymous enum
 

Enumeration values:
dtIndex 


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

Return to top of page