OMNeT++ Simulation Library  5.6.1
cmessageprinter.h
1 //==========================================================================
2 // CMESSAGEPRINTER.H - part of
3 // OMNeT++/OMNEST
4 // Discrete System Simulation in C++
5 //
6 //==========================================================================
7 
8 /*--------------------------------------------------------------*
9  Copyright (C) 1992-2017 Andras Varga
10  Copyright (C) 2006-2017 OpenSim Ltd.
11 
12  This file is distributed WITHOUT ANY WARRANTY. See the file
13  `license' for details on this and other legal matters.
14 *--------------------------------------------------------------*/
15 
16 #ifndef __OMNETPP_CMESSAGEPRINTER_H
17 #define __OMNETPP_CMESSAGEPRINTER_H
18 
19 #include <set>
20 #include <vector>
21 #include "cownedobject.h"
22 
23 namespace omnetpp {
24 
25 class cMessage;
26 
49 {
50  public:
54  struct Options {
55  std::set<std::string> enabledTags;
56  };
57 
58  public:
63 
67  virtual ~cMessagePrinter() {}
68 
77  virtual int getScoreFor(cMessage *msg) const = 0;
78 
87  virtual std::set<std::string> getSupportedTags() const {return {};}
88 
93  virtual std::set<std::string> getDefaultEnabledTags() const {return {};}
94 
101  virtual std::vector<std::string> getColumnNames(const Options *options) const {(void)options; return {};}
102 
110  virtual void printMessage(std::ostream& os, cMessage *msg, const Options *options) const = 0;
111 };
112 
121 {
122  public:
124  virtual ~cDefaultMessagePrinter() {}
125  virtual int getScoreFor(cMessage *msg) const override;
126 
127  virtual std::set<std::string> getSupportedTags() const override;
128  virtual std::set<std::string> getDefaultEnabledTags() const override;
129  virtual std::vector<std::string> getColumnNames(const Options *options) const override;
130 
131  virtual void printMessage(std::ostream& os, cMessage *msg, const Options *options) const override;
132 };
133 
134 } // namespace omnetpp
135 
136 #endif
137 
138 
The message class in OMNeT++. cMessage objects may represent events, messages, jobs or other entities...
Definition: cmessage.h:95
virtual ~cMessagePrinter()
Definition: cmessageprinter.h:67
Base class for message printers.
Definition: cmessageprinter.h:48
A default message printer that displays the ID, kind, and length (for packets) of the message...
Definition: cmessageprinter.h:120
virtual std::set< std::string > getDefaultEnabledTags() const
Definition: cmessageprinter.h:93
cMessagePrinter()
Definition: cmessageprinter.h:62
virtual std::vector< std::string > getColumnNames(const Options *options) const
Definition: cmessageprinter.h:101
Definition: cmessageprinter.h:54
Definition: cabstracthistogram.h:21
virtual std::set< std::string > getSupportedTags() const
Definition: cmessageprinter.h:87
Base class for cOwnedObject-based classes that do not wish to support assignment and duplication...
Definition: cownedobject.h:248