|
OMNeT++ API 6.1
Discrete Event Simulation Library
|
|
16 #ifndef __OMNETPP_CENVIR_H
17 #define __OMNETPP_CENVIR_H
21 #include "simkerneldefs.h"
22 #include "simtime_t.h"
23 #include "opp_string.h"
24 #include "clistener.h"
25 #include "clifecyclelistener.h"
28 namespace osg {
class Node; }
49 class cConfigurationEx;
56 #define EVCB cSimulation::getActiveEnvir()->suppressNotifications ? (void)0 : (*cSimulation::getActiveEnvir())
80 bool loggingEnabled =
true;
88 bool suppressNotifications =
false;
91 bool debugOnErrors =
false;
94 std::vector<cISimulationLifecycleListener*> listeners;
135 virtual void simulationEvent(
cEvent *event) = 0;
141 virtual void messageScheduled(
cMessage *msg) = 0;
147 virtual void messageCancelled(
cMessage *msg) = 0;
167 virtual void messageSendHop(
cMessage *msg,
cGate *srcGate) = 0;
173 virtual void endSend(
cMessage *msg) = 0;
179 virtual void messageCreated(
cMessage *msg) = 0;
192 virtual void messageDeleted(
cMessage *msg) = 0;
197 virtual void moduleReparented(
cModule *module,
cModule *oldparent,
int oldId) = 0;
205 virtual void componentMethodBegin(
cComponent *from,
cComponent *to,
const char *methodFmt, va_list va,
bool silent) = 0;
211 virtual void componentMethodEnd() = 0;
218 virtual void moduleCreated(
cModule *newmodule) = 0;
231 virtual void moduleDeleted(
cModule *module) = 0;
236 virtual void gateCreated(
cGate *newgate) = 0;
242 virtual void gateDeleted(
cGate *gate) = 0;
248 virtual void connectionCreated(
cGate *srcgate) = 0;
254 virtual void connectionDeleted(
cGate *srcgate) = 0;
260 virtual void displayStringChanged(
cComponent *component) = 0;
302 virtual void preconfigure(
cComponent *component) = 0;
310 virtual void configure(
cComponent *component) = 0;
316 virtual void readParameter(
cPar *parameter) = 0;
328 virtual bool isModuleLocal(
cModule *parentmod,
const char *modname,
int index) = 0;
352 virtual cXMLElement *getXMLDocument(
const char *filename,
const char *xpath=
nullptr) = 0;
375 virtual cXMLElement *getParsedXMLString(
const char *content,
const char *xpath=
nullptr) = 0;
390 virtual void forgetXMLDocument(
const char *filename) = 0;
404 virtual void forgetParsedXMLString(
const char *content) = 0;
415 virtual void flushXMLDocumentCache() = 0;
426 virtual void flushXMLParsedContentCache() = 0;
432 virtual unsigned getExtraStackForEnvir()
const = 0;
460 virtual std::string resolveResourcePath(
const char *fileName,
cComponentType *context=
nullptr) = 0;
472 virtual bool isGUI()
const = 0;
485 virtual bool isExpressMode()
const = 0;
491 virtual void bubble(
cComponent *component,
const char *text) = 0;
502 virtual void alert(
const char *msg) = 0;
507 _OPP_GNU_ATTRIBUTE(format(printf, 2, 3))
508 virtual
void printfmsg(const
char *fmt,...);
514 virtual std::
string gets(const
char *prompt, const
char *defaultReply=
nullptr) = 0;
521 virtual
bool askYesNo(const
char *prompt) = 0;
527 virtual std::ostream& getOutputStream() = 0;
538 virtual
void getImageSize(const
char *imageName,
double& outWidth,
double& outHeight) = 0;
547 virtual
void getTextExtent(const
cFigure::Font& font, const
char *text,
double& outWidth,
double& outHeight,
double& outAscent) = 0;
560 virtual
void appendToImagePath(const
char *directory) = 0;
585 virtual
void loadImage(const
char *fileName, const
char *imageName=
nullptr) = 0;
604 virtual
cFigure::Rectangle getSubmoduleBounds(const
cModule *submodule) = 0;
626 virtual std::vector<
cFigure::Point> getConnectionLine(const
cGate *sourceGate) = 0;
642 virtual
double getZoomLevel(const
cModule *module) = 0;
650 virtual
double getAnimationTime() const = 0;
661 virtual
double getAnimationSpeed() const = 0;
670 virtual
double getRemainingAnimationHoldTime() const = 0;
680 virtual
int getNumRNGs() const = 0;
685 virtual
cRNG *getRNG(
int k) = 0;
705 virtual
void *registerOutputVector(const
char *modulename, const
char *vectorname,
opp_string_map *attributes=
nullptr) = 0;
710 virtual
void deregisterOutputVector(
void *vechandle) = 0;
717 virtual
bool recordInOutputVector(
void *vechandle,
simtime_t t,
double value) = 0;
733 virtual
void recordScalar(
cComponent *component, const
char *name,
double value,
opp_string_map *attributes=
nullptr) = 0;
744 virtual
void recordParameter(
cPar *par) = 0;
749 virtual
void recordComponentType(
cComponent *component) = 0;
789 virtual std::ostream *getStreamForSnapshot() = 0;
794 virtual
void releaseStreamForSnapshot(std::ostream *os) = 0;
802 virtual
int getArgCount() const = 0;
807 virtual
char **getArgVector() const = 0;
812 virtual
int getParsimProcId() const = 0;
818 virtual
int getParsimNumPartitions() const = 0;
823 virtual
unsigned long getUniqueNumber() = 0;
829 virtual
void refOsgNode(osg::Node *scene) = 0;
835 virtual
void unrefOsgNode(osg::Node *scene) = 0;
850 virtual
bool idle() = 0;
859 virtual
void pausePoint() = 0;
875 virtual
bool ensureDebugger(
cRuntimeError *error =
nullptr) = 0;
This class represents modules in the simulation.
Definition: cmodule.h:48
Allows returning multiple values from the processMessage() method.
Definition: cchannel.h:33
int simsignal_t
Signal handle.
Definition: clistener.h:27
cEnvir()
Definition: cenvir.h:103
Represents a configuration suitable for use with the Envir library.
Definition: cconfiguration.h:304
cObject is a lightweight class which serves as the root of the OMNeT++ class hierarchy....
Definition: cobject.h:92
Represents the configuration, as accessed by the simulation kernel.
Definition: cconfiguration.h:76
Represents an event in the discrete event simulator.
Definition: cevent.h:46
This class holds various data that is captured when a particular log statement executes....
Definition: clog.h:376
Lightweight string-to-string map, used internally in some parts of OMNeT++.
Definition: opp_string.h:219
SimulationLifecycleEventType
Event type for cISimulationLifecycleListener's lifecycleEvent() method.
Definition: clifecyclelistener.h:28
virtual cModule * getCurrentEventModule()
Definition: cenvir.h:290
int64_t-based, base-10 fixed-point simulation time.
Definition: simtime.h:66
virtual void componentInitBegin(cComponent *component, int stage)
Definition: cenvir.h:126
virtual const char * getCurrentEventClassName()
Definition: cenvir.h:284
Options for the cSimpleModule::send() and cSimpleModule::sendDirect() calls.
Definition: csimplemodule.h:82
virtual ~cEnvir()
Definition: cenvir.h:108
virtual void undisposedObject(cObject *obj)
Definition: cenvir.h:269
Represents a module gate.
Definition: cgate.h:62
Abstract interface for random number generator classes.
Definition: crng.h:48
Represents a module or channel parameter.
Definition: cpar.h:70
virtual void objectDeleted(cObject *object)
Definition: cenvir.h:121
Common base class for cModuleType and cChannelType.
Definition: ccomponenttype.h:49
The message class in OMNeT++. cMessage objects may represent events, messages, jobs or other entities...
Definition: cmessage.h:95
Represents an XML element in an XML configuration file.
Definition: cxmlelement.h:75
Common base for module and channel classes.
Definition: ccomponent.h:49
virtual const char * getCurrentEventName()
Definition: cenvir.h:278
cStatistic is an abstract class for computing statistical properties of a random variable.
Definition: cstatistic.h:34
bool isLoggingEnabled() const
Definition: cenvir.h:478
Thrown when the simulation kernel or other components detect a runtime error.
Definition: cexception.h:286
cEnvir represents the "environment" or user interface of the simulation.
Definition: cenvir.h:75
Stores a (NED) property with its (possibly compound) value.
Definition: cproperty.h:38
A callback interface for receiving notifications at various stages simulations, including setting up,...
Definition: clifecyclelistener.h:186
A cEnvir that can be instantiated as a user interface, like Cmdenv and Tkenv.
Definition: cenvir.h:913