The devs class provides some fundamental behavior needed by its network and atomic sub-classes.
Inheritance:
Public Classes
-
enum ModelType
- Enumeration of model types
Public Methods
-
devs(ModelType type = UNKNOWN)
- Constructor.
-
devs(const char* name, ModelType type = UNKNOWN)
- Constructor.
-
inline void setName(const char* name)
- Sets the model's name
-
inline stime_t elapsed() const
- Returns time elapsed since the last event.
-
inline stime_t sigma() const
- Returns time remaining until the next event.
-
inline stime_t ta() const
- Returns the time allowed to remain in the current state.
-
inline stime_t timeNext() const
- Returns the next event time
-
inline stime_t timeLast() const
- Returns the last event time
-
inline stime_t timeCurrent() const
- Returns the current simulation time.
-
void hold(stime_t dt)
- Reschedules the model such that tN = t + dt
-
inline void passivate()
- Sets tN = INFINITY
-
bag* inputOnPort(port_t inport) const
- Returns the input available on the port.
-
void output(port_t outport, object* value, bool gc = true)
- Writes a value to the output port.
-
void output(port_t outport, const object& value)
- Writes a clone() of the output value to the port.
-
virtual void addInputPort(port_t inport)
- Add an input port
-
virtual void addOutputPort(port_t outport)
- Add an output port
-
bool hasInputPort(port_t inport) const
- Returns true if the port is found, false otherwise
-
bool hasOutputPort(port_t outport) const
- Returns true if the port is found, false otherwise
-
inline const char* getName() const
- Get the name of the model
-
void setThreaded(bool value)
- Indicate that this model should be assigned its own thread of execution
-
bool getThreaded() const
- Returns true if this model will be assigned its own thread of execution
-
const port_t* outputPorts(int* count)
- Method to support the simulator
-
bag* outputOnPort(port_t outport) const
- Method to support the simulator
-
void clearPorts()
- Method to support the simulator
-
void clearPorts(indexed& garbage)
- Method to support the simulator
-
void emptyGarbage()
- Method to support the simulator
-
inline void setTime(stime_t t)
- Method to support the simulator
-
inline void setTimeLast(stime_t tL)
- Method to support the simulator
-
inline void setTimeNext(stime_t tN)
- Method to support the simulator
-
virtual void _reset(stime_t t0 = 0.0)
- Method to support the simulator.
-
void input(port_t inport, object* value)
- Method to support the simulator
-
virtual ~devs()
- Method to support the simulator
-
ModelType getType() const
- Get the typecode for this model
Inherited from object:
Public Methods
-
virtual bool operator==(const object &obj) const
-
virtual bool operator!=(const object &obj) const
-
virtual unsigned int hashcode() const
-
virtual object* clone() const
Documentation
The devs class provides some fundamental behavior needed by its
network and atomic sub-classes. Generally, none of the methods
here should be overridden.
enum ModelType
- Enumeration of model types
UNKNOWN
ATOMIC
NETWORK
devs(ModelType type = UNKNOWN)
- Constructor. Default model type is UNKNOWN
devs(const char* name, ModelType type = UNKNOWN)
- Constructor. Assigns the given name to the model.
inline void setName(const char* name)
- Sets the model's name
inline stime_t elapsed() const
- Returns time elapsed since the last event. e = t - tL
inline stime_t sigma() const
- Returns time remaining until the next event. s = tN - t
inline stime_t ta() const
- Returns the time allowed to remain in the current state. ta = tN - tL
inline stime_t timeNext() const
- Returns the next event time
inline stime_t timeLast() const
- Returns the last event time
inline stime_t timeCurrent() const
- Returns the current simulation time.
void hold(stime_t dt)
- Reschedules the model such that tN = t + dt
inline void passivate()
- Sets tN = INFINITY
bag* inputOnPort(port_t inport) const
-
Returns the input available on the port.
The bag should not be deleted, it is still owned the devs.
void output(port_t outport, object* value, bool gc = true)
-
Writes a value to the output port. If gc is false, object will not
be garbage collected. Default is to garbage collect object.
void output(port_t outport, const object& value)
-
Writes a clone() of the output value to the port. Fails
with a CloneException if the object does not support the clone()
method.
virtual void addInputPort(port_t inport)
- Add an input port
virtual void addOutputPort(port_t outport)
- Add an output port
bool hasInputPort(port_t inport) const
- Returns true if the port is found, false otherwise
bool hasOutputPort(port_t outport) const
- Returns true if the port is found, false otherwise
inline const char* getName() const
- Get the name of the model
void setThreaded(bool value)
- Indicate that this model should be assigned its own thread of execution
bool getThreaded() const
- Returns true if this model will be assigned its own thread of execution
const port_t* outputPorts(int* count)
- Method to support the simulator
bag* outputOnPort(port_t outport) const
- Method to support the simulator
void clearPorts()
- Method to support the simulator
void clearPorts(indexed& garbage)
- Method to support the simulator
void emptyGarbage()
- Method to support the simulator
inline void setTime(stime_t t)
- Method to support the simulator
inline void setTimeLast(stime_t tL)
- Method to support the simulator
inline void setTimeNext(stime_t tN)
- Method to support the simulator
virtual void _reset(stime_t t0 = 0.0)
-
Method to support the simulator. Indicates that the model should reset its state.
t indicates the initial time for the model.
void input(port_t inport, object* value)
- Method to support the simulator
virtual ~devs()
- Method to support the simulator
ModelType getType() const
- Get the typecode for this model
- Direct child classes:
- devsn
atomic
Alphabetic index HTML hierarchy of classes or Java
This page was generated with the help of DOC++.