ASL 0.1.7
Advanced Simulation Library
Loading...
Searching...
No Matches
aslTimeStamp.h
Go to the documentation of this file.
1/*
2 * Advanced Simulation Library <http://asl.org.il>
3 *
4 * Copyright 2015 Avtech Scientific <http://avtechscientific.com>
5 *
6 *
7 * This file is part of Advanced Simulation Library (ASL).
8 *
9 * ASL is free software: you can redistribute it and/or modify it
10 * under the terms of the GNU Affero General Public License as
11 * published by the Free Software Foundation, version 3 of the License.
12 *
13 * ASL is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU Affero General Public License for more details.
17 *
18 * You should have received a copy of the GNU Affero General Public License
19 * along with ASL. If not, see <http://www.gnu.org/licenses/>.
20 *
21 */
22
23
24#ifndef ASLTIMESTAMP_H
25#define ASLTIMESTAMP_H
26
27
28namespace asl{
29
31 class TimeStamp {
32 public:
33 typedef long unsigned int TSType;
34 private:
35 static TSType tsTime;
36 TSType stamp;
37 public:
38 inline TimeStamp():stamp(0){};
39 inline void update(){stamp=++tsTime; tsTime=(tsTime==0?1:tsTime);}
40 inline bool needUpdate(const TimeStamp & a) const{
41 return (stamp<a.stamp) || (stamp> tsTime);
42 }
43// friend bool operator<(const TimeStamp &a, const TimeStamp &b);
44// friend bool operator>(const TimeStamp &a, const TimeStamp &b);
45 };
46
47/* inline bool operator<(const TimeStamp &a, const TimeStamp &b)
48 {
49 return a.stamp<b.stamp;
50 }
51
52 inline bool operator>(const TimeStamp &a, const TimeStamp &b)
53 {
54 return a.stamp>b.stamp;
55 }
56*/
57
58} //namespace acl
59
60#endif // ASLTIMESTAMP_H
long unsigned int TSType
bool needUpdate(const TimeStamp &a) const
Advanced Simulation Library.
Definition aslDataInc.h:31