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

Event is used to describe an event on a port or a net using logic state transitions. Events can also be described for unordered groups of ports or nets using portGroup or netGroup. An ordered list of ports may also be used using a portList. More...

#include <Event.hpp>

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

Data Structures

class  Factory
 

Public Types

enum  Type { eTypeEvent = 0, eTypeOffsetEvent }
 
typedef VisitorType< EventVisitor
 
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 getPortElements (std::list< PortElement > &outPortElements) const
 
void addPort (const PortSharedPtr &inPort)
 
void addPortReference (const PortReferenceSharedPtr &inPortRef)
 
const PortListSharedPtr getPortList () const
 
void setPortList (const PortListSharedPtr &inPortList)
 
void getNets (std::list< NetSharedPtr > &outNets) const
 
void addNet (const NetSharedPtr &inNet)
 
const LogicElementSharedPtr getTransition () const
 
void setTransition (const LogicElementSharedPtr &inSource)
 
const Value getOffsetTime () const
 
void setOffsetTime (const Value &value)
 
virtual ~Event () throw ()
 
void setWeakThis (const WeakPointer &inWeakThis)
 
Pointer getSharedThis () const
 

Protected Member Functions

 Event ()
 

Private Member Functions

 Event (const Event &source)
 
Eventoperator= (const Event &source)
 

Private Attributes

Type mType
 
std::list< PortElementmPortElements
 
PortListSharedPtr mPortList
 
std::list< NetSharedPtrmNets
 
LogicElementSharedPtr mTransition
 
Value mOffsetTime
 

Friends

class FactoryType< Event >
 

Detailed Description

Event is used to describe an event on a port or a net using logic state transitions. Events can also be described for unordered groups of ports or nets using portGroup or netGroup. An ordered list of ports may also be used using a portList.

This class also models edif OffsetEvent construct, which is used to define a time relative to an Event.

Definition at line 45 of file Event.hpp.

Member Typedef Documentation

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

Definition at line 36 of file SelfReferencing.hpp.

Convenience class to visit an Event.

Definition at line 60 of file Event.hpp.

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

Definition at line 37 of file SelfReferencing.hpp.

Member Enumeration Documentation

Event type

Enumerator
eTypeEvent 
eTypeOffsetEvent 

Definition at line 53 of file Event.hpp.

Constructor & Destructor Documentation

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

Definition at line 154 of file Event.cpp.

154 {}
torc::generic::Event::Event ( )
protected

Definition at line 151 of file Event.cpp.

151  : Visitable(), SelfReferencing<Event>(), mType(), mPortElements(), mPortList(),
152  mNets(), mTransition(), mOffsetTime() {}
std::list< NetSharedPtr > mNets
Definition: Event.hpp:199
PortListSharedPtr mPortList
Definition: Event.hpp:198
std::list< PortElement > mPortElements
Definition: Event.hpp:197
LogicElementSharedPtr mTransition
Definition: Event.hpp:200
torc::generic::Event::Event ( const Event source)
private

Member Function Documentation

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

Implements torc::generic::Visitable.

Definition at line 79 of file Event.cpp.

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

+ Here is the call graph for this function:

void torc::generic::Event::addNet ( const NetSharedPtr inNet)

Add a Net to the Net list.

Parameters
[in]inNetPointer to Net to be added.

Definition at line 130 of file Event.cpp.

130  {
131  mNets.push_back(inNet);
132 }
std::list< NetSharedPtr > mNets
Definition: Event.hpp:199
void torc::generic::Event::addPort ( const PortSharedPtr inPort)

Add a port to the port list.

Parameters
[in]inPortPointer to port to be added.

Definition at line 102 of file Event.cpp.

102  {
103  mPortElements.push_back(PortElement(inPort));
104 }
std::list< PortElement > mPortElements
Definition: Event.hpp:197
void torc::generic::Event::addPortReference ( const PortReferenceSharedPtr inPortRef)

Add a port reference to the port list.

Parameters
[in]inPortRefPointer to port reference to be added.

Definition at line 111 of file Event.cpp.

111  {
112  mPortElements.push_back(PortElement(inPortRef));
113 }
std::list< PortElement > mPortElements
Definition: Event.hpp:197
void torc::generic::Event::getNets ( std::list< NetSharedPtr > &  outNets) const
inline

Get the list of Net of an Event. When Net element list size is more than one, it is NetGroup.

Returns
outNets List of nets to be appended to

Get the list of nets of an Event. When Net element list size is more than one, it is NetGroup.

Returns
outNets List of nets to be appended to

Definition at line 239 of file Event.hpp.

239  {
240  outNets.insert(outNets.end(), mNets.begin(), mNets.end());
241 }
std::list< NetSharedPtr > mNets
Definition: Event.hpp:199
const Value torc::generic::Event::getOffsetTime ( ) const
inline

Get the offset time retative to an event.

Returns
Value offset time retative to an event.

Definition at line 256 of file Event.hpp.

256  {
257  return mOffsetTime;
258 }
void torc::generic::Event::getPortElements ( std::list< PortElement > &  outPortElements) const
inline

Get the list of port elements of an Event. When port element list size is more than one, it is portGroup.

Returns
outPortElements List of port elements to be appended to

Definition at line 220 of file Event.hpp.

220  {
221  outPortElements.insert(outPortElements.end(), mPortElements.begin(), mPortElements.end());
222 }
std::list< PortElement > mPortElements
Definition: Event.hpp:197
const PortListSharedPtr torc::generic::Event::getPortList ( ) const
inline

Get the pointer to portList of an Event.

Returns
Pointer to portList

Definition at line 229 of file Event.hpp.

229  {
230  return mPortList;
231 }
PortListSharedPtr mPortList
Definition: Event.hpp:198
Pointer torc::generic::SelfReferencing< Event >::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
const LogicElementSharedPtr torc::generic::Event::getTransition ( ) const
inline

Get the pointer to logic state value(transition/becomes).

Returns
Pointer to logic state value(transition/becomes).

Definition at line 248 of file Event.hpp.

248  {
249  return mTransition;
250 }
LogicElementSharedPtr mTransition
Definition: Event.hpp:200
const Event::Type torc::generic::Event::getType ( void  ) const
inline

Get the event type

Returns
Event type

Definition at line 210 of file Event.hpp.

210  {
211  return mType;
212 }
Event& torc::generic::Event::operator= ( const Event source)
private
void torc::generic::Event::setOffsetTime ( const Value value)

Set the offset time retative to an event.

Parameters
[in]valueOffset time retative to an event.

Definition at line 147 of file Event.cpp.

147  {
148  mOffsetTime = value;
149 }
void torc::generic::Event::setPortList ( const PortListSharedPtr inPortList)

Set the pointer to portList

Parameters
[in]inPortListPointer to portList

Definition at line 121 of file Event.cpp.

121  {
122  mPortList = inPortList;
123 }
PortListSharedPtr mPortList
Definition: Event.hpp:198
void torc::generic::Event::setTransition ( const LogicElementSharedPtr inSource)

Set the pointer to logic state value(transition/becomes).

Parameters
[in]inSourcePointer to logic state value(transition/becomes).

Definition at line 139 of file Event.cpp.

139  {
140  mTransition = inSource;
141 }
LogicElementSharedPtr mTransition
Definition: Event.hpp:200
void torc::generic::Event::setType ( const Type inSource)

Set the event type

Parameters
[in]inSourceEvent type

Definition at line 93 of file Event.cpp.

93  {
94  mType = inSource;
95 }
void torc::generic::SelfReferencing< Event >::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< Event >
friend

Definition at line 46 of file Event.hpp.

Field Documentation

std::list<NetSharedPtr> torc::generic::Event::mNets
private

Definition at line 199 of file Event.hpp.

Value torc::generic::Event::mOffsetTime
private

Definition at line 201 of file Event.hpp.

std::list<PortElement> torc::generic::Event::mPortElements
private

Definition at line 197 of file Event.hpp.

PortListSharedPtr torc::generic::Event::mPortList
private

Definition at line 198 of file Event.hpp.

LogicElementSharedPtr torc::generic::Event::mTransition
private

Definition at line 200 of file Event.hpp.

Type torc::generic::Event::mType
private

Definition at line 196 of file Event.hpp.


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