MeVisLab Toolbox Reference
mlMemoryInfo.h
Go to the documentation of this file.
1 /*************************************************************************************
2 **
3 ** Copyright 2009, MeVis Medical Solutions AG
4 **
5 ** The user may use this file in accordance with the license agreement provided with
6 ** the Software or, alternatively, in accordance with the terms contained in a
7 ** written agreement between the user and MeVis Medical Solutions AG.
8 **
9 ** For further information use the contact form at https://www.mevislab.de/contact
10 **
11 **************************************************************************************/
12 
13 #ifndef ML_MEMORY_INFO_H
14 #define ML_MEMORY_INFO_H
15 
17 
18 #include "mlUtilsSystem.h"
19 
20 ML_UTILS_START_NAMESPACE
21 
22 //=============================================================================
25 //=============================================================================
27 {
28 public:
29  // --------------------------------------------------------------------------
33  // --------------------------------------------------------------------------
35 
36 protected:
37  // --------------------------------------------------------------------------
41  // --------------------------------------------------------------------------
43 
44 public:
45  // --------------------------------------------------------------------------
47  // --------------------------------------------------------------------------
48  unsigned int getTotalPhysicalMemoryInMB() const
49  {
50  return _amountOfPhysicalMemoryInMB;
51  }
52 
53  // --------------------------------------------------------------------------
55  // --------------------------------------------------------------------------
56  unsigned int getAvailableMemoryInMB() const
57  {
58  return _availableMemoryInMB;
59  }
60 
61 private:
62  void init();
63 
64  unsigned int _amountOfPhysicalMemoryInMB = 0;
65  unsigned int _availableMemoryInMB = 0;
66 
67 #if ML_DEPRECATED_SINCE(3,5,0)
68 
71 
72 public:
73 
76  inline ML_DEPRECATED unsigned int amountOfPhysicalMemoryInMB() const { return getTotalPhysicalMemoryInMB(); };
77 
79 
80 #endif
81 
82 };
83 
84 ML_UTILS_END_NAMESPACE
85 #endif
#define ML_DEPRECATED
Definition: CSOGroup.h:371
Singleton class that provides hardware specific information.
Definition: mlMemoryInfo.h:27
MemoryInfo()
This constructor must not be called from anywhere else but the getInstance() method (which does call ...
static MemoryInfo & getInstance()
Returns the single existing object of this class.
unsigned int getAvailableMemoryInMB() const
Returns the available amount of memory in MB.
Definition: mlMemoryInfo.h:56
unsigned int getTotalPhysicalMemoryInMB() const
Returns the total amount of physical memory in MB.
Definition: mlMemoryInfo.h:48
#define ML_UTILS_EXPORT
Defines platform dependent DLL export macro for mlUtils.
Definition: mlUtilities.h:20
void init()
Initializes the ML, the runtime type system, the memory manager, fields, static buffers,...