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

Represents EDIF status construct. More...

#include <Status.hpp>

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

Data Structures

class  Factory
 

Public Types

typedef VisitorType< StatusVisitor
 
typedef Status Type
 
typedef boost::shared_ptr< TypePointer
 
typedef boost::weak_ptr< TypeWeakPointer
 

Public Member Functions

virtual ~Status () throw ()
 
void getWrittens (std::vector< WrittenSharedPtr > &outValues) const
 
void setWrittens (const std::vector< WrittenSharedPtr > &inSource)
 
void addWritten (WrittenSharedPtr &inWritten) throw (Error)
 
virtual void accept (BaseVisitor &visitor) throw (Error)
 
void addComment (const std::string &comment)
 
const std::vector< std::string > & getComments () const
 
void setComments (const std::vector< std::string > &inSource)
 
void getUserData (std::list< std::string > &outUserData) const
 
void setUserData (const std::list< std::string > &inSource)
 
void addUserData (const std::string &inSource)
 
void setWeakThis (const WeakPointer &inWeakThis)
 
Pointer getSharedThis () const
 

Protected Member Functions

 Status ()
 

Private Attributes

std::vector< WrittenSharedPtrmWrittens
 

Friends

class FactoryType< Status >
 

Detailed Description

Represents EDIF status construct.

Status is used to convey accounting and problem analysis information for the design.

Definition at line 42 of file Status.hpp.

Member Typedef Documentation

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

Definition at line 36 of file SelfReferencing.hpp.

Definition at line 35 of file SelfReferencing.hpp.

Convenience class to visit a status.

Definition at line 52 of file Status.hpp.

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

Definition at line 37 of file SelfReferencing.hpp.

Constructor & Destructor Documentation

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

Definition at line 44 of file Status.cpp.

44 {}
torc::generic::Status::Status ( )
protected

Definition at line 41 of file Status.cpp.

41  : Commentable(), Visitable(), UserDataContainer(), SelfReferencing<Status>(),
42  mWrittens() {}
std::vector< WrittenSharedPtr > mWrittens
Definition: Status.hpp:116

Member Function Documentation

void torc::generic::Status::accept ( BaseVisitor visitor)
throw (Error
)
virtual

Receive a visitor to this class. The visit method of the visitor 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 situation can arise when the passed Visitor object does not inherit from the appropriate visitor specialization. See Visitor documentation for more details.

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

Implements torc::generic::Visitable.

Definition at line 70 of file Status.cpp.

70  {
71  try {
72  runVisitor(*this, visitor);
73  } catch(Error& e) {
74  e.setCurrentLocation(__FUNCTION__, __FILE__, __LINE__);
75  throw;
76  }
77 }
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::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::Status::addWritten ( WrittenSharedPtr inWritten)
throw (Error
)

Add a written statement to the vector of written statements. If an empty pointer is supplied, it returns without doing anything.

Parameters
[in]inWrittenA pointer to a written object.
Exceptions
ErrorWritten could not be added.

Definition at line 66 of file Status.cpp.

66  {
67  mWrittens.push_back(inWritten);
68 }
std::vector< WrittenSharedPtr > mWrittens
Definition: Status.hpp:116
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
Pointer torc::generic::SelfReferencing< Status >::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
void torc::generic::Status::getWrittens ( std::vector< WrittenSharedPtr > &  outValues) const
inline

Get the vector of written statements.

Returns
vector Containing written statements

Definition at line 120 of file Status.hpp.

120  {
121  outValues.insert(outValues.end(), mWrittens.begin(), mWrittens.end());
122 }
std::vector< WrittenSharedPtr > mWrittens
Definition: Status.hpp:116
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::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< Status >::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
void torc::generic::Status::setWrittens ( const std::vector< WrittenSharedPtr > &  inSource)

Set the vector of written statements.

Parameters
[in]inSourceVector containing written statements

Definition at line 51 of file Status.cpp.

51  {
52  std::vector<WrittenSharedPtr>::const_iterator it = inSource.begin();
53  for(; it != inSource.end(); it++) {
54  mWrittens.push_back(*it);
55  }
56 }
std::vector< WrittenSharedPtr > mWrittens
Definition: Status.hpp:116

Friends And Related Function Documentation

friend class FactoryType< Status >
friend

Definition at line 45 of file Status.hpp.

Field Documentation

std::vector<WrittenSharedPtr> torc::generic::Status::mWrittens
private

Definition at line 116 of file Status.hpp.


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