Statistics
| Branch: | Revision:

root / src / envir / filesnapshotmgr.h @ 68da4f12

History | View | Annotate | Download (1.85 KB)

1
//==========================================================================
2
//  FILESNAPSHOTMGR.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 __FILESNAPSHOTMGR_H
19
#define __FILESNAPSHOTMGR_H
20

    
21
#include <stdio.h>
22
#include "envirdefs.h"
23
#include "envirext.h"
24
#include "simutil.h"
25

    
26
NAMESPACE_BEGIN
27

    
28
/**
29
 * The default cSnapshotManager.
30
 *
31
 * @ingroup Envir
32
 */
33
class ENVIR_API cFileSnapshotManager : public cSnapshotManager
34
{
35
  protected:
36
    opp_string fname;  // output file name
37

    
38
  public:
39
    /** @name Constructor, destructor */
40
    //@{
41

    
42
    /**
43
     * Constructor.
44
     */
45
    explicit cFileSnapshotManager();
46

    
47
    /**
48
     * Destructor.
49
     */
50
    virtual ~cFileSnapshotManager();
51
    //@}
52

    
53
    /** @name Controlling the beginning and end of collecting data. */
54
    //@{
55

    
56
    /**
57
     * Called at the beginning of a simulation run.
58
     */
59
    virtual void startRun();
60

    
61
    /**
62
     * Called at the end of a simulation run.
63
     */
64
    virtual void endRun();
65
    //@}
66

    
67
    /** @name Snapshot management */
68
    //@{
69
    /**
70
     * Returns a stream where a snapshot can be written.
71
     */
72
    virtual std::ostream *getStreamForSnapshot();
73

    
74
    /**
75
     * Releases a stream after a snapshot was written.
76
     */
77
    virtual void releaseStreamForSnapshot(std::ostream *os);
78

    
79
    /**
80
     * Returns the file name.
81
     */
82
    const char *getFileName() const;
83
    //@}
84
};
85

    
86
NAMESPACE_END
87

    
88

    
89
#endif
90