SimObject Class Reference

#include <SimObject.h>

Inheritance diagram for SimObject:
AbstractSimObject LogicGate OneInputGate TwoInputGate Input Output

List of all members.

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 SimObjectclone () 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.

Detailed Description

Description

The Class SimObject represents an abstract simulation object (processing station). A simulation application would inherit from this class.


Member Typedef Documentation

typedef Graph::GraphNode SimObject::GNode
typedef Galois::Graph::FirstGraph<SimObject*, void, true> SimObject::Graph

Constructor & Destructor Documentation

virtual SimObject::~SimObject (  )  [inline, virtual]

Member Function Documentation

virtual SimObject* SimObject::clone (  )  const [pure virtual]

a way to construct different subtypes

Returns:
a new instance of subtype

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

Parameters:
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]

Gets the id.

Returns:
the id

Implemented in AbstractSimObject.

virtual bool SimObject::isActive (  )  const [pure virtual]

Checks if is active.

Returns:
true, if is active

Implemented in AbstractSimObject.

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.

Parameters:
sendObj the send obj
recvObj the recv obj
type the type
act the action to be performed
sendTime the send time
delay the delay
Returns:
the event

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.

Parameters:
inputIndex is the index of the input on which the event e is received
e the event to be received

Implemented in AbstractSimObject.

virtual size_t SimObject::simulate ( Graph graph,
GNode myNode 
) [pure virtual]

Simulate.

Parameters:
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
Returns:
number of events that were processed during the call

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.


Member Data Documentation

const SimTime SimObject::MIN_DELAY = 1l [static, protected]

The MIN_DELAY allowed for new events.


The documentation for this class was generated from the following file:
Generated on Tue Aug 2 11:51:28 2011 for Galois by  doxygen 1.6.3