Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013 #ifndef MEMORY_USAGE_MONITOR_H
00014 #define MEMORY_USAGE_MONITOR_H
00015
00016 #include "ace/pre.h"
00017
00018 #include "ace/Monitor_Base.h"
00019
00020 #if !defined (ACE_LACKS_PRAGMA_ONCE)
00021 #pragma once
00022 #endif
00023
00024 #if defined (ACE_HAS_MONITOR_FRAMEWORK) && (ACE_HAS_MONITOR_FRAMEWORK == 1)
00025
00026 #if defined (ACE_HAS_PDH_H) && !defined (ACE_LACKS_PDH_H)
00027 #include "ace/Monitor_Control/Windows_Monitor.h"
00028 #elif defined (ACE_HAS_LINUX_SYSINFO)
00029 #include "ace/os_include/sys/os_sysinfo.h"
00030 #endif
00031
00032 #include "ace/Monitor_Control/Monitor_Control_export.h"
00033
00034 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
00035
00036 namespace ACE
00037 {
00038 namespace Monitor_Control
00039 {
00040
00041
00042
00043
00044
00045 class MONITOR_CONTROL_Export Memory_Usage_Monitor
00046 : public Monitor_Base
00047 #if defined (ACE_HAS_WIN32_PDH)
00048 , public Windows_Monitor
00049 #endif
00050 {
00051 public:
00052 Memory_Usage_Monitor (const char* name);
00053
00054
00055 virtual void update (void);
00056
00057
00058 static const char* default_name (void);
00059
00060 private:
00061
00062 virtual void clear_i (void);
00063
00064 private:
00065 static const char* default_name_;
00066
00067 #if defined (ACE_HAS_LINUX_SYSINFO)
00068 struct sysinfo sysinfo_;
00069 #endif
00070 };
00071 }
00072 }
00073
00074 ACE_END_VERSIONED_NAMESPACE_DECL
00075
00076 #endif
00077
00078 #include "ace/post.h"
00079
00080 #endif // MEMORY_USAGE_MONITOR_H