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

This class is used to hold all information about the logic values used within a library. More...

#include <SimulationInfo.hpp>

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

Data Structures

class  Factory
 

Public Types

typedef VisitorType
< SimulationInfo
Visitor
 
typedef SimulationInfo Type
 
typedef boost::shared_ptr< TypePointer
 
typedef boost::weak_ptr< TypeWeakPointer
 

Public Member Functions

virtual void accept (BaseVisitor &inoutVisitor) throw (Error)
 
void addLogicValue (const LogicValueSharedPtr &inLogicValue) throw (Error)
 
LogicValueSharedPtr findLogicValue (const std::string &inName)
 
void removeLogicValue (const std::string &inName) throw (Error)
 
void getLogicValues (std::vector< LogicValueSharedPtr > &outLogicValues) const
 
void setLogicValues (const std::vector< LogicValueSharedPtr > &inLogicValues) throw (Error)
 
template<typename _Action >
void applyOnAllLogicValues (const _Action &action) throw (Error)
 
virtual ~SimulationInfo () throw ()
 
void addComment (const std::string &comment)
 
const std::vector< std::string > & getComments () const
 
void setComments (const std::vector< std::string > &inSource)
 
const boost::shared_ptr< LibrarygetParent () const
 
virtual void setParent (const boost::shared_ptr< Library > &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)
 

Protected Member Functions

 SimulationInfo ()
 

Private Member Functions

 SimulationInfo (const SimulationInfo &source)
 
SimulationInfooperator= (const SimulationInfo &source)
 

Private Attributes

SymTab< std::string,
LogicValueSharedPtr
mLogicValueSymTab
 

Friends

class FactoryType< SimulationInfo >
 

Detailed Description

This class is used to hold all information about the logic values used within a library.

Definition at line 44 of file SimulationInfo.hpp.

Member Typedef Documentation

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

Definition at line 36 of file SelfReferencing.hpp.

Definition at line 35 of file SelfReferencing.hpp.

Convenience typedef for visiting a simulation info

Definition at line 53 of file SimulationInfo.hpp.

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

Definition at line 37 of file SelfReferencing.hpp.

Constructor & Destructor Documentation

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

Definition at line 142 of file SimulationInfo.cpp.

142 {}
torc::generic::SimulationInfo::SimulationInfo ( )
protected

Definition at line 139 of file SimulationInfo.cpp.

139  : Commentable(), Visitable(), ParentedObject<Library>(),
140  SelfReferencing<SimulationInfo>(), UserDataContainer(), mLogicValueSymTab() {}
SymTab< std::string, LogicValueSharedPtr > mLogicValueSymTab
torc::generic::SimulationInfo::SimulationInfo ( const SimulationInfo source)
private

Member Function Documentation

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

Implements torc::generic::Visitable.

Definition at line 46 of file SimulationInfo.cpp.

46  {
47  try {
48  runVisitor(*this, inoutVisitor);
49  } catch(Error& e) {
50  e.setCurrentLocation(__FUNCTION__, __FILE__, __LINE__);
51  throw;
52  }
53 }
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::SimulationInfo::addLogicValue ( const LogicValueSharedPtr inLogicValue)
throw (Error
)

Add a logic value to the list of logic values. If an empty pointer is supplied, it returns without doing anything.

Parameters
[in]inLogicValueA pointer to a logic value object.
Exceptions
ErrorLogic value could not be added.

Definition at line 81 of file SimulationInfo.cpp.

81  {
82  if(!inLogicValue) {
83  return;
84  }
85  std::string name = inLogicValue->getName();
86  if(name.empty()) {
87  Error e(eMessageIdErrorEmptyItemName, __FUNCTION__, __FILE__, __LINE__);
88  e.saveContextData("Empty logic value name ", name);
89  throw e;
90  }
91  if(false == mLogicValueSymTab.set(name, inLogicValue)) {
92  Error e(eMessageIdErrorItemAlreadyExists, __FUNCTION__, __FILE__, __LINE__);
93  e.saveContextData("Logic value name", name);
94  throw e;
95  }
96  inLogicValue->setParent(getSharedThis());
97 }
bool set(const KeyType &inKey, const ValueType &inValue)
Definition: SymTab.hpp:132
std::string string
SymTab< std::string, LogicValueSharedPtr > mLogicValueSymTab

+ Here is the call graph for this function:

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
template<typename _Action >
void torc::generic::SimulationInfo::applyOnAllLogicValues ( const _Action &  action)
throw (Error
)
inline

Apply action on all logic values.

Parameters
[in]actionAction to be applied

Definition at line 156 of file SimulationInfo.hpp.

157  {
158  try {
160  } catch(Error& e) {
161  e.setCurrentLocation(__FUNCTION__, __FILE__, __LINE__);
162  throw;
163  }
164 }
void applyOnAll(const _Action &action)
Definition: SymTab.hpp:192
SymTab< std::string, LogicValueSharedPtr > mLogicValueSymTab

+ Here is the call graph for this function:

LogicValueSharedPtr torc::generic::SimulationInfo::findLogicValue ( const std::string &  inName)

Find a logic value by name, in the list of logic values in simulationInfo.

Parameters
[in]inNameString value specifying the name of the logic value.
Returns
A pointer to the logic value if found, an empty pointer otherwise.

Find a logic value by name, in the list of logic values in simulationInfo.

Parameters
[in]nameString value specifying the name of the logic value.
Returns
A pointer to the logic value if found, an empty pointer otherwise.

Definition at line 106 of file SimulationInfo.cpp.

106  {
107  if(inName.empty()) {
108  Error e(eMessageIdErrorEmptyItemName, __FUNCTION__, __FILE__, __LINE__);
109  e.saveContextData("Empty logic value name", inName);
110  throw e;
111  }
112  LogicValueSharedPtr logicValue;
113  mLogicValueSymTab.get(inName, logicValue);
114  return logicValue;
115 }
boost::shared_ptr< LogicValue > LogicValueSharedPtr
bool get(const KeyType &inKey, ValueType &outValue) const
Definition: SymTab.hpp:121
SymTab< std::string, LogicValueSharedPtr > mLogicValueSymTab

+ 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
void torc::generic::SimulationInfo::getLogicValues ( std::vector< LogicValueSharedPtr > &  outLogicValues) const
inline

Get the list of logic values.

Parameters
[out]outLogicValuesVector of logic values to be appended to

Definition at line 147 of file SimulationInfo.hpp.

147  {
148  mLogicValueSymTab.getValues(outLogicValues);
149 }
void getValues(std::vector< ValueType > &outValues) const
Definition: SymTab.hpp:158
SymTab< std::string, LogicValueSharedPtr > mLogicValueSymTab
const boost::shared_ptr<Library > torc::generic::ParentedObject< Library >::getParent ( ) const
inlineinherited

Get a pointer to the parent object

Returns
Pointer to parent
Pointer torc::generic::SelfReferencing< SimulationInfo >::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::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
SimulationInfo& torc::generic::SimulationInfo::operator= ( const SimulationInfo source)
private
void torc::generic::SimulationInfo::removeLogicValue ( const std::string &  inName)
throw (Error
)

Remove the specified logic value from the list of logic values. If an empty pointer is passed, it returns without doing anything

Parameters
[in]inNamename of the object to be removed
Exceptions
ErrorLogic Value not preset in collection.

Definition at line 125 of file SimulationInfo.cpp.

125  {
126  if(inName.empty()) {
127  Error e(eMessageIdErrorEmptyItemName, __FUNCTION__, __FILE__, __LINE__);
128  e.saveContextData("Logic value name", inName);
129  throw e;
130  }
131  if(false == mLogicValueSymTab.remove(inName)) {
132  Error e(eMessageIdErrorItemNotFound, __FUNCTION__, __FILE__, __LINE__);
133  e.saveContextData("Logic value name", inName);
134  throw e;
135  }
136  return;
137 }
bool remove(const KeyType &inKey)
Definition: SymTab.hpp:153
SymTab< std::string, LogicValueSharedPtr > mLogicValueSymTab

+ 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::SimulationInfo::setLogicValues ( const std::vector< LogicValueSharedPtr > &  inLogicValues)
throw (Error
)

Set the list of logic values.

Parameters
[in]inLogicValuesVector of logic values to be appended to

Definition at line 60 of file SimulationInfo.cpp.

61  {
62  std::vector<LogicValueSharedPtr>::const_iterator it = inLogicValues.begin();
63  for(; it != inLogicValues.end(); it++) {
64  try {
65  addLogicValue(*it);
66  } catch(Error& e) {
67  e.setCurrentLocation(__FUNCTION__, __FILE__, __LINE__);
68  throw;
69  }
70  }
71 }
void addLogicValue(const LogicValueSharedPtr &inLogicValue)

+ Here is the call graph for this function:

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::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< SimulationInfo >::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< SimulationInfo >
friend

Definition at line 47 of file SimulationInfo.hpp.

Field Documentation

SymTab<std::string, LogicValueSharedPtr> torc::generic::SimulationInfo::mLogicValueSymTab
private

Definition at line 138 of file SimulationInfo.hpp.


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