OMNeT++ Simulation Library
5.6.1
|
#include <cmessageprinter.h>
Base class for message printers.
Message printers is a somewhat experimental feature, intended at giving models a way to control how network packets or in general, cMessage objects) are displayed. Currently, message printer output is used for the Messages mode display of the Log viewer in Tkenv/Qtenv.
Several message printers may be registered (with Register_MessagePrinter()), independent of each other, and OMNeT++ will choose the "best" or most specific one for each message object. The best one is decided based on scoring: every message printer will be polled by passing the message object to its getScoreFor() method, and the message printer returning the highest score will "win".
OMNeT++ calls printMessage() to obtain information to be displayed about a message.
Classes | |
struct | Options |
Public Member Functions | |
cMessagePrinter () | |
virtual | ~cMessagePrinter () |
virtual int | getScoreFor (cMessage *msg) const =0 |
virtual std::set< std::string > | getSupportedTags () const |
virtual std::set< std::string > | getDefaultEnabledTags () const |
virtual std::vector< std::string > | getColumnNames (const Options *options) const |
virtual void | printMessage (std::ostream &os, cMessage *msg, const Options *options) const =0 |
Public Member Functions inherited from cNoncopyableOwnedObject | |
cNoncopyableOwnedObject (const char *name=nullptr, bool namepooling=true) | |
virtual cNoncopyableOwnedObject * | dup () const override |
virtual void | parsimPack (cCommBuffer *buffer) const override |
virtual void | parsimUnpack (cCommBuffer *buffer) override |
Public Member Functions inherited from cOwnedObject | |
cOwnedObject () | |
cOwnedObject (const char *name, bool namepooling=true) | |
cOwnedObject (const cOwnedObject &obj) | |
virtual | ~cOwnedObject () |
cOwnedObject & | operator= (const cOwnedObject &o) |
virtual cObject * | getOwner () const override |
virtual bool | isOwnedObject () const override |
virtual bool | isSoftOwner () const |
Public Member Functions inherited from cNamedObject | |
cNamedObject () | |
cNamedObject (const char *name, bool namepooling=true) | |
cNamedObject (const cNamedObject &obj) | |
virtual | ~cNamedObject () |
cNamedObject & | operator= (const cNamedObject &o) |
virtual void | setName (const char *s) |
virtual const char * | getName () const override |
virtual void | setNamePooling (bool b) |
virtual bool | getNamePooling () |
Public Member Functions inherited from cObject | |
cObject () | |
cObject (const cObject &other) | |
virtual | ~cObject () |
virtual const char * | getClassName () const |
bool | isName (const char *s) const |
virtual const char * | getFullName () const |
virtual std::string | getFullPath () const |
const cObject * | getThisPtr () const |
virtual std::string | str () const |
virtual _OPPDEPRECATED std::string | info () const |
virtual _OPPDEPRECATED std::string | detailedInfo () const |
virtual void | forEachChild (cVisitor *v) |
cObject * | findObject (const char *name, bool deep=true) |
void | copyNotSupported () const |
Additional Inherited Members | |
Static Public Member Functions inherited from cOwnedObject | |
static long | getTotalObjectCount () |
static long | getLiveObjectCount () |
static void | resetObjectCounters () |
static cDefaultList * | getDefaultOwner () |
Protected Member Functions inherited from cObject | |
virtual void | take (cOwnedObject *obj) |
virtual void | drop (cOwnedObject *obj) |
void | dropAndDelete (cOwnedObject *obj) |
|
inline |
Constructor
|
inlinevirtual |
Destructor
|
pure virtual |
Scoring function that lets OMNeT++ decide which message printer to use for a particular message object. The "better", more specific the message printer is for that message, the higher score it should return. Guideline: 0 or negative: does not support this message; 10: returned by cDefaultMessagePrinter
Implemented in cDefaultMessagePrinter.
|
inlinevirtual |
Returns the tags supported by this printer.
Reimplemented in cDefaultMessagePrinter.
|
inlinevirtual |
Returns the list of tags that this printer recommends to enable by default. The result must only contain tags that are also returned by "getSupportedTags()".
Reimplemented in cDefaultMessagePrinter.
|
inlinevirtual |
Returns column names for the specified options. The options parameter should never be nullptr. The list of enabled tags in "options" may contain tags not known or supported by this printer. Those should be silently ignored.
Reimplemented in cDefaultMessagePrinter.
|
pure virtual |
Print a single-line text about the message object into the given output stream. Use Tab characters to separate columns. Splitting the text into more or fewer columns than returned by getColumnNames is allowed, but being consistent with those is highly recommended. The options parameter should never be nullptr.
Implemented in cDefaultMessagePrinter.