fw4spl
NeverDump.hpp
1 /* ***** BEGIN LICENSE BLOCK *****
2  * FW4SPL - Copyright (C) IRCAD, 2009-2017.
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 __FWMEMORY_POLICY_NEVERDUMP_HPP__
8 #define __FWMEMORY_POLICY_NEVERDUMP_HPP__
9 
10 #include "fwMemory/BufferInfo.hpp"
11 #include "fwMemory/config.hpp"
12 #include "fwMemory/IPolicy.hpp"
13 #include "fwMemory/policy/factory/new.hpp"
14 
15 #include <fwCore/base.hpp>
16 
17 namespace fwMemory
18 {
19 
20 namespace policy
21 {
22 
30 class FWMEMORY_CLASS_API NeverDump : public fwMemory::IPolicy
31 {
32 public:
33 
35  (()),
36  ::fwMemory::policy::factory::New< NeverDump >)
37 
38  FWMEMORY_API virtual void allocationRequest( BufferInfo& info,
39  ::fwMemory::BufferManager::ConstBufferPtrType buffer,
40  BufferInfo::SizeType size ) override;
41 
42  FWMEMORY_API virtual void setRequest( BufferInfo& info,
43  ::fwMemory::BufferManager::ConstBufferPtrType buffer,
44  BufferInfo::SizeType size ) override;
45 
46  FWMEMORY_API virtual void reallocateRequest( BufferInfo& info,
47  ::fwMemory::BufferManager::ConstBufferPtrType buffer,
48  BufferInfo::SizeType newSize ) override;
49 
50  FWMEMORY_API virtual void destroyRequest( BufferInfo& info,
51  ::fwMemory::BufferManager::ConstBufferPtrType buffer ) override;
52 
53  FWMEMORY_API virtual void lockRequest( BufferInfo& info,
54  ::fwMemory::BufferManager::ConstBufferPtrType buffer ) override;
55  FWMEMORY_API virtual void unlockRequest( BufferInfo& info,
56  ::fwMemory::BufferManager::ConstBufferPtrType buffer ) override;
57 
58  FWMEMORY_API virtual void dumpSuccess( BufferInfo& info,
59  ::fwMemory::BufferManager::ConstBufferPtrType buffer ) override;
60  FWMEMORY_API virtual void restoreSuccess( BufferInfo& info,
61  ::fwMemory::BufferManager::ConstBufferPtrType buffer ) override;
62 
63  FWMEMORY_API virtual void refresh() override;
64 
65  //------------------------------------------------------------------------------
66 
67  bool setParam(const std::string& name, const std::string& value) override
68  {
69  FwCoreNotUsedMacro(name);
70  FwCoreNotUsedMacro(value);
71  return false;
72  }
73 
74  FWMEMORY_API virtual std::string getParam(const std::string& name, bool* ok = NULL ) const override;
75 
76  //------------------------------------------------------------------------------
77 
78  const fwMemory::IPolicy::ParamNamesType& getParamNames() const override
79  {
80  static fwMemory::IPolicy::ParamNamesType names;
81  return names;
82  }
83 };
84 
85 } // namespace policy
86 
87 } // namespace fwMemory
88 
89 #endif // __FWMEMORY_POLICY_NEVERDUMP_HPP__
90 
Never dump policy.
Definition: NeverDump.hpp:30
The namespace fwMemory contains tools to manage memory. Use for dump.
Definition: SReader.hpp:20
STL namespace.
#define fwCoreClassDefinitionsWithFactoryMacro(_classinfo_, _parameters_, _factory_)
Generate common construction methods for classes with one factory.
BufferManager implementation.
Defines the memory dump policy interface.
Definition: IPolicy.hpp:23