fw4spl
LogicStamp.hpp
1 /* ***** BEGIN LICENSE BLOCK *****
2  * FW4SPL - Copyright (C) IRCAD, 2009-2015.
3  * Distributed under the terms of the GNU Lesser General Public License (LGPL) as
4  * published by the Free Software Foundation.
5  * ****** END LICENSE BLOCK ****** */
6 
7 #ifndef __FWCORE_LOGICSTAMP_HPP__
8 #define __FWCORE_LOGICSTAMP_HPP__
9 
10 #include "fwCore/base.hpp"
11 #include "fwCore/HiResClock.hpp"
12 
13 
14 namespace fwCore
15 {
16 
22 class FWCORE_CLASS_API LogicStamp : public BaseObject
23 {
24 
25 public:
27 
31  typedef unsigned long LogicStampType;
32 
37  FWCORE_API LogicStamp()
38  {
39  this->m_modifiedLogicalTime = 0;
40  }
41 
48  FWCORE_API void modified();
49 
50 
54  FWCORE_API LogicStampType getLogicStamp() const
55  {
56  return this->m_modifiedLogicalTime;
57  }
58 
59 
65  FWCORE_API bool operator>(const LogicStamp& ls) const
66  {
67  return ( this->m_modifiedLogicalTime > ls.m_modifiedLogicalTime );
68  }
69 
75  FWCORE_API bool operator<(const LogicStamp& ls) const
76  {
77  return ( this->m_modifiedLogicalTime < ls.m_modifiedLogicalTime );
78  }
79 
83  FWCORE_API operator LogicStampType() const
84  {
85  return this->m_modifiedLogicalTime;
86  }
87 
88 
89 private:
90 
94  LogicStampType m_modifiedLogicalTime;
95 
96 };
97 
98 } //namespace fwCore
99 
100 #endif // __FWCORE_LOGICSTAMP_HPP__
101 
FWCORE_API bool operator<(const LogicStamp &ls) const
Lesser than operator for LogicStamp.
Definition: LogicStamp.hpp:75
Base class for all FW4SPL&#39;s classes.
Definition: BaseObject.hpp:22
This namespace fwCore provides common foundations for FW4SPL.
Definition: BaseObject.hpp:16
#define fwCoreClassDefinitionsWithFactoryMacro(_classinfo_, _parameters_, _factory_)
Generate common construction methods for classes with one factory.
unsigned long LogicStampType
Type used in logical typestamp.
Definition: LogicStamp.hpp:26
Provides a Logical timestamp system.
Definition: LogicStamp.hpp:22
FWCORE_API LogicStampType getLogicStamp() const
Definition: LogicStamp.hpp:54
FWCORE_API bool operator>(const LogicStamp &ls) const
Greater than operator for LogicStamp.
Definition: LogicStamp.hpp:65