torc::generic::Root Class Reference

Root of the EDIF Object Model. More...

#include <Root.hpp>

Inheritance diagram for torc::generic::Root:

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

Collaboration graph
[legend]

List of all members.

Public Types

typedef VisitorType< RootVisitor

Public Member Functions

virtual void addLibrary (const LibrarySharedPtr &inLibrary) throw (Error)
virtual void removeLibrary (const std::string &inName) throw (Error)
virtual LibrarySharedPtr findLibrary (const std::string &inName) throw ()
virtual void getLibraries (std::vector< LibrarySharedPtr > &outLibraries) throw ()
template<typename _Action>
void applyOnAllLibraries (const _Action &action) throw (Error)
virtual void addDesign (const DesignSharedPtr &inDesign) throw (Error)
virtual void removeDesign (const std::string &inName) throw (Error)
virtual DesignSharedPtr findDesign (const std::string &inName) throw ()
virtual void getDesigns (std::vector< DesignSharedPtr > &outDesigns) throw ()
template<typename _Action>
void applyOnAllDesigns (const _Action &action) throw (Error)
virtual void accept (BaseVisitor &inoutVisitor) throw (Error)
const EdifVersion getVersion () const throw ()
void setVersion (const EdifVersion &inSource) throw ()
const EdifLevel getLevel () const throw ()
void setLevel (const EdifLevel &inSource) throw ()

Private Member Functions

 Root (const Root &source) throw ()
Rootoperator= (const Root &source) throw ()

Private Attributes

EdifLevel mLevel
SymTab< std::string,
LibrarySharedPtr > 
mLibraries
SymTab< std::string,
DesignSharedPtr > 
mDesignSymTab
EdifVersion mVersion

Friends

class FactoryType< Root >

Classes

class  Factory


Detailed Description

Root of the EDIF Object Model.

The Root class represents and EDIF hierarchy. All parsed EDIF files contribute to the growth of the object tree rooted here. At the top level, it provides access to the libraries present in the design.

Note:
In case the tree has been programatically created, clients need to decompile this tree, a name has to be given to the tree, otherwise an exception will be generated. This name will become the design name of the decompiled output file. For parser generated trees, the design name of the last file parsed becomes the name of the root. This can obviously be changed by the client, by calling the set_name() method.

Definition at line 64 of file Root.hpp.


Member Typedef Documentation

Convenience typedef for visiting the root

Definition at line 83 of file Root.hpp.


Member Function Documentation

void torc::generic::Root::addLibrary ( const LibrarySharedPtr &  inLibrary  )  throw (Error) [virtual]

Add a library to the list of libraries. If an empty pointer is supplied, it returns without doing anything.

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

Parameters:
[in] inLibrary A pointer to a library object.
Exceptions:
Error Library could not be added. because Library name is empty
Error Library could not be added. because Library name is already exists

Definition at line 52 of file Root.cpp.

void torc::generic::Root::removeLibrary ( const std::string &  inName  )  throw (Error) [virtual]

Remove the specified library from the list of libraries.

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

Parameters:
inName Name of the object to be delete
Exceptions:
Error Empty Library name
Error Library not preset in collection

Definition at line 98 of file Root.cpp.

LibrarySharedPtr torc::generic::Root::findLibrary ( const std::string &  inName  )  throw () [virtual]

Find a library by name, in the list of libraries.

Parameters:
[in] inName String specifying the name of the library.
Returns:
A pointer to the libary if found, an empty pointer otherwise.
Note:
If some libraries 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 library by name, in the list of libraries.

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

Definition at line 155 of file Root.cpp.

void torc::generic::Root::getLibraries ( std::vector< LibrarySharedPtr > &  outLibraries  )  throw () [virtual]

Get the list of libraries.

Parameters:
[out] outLibraries List of libraries contained in the root
Note:
If some libraries 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 libraries.

Parameters:
[out] outLibraries List of libraries

Definition at line 139 of file Root.cpp.

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

Apply action on all Libraries.

Parameters:
[in] action Action to be applied
Note:
If some libraries 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 libraries under the root.
Apply action on all Libraries.
Parameters:
[in] action Action to be applied

Definition at line 377 of file Root.hpp.

void torc::generic::Root::addDesign ( const DesignSharedPtr &  inDesign  )  throw (Error) [virtual]

Add a design to the list of designs. If an empty pointer is supplied, it returns without doing anything.

Parameters:
[in] inDesign A pointer to a design object.
Exceptions:
Error Design could not be added. because design name is empty
  • Id : eMessageIdErrorEmptyItemName
Error Design could not be added. because Library name is already exists
  • Id : eMessageIdErrorItemAlreadyExists
Add a design to the list of designs. If an empty pointer is supplied, it returns without doing anything.

Definition at line 171 of file Root.cpp.

void torc::generic::Root::removeDesign ( const std::string &  inName  )  throw (Error) [virtual]

Remove the specified design from the list of designs.

Parameters:
inName Name of the object to be delete
Exceptions:
Error Empty design name
  • Id : eMessageIdErrorEmptyItemName
Error design not preset in collection
  • Id : eMessageIdErrorItemNotFound
Remove the specified Design from the list of libraries. If an empty pointer is passed, it returns without doing anything

Definition at line 201 of file Root.cpp.

DesignSharedPtr torc::generic::Root::findDesign ( const std::string &  inName  )  throw () [virtual]

Find a design by name, in the list of designs.

Parameters:
[in] inName String specifying the name of the design.
Returns:
A pointer to the design if found, an empty pointer otherwise.
Find a Design by name, in the list of libraries.

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

Definition at line 238 of file Root.cpp.

void torc::generic::Root::getDesigns ( std::vector< DesignSharedPtr > &  outDesigns  )  throw () [virtual]

Get the list of designs.

Parameters:
[out] outDesigns List of designs contained in the root
Get the list of designs.

Parameters:
[out] outDesigns List of libraries

Definition at line 225 of file Root.cpp.

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

Apply action on all Designs.

Parameters:
[in] action Action to be applied

Definition at line 400 of file Root.hpp.

void torc::generic::Root::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 275 of file Root.cpp.

const EdifVersion torc::generic::Root::getVersion (  )  const throw () [inline]

Get the version of EDIF present in the tree.

Returns:
Version of edif

Definition at line 419 of file Root.hpp.

void torc::generic::Root::setVersion ( const EdifVersion inSource  )  throw ()

Set the version of EDIF being used. This should be 2 0 0 for the current EOM version.

Parameters:
[in] inSource An object of type EdifVersion.

Definition at line 294 of file Root.cpp.

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

The the level of EDIF file.

Returns:
The EDIF level for this file

Definition at line 429 of file Root.hpp.

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

Set the EDIF level.

Note:
Current parser supports LEVEL_0 edif only.
Parameters:
[in] inSource EdifLevel object
Set the EDIF level.

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

Definition at line 306 of file Root.cpp.


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

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