torc::generic::Library Class Reference

An EDIF cell library. More...

#include <Library.hpp>

Inheritance diagram for torc::generic::Library:

Inheritance graph
[legend]
Collaboration diagram for torc::generic::Library:

Collaboration graph
[legend]

List of all members.

Public Types

typedef VisitorType< LibraryVisitor

Public Member Functions

virtual void accept (BaseVisitor &inoutVisitor) throw (Error)
const EdifLevel getLevel () const throw ()
void setLevel (const EdifLevel &inSource) throw ()
const std::map< Unit, ScaleFactorgetScaleFactors () const throw ()
bool findScaleFactor (Unit inUnit, ScaleFactor &outResult) const throw ()
bool setScaleFactor (Unit inUnit, const ScaleFactor &inScale) throw ()
void addCell (const CellSharedPtr &inCell) throw (Error)
virtual CellSharedPtr findCell (const std::string &inName) throw (Error)
void removeCell (const std::string &inName) throw (Error)
virtual void getCells (std::vector< CellSharedPtr > &outCells) throw ()
template<typename _Action>
void applyOnAllCells (const _Action &action) throw (Error)
const SimulationInfoSharedPtr getSimulationInfo () const throw ()
void setSimulationInfo (const SimulationInfoSharedPtr &inSource) throw ()

Private Member Functions

 Library (const Library &)
Libraryoperator= (const Library &)

Private Attributes

SymTab< Unit, ScaleFactormScaleFactors
EdifLevel mLevel
SymTab< std::string,
CellSharedPtr > 
mCellSymTab
SimulationInfoSharedPtr mSimulationInfo

Friends

class FactoryType< Library >

Classes

class  Factory


Detailed Description

An EDIF cell library.

A Library object defines a collection of EDIF libraries

Definition at line 58 of file Library.hpp.


Member Typedef Documentation

Convenience typedef for visiting a library

Definition at line 79 of file Library.hpp.


Member Function Documentation

void torc::generic::Library::accept ( BaseVisitor inoutVisitor  )  throw (Error) [virtual]

Recive a inoutVisitor to this class. The visit method of the inoutVisitor is called and a reference to this object is passed as a parameter. It has to be noted however, that a dynamic_cast is performed inside this method. If the cast fails, an appropriate exception is thrown by this method. This sitation can arise when the passed Visitor object does not inherit from the appropriate inoutVisitor specialization. See Visitor documentation for more details.

Parameters:
[in,out] inoutVisitor A reference to the inoutVisitor object
Exceptions:
Error Visitor type inappropriate for visiting this object or any other error thrown by the Visitor::throw() method.

Implements torc::generic::Visitable.

Definition at line 108 of file Library.cpp.

const EdifLevel torc::generic::Library::getLevel (  )  const throw () [inline]

The the level of EDIF file.

Returns:
The EDIF level for this file

Definition at line 329 of file Library.hpp.

void torc::generic::Library::setLevel ( const EdifLevel inSource  )  throw ()

Set the EDIF level.

Note:
Current parser supports LEVEL_1 edif only.
Parameters:
[in] inSource EdifLevel object

Definition at line 129 of file Library.cpp.

const std::map< Unit, ScaleFactor > torc::generic::Library::getScaleFactors (  )  const throw () [inline]

Get scale factors for different units in the library.

Returns:
Scale factors

Definition at line 339 of file Library.hpp.

bool torc::generic::Library::findScaleFactor ( Unit  inUnit,
ScaleFactor outResult 
) const throw ()

Find a scale factor for the given unit.

Parameters:
[in] inUnit Units for which scale factor is to be found.
[out] outResult The scale factor if found.
Returns:
true if found, false otherwise

Definition at line 142 of file Library.cpp.

bool torc::generic::Library::setScaleFactor ( Unit  inUnit,
const ScaleFactor inScale 
) throw ()

Set a scale factor for the given unit.

Parameters:
[in] inUnit Units for which scale factor is to be set.
[out] inScale The scale factor to store.
Returns:
True if set
Set a scale factor for the given unit.

Parameters:
[in] inUnit Units for which scale factor is to be set.
[out] inScale The scale factor to store.

Definition at line 155 of file Library.cpp.

void torc::generic::Library::addCell ( const CellSharedPtr &  inCell  )  throw (Error)

Add a cell to the list of cells. If an empty pointer is supplied, it returns without doing anything. If an cell already exists in EDIF file in same library, parser ignores the cell.

Parameters:
[in] inCell A pointer to a cell object.
Exceptions:
Error Cell could not be added, because Cell name is empty
  • Id : eMessageIdErrorEmptyItemName
  • Context Data
    • Cell name - String
Error Cell could not be added, because Cell name is already exists
  • Id : eMessageIdErrorItemAlreadyExists
  • Context Data
    • Cell name - String
Add a cell to the list of cells. If an empty pointer is supplied, it returns without doing anything.

Parameters:
[in] inCell A pointer to a cell object.
Exceptions:
Error Cell could not be added.

Definition at line 168 of file Library.cpp.

CellSharedPtr torc::generic::Library::findCell ( const std::string &  inName  )  throw (Error) [virtual]

Find a cell by name, in the list of cells.

Parameters:
[in] inName String inSource specifying the name of the cell.
Returns:
A pointer to the cell if found, an empty pointer otherwise.
Exceptions:
Error Cell could not be found, because Cell name is empty
  • Id : eMessageIdErrorEmptyItemName
  • Context Data
    • Cell name - String
Note:
If some cells are yet to be restored, this method is not thread safe. For non-serializable mode this is thread safe. For dump mode derived classes can override this to make it thread safe by placing appropriate locks.
Find a cell by name, in the list of cells.

Parameters:
[in] inName String inSource specifying the name of the cell.
Returns:
A pointer to the cell if found, an empty pointer otherwise.

Definition at line 212 of file Library.cpp.

void torc::generic::Library::removeCell ( const std::string &  inName  )  throw (Error)

Remove the specified cell from the list of cells. If an empty pointer is passed, it returns without doing anything

Parameters:
inName Name of the object to be delete
Exceptions:
Error Cell name is empty
  • Id : eMessageIdErrorEmptyItemName
  • Context Data
    • Cell name - String
Error Cell name not preset in collection.
  • Id : eMessageIdErrorItemNotFound
  • Context Data
    • Cell name - String
Remove the specified cell from the list of cells. If an empty pointer is passed, it returns without doing anything

Parameters:
inCell Pointer to a cell object.
Exceptions:
Error Cell name is empty
Error Cell name not preset in collection.

Definition at line 240 of file Library.cpp.

void torc::generic::Library::getCells ( std::vector< CellSharedPtr > &  outCells  )  throw () [virtual]

Get the list of cells. The list of cells is appended to the provided list

Parameters:
[out] outCells List of cells to be populated
Returns:
List of cells in the library.
Note:
If some cells are yet to be restored, this method is not thread safe. For non-serializable mode this is thread safe. For dump mode derived classes can override this to make it thread safe by placing appropriate locks. In dump mode using this method will lead to restoration of all children.
Get the list of cells.

Returns:
List of cells in the library.

Definition at line 281 of file Library.cpp.

template<typename _Action>
void torc::generic::Library::applyOnAllCells ( const _Action &  action  )  throw (Error) [inline]

Apply action on all Cells.

Parameters:
[in] action Action to be applied
Note:
If some cells are yet to be restored, this method is not thread safe. For non-serializable mode this is thread safe. For dump mode derived classes can write an appropriate thread safe wrapper method that can be accesed using visitors. However, using this method in dump mode should be avoided unless under dire situations, as it will lead to restoration of all cells under the library.
Apply action on all Cells.
Parameters:
[in] action Action to be applied

Definition at line 352 of file Library.hpp.

const SimulationInfoSharedPtr torc::generic::Library::getSimulationInfo (  )  const throw () [inline]

Get the pointer to the simulation info.

Returns:
Pointer to the simulation info

Definition at line 373 of file Library.hpp.

void torc::generic::Library::setSimulationInfo ( const SimulationInfoSharedPtr &  inSource  )  throw ()

Set the pointer to the simulation info.

Parameters:
[in] inSource Pointer to the simulation info

Definition at line 295 of file Library.cpp.


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

Generated on Thu Oct 13 16:50:07 2011 for TORC by  doxygen 1.5.6