cmessageprinter.h Source File

API: cmessageprinter.h Source File
API
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
23namespace omnetpp {
24
25class cMessage;
26
48class SIM_API cMessagePrinter : public cNoncopyableOwnedObject
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
120class SIM_API cDefaultMessagePrinter : public cMessagePrinter
121{
122 public:
123 cDefaultMessagePrinter() {}
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
virtual std::set< std::string > getDefaultEnabledTags() const override
virtual void printMessage(std::ostream &os, cMessage *msg, const Options *options) const override
virtual std::set< std::string > getSupportedTags() const override
virtual std::vector< std::string > getColumnNames(const Options *options) const override
virtual int getScoreFor(cMessage *msg) const override
virtual std::vector< std::string > getColumnNames(const Options *options) const
Definition cmessageprinter.h:101
virtual int getScoreFor(cMessage *msg) const =0
virtual void printMessage(std::ostream &os, cMessage *msg, const Options *options) const =0
virtual std::set< std::string > getSupportedTags() const
Definition cmessageprinter.h:87
virtual ~cMessagePrinter()
Definition cmessageprinter.h:67
cMessagePrinter()
Definition cmessageprinter.h:62
virtual std::set< std::string > getDefaultEnabledTags() const
Definition cmessageprinter.h:93
The message class in OMNeT++. cMessage objects may represent events, messages, jobs or other entities...
Definition cmessage.h:96
Definition cmessageprinter.h:54