fw4spl
LogicStamp.cpp
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 
8 #include "fwCore/mt/types.hpp"
9 #include "fwCore/LogicStamp.hpp"
10 
11 namespace fwCore
12 {
13 
14 
16 {
17  static LogicStampType globalLogicStamp = 0;
18  static ::fwCore::mt::Mutex globalLogicStampMutex;
19 
20  ::fwCore::mt::ScopedLock lock(globalLogicStampMutex);
21 
22  m_modifiedLogicalTime = ++globalLogicStamp;
23 
24  SLM_ASSERT("globalLogicStamp not instanced", globalLogicStamp); // detects overflow
25 }
26 
27 
28 } //namespace fwCore
This namespace fwCore provides common foundations for FW4SPL.
Definition: BaseObject.hpp:16
unsigned long LogicStampType
Type used in logical typestamp.
Definition: LogicStamp.hpp:26
#define SLM_ASSERT(message, cond)
work like 'assert' from 'cassert', with in addition a message logged by spylog (with FATAL loglevel) ...
Definition: spyLog.hpp:308
FWCORE_API void modified()
Increment global Logical counter and copy it to this LogicStamp.
Definition: LogicStamp.cpp:15