FSM Macros | |
#define | FSM_MAXT 64 |
#define | FSM_Switch(fsm) |
#define | FSM_Transient(state) |
#define | FSM_Steady(state) |
#define | FSM_Enter(state) |
#define | FSM_Exit(state) |
#define | FSM_Goto(fsm, state) |
WATCH macros for STL container classes | |
#define | WATCH_VECTOR(variable) |
#define | WATCH_PTRVECTOR(variable) |
#define | WATCH_LIST(variable) |
#define | WATCH_PTRLIST(variable) |
#define | WATCH_SET(variable) |
#define | WATCH_PTRSET(variable) |
#define | WATCH_MAP(m) |
#define | WATCH_PTRMAP(m) |
WATCH macros | |
#define | WATCH(variable) |
#define | WATCH_RW(variable) |
#define | WATCH_OBJ(variable) |
#define | WATCH_PTR(variable) |
Declaration macros | |
#define | Define_Network(NAME) |
#define | Define_Channel(NAME) |
#define | Define_Function(NAME, ARGCOUNT) |
#define | Define_Function2(NAME, FUNCTION, ARGCOUNT) |
#define | Register_Class(CLASSNAME) |
Module declaration macros | |
#define | Define_Module(CLASSNAME) |
#define | Define_Module_Like(CLASSNAME, INTERFACENAME) |
#define | Module_Class_Members(CLASSNAME, BASECLASS, STACK) |
|
Registers a channel type definition (cChannelType object).
|
|
Registers a mathematical function that takes 0, 1, 2 or 3 double arguments and returns a double. The use of this macro allows the function to be used in expressions inside NED network descriptions. Commonly used <math.h> functions have Define_Function() lines in the OMNeT++ simulation kernel. |
|
Like Define_Function(), but takes three arguments, the second one being the pointer to the function. This macro allows registering a function with a different name than its implementation. |
|
Announces the class as a module to OMNeT++ and couples it with the NED interface of the same name. The macro expands to the definition a cModuleType object. The NEDC compiler generates Define_Module() lines for all compound modules. However, it is the user's responsibility to put Define_Module() lines for all simple module types into one of the C++ sources. |
|
Similar to Define_Module(), except that it couples the class with the NED interface of the given name.
While this macro continues to be supported, it is NOT RECOMMENDED because modules defined with it don't show up in documentation generated with opp_neddoc. One can use NED's |
|
Network declaration macro. It can be found in code generated by the NEDC compiler. The use of this macro allows the creation of a network when only its name is available as a string. (Typically, the name of the network to be simulated is read from the configuration file.) The macro expands to the definition of a cNetworkType object. |
|
Within an FSM_Switch() case branch, declares code to be executed on entering the given state. No calls to FSM_Goto() are allowed within a state's Enter block.
|
|
Within an FSM_Switch() case branch, declares code to be executed on exiting the given state.
|
|
To be used in state exit code, to transition to another state. Uses stringize (#state), so it only works correctly if 'state' is the enum name itself and not some variable that contains the state code.
|
|
After this many transitions without reaching a steady state we assume the FSM is in an infinite loop.
|
|
Declares a steady state; to be used in enum which declares states. See example in FSM_Transient.
|
|
Implements a Finite State Machine. FSM state is stored in an object of type cFSM. There are two kinds of states: transient and steady. At each execution of the FSM_Switch() statement, the FSM transitions out of the current (steady) state, potentially undergoes a series of state changes to transient states, and arrives at another steady state. The actual FSM is embedded in an FSM_Switch(), which has cases for entering and leaving each state:
FSM_Switch(fsm) { case FSM_Exit(state1): //... break; case FSM_Enter(state1): //... break; case FSM_Exit(state2): //... break; case FSM_Enter(state2): //... break; //... } States are declared in enums, using the FSM_Transient() and FSM_Steady() macros. State transitions are done via calls to FSM_Goto(), which simply stores the new state in the cFSM object.
|
|
Declares a transient state; to be used in enum which declares states. Example:
enum { INIT = 0, SLEEP = FSM_Steady(1), ACTIVE = FSM_Steady(2), SEND = FSM_Transient(1), }; The numbers in parens must be unique within the state type and they are used for constructing numeric IDs for the states.
|
|
This macro facilitates the declaration of a simple module class, and it expands to the definition of mandatory member functions. (Currently only a constructor.) The macro is used like this:
class CLASSNAME : public cSimpleModule { Module_Class_Members(CLASSNAME,cSimpleModule,8192) virtual void activity(); }; |
|
Register class. This defines a factory object which makes it possible to create an object by the passing class name to the createOne() function. The class must be a subclass of cPolymorphic, otherwise a compile-time error will occur: "cannot convert..." |
|
Makes primitive types and types with operator<< inspectable in Tkenv. See also WATCH_RW(), WATCH_PTR(), WATCH_OBJ(), WATCH_VECTOR(), WATCH_PTRVECTOR(), etc. macros. |
|
Makes std::lists inspectable in Tkenv. See also WATCH_PTRLIST(). |
|
Makes std::maps inspectable in Tkenv. See also WATCH_PTRMAP(). |
|
Makes classes derived from cPolymorphic inspectable in Tkenv. See also WATCH_PTR(). |
|
Makes pointers to objects derived from cPolymorphic inspectable in Tkenv. See also WATCH_OBJ(). |
|
Makes std::lists storing pointers inspectable in Tkenv. See also WATCH_LIST(). |
|
Makes std::maps storing pointers inspectable in Tkenv. See also WATCH_MAP(). |
|
Makes std::sets storing pointers inspectable in Tkenv. See also WATCH_SET(). |
|
Makes std::vectors storing pointers inspectable in Tkenv. See also WATCH_VECTOR(). |
|
Makes types with operator<< and operator>> inspectable in Tkenv. operator>> is used to enable changing the variable's value interactively. |
|
Makes std::sets inspectable in Tkenv. See also WATCH_PTRSET(). |
|
Makes std::vectors inspectable in Tkenv. See also WATCH_PTRVECTOR(). |