lm::LoadMonitor::MemoryEnumCache Class Reference

Cache for memory monitoring data. More...

Inheritance diagram for lm::LoadMonitor::MemoryEnumCache:

lm::LoadMonitor::PerformanceCounterEnumCache

Public Member Functions

 MemoryEnumCache (void)
 Create new cache object.
virtual ~MemoryEnumCache (void)
 Free used resources.
virtual bool AddToRefresher (IWbemConfigureRefresher *configure, IWbemServices *services)
 Add object to the refresher.
virtual void Release (void)
 Free resources.
virtual bool QueryData (LoadSample &target)
 Query data.
unsigned long long GetSize ()
 Get total size of physcial memory in bytes.

Protected Member Functions

virtual bool CacheImpl (IWbemObjectAccess *access_object)
 Cache property handles.

Private Attributes

IWbemHiPerfEnum * enum_memory_usage
 Enumerator for Win32_PerfRawData_PerfOS_Memory or Win32_PerfFormattedData_PerfOS_Memory classes.
long enum_memory_usage_id
 ID of the memory enumerator.
long id_available
 ID of the "AvailableBytes" property.

Detailed Description

Cache for memory monitoring data.


Constructor & Destructor Documentation

lm::LoadMonitor::MemoryEnumCache::MemoryEnumCache ( void   ) 

Create new cache object.

lm::LoadMonitor::MemoryEnumCache::~MemoryEnumCache ( void   )  [virtual]

Free used resources.


Member Function Documentation

bool lm::LoadMonitor::MemoryEnumCache::AddToRefresher ( IWbemConfigureRefresher *  configure,
IWbemServices *  services 
) [virtual]

Add object to the refresher.

Parameters:
configure Configure refresher which will be used to add required objects to the refresher.
services WMI service provider.
Returns:
true on success, false otherwise.

Implements lm::LoadMonitor::PerformanceCounterEnumCache.

bool lm::LoadMonitor::MemoryEnumCache::CacheImpl ( IWbemObjectAccess *  access_object  )  [protected, virtual]

Cache property handles.

Parameters:
access_object Object which contains all properties that need to be cached.
Returns:
true on success, false otherwise.

Implements lm::LoadMonitor::PerformanceCounterEnumCache.

unsigned long long lm::LoadMonitor::MemoryEnumCache::GetSize (  ) 

Get total size of physcial memory in bytes.

Gets total size of physical memory in bytes. This method does not use WMI, just pure WinAPI (GlobalMemoryStatusEx).

Returns:
Size of physical memory in bytes.

bool lm::LoadMonitor::MemoryEnumCache::QueryData ( LoadSample target  )  [virtual]

Query data.

Query data after it has been refreshed. This will collect all data from enumerators previously registered with refresher via AddToRefresher method and store resulting data in provided load sample. If data are stored in array (e.g. CPU usage on multi-processor machines), arrays will be automatically allocated. If query fails, sample will remain unmodified.

Parameters:
target Reference to the load sample which will receive data.
Returns:
true on success, false otherwise.

Implements lm::LoadMonitor::PerformanceCounterEnumCache.

void lm::LoadMonitor::MemoryEnumCache::Release ( void   )  [virtual]

Free resources.

Implements lm::LoadMonitor::PerformanceCounterEnumCache.


Field Documentation

IWbemHiPerfEnum* lm::LoadMonitor::MemoryEnumCache::enum_memory_usage [private]

Enumerator for Win32_PerfRawData_PerfOS_Memory or Win32_PerfFormattedData_PerfOS_Memory classes.

long lm::LoadMonitor::MemoryEnumCache::enum_memory_usage_id [private]

ID of the memory enumerator.

long lm::LoadMonitor::MemoryEnumCache::id_available [private]

ID of the "AvailableBytes" property.


The documentation for this class was generated from the following files:
Generated on Tue Dec 19 17:43:49 2006 for Load Monitor for Windows by  doxygen 1.4.7