torc-master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
torc::generic::Cell Class Reference

Represents an EDIF cell. More...

#include <Cell.hpp>

+ Inheritance diagram for torc::generic::Cell:
+ Collaboration diagram for torc::generic::Cell:

Data Structures

class  Factory
 

Public Types

enum  Type { eTypeTie = 0, eTypeRipper, eTypeGeneric }
 
typedef VisitorType< CellVisitor
 
typedef std::string Name
 
typedef boost::shared_ptr< TypePointer
 
typedef boost::weak_ptr< TypeWeakPointer
 

Public Member Functions

virtual void accept (BaseVisitor &inoutVisitor) throw (Error)
 
const Type getType () const
 
void setType (const Type &inSource)
 
void addView (const ViewSharedPtr &inView) throw (Error)
 
ViewSharedPtr findView (const std::string &inName)
 
void removeView (const std::string &inName) throw (Error)
 
void getViews (std::vector< ViewSharedPtr > &outViews) const
 
template<typename _Action >
void applyOnAllViews (const _Action &action) throw (Error)
 
virtual ~Cell () throw ()
 
void addComment (const std::string &comment)
 
const std::vector< std::string > & getComments () const
 
void setComments (const std::vector< std::string > &inSource)
 
bool getIsExtern () const
 
bool isExtern () const
 
void setIsExtern (bool inIsExtern)
 
virtual const std::string getName () const
 
void setName (const std::string &inSource) throw (Error)
 
const boost::shared_ptr< LibrarygetParent () const
 
virtual void setParent (const boost::shared_ptr< Library > &inSource)
 
PropertySharedPtr getProperty (const std::string &inName)
 
bool setProperty (const std::string &inName, const PropertySharedPtr &inProperty)
 
void getProperties (std::map< std::string, PropertySharedPtr > &outProperties) const
 
void setProperties (const std::map< std::string, PropertySharedPtr > &inSource)
 
template<typename _Action >
void applyOnAllProperties (const _Action &action) throw (Error)
 
virtual Name getOriginalName () const
 
virtual void setOriginalName (const Name &inSource)
 
void setWeakThis (const WeakPointer &inWeakThis)
 
Pointer getSharedThis () const
 
void getUserData (std::list< std::string > &outUserData) const
 
void setUserData (const std::list< std::string > &inSource)
 
void addUserData (const std::string &inSource)
 
void getStatuses (std::vector< StatusSharedPtr > &outStatus) const
 
void setStatuses (const std::vector< StatusSharedPtr > &inStatus)
 
void addStatus (const StatusSharedPtr &inStatus) throw (Error)
 
template<typename _Action >
void applyOnAllStatuses (const _Action &action) throw (Error)
 

Protected Member Functions

 Cell ()
 

Private Member Functions

 Cell (const Cell &rhs)
 
Celloperator= (const Cell &rhs)
 

Private Attributes

SymTab< std::string,
ViewSharedPtr
mViewSymTab
 
Type mType
 
ParameterMapSharedPtr mParameters
 

Friends

class FactoryType< Cell >
 

Detailed Description

Represents an EDIF cell.

The Cell class is used to implement an EDIF cell object. It contains the different views of a cell. A cell can be concrete or extern (black-box).

Note
Currently parser performs semantic checks for GENERIC type only. Programattic creation may be achieved. However, a warning may be emitted when cell type is set to TIE or RIPPER.

Definition at line 55 of file Cell.hpp.

Member Typedef Documentation

typedef std::string torc::generic::Renamable::Name
inherited

Definition at line 40 of file generic/Renamable.hpp.

typedef boost::shared_ptr<Type> torc::generic::SelfReferencing< Cell >::Pointer
inherited

Definition at line 36 of file SelfReferencing.hpp.

Convenience class to visit a Cell.

Definition at line 78 of file Cell.hpp.

typedef boost::weak_ptr<Type> torc::generic::SelfReferencing< Cell >::WeakPointer
inherited

Definition at line 37 of file SelfReferencing.hpp.

Member Enumeration Documentation

Type of cell.

Enumerator
eTypeTie 
eTypeRipper 
eTypeGeneric 

Definition at line 71 of file Cell.hpp.

Constructor & Destructor Documentation

torc::generic::Cell::~Cell ( )
throw (
)
virtual

Definition at line 169 of file Cell.cpp.

169 {}
torc::generic::Cell::Cell ( )
protected
torc::generic::Cell::Cell ( const Cell rhs)
private

Member Function Documentation

void torc::generic::Cell::accept ( BaseVisitor inoutVisitor)
throw (Error
)
virtual

Implements torc::generic::Visitable.

Definition at line 81 of file Cell.cpp.

81  {
82  try {
83  runVisitor(*this, inoutVisitor);
84  } catch(Error& e) {
85  e.setCurrentLocation(__FUNCTION__, __FILE__, __LINE__);
86  throw;
87  }
88 }
void runVisitor(_Tp &inoutVisited, BaseVisitor &inoutVisitor)
Definition: VisitorType.hpp:78

+ Here is the call graph for this function:

void torc::generic::Commentable::addComment ( const std::string &  comment)
inherited

Add a comment to the object

Parameters
[in]commentThe comment to add to an existing list of comments

Definition at line 36 of file Commentable.cpp.

36  {
37  mComments.push_back(comment);
38 }
std::vector< std::string > mComments
Definition: Commentable.hpp:77
void torc::generic::StatusContainer::addStatus ( const StatusSharedPtr inStatus)
throw (Error
)
inherited

Add a status to the vector of statuses. If an empty pointer is supplied, it returns without doing anything.

Parameters
[in]inStatusA pointer to a status object.
Exceptions
ErrorStatus could not be added.

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

Parameters
[in]inStatusA pointer to a status object.
Exceptions
ErrorStatus could not be added.

Definition at line 47 of file StatusContainer.cpp.

47  {
48  mStatuses.push_back(inStatus);
49 }
std::vector< StatusSharedPtr > mStatuses
void torc::generic::UserDataContainer::addUserData ( const std::string &  inSource)
inherited

Add an user data to the list of user data

Parameters
[in]inSourceAn user data as string

Definition at line 34 of file UserDataContainer.cpp.

34  {
35  mUserData.push_back(inSource);
36 }
std::list< std::string > mUserData
void torc::generic::Cell::addView ( const ViewSharedPtr inView)
throw (Error
)

Add a view to the list of views. An empty pointer will be ignored. If an view already exists in EDIF file in same cell, parser ignores the view.

Parameters
[in]inViewPointer to a view.
Exceptions
ErrorEmpty View type
  • Id : eMessageIdErrorEmptyItemName
ErrorView name already exists
  • Id : eMessageIdErrorItemAlreadyExists

Add a view to the list of views. An empty pointer will be ignored.

Parameters
[in]inViewPointer to a view.
Exceptions
ErrorEmpty View type
ErrorView name already exists

Definition at line 108 of file Cell.cpp.

108  {
109  if(!inView) {
110  return;
111  }
112  std::string name = inView->getName();
113  if(name.empty()) {
114  Error e(eMessageIdErrorEmptyItemName, __FUNCTION__, __FILE__, __LINE__);
115  e.saveContextData("Empty View type", name);
116  throw e;
117  }
118  if(false == mViewSymTab.set(name, inView)) {
119  Error e(eMessageIdErrorItemAlreadyExists, __FUNCTION__, __FILE__, __LINE__);
120  e.saveContextData("View name", name);
121  throw e;
122  }
123  inView->setParent(getSharedThis());
124 }
SymTab< std::string, ViewSharedPtr > mViewSymTab
Definition: Cell.hpp:201
bool set(const KeyType &inKey, const ValueType &inValue)
Definition: SymTab.hpp:132
std::string string

+ Here is the call graph for this function:

template<typename _Action >
void torc::generic::PropertyContainer::applyOnAllProperties ( const _Action &  action)
throw (Error
)
inlineinherited

Apply action on all properties.

Parameters
[in]actionAction to be applied

Definition at line 113 of file PropertyContainer.hpp.

114  {
115  try {
116  mProperties.applyOnAll(action);
117  } catch(Error& e) {
118  e.setCurrentLocation(__FUNCTION__, __FILE__, __LINE__);
119  throw;
120  }
121 }
void applyOnAll(const _Action &action)
Definition: SymTab.hpp:192
SymTab< std::string, PropertySharedPtr > mProperties

+ Here is the call graph for this function:

template<typename _Action >
void torc::generic::StatusContainer::applyOnAllStatuses ( const _Action &  action)
throw (Error
)
inlineinherited

Apply action on all statuses.

Parameters
[in]actionAction to be applied

Definition at line 95 of file StatusContainer.hpp.

96  {
97  try {
98  std::vector<StatusSharedPtr>::iterator it = mStatuses.begin();
99  for(; it != mStatuses.end(); ++it) {
100  action(*it);
101  }
102  } catch(Error& e) {
103  e.setCurrentLocation(__FUNCTION__, __FILE__, __LINE__);
104  throw;
105  }
106 }
std::vector< StatusSharedPtr > mStatuses

+ Here is the call graph for this function:

template<typename _Action >
void torc::generic::Cell::applyOnAllViews ( const _Action &  action)
throw (Error
)
inline

Apply action on all Views.

Parameters
[in]actionAction to be applied

Definition at line 224 of file Cell.hpp.

224  {
225  try {
226  mViewSymTab.applyOnAll(action);
227  } catch(Error& e) {
228  e.setCurrentLocation(__FUNCTION__, __FILE__, __LINE__);
229  throw;
230  }
231 }
SymTab< std::string, ViewSharedPtr > mViewSymTab
Definition: Cell.hpp:201
void applyOnAll(const _Action &action)
Definition: SymTab.hpp:192

+ Here is the call graph for this function:

ViewSharedPtr torc::generic::Cell::findView ( const std::string &  inName)

Find a view by name.

Parameters
[in]inNameName of the cell to be found.
Returns
Pointer to cell if found, empty pointer otherwise.
Exceptions
ErrorEmpty Cell name
  • Id : eMessageIdErrorEmptyItemName
  • Context Data
    • Cell name - String

Find a view by name.

Parameters
[in]inNameName of the cell to be found.
Returns
Pointer to cell if found, empty pointer otherwise.

Definition at line 133 of file Cell.cpp.

133  {
134  if(inName.empty()) {
135  Error e(eMessageIdErrorEmptyItemName, __FUNCTION__, __FILE__, __LINE__);
136  e.saveContextData("Empty Cell name", inName);
137  throw e;
138  }
139  ViewSharedPtr view;
140  mViewSymTab.get(inName, view);
141  return view;
142 }
SymTab< std::string, ViewSharedPtr > mViewSymTab
Definition: Cell.hpp:201
bool get(const KeyType &inKey, ValueType &outValue) const
Definition: SymTab.hpp:121
boost::shared_ptr< View > ViewSharedPtr

+ Here is the call graph for this function:

const std::vector< std::string > & torc::generic::Commentable::getComments ( ) const
inlineinherited

Get the list of all comments

Returns
A list of all comments on this object

Definition at line 85 of file Commentable.hpp.

85  {
86  return mComments;
87 }
std::vector< std::string > mComments
Definition: Commentable.hpp:77
bool torc::generic::Extern::getIsExtern ( ) const
inlineinherited

Get whether the item is an extern(placeholder) or an actual item.

Returns
True if extern, false otherwise

Definition at line 86 of file Extern.hpp.

86  {
87  return mIsExtern;
88 }
const std::string torc::generic::Nameable::getName ( void  ) const
inlinevirtualinherited

Get the object name

Returns
Name of the object

Definition at line 89 of file Nameable.hpp.

89  {
90  return mName;
91 }

+ Here is the caller graph for this function:

Renamable::Name torc::generic::Renamable::getOriginalName ( ) const
inlinevirtualinherited

Get the new name provided for the object.

Returns
Name of the object

Definition at line 78 of file generic/Renamable.hpp.

78  {
79  return mOriginalName;
80 }

+ Here is the caller graph for this function:

const boost::shared_ptr<Library > torc::generic::ParentedObject< Library >::getParent ( ) const
inlineinherited

Get a pointer to the parent object

Returns
Pointer to parent
void torc::generic::PropertyContainer::getProperties ( std::map< std::string, PropertySharedPtr > &  outProperties) const
inlineinherited

Get the map of all properties

Parameters
[out]outPropertiesThe map of properties

Get the map of all properties

Returns
The map of properties

Definition at line 107 of file PropertyContainer.hpp.

108  {
109  mProperties.getValueMap(outProperties);
110  return;
111 }
void getValueMap(UserMap &outMap) const
Definition: SymTab.hpp:171
SymTab< std::string, PropertySharedPtr > mProperties

+ Here is the call graph for this function:

PropertySharedPtr torc::generic::PropertyContainer::getProperty ( const std::string &  inName)
inherited

Get a property

Parameters
[in]inNameName of the property to be retreived
Returns
Pointer to the property object if present, empty pointer otherwise.

Get a property

Parameters
[in]nameName of the property to be retreived
Returns
Pointer to the property object if present, empty pointer otherwise.

Definition at line 37 of file PropertyContainer.cpp.

37  {
38  PropertySharedPtr property;
39  if(!inName.empty()) {
40  mProperties.get(inName, property);
41  }
42  return property;
43 }
bool get(const KeyType &inKey, ValueType &outValue) const
Definition: SymTab.hpp:121
SymTab< std::string, PropertySharedPtr > mProperties
boost::shared_ptr< Property > PropertySharedPtr

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Pointer torc::generic::SelfReferencing< Cell >::getSharedThis ( ) const
inlineinherited

Get a shared pointer to this object. A valid pointer is returned if weakThis was set. Otherwise this returns a NULL pointer. For Vector types, the second scenario is an exception condition and should be treated as such.

Returns
A shared pointer to this object

Get a shared pointer to this object. A valid pointer is returned if weakThis was set. Otherwise this returns a NULL pointer. For Vector types, the second scenario is an exception condition and should be treated as such.

Parameters
[out]ptrSet to a shared pointer to this object
void torc::generic::StatusContainer::getStatuses ( std::vector< StatusSharedPtr > &  outStatus) const
inlineinherited

Get a vector of pointer to Status object

Parameters
[out]outStatusThe vector of pointer to Status object

Definition at line 86 of file StatusContainer.hpp.

86  {
87  outStatus.insert(outStatus.end(), mStatuses.begin(), mStatuses.end());
88 }
std::vector< StatusSharedPtr > mStatuses
const Cell::Type torc::generic::Cell::getType ( void  ) const
inline

Get the type of cell

Returns
Type of cell

Definition at line 211 of file Cell.hpp.

211  {
212  return mType;
213 }
void torc::generic::UserDataContainer::getUserData ( std::list< std::string > &  outUserData) const
inlineinherited

Get the list of all userData

Parameters
[out]outUserDataThe list of all userData

Definition at line 78 of file UserDataContainer.hpp.

78  {
79  outUserData.insert(outUserData.end(), mUserData.begin(), mUserData.end());
80  return;
81 }
std::list< std::string > mUserData
void torc::generic::Cell::getViews ( std::vector< ViewSharedPtr > &  outViews) const
inline

Get the views of this cell.

Parameters
[out]outViewsList of views to be appended to

Get the views of this cell.

Returns
A list of views of this cell.

Definition at line 220 of file Cell.hpp.

220  {
221  mViewSymTab.getValues(outViews);
222 }
void getValues(std::vector< ValueType > &outValues) const
Definition: SymTab.hpp:158
SymTab< std::string, ViewSharedPtr > mViewSymTab
Definition: Cell.hpp:201

+ Here is the call graph for this function:

bool torc::generic::Extern::isExtern ( ) const
inlineinherited

Get whether the item is an extern(placeholder) or an actual item.

Returns
True if extern, false otherwise

Definition at line 95 of file Extern.hpp.

95  {
96  return mIsExtern;
97 }
Cell& torc::generic::Cell::operator= ( const Cell rhs)
private
void torc::generic::Cell::removeView ( const std::string &  inName)
throw (Error
)

Remove the specified pointer from the view. Empty pointer is ignored.

Parameters
[in]inNamename of the object to be removed
Exceptions
ErrorView is not a member of the views list.

Remove the specified pointer from the view. Empty pointer is ignored.

Parameters
[in]inNamename of object to be removed
Exceptions
ErrorView is not a member of the views list.

Definition at line 151 of file Cell.cpp.

151  {
152  if(inName.empty()) {
153  Error e(eMessageIdErrorEmptyItemName, __FUNCTION__, __FILE__, __LINE__);
154  e.saveContextData("View name", inName);
155  throw e;
156  }
157  if(false == mViewSymTab.remove(inName)) {
158  Error e(eMessageIdErrorItemNotFound, __FUNCTION__, __FILE__, __LINE__);
159  e.saveContextData("View name", inName);
160  throw e;
161  }
162  return;
163 }
SymTab< std::string, ViewSharedPtr > mViewSymTab
Definition: Cell.hpp:201
bool remove(const KeyType &inKey)
Definition: SymTab.hpp:153

+ Here is the call graph for this function:

void torc::generic::Commentable::setComments ( const std::vector< std::string > &  inSource)
inherited

Get the list of all comments

Parameters
[in]inSourceA list of all comments to be set on this object

Definition at line 45 of file Commentable.cpp.

45  {
46  mComments.insert(mComments.end(), inSource.begin(), inSource.end());
47 }
std::vector< std::string > mComments
Definition: Commentable.hpp:77
void torc::generic::Extern::setIsExtern ( bool  inIsExtern)
inherited

Set whether an item is extern or not.

Parameters
[in]isExternTrue if extern, false otherwise

Definition at line 35 of file Extern.cpp.

35  {
36  mIsExtern = inIsExtern;
37 }
void torc::generic::Nameable::setName ( const std::string &  inSource)
throw (Error
)
inherited

Set a name for this object

Parameters
[in]inSourceName of the object
Exceptions
ErrorCould not set name, because name is empty (Will be used by array members)
  • Id : eMessageIdErrorEmptyItemName
  • Context Data

Set a name for this object

Parameters
[in]inSourceName of the object
Exceptions
ErrorCould not set name, because name is empty (Will be used by array members)

Definition at line 41 of file Nameable.cpp.

41  {
42  if(inSource.empty()) {
43  Error e(eMessageIdErrorEmptyItemName, __FUNCTION__, __FILE__, __LINE__);
44  e.saveContextData("Nameable", inSource);
45  throw e;
46  }
47  mName = inSource;
48 }

+ Here is the call graph for this function:

void torc::generic::Renamable::setOriginalName ( const Name inSource)
virtualinherited

Set the new name provided for the object.

Parameters
[in]inSourceName of the object

Definition at line 35 of file generic/Renamable.cpp.

35  {
36  mOriginalName = inSource;
37 }
virtual void torc::generic::ParentedObject< Library >::setParent ( const boost::shared_ptr< Library > &  inSource)
virtualinherited

Set a pointer to the parent

Parameters
[in]inSourceSet a pointer to the parent
void torc::generic::PropertyContainer::setProperties ( const std::map< std::string, PropertySharedPtr > &  inSource)
inherited

Set the map of properties

Parameters
[in]inSourceThe map of properties

Definition at line 66 of file PropertyContainer.cpp.

66  {
67  std::map<std::string, PropertySharedPtr>::const_iterator it = inSource.begin();
68  for(; it != inSource.end(); it++) {
69  setProperty((*it).first, (*it).second);
70  }
71 }
bool setProperty(const std::string &inName, const PropertySharedPtr &inProperty)

+ Here is the call graph for this function:

bool torc::generic::PropertyContainer::setProperty ( const std::string &  inName,
const PropertySharedPtr inProperty 
)
inherited

Save the inSource of a property

Parameters
[in]inNameName of the property to be saved
[in]inPropertyPointer to the property object if present, empty pointer otherwise.
Returns
bool True if saved, false otherwise.

Save the inSource of a property

Parameters
[in]inNameName of the property to be saved
[in]inPopertyPointer to the property object if present, empty pointer otherwise.
Returns
bool True if saved, false otherwise.

Definition at line 53 of file PropertyContainer.cpp.

54  {
55  if(!inName.empty()) {
56  return mProperties.set(inName, inProperty);
57  }
58  return false;
59 }
bool set(const KeyType &inKey, const ValueType &inValue)
Definition: SymTab.hpp:132
SymTab< std::string, PropertySharedPtr > mProperties

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void torc::generic::StatusContainer::setStatuses ( const std::vector< StatusSharedPtr > &  inStatus)
inherited

Set a vector of pointer to Status object

Parameters
[in]inStatusThe vector of pointer to Status object

Definition at line 32 of file StatusContainer.cpp.

32  {
33  std::vector<StatusSharedPtr>::const_iterator it = inStatus.begin();
34  for(; it != inStatus.end(); it++) {
35  mStatuses.push_back(*it);
36  }
37 }
std::vector< StatusSharedPtr > mStatuses
void torc::generic::Cell::setType ( const Type inSource)

Set the type of cell

Parameters
[in]inSourceType of cell

Definition at line 95 of file Cell.cpp.

95  {
96  mType = inSource;
97 }
void torc::generic::UserDataContainer::setUserData ( const std::list< std::string > &  inSource)
inherited

Set the list of userData

Parameters
[in]inSourceThe list of UserData

Definition at line 26 of file UserDataContainer.cpp.

26  {
27  mUserData.insert(mUserData.end(), inSource.begin(), inSource.end());
28 }
std::list< std::string > mUserData
void torc::generic::SelfReferencing< Cell >::setWeakThis ( const WeakPointer inWeakThis)
inlineinherited

Set a weak pointer to this object. This will be used later to get a shared pointer to this object from within other member methods if required. This should be called by the Factory creating the object.

Parameters
[in]weakThisA weak pointer to this object

Friends And Related Function Documentation

friend class FactoryType< Cell >
friend

Definition at line 63 of file Cell.hpp.

Field Documentation

ParameterMapSharedPtr torc::generic::Cell::mParameters
private

Definition at line 203 of file Cell.hpp.

Type torc::generic::Cell::mType
private

Definition at line 202 of file Cell.hpp.

SymTab<std::string, ViewSharedPtr> torc::generic::Cell::mViewSymTab
private

Definition at line 201 of file Cell.hpp.


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