cNullEnvir Class Reference
[User interface: cEnvir and evExtension interfaces]

A cEnvir implementation with all pure virtual methods defined with an empty body, with a trivial implementation, or to throw an exception with the "unsupported method" text. More...

#include <cnullenvir.h>

Inheritance diagram for cNullEnvir:
cEnvir

List of all members.

Public Member Functions

virtual void objectDeleted (cObject *object)
virtual void simulationEvent (cMessage *msg)
virtual void messageSent_OBSOLETE (cMessage *msg, cGate *directToGate=NULL)
virtual void messageScheduled (cMessage *msg)
virtual void messageCancelled (cMessage *msg)
virtual void beginSend (cMessage *msg)
virtual void messageSendDirect (cMessage *msg, cGate *toGate, simtime_t propagationDelay, simtime_t transmissionDelay)
virtual void messageSendHop (cMessage *msg, cGate *srcGate)
virtual void messageSendHop (cMessage *msg, cGate *srcGate, simtime_t propagationDelay, simtime_t transmissionDelay)
virtual void endSend (cMessage *msg)
virtual void messageCreated (cMessage *msg)
virtual void messageCloned (cMessage *msg, cMessage *clone)
virtual void messageDeleted (cMessage *msg)
virtual void moduleReparented (cModule *module, cModule *oldparent)
virtual void componentMethodBegin (cComponent *from, cComponent *to, const char *methodFmt, va_list va, bool silent)
virtual void componentMethodEnd ()
virtual void moduleCreated (cModule *newmodule)
virtual void moduleDeleted (cModule *module)
virtual void gateCreated (cGate *newgate)
virtual void gateDeleted (cGate *gate)
virtual void connectionCreated (cGate *srcgate)
virtual void connectionDeleted (cGate *srcgate)
virtual void displayStringChanged (cComponent *component)
virtual void undisposedObject (cObject *obj)
virtual void configure (cComponent *component)
virtual void readParameter (cPar *par)
virtual bool isModuleLocal (cModule *parentmod, const char *modname, int index)
virtual cXMLElementgetXMLDocument (const char *filename, const char *xpath=NULL)
virtual cXMLElementgetParsedXMLString (const char *content, const char *xpath=NULL)
virtual void forgetXMLDocument (const char *filename)
virtual void forgetParsedXMLString (const char *content)
virtual void flushXMLDocumentCache ()
virtual void flushXMLParsedContentCache ()
virtual unsigned getExtraStackForEnvir () const
virtual cConfigurationgetConfig ()
virtual bool isGUI () const
virtual void bubble (cComponent *component, const char *text)
virtual std::string gets (const char *prompt, const char *defaultreply=NULL)
virtual cEnvirflush ()
virtual int getNumRNGs () const
virtual cRNGgetRNG (int k)
virtual void getRNGMappingFor (cComponent *component)
virtual void * registerOutputVector (const char *modulename, const char *vectorname)
virtual void deregisterOutputVector (void *vechandle)
virtual void setVectorAttribute (void *vechandle, const char *name, const char *value)
virtual bool recordInOutputVector (void *vechandle, simtime_t t, double value)
virtual void recordScalar (cComponent *component, const char *name, double value, opp_string_map *attributes=NULL)
virtual void recordStatistic (cComponent *component, const char *name, cStatistic *statistic, opp_string_map *attributes=NULL)
virtual void addResultRecorders (cComponent *component, simsignal_t signal, const char *statisticName, cProperty *statisticTemplateProperty)
virtual std::ostream * getStreamForSnapshot ()
virtual void releaseStreamForSnapshot (std::ostream *os)
virtual int getArgCount () const
virtual char ** getArgVector () const
virtual int getParsimProcId () const
virtual int getParsimNumPartitions () const
virtual unsigned long getUniqueNumber ()
virtual bool idle ()
virtual void attachDebugger ()

Detailed Description

A cEnvir implementation with all pure virtual methods defined with an empty body, with a trivial implementation, or to throw an exception with the "unsupported method" text.

This class is not used by OMNeT++, it is provided for convenience of writing standlone programs that embed the simulation kernel as a library.

You may want to subclass from cNullEnvir, and redefine some the following methods:


Member Function Documentation

virtual void cNullEnvir::addResultRecorders ( cComponent component,
simsignal_t  signal,
const char *  statisticName,
cProperty statisticTemplateProperty 
) [inline, virtual]

Adds result recording listeners for the given signal on the given component.

The result will be recorded to the the given component, with a name equal to or derived from the given statisticName. The statisticTemplateProperty parameter is expected to point to a NED property with content similar to properties. The computation and result type (scalar, vector, etc) will be taken from the 'record' key of statisticTemplateProperty in the same way as with . Also similar to , key-value pairs of statisticTemplateProperty will be recorded as result attributes.

In statisticTemplateProperty, the 'source' key will be ignored (because the signal given as parameter will be used as source). The actual name and index of statisticTemplateProperty will also be ignored. (With , the index holds the result name, but here the name is explicitly specified in the statisticName parameter.)

The purpose of this function is to allow setting up signal-based result recording dynamically when static configuration via properties is not possible, e.g. because the set of signals to record is only known at runtime.

Implements cEnvir.

virtual void cNullEnvir::attachDebugger (  )  [inline, virtual]

Starts an external debugger program and attaches it to this process.

The command line to start the debugger can be configured.

Implements cEnvir.

virtual void cNullEnvir::beginSend ( cMessage msg  )  [inline, virtual]

Notifies the environment that a message is being sent from a simple module.

beginSend() will be followed by a messageSendDirect() (optional, only present when cSimpleModule::sendDirect() was called), several messageSendHop() calls (one for each connection in the path), and finally an endSend().

Implements cEnvir.

virtual void cNullEnvir::componentMethodBegin ( cComponent from,
cComponent to,
const char *  methodFmt,
va_list  va,
bool  silent 
) [inline, virtual]

Notifies the environment that one component (module) called a member function of another component.

This hook enables a graphical user interface to animate the method call in the network diagram. Pass methodFmt==NULL for Enter_Method_Silent.

Implements cEnvir.

virtual void cNullEnvir::configure ( cComponent component  )  [inline, virtual]

Called when a module or channel has been created and installed in the model, and lets the environment perform extra setup.

One use is to add signal listeners for result recording.

Implements cEnvir.

virtual void cNullEnvir::endSend ( cMessage msg  )  [inline, virtual]

Closes a beginSend() sequence.

See also:
beginSend()

Implements cEnvir.

virtual cEnvir& cNullEnvir::flush (  )  [inline, virtual]

Flushes the output buffer of ev.printf() and ev<< operations.

Only some user interfaces need it: it can be useful with Cmdenv which writes to the standard output, but no need for it with Tkenv which displays all output immediately anyway.

Implements cEnvir.

virtual void cNullEnvir::flushXMLDocumentCache (  )  [inline, virtual]

Clears the cache of loaded XML documents, and deletes the corresponding cXMLElement trees.

CAUTION: As of version 4.1, this is not a safe operation, as module parameters (cPar) of type "xml" hold pointers to the element trees returned by getXMLDocument(), and this method makes those pointers invalid.

Implements cEnvir.

virtual void cNullEnvir::flushXMLParsedContentCache (  )  [inline, virtual]

Clears the cache of parsed XML content strings, and deletes the corresponding cXMLElement trees.

CAUTION: As of version 4.1, this is not a safe operation, as module parameters (cPar) of type "xml" hold pointers to the element trees returned by getXMLDocument(), and this method makes those pointers invalid.

Implements cEnvir.

virtual void cNullEnvir::forgetParsedXMLString ( const char *  content  )  [inline, virtual]

Removes the given document from the XML document cache (if cached), and deletes the object tree from memory.

After forgetXMLDocument(), cXMLElement objects returned for the same content string by getParsedXMLString() should no longer be referenced. The call has no effect if the given string has not yet been parsed.

CAUTION: As of version 4.1, this is not a safe operation! Module parameters (cPar) of type "xml" hold pointers to the element trees returned by getXMLDocument(), and this method makes those pointers invalid.

Implements cEnvir.

virtual void cNullEnvir::forgetXMLDocument ( const char *  filename  )  [inline, virtual]

Removes the given document from the XML document cache (if cached), and deletes the object tree from memory.

Further getXMLDocument() calls will reload the file from the disk. After forgetXMLDocument(), cXMLElement objects returned for the same document by getXMLDocument() should no longer be referenced. The call has no effect if the given file does not exist or has not yet been loaded.

CAUTION: As of version 4.1, this is not a safe operation! Module parameters (cPar) of type "xml" hold pointers to the element trees returned by getXMLDocument(), and this method makes those pointers invalid.

Implements cEnvir.

virtual cConfiguration* cNullEnvir::getConfig (  )  [inline, virtual]

Access to the configuration (by default, omnetpp.ini).

This method is provided here for the benefit of schedulers, parallel simulation algorithms and other simulation kernel extensions. Models (simple modules) should NOT directly access the configuration -- they should rely on module parameters to get input.

Implements cEnvir.

virtual cXMLElement* cNullEnvir::getParsedXMLString ( const char *  content,
const char *  xpath = NULL 
) [inline, virtual]

Returns the parsed form of an XML content string.

The first argument is the XML content string. The optional second argument may contain an XPath-like expression to denote an element within the XML document. If path is not present, the root element is returned.

See documentation of cXMLElement::getElementByPath() for path syntax. There is a difference however: paths starting with "." are not accepted, and the first path component must name the root element of the document (with getElementByPath() it would match a child element of the current element). That is, a leading "/" is always assumed at the beginning of the path expression, even if it is not explicitly there.

The method throws an exception if there was a parse error or if the given path expression is invalid. It returns NULL if the element denoted by the path expression does not exist in the document.

The returned object tree should not be modified because cEnvir may cache the tree and return the same pointer to several callers.

Implements cEnvir.

virtual std::ostream* cNullEnvir::getStreamForSnapshot (  )  [inline, virtual]

Returns a stream where a snapshot can be written.

Called from cSimulation::snapshot().

Implements cEnvir.

virtual cXMLElement* cNullEnvir::getXMLDocument ( const char *  filename,
const char *  xpath = NULL 
) [inline, virtual]

Resolves reference to an XML model configuration file.

First argument is the file name of the XML document. The optional second argument may contain an XPath-like expression to denote an element within the XML document. If path is not present, the root element is returned.

See documentation of cXMLElement::getElementByPath() for path syntax. There is a difference however: paths starting with "." are not accepted, and the first path component must name the root element of the document (with getElementByPath() it would match a child element of the current element). That is, a leading "/" is always assumed at the beginning of the path expression, even if it is not explicitly there.

The method throws an exception if the document cannot be found, there was a parse error, or the given path expression is invalid. It returns NULL if the element denoted by the path expression does not exist in the document.

The returned object tree should not be modified because cEnvir may cache the file and return the same pointer to several callers.

Implements cEnvir.

virtual bool cNullEnvir::idle (  )  [inline, virtual]

May be called from the simulation while actively waiting for some external condition to occur -- for example from blocking receive in parallel simulation, or during wait in real-time simulation.

In a graphical user interface, this method may take care of display redraw and handling user interaction (including handling of the Stop button).

Normally returns false. A true value means the user wants to abort waiting (e.g. pushed the Stop button).

Implements cEnvir.

virtual bool cNullEnvir::isGUI (  )  const [inline, virtual]

Tells if the current environment is graphical or not.

(For Tkenv it returns true, and with Cmdenv it returns false.) Simple modules can examine this flag to decide whether or not they need to bother updating display strings.

Implements cEnvir.

virtual bool cNullEnvir::isModuleLocal ( cModule parentmod,
const char *  modname,
int  index 
) [inline, virtual]

Used for parallel distributed simulation.

Returns true if the named future submodule of parentmod is (or will have any submodule) in the local partition, and false otherwise. index should be -1 if the submodule is not in a module vector.

Note that for compound modules that contain simple modules in several partitions, this function will return true on all those partitions.

Implements cEnvir.

virtual void cNullEnvir::messageCancelled ( cMessage msg  )  [inline, virtual]

Notifies the environment that a scheduled message was cancelled.

See also:
cSimpleModule::cancelEvent()

Implements cEnvir.

virtual void cNullEnvir::messageCloned ( cMessage msg,
cMessage clone 
) [inline, virtual]

Notifies the environment that a message object is being cloned.

This is called from the cMessage copy constructor.

Implements cEnvir.

virtual void cNullEnvir::messageCreated ( cMessage msg  )  [inline, virtual]

Notifies the environment that a message object is being created.

This is called from the cMessage constructor.

Implements cEnvir.

virtual void cNullEnvir::messageDeleted ( cMessage msg  )  [inline, virtual]

Notifies the environment that a message object is being deleted.

This is called from the cMessage destructor, so any information added to cMessage via subclassing is already lost at the time of the call.

Implements cEnvir.

virtual void cNullEnvir::messageScheduled ( cMessage msg  )  [inline, virtual]

Notifies the environment that a message was scheduled.

See also:
cSimpleModule::scheduleAt()

Implements cEnvir.

virtual void cNullEnvir::messageSendDirect ( cMessage msg,
cGate toGate,
simtime_t  propagationDelay,
simtime_t  transmissionDelay 
) [inline, virtual]

Part of the beginSend() sequence.

See also:
beginSend()

Implements cEnvir.

virtual void cNullEnvir::messageSendHop ( cMessage msg,
cGate srcGate,
simtime_t  propagationDelay,
simtime_t  transmissionDelay 
) [inline, virtual]

Part of the beginSend() sequence.

See also:
beginSend()

Implements cEnvir.

virtual void cNullEnvir::messageSendHop ( cMessage msg,
cGate srcGate 
) [inline, virtual]

Part of the beginSend() sequence.

See also:
beginSend()

Implements cEnvir.

virtual void cNullEnvir::messageSent_OBSOLETE ( cMessage msg,
cGate directToGate = NULL 
) [inline, virtual]

Notifies the environment that a message was sent.

Details can be extracted from the message object itself. The user interface implementation may use the notification to animate the message on a network diagram, to write a log entry, etc.

The second argument is non-NULL only when sendDirect() was used, and identifies the target gate that was passed to the sendDirect() call. (This information is necessary for proper animation: the target gate might belong to a compound module and be further connected, and then the message will additionally travel through a series of connections before it arrives in a simple module.)

Implements cEnvir.

virtual void cNullEnvir::moduleCreated ( cModule newmodule  )  [inline, virtual]

Notifies the environment that a module was created.

This method is called from cModuleType::create(), when the module has already been created but buildInside() has not been invoked yet.

Implements cEnvir.

virtual void cNullEnvir::moduleDeleted ( cModule module  )  [inline, virtual]

Notifies the environment that a module was (more precisely: is being) deleted.

This method is called from cModule destructor, so the "real" type (getClassName() and everything from the actual subclass) is already lost at this point, however getName(), getFullName(), getFullPath(), gates, parameters (everything that comes from cModule) are still valid.

If a compound module (or a module with dynamically created submodules) is deleted, one should not assume anything about the relative order moduleDeleted() is called for the module and its submodules.

Implements cEnvir.

virtual void cNullEnvir::objectDeleted ( cObject object  )  [inline, virtual]

Notifies the environment that the object no longer exists.

The user interface should close all inspector windows for the object and remove it from object lists currently displayed. cObject's destructor automatically calls this function.

Reimplemented from cEnvir.

virtual bool cNullEnvir::recordInOutputVector ( void *  vechandle,
simtime_t  t,
double  value 
) [inline, virtual]

This method is intended to be called by cOutVector objects to write a value into the output vector.

The return value is true if the data was actually recorded, and false if it was not recorded (because of filtering, etc.)

Implements cEnvir.

virtual void cNullEnvir::recordStatistic ( cComponent component,
const char *  name,
cStatistic statistic,
opp_string_map attributes = NULL 
) [inline, virtual]

Records a statistic object (histogram, etc) into the scalar result file.

This operation may invoke the transform() method on the histogram object.

Implements cEnvir.

virtual void* cNullEnvir::registerOutputVector ( const char *  modulename,
const char *  vectorname 
) [inline, virtual]

This method is intended to be called by cOutVector objects to register themselves.

The returned value is a handle that identifies the vector in subsequent recordInOutputVector() and deregisterOutputVector() calls. The handle may have any value (it does not have to be a valid pointer), but it should NOT be NULL.

Implements cEnvir.

virtual void cNullEnvir::simulationEvent ( cMessage msg  )  [inline, virtual]

Notifies the environment that a message was delivered to its destination module, that is, a message arrival event occurred.

Details can be extracted from the message object itself. The user interface implementation may use the notification to animate the message on a network diagram, to write a log entry, etc.

Implements cEnvir.


The documentation for this class was generated from the following file:
Generated on Tue Dec 2 11:16:29 2014 for OMNeT++ Simulation Library by  doxygen 1.6.3