3 //=============================================================================
5 * @file Memory_Usage_Monitor.h
7 * @author Jeff Parsons <j.parsons@vanderbilt.edu>
9 //=============================================================================
11 #ifndef MEMORY_USAGE_MONITOR_H
12 #define MEMORY_USAGE_MONITOR_H
14 #include /**/ "ace/pre.h"
16 #include "ace/Monitor_Base.h"
18 #if !defined (ACE_LACKS_PRAGMA_ONCE)
20 #endif /* ACE_LACKS_PRAGMA_ONCE */
22 #if defined (ACE_HAS_MONITOR_FRAMEWORK) && (ACE_HAS_MONITOR_FRAMEWORK == 1)
24 #if defined (ACE_HAS_PDH_H) && !defined (ACE_LACKS_PDH_H)
25 #include "ace/Monitor_Control/Windows_Monitor.h"
26 #elif defined (ACE_HAS_LINUX_SYSINFO)
27 #include "ace/os_include/sys/os_sysinfo.h"
30 #include "ace/Monitor_Control/Monitor_Control_export.h"
32 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
36 namespace Monitor_Control
39 * @class Memory_Usage_Monitor
41 * @brief Monitor percentage of total available memory used.
43 class MONITOR_CONTROL_Export Memory_Usage_Monitor
45 #if defined (ACE_HAS_WIN32_PDH)
46 , public Windows_Monitor
50 Memory_Usage_Monitor (const char* name
);
52 /// Implementation of the pure virtual method.
53 virtual void update ();
55 /// Stores the default name, used if none is supplied by the user.
56 static const char* default_name ();
59 /// Overridden reset, calls platform-specific reset.
60 virtual void clear_i ();
63 static const char* default_name_
;
65 #if defined (ACE_HAS_LINUX_SYSINFO)
66 struct sysinfo sysinfo_
;
72 ACE_END_VERSIONED_NAMESPACE_DECL
74 #endif /* ACE_HAS_MONITOR_FRAMEWORK==1 */
76 #include /**/ "ace/post.h"
78 #endif // MEMORY_USAGE_MONITOR_H