fw4spl
MemoryMonitorTools.cpp
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 #include "fwMemory/tools/MemoryMonitorTools.hpp"
8 
9 #ifdef _WIN32
10 #define MEMORYTOOLIMPL Win32MemoryMonitorTools
11 #include "fwMemory/tools/Win32MemoryMonitorTools.hpp"
12 #elif defined(__MACOSX__)
13 #define MEMORYTOOLIMPL DarwinMemoryMonitorTools
14 #include "fwMemory/tools/DarwinMemoryMonitorTools.hpp"
15 #else
16 #define MEMORYTOOLIMPL PosixMemoryMonitorTools
17 #include "fwMemory/tools/PosixMemoryMonitorTools.hpp"
18 #endif
19 
20 namespace fwMemory
21 {
22 namespace tools
23 {
24 
25 //-----------------------------------------------------------------------------
26 
27 MemoryMonitorTools::MemoryMonitorTools()
28 {
29 }
30 
31 //-----------------------------------------------------------------------------
32 
33 MemoryMonitorTools::~MemoryMonitorTools()
34 {
35 }
36 
37 //-----------------------------------------------------------------------------
38 
39 std::uint64_t MemoryMonitorTools::estimateFreeMem()
40 {
41  return MEMORYTOOLIMPL::estimateFreeMem();
42 }
43 
44 //-----------------------------------------------------------------------------
45 
46 void MemoryMonitorTools::printProcessMemoryInformation()
47 {
48  MEMORYTOOLIMPL::printProcessMemoryInformation();
49 }
50 
51 //-----------------------------------------------------------------------------
52 
53 void MemoryMonitorTools::printSystemMemoryInformation()
54 {
55  MEMORYTOOLIMPL::printSystemMemoryInformation();
56 }
57 
58 //-----------------------------------------------------------------------------
59 
60 void MemoryMonitorTools::printMemoryInformation()
61 {
62  MEMORYTOOLIMPL::printMemoryInformation();
63 }
64 
65 //-----------------------------------------------------------------------------
66 
67 std::uint64_t MemoryMonitorTools::getTotalSystemMemory()
68 {
69  return MEMORYTOOLIMPL::getTotalSystemMemory();
70 }
71 
72 //-----------------------------------------------------------------------------
73 
74 std::uint64_t MemoryMonitorTools::getUsedSystemMemory()
75 {
76  return MEMORYTOOLIMPL::getUsedSystemMemory();
77 }
78 
79 //-----------------------------------------------------------------------------
80 
81 std::uint64_t MemoryMonitorTools::getFreeSystemMemory()
82 {
83  return MEMORYTOOLIMPL::getFreeSystemMemory();
84 }
85 
86 //-----------------------------------------------------------------------------
87 
88 std::uint64_t MemoryMonitorTools::getUsedProcessMemory()
89 {
90  return MEMORYTOOLIMPL::getUsedProcessMemory();
91 }
92 
93 //-----------------------------------------------------------------------------
94 
95 } // namespace tools
96 } // namespace fwMemory
The namespace fwMemory contains tools to manage memory. Use for dump.
Definition: SReader.hpp:20