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

This class is used within simulate to describe input stimuli and expected responces over a certain time interval. More...

#include <Apply.hpp>

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

Data Structures

class  Factory
 

Public Types

typedef VisitorType< ApplyVisitor
 
typedef Apply Type
 
typedef boost::shared_ptr< TypePointer
 
typedef boost::weak_ptr< TypeWeakPointer
 

Public Member Functions

virtual void accept (BaseVisitor &inoutVisitor) throw (Error)
 
const int32_t getNoOfCycle () const
 
void setNoOfCycle (const int32_t &inValue)
 
const Value getCycleDuration () const
 
void setCycleDuration (const Value &value)
 
void getLogicResponses (std::list< LogicalResponseSharedPtr > &outLogicResponces) const
 
void setLogicResponses (const std::list< LogicalResponseSharedPtr > &inLogicResponces)
 
void addLogicResponse (const LogicalResponseSharedPtr &inLogicResponce)
 
 ~Apply () throw ()
 
void addComment (const std::string &comment)
 
const std::vector< std::string > & getComments () const
 
void setComments (const std::vector< std::string > &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

 Apply ()
 

Private Member Functions

 Apply (const Apply &source)
 
Applyoperator= (const Apply &source)
 

Private Attributes

int32_t mNoOfCycle
 
Value mCycleDuration
 
std::list
< LogicalResponseSharedPtr
mLogicResponses
 

Friends

class FactoryType< Apply >
 

Detailed Description

This class is used within simulate to describe input stimuli and expected responces over a certain time interval.

Definition at line 37 of file Apply.hpp.

Member Typedef Documentation

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

Definition at line 36 of file SelfReferencing.hpp.

Definition at line 35 of file SelfReferencing.hpp.

Convenience class to visit apply .

Definition at line 46 of file Apply.hpp.

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

Definition at line 37 of file SelfReferencing.hpp.

Constructor & Destructor Documentation

torc::generic::Apply::~Apply ( )
throw (
)

Definition at line 113 of file Apply.cpp.

113 {}
torc::generic::Apply::Apply ( )
protected

Definition at line 110 of file Apply.cpp.

110  : Commentable(), Visitable(), SelfReferencing<Apply>(), UserDataContainer(),
int32_t mNoOfCycle
Definition: Apply.hpp:127
std::list< LogicalResponseSharedPtr > mLogicResponses
Definition: Apply.hpp:129
torc::generic::Apply::Apply ( const Apply source)
private

Member Function Documentation

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

Implements torc::generic::Visitable.

Definition at line 53 of file Apply.cpp.

53  {
54  try {
55  runVisitor(*this, inoutVisitor);
56  } catch(Error& e) {
57  e.setCurrentLocation(__FUNCTION__, __FILE__, __LINE__);
58  throw;
59  }
60 }
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::Apply::addLogicResponse ( const LogicalResponseSharedPtr inLogicResponce)

Add a LogicResponce to the list of LogicResponce.

Parameters
[in]inLogicResponcePointer to LogicResponce to be appended to

Add a LogicResponce to the list of LogicResponces.

Parameters
[in]inLogicResponcePointer to LogicResponce to be appended to

Definition at line 101 of file Apply.cpp.

101  {
102  try {
103  mLogicResponses.push_back(inLogicResponce);
104  } catch(Error& e) {
105  e.setCurrentLocation(__FUNCTION__, __FILE__, __LINE__);
106  throw;
107  }
108 }
std::list< LogicalResponseSharedPtr > mLogicResponses
Definition: Apply.hpp:129

+ Here is the call graph for this function:

+ Here is the caller 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
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
const Value torc::generic::Apply::getCycleDuration ( ) const
inline

Get the duration of each cycle

Returns
Duration of each cycle

Definition at line 145 of file Apply.hpp.

145  {
146  return mCycleDuration;
147 }
void torc::generic::Apply::getLogicResponses ( std::list< LogicalResponseSharedPtr > &  outLogicResponces) const
inline

Get the list of LogicResponce.

Parameters
[out]outLogicResponcesList of LogicResponce (s) to be appended to

Definition at line 154 of file Apply.hpp.

154  {
155  outLogicResponces.insert(outLogicResponces.end(), mLogicResponses.begin(),
156  mLogicResponses.end());
157 }
std::list< LogicalResponseSharedPtr > mLogicResponses
Definition: Apply.hpp:129
const int32_t torc::generic::Apply::getNoOfCycle ( ) const
inline

Get the no of cycles

Returns
int32_t No of cycles

Definition at line 137 of file Apply.hpp.

137  {
138  return mNoOfCycle;
139 }
int32_t mNoOfCycle
Definition: Apply.hpp:127
Pointer torc::generic::SelfReferencing< Apply >::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
Apply& torc::generic::Apply::operator= ( const Apply source)
private
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::Apply::setCycleDuration ( const Value value)

Set the duration of each cycle

Parameters
[in]valueDuration of each cycle

Definition at line 74 of file Apply.cpp.

74  {
75  mCycleDuration = value;
76 }
void torc::generic::Apply::setLogicResponses ( const std::list< LogicalResponseSharedPtr > &  inLogicResponces)

Set the list of LogicResponce.

Parameters
[in]inLogicResponcesList of LogicResponce (s) to be appended to

Definition at line 83 of file Apply.cpp.

83  {
84  std::list<LogicalResponseSharedPtr>::const_iterator logicalResponse = inLogicResponces.begin();
85  std::list<LogicalResponseSharedPtr>::const_iterator end = inLogicResponces.end();
86  for(; logicalResponse != end; logicalResponse++) {
87  try {
88  addLogicResponse(*logicalResponse);
89  } catch(Error& e) {
90  e.setCurrentLocation(__FUNCTION__, __FILE__, __LINE__);
91  throw;
92  }
93  }
94 }
void addLogicResponse(const LogicalResponseSharedPtr &inLogicResponce)
Definition: Apply.cpp:101

+ Here is the call graph for this function:

void torc::generic::Apply::setNoOfCycle ( const int32_t &  inValue)

Set the no of cycles

Parameters
[in]inValueint32_t No of cycles

Definition at line 66 of file Apply.cpp.

66  {
67  mNoOfCycle = inValue;
68 }
int32_t mNoOfCycle
Definition: Apply.hpp:127
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< Apply >::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< Apply >
friend

Definition at line 40 of file Apply.hpp.

Field Documentation

Value torc::generic::Apply::mCycleDuration
private

Definition at line 128 of file Apply.hpp.

std::list<LogicalResponseSharedPtr> torc::generic::Apply::mLogicResponses
private

Definition at line 129 of file Apply.hpp.

int32_t torc::generic::Apply::mNoOfCycle
private

Definition at line 127 of file Apply.hpp.


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