Statistics
| Branch: | Revision:

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

History | View | Annotate | Download (2.21 KB)

1 01873262 Georg Kunz
//==========================================================================
2
//  AKOUTVECTORMGR.H - part of
3
//                     OMNeT++/OMNEST
4
//            Discrete System Simulation in C++
5
//
6
//  Declaration of the following classes:
7
//     cAkOutputVectorManager
8
//
9
//  Author: Andras Varga
10
//
11
//==========================================================================
12
13
/*--------------------------------------------------------------*
14
  Copyright (C) 1992-2008 Andras Varga
15
  Copyright (C) 2006-2008 OpenSim Ltd.
16

17
  This file is distributed WITHOUT ANY WARRANTY. See the file
18
  `license' for details on this and other legal matters.
19
*--------------------------------------------------------------*/
20
21
#ifdef WITH_AKAROA
22
23
#ifndef __AKOUTVECTORMGR_H
24
#define __AKOUTVECTORMGR_H
25
26
#include <stdio.h>
27
#include "fileoutvectormgr.h"
28
#include "simutil.h"
29
30
NAMESPACE_BEGIN
31
32
33
/**
34
 * An output vector manager that supports multiple independent runs
35
 * via Akaroa; otherwise it behaves as the default output vector manager.
36
 * Akaroa will stop the simulation when the desired result accuracy
37
 * has been reached.
38
 *
39
 * @ingroup Envir
40
 */
41
class ENVIR_API cAkOutputVectorManager : public cFileOutputVectorManager
42
{
43
    struct sAkVectorData : sVectorData {
44
       bool ak_controlled;  // under Akaroa control or not
45
       long ak_id;          // Akaroa vector ID
46
    };
47
48
  protected:
49
    bool ak_declared;  // is true when the number of records is already declared to Akaroa
50
    int ak_count;      // number of Akaroa vectors already registered
51
52
  protected:
53
    virtual sVectorData *createVectorData();
54
55
  public:
56
    /** @name Constructors, destructor */
57
    //@{
58
59
    /**
60
     * Constructor.
61
     */
62
    explicit cAkOutputVectorManager();
63
64
    /**
65
     * Destructor.
66
     */
67
    virtual ~cAkOutputVectorManager();
68
    //@}
69
70
    /** @name Redefined cFileOutputVectorManager member functions. */
71
    //@{
72
73
    /**
74
     * Registers a vector and returns a handle.
75
     */
76
    virtual void *registerVector(const char *modulename, const char *vectorname);
77
78
    /**
79
     * Passes a (time, value) pair to Akaroa and also writes it into the output file.
80
     */
81
    virtual bool record(void *vectorhandle, simtime_t t, double value);
82
    //@}
83
};
84
85
#endif
86
NAMESPACE_END
87
88
89
#endif