Project

General

Profile

Statistics
| Branch: | Revision:

root / src / envir / eventlogfilemgr.h @ e26d3d25

History | View | Annotate | Download (3.05 KB)

1
//==========================================================================
2
//  EVENTLOGFILEMGR.H - part of
3
//                     OMNeT++/OMNEST
4
//            Discrete System Simulation in C++
5
//
6
//  Author: Andras Varga, Levente Meszaros
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 __EVENTLOGFILEMGR_H
19
#define __EVENTLOGFILEMGR_H
20

    
21
#include "simkerneldefs.h"
22
#include "envirdefs.h"
23
#include "opp_string.h"
24
#include "objectprinter.h"
25
#include "intervals.h"
26

    
27
class cModule;
28
class cMessage;
29
class cGate;
30
class cComponent;
31

    
32
NAMESPACE_BEGIN
33

    
34
/**
35
 * Responsible for writing the eventlog file.
36
 */
37
class ENVIR_API EventlogFileManager
38
{
39
  private:
40
    opp_string filename;
41
    FILE *feventlog;
42
    ObjectPrinter *objectPrinter;
43
    Intervals *recordingIntervals;
44
    bool isEventLogRecordingEnabled;
45
    bool isModuleEventLogRecordingEnabled;
46
    bool isIntervalEventLogRecordingEnabled;
47

    
48
  public:
49
    EventlogFileManager();
50
    virtual ~EventlogFileManager();
51

    
52
    virtual void configure();
53
    virtual void open();
54
    virtual void startRun();
55
    virtual void endRun();
56

    
57
    virtual bool hasRecordingIntervals() const;
58
    virtual void clearRecordingIntervals();
59

    
60
    virtual void recordSimulation();
61
    virtual void recordMessages();
62
    virtual void recordModules(cModule *module);
63
    virtual void recordConnections(cModule *module);
64

    
65
    virtual void flush();
66

    
67
    /** @name Functions called from cEnvir's similar functions */
68
    //@{
69
    virtual void simulationEvent(cMessage *msg);
70
    virtual void bubble(cComponent *component, const char *text);
71
    virtual void messageScheduled(cMessage *msg);
72
    virtual void messageCancelled(cMessage *msg);
73
    virtual void beginSend(cMessage *msg);
74
    virtual void messageSendDirect(cMessage *msg, cGate *toGate, simtime_t propagationDelay, simtime_t transmissionDelay);
75
    virtual void messageSendHop(cMessage *msg, cGate *srcGate);
76
    virtual void messageSendHop(cMessage *msg, cGate *srcGate, simtime_t propagationDelay, simtime_t transmissionDelay);
77
    virtual void endSend(cMessage *msg);
78
    virtual void messageDeleted(cMessage *msg);
79
    virtual void moduleReparented(cModule *module, cModule *oldparent);
80
    virtual void componentMethodBegin(cComponent *from, cComponent *to, const char *methodFmt, va_list va);
81
    virtual void componentMethodEnd();
82
    virtual void moduleCreated(cModule *newmodule);
83
    virtual void moduleDeleted(cModule *module);
84
    virtual void gateCreated(cGate *newgate);
85
    virtual void gateDeleted(cGate *gate);
86
    virtual void connectionCreated(cGate *srcgate);
87
    virtual void connectionDeleted(cGate *srcgate);
88
    virtual void displayStringChanged(cComponent *component);
89
    virtual void sputn(const char *s, int n);
90
    //@}
91
};
92

    
93
NAMESPACE_END
94

    
95
#endif