fw4spl
LockDumpSrv.cpp
1 /* ***** BEGIN LICENSE BLOCK *****
2  * FW4SPL - Copyright (C) IRCAD, 2009-2018.
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 #include "ctrlMemory/LockDumpSrv.hpp"
8 
9 #include <fwServices/macros.hpp>
10 
11 namespace ctrlMemory
12 {
13 
14 static const ::fwServices::IService::KeyType s_TARGET_INOUT = "target";
15 
16 //-----------------------------------------------------------------------------
17 
18 fwServicesRegisterMacro( ::fwServices::IController, ::ctrlMemory::LockDumpSrv, ::fwData::Object );
19 
20 //-----------------------------------------------------------------------------
21 
22 LockDumpSrv::LockDumpSrv() noexcept
23 {
24 }
25 
26 //-----------------------------------------------------------------------------
27 
29 {
30 }
31 
32 //-----------------------------------------------------------------------------
33 
35 {
36  ::fwData::Object::sptr object = this->getInOut< ::fwData::Object >(s_TARGET_INOUT);
37  if (!object)
38  {
39  FW_DEPRECATED_KEY(s_TARGET_INOUT, "inout", "18.0");
40  object = this->getObject();
41  }
42  m_objLock = ::fwData::ObjectLock( object );
43 }
44 
45 //-----------------------------------------------------------------------------
46 
48 {
49  m_objLock = ::fwData::ObjectLock();
50 }
51 
52 //-----------------------------------------------------------------------------
53 
55 {
56 }
57 
58 //-----------------------------------------------------------------------------
59 
61 {
62 }
63 
64 //-----------------------------------------------------------------------------
65 
67 {
68 }
69 
70 //-----------------------------------------------------------------------------
71 
72 void LockDumpSrv::info( std::ostream& _sstream )
73 {
74 }
75 
76 //-----------------------------------------------------------------------------
77 
78 } // ctrlMemory
#define FW_DEPRECATED_KEY(newKey, access, version)
Use this macro when deprecating a service key to warn the developer.
Definition: spyLog.hpp:366
virtual CTRLMEMORY_API void configuring() override
Does nothing.
Definition: LockDumpSrv.cpp:54
virtual CTRLMEMORY_API ~LockDumpSrv() noexcept
Destructor. Does nothing.
Definition: LockDumpSrv.cpp:28
This interface defines control service API. Does nothing particularly, can be considered as a default...
Definition: IController.hpp:23
virtual CTRLMEMORY_API void stopping() override
Dump unlock the associated data.
Definition: LockDumpSrv.cpp:47
Base class for each data object.
FWSERVICES_API::fwData::Object::sptr getObject()
Return the object associated to service.
Definition: IService.cpp:101
CTRLMEMORY_API LockDumpSrv() noexcept
Constructor. Does nothing.
virtual CTRLMEMORY_API void starting() override
Uses fwData::ObjectLock to dump lock the associated data.
Definition: LockDumpSrv.cpp:34
A simple helper to lock specific object, manages : Image, Mesh and Array.
Definition: ObjectLock.hpp:26
virtual CTRLMEMORY_API void info(std::ostream &_sstream) override
Does nothing.
Definition: LockDumpSrv.cpp:72
virtual CTRLMEMORY_API void reconfiguring() override
Does nothing.
Definition: LockDumpSrv.cpp:60
virtual CTRLMEMORY_API void updating() override
Does nothing.
Definition: LockDumpSrv.cpp:66
This services dump lock object. Unlock it on stopping.
Definition: LockDumpSrv.hpp:31
The namespace ctrlMemory contains services to lock objects to prevent dump.
Definition: LockDumpSrv.hpp:15