Statistics
| Branch: | Revision:

root / src / envir / statisticparser.h @ fbe00e73

History | View | Annotate | Download (2.22 KB)

1
//==========================================================================
2
//  STATISTICPARSER.H - part of
3
//                     OMNeT++/OMNEST
4
//            Discrete System Simulation in C++
5
//
6
//  Author: Andras Varga
7
//
8
//==========================================================================
9

    
10
/*--------------------------------------------------------------*
11
  Copyright (C) 1992-2008 Andras Varga
12
  Copyright (C) 2006-2008 OpenSim Ltd.
13

14
  This file is distributed WITHOUT ANY WARRANTY. See the file
15
  `license' for details on this and other legal matters.
16
*--------------------------------------------------------------*/
17

    
18
#ifndef __ENVIR_STATISTICPARSER_H
19
#define __ENVIR_STATISTICPARSER_H
20

    
21
#include "envirdefs.h"
22
#include "expression.h"
23
#include "resultrecorders.h"
24

    
25
class FilterOrRecorderReference;
26

    
27
class ENVIR_API StatisticSourceParser
28
{
29
  protected:
30
    // create and install a ResultFilter; its input is the expression at the top of the stack (length 'len').
31
    // filterRef may be NULL; in that case, only the expression filter needs to be created
32
    SignalSource createFilter(FilterOrRecorderReference *filterRef, const std::vector<Expression::Elem>& stack, int len);
33
  public:
34
    StatisticSourceParser() {}
35
    SignalSource parse(cComponent *component, const char *statisticName, const char *sourceSpec, bool needWarmupFilter);
36
};
37

    
38
class ENVIR_API StatisticRecorderParser
39
{
40
  protected:
41
    // create and install a ResultFilter or a ResultRecorder, depending on the makeRecorder flag;
42
    // its input is the expression at the top of the stack (length 'len').
43
    // filterRef may be NULL; in that case, only the expression filter/recorder needs to be created.
44
    // returns SignalSource(NULL) if called with makeRecorder==true, meaning that no chaining is possible
45
    SignalSource createFilterOrRecorder(FilterOrRecorderReference *filterOrRecorderRef, bool makeRecorder, const std::vector<Expression::Elem>& stack, int len, const SignalSource& source, cComponent *component, const char *statisticName, const char *recordingMode);
46
  public:
47
    StatisticRecorderParser() {}
48
    void parse(const SignalSource& source, const char *recordingMode, bool scalarsEnabled, bool vectorsEnabled, cComponent *component, const char *statisticName);
49
};
50

    
51
#endif
52

    
53