#include <SimObject.h>
Public Types | |
typedef Galois::Graph::FirstGraph < SimObject *, void, true > | Graph |
typedef Graph::GraphNode | GNode |
typedef Event< SimObject *, LogicUpdate > | EventTy |
Public Member Functions | |
virtual | ~SimObject () |
virtual SimObject * | clone () const =0 |
a way to construct different subtypes | |
virtual EventTy | makeEvent (SimObject *sendObj, SimObject *recvObj, const EventTy::Type &type, const LogicUpdate &act, const SimTime &sendTime, SimTime delay=MIN_DELAY)=0 |
Make event. | |
virtual void | recvEvent (size_t inputIndex, const EventTy &e)=0 |
Recv event. | |
virtual void | execEvent (Graph &graph, GNode &myNode, const EventTy &e)=0 |
Exec event. | |
virtual size_t | simulate (Graph &graph, GNode &myNode)=0 |
Simulate. | |
virtual bool | isActive () const =0 |
Checks if is active. | |
virtual void | updateActive ()=0 |
active is set to true if there exists an event on each input pq or if an input pq is empty and an event with INFINITY has been received telling that no more events on this input will be received. | |
virtual size_t | numPendingEvents () const =0 |
virtual const std::string | toString () const =0 |
string representation for printing | |
virtual size_t | getId () const =0 |
Gets the id. | |
Static Protected Attributes | |
static const SimTime | MIN_DELAY = 1l |
The MIN_DELAY allowed for new events. |
The Class SimObject represents an abstract simulation object (processing station). A simulation application would inherit from this class.
typedef Event<SimObject*, LogicUpdate> SimObject::EventTy |
typedef Graph::GraphNode SimObject::GNode |
typedef Galois::Graph::FirstGraph<SimObject*, void, true> SimObject::Graph |
virtual SimObject::~SimObject | ( | ) | [inline, virtual] |
virtual SimObject* SimObject::clone | ( | ) | const [pure virtual] |
a way to construct different subtypes
Implemented in AbstractSimObject, Input, OneInputGate, Output, and TwoInputGate.
virtual void SimObject::execEvent | ( | Graph & | graph, | |
GNode & | myNode, | |||
const EventTy & | e | |||
) | [pure virtual] |
Exec event.
The user code should override this method inorder to define the semantics of executing and event on
graph,: | the graph whose nodes contain simulation objects and edges model the communication links | |
myNode | the node in the graph that has this SimObject as its node data | |
e | the input event |
Implemented in AbstractSimObject, Input, OneInputGate, Output, and TwoInputGate.
virtual size_t SimObject::getId | ( | ) | const [pure virtual] |
virtual bool SimObject::isActive | ( | ) | const [pure virtual] |
virtual EventTy SimObject::makeEvent | ( | SimObject * | sendObj, | |
SimObject * | recvObj, | |||
const EventTy::Type & | type, | |||
const LogicUpdate & | act, | |||
const SimTime & | sendTime, | |||
SimTime | delay = MIN_DELAY | |||
) | [pure virtual] |
Make event.
sendObj | the send obj | |
recvObj | the recv obj | |
type | the type | |
act | the action to be performed | |
sendTime | the send time | |
delay | the delay |
Implemented in AbstractSimObject.
virtual size_t SimObject::numPendingEvents | ( | ) | const [pure virtual] |
Implemented in AbstractSimObject.
virtual void SimObject::recvEvent | ( | size_t | inputIndex, | |
const EventTy & | e | |||
) | [pure virtual] |
Recv event.
inputIndex | is the index of the input on which the event e is received | |
e | the event to be received |
Implemented in AbstractSimObject.
Simulate.
graph,: | the graph composed of simulation objects/stations and communication links | |
myNode | the node in the graph that has this SimObject as its node data |
Implemented in AbstractSimObject.
virtual const std::string SimObject::toString | ( | ) | const [pure virtual] |
string representation for printing
Implemented in AbstractSimObject, OneInputGate, and TwoInputGate.
virtual void SimObject::updateActive | ( | ) | [pure virtual] |
active is set to true if there exists an event on each input pq or if an input pq is empty and an event with INFINITY has been received telling that no more events on this input will be received.
Implemented in AbstractSimObject.
const SimTime SimObject::MIN_DELAY = 1l [static, protected] |
The MIN_DELAY allowed for new events.