cstatisticbuilder.h Source File

API: cstatisticbuilder.h Source File
API
cstatisticbuilder.h
1//==========================================================================
2// CSTATISTICBUILDER.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_CSTATISTICBUILDER_H
17#define __OMNETPP_CSTATISTICBUILDER_H
18
19#include "omnetpp/clistener.h"
20#include "omnetpp/cproperty.h"
21
22namespace omnetpp {
23
24extern const char *PROPKEY_STATISTIC_SOURCE;
25extern const char *PROPKEY_STATISTIC_RECORD;
26extern const char *PROPKEY_STATISTIC_CHECKSIGNALS;
27
28class cConfiguration;
29struct SignalSource;
30
34class SIM_API cStatisticBuilder
35{
36 public:
37 enum TristateBool {TRISTATE_TRUE=1, TRISTATE_FALSE=0, TRISTATE_DEFAULT=-1}; // for internal use only
38
39 private:
40 cConfiguration *config;
41
42 public:
43 cStatisticBuilder(cConfiguration *config) : config(config) {}
44
50
55 void addResultRecorders(cComponent *component, simsignal_t signal, const char *statisticName, cProperty *statisticTemplateProperty);
56
57 protected:
58 // Utility function: adds result recording listeners for the given signal (if it's non-null) or for the given @statistic property.
59 // If signal is specified, it will override the source= key in statisticProperty.
60 // The index of statisticProperty is ignored; statisticName will be used as name of the statistic instead.
61 void doAddResultRecorders(cComponent *component, std::string& componentFullPath, const char *statisticName, cProperty *statisticProperty, simsignal_t signal=SIMSIGNAL_NULL);
62
63 // Utility functions for addResultRecorders()
64 std::vector<std::string> extractRecorderList(const char *modesOption, cProperty *statisticProperty);
65 SignalSource doStatisticSource(cComponent *component, cProperty *statisticProperty, const char *statisticName, const char *sourceSpec, TristateBool checkSignalDecl, bool needWarmupFilter);
66 void doResultRecorder(const SignalSource& source, const char *mode, cComponent *component, const char *statisticName, cProperty *attrsProperty);
67 TristateBool parseTristateBool(const char *s, const char *what);
68};
69
70} // namespace omnetpp
71
72#endif
73
74
Common base for module and channel classes.
Definition ccomponent.h:51
Represents the configuration, as accessed by the simulation kernel.
Definition cconfiguration.h:77
Stores a (NED) property with its (possibly compound) value.
Definition cproperty.h:39
void addResultRecorders(cComponent *component, simsignal_t signal, const char *statisticName, cProperty *statisticTemplateProperty)
void addResultRecorders(cComponent *component)
int simsignal_t
Signal handle.
Definition clistener.h:37