Statistics
| Branch: | Revision:

root / src / envir / intervals.h @ fbe00e73

History | View | Annotate | Download (1.32 KB)

1 01873262 Georg Kunz
//==========================================================================
2
//  INTERVALS.H - part of
3
//                     OMNeT++/OMNEST
4
//            Discrete System Simulation in C++
5
//
6
//  Author: 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 __INTERVALS_H
19
#define __INTERVALS_H
20
21
#include "simkerneldefs.h"
22
#include "envirdefs.h"
23
#include "simtime_t.h"
24
25
NAMESPACE_BEGIN
26
27
/**
28
 * A list of simulation time intervals represented as an array of (starttime, stoptime)
29
 * pairs terminated with (0,0), or NULL
30
 */
31
class ENVIR_API Intervals
32
{
33
    public:
34
        struct Interval {
35
            simtime_t startTime;
36
            simtime_t stopTime;  // 0 if unspecified
37
            Interval() { startTime = stopTime = 0; }
38
        };
39
40
    private:
41
        Interval *intervals;
42
43
    public:
44
        Intervals();
45
        ~Intervals();
46
        void parse(const char *text);
47
        bool contains(simtime_t t) const;
48
        bool empty() const;
49
};
50
51
NAMESPACE_END
52
53
#endif