CoreModule designed for diagnostic purposes, collects wosh::SystemInfo system information and provides access to profiling data (when enabled). More...
#include <H:/WOSH/win32_vc2010/src/core/SystemMonitor.h>
Public Member Functions | |
| virtual | ~SystemMonitor () |
| Destructor. SystemInfo list is destroyed (nested). | |
Public methods | |
| WRESULT | updateSystemInfo () |
| Update System information, the fields are OS-dependent. Reentrant. | |
| const tSystemInfoList & | getSystemInfos () const |
| long | getSystemInfosMaxSize () const |
| WRESULT | installSystemInfoProxy (SystemInfoProxy *systeminfo_proxy) |
| WRESULT | installSystemInfoProxy (const std::string &systeminfo_proxy_classname, double version=0.0) |
| WRESULT | installSystemInfoProxies (const std::string &systeminfo_proxy_classname_pattern) |
Message Events (incoming message) | |
| void | busMessage (const Message &message, const Bus *source) |
| Method raised by the Bus when it processes a new message. Implementations will probably analyze the message and perform actions. | |
Protected Member Functions | |
| SystemMonitor (const WoshKernel *parent=NULL) | |
| Default constructor. Call base constructor and initialize some properties and hosted methods. | |
| WRESULT | onKernelInitializing () |
| Call base class implementation and (synch) update system informations. | |
| WRESULT | onKernelInitialized () |
| Event raised synchonously by the Kernel when switching to WoshKernel::STATE_INITIALIZED state. | |
| WRESULT | onKernelStopped () |
| Eventually save SystemInfos list and call base class implementation. | |
Private Attributes | |
| long | systemInfoTs |
| timestamp of system-info data (epoch in seconds) | |
Friends | |
| class | wosh::WoshKernel |
IPropertiesProviderListener interface | |
| class | wosh::PropertiesProvider |
| bool | readingProperty (Property *property_curr, const PropertiesProvider *source) |
Internal Mehods and SystemInfo management | |
| class | wosh::SystemInfo |
| allow some access from my child-object | |
| static WRESULT | save (SystemInfo *error, const Object *source=NULL, bool raise_message=false) |
| static SystemMonitor * | getInstance () |
| Access the SystemMonitor singleton. Gamma Pattern. Static reference is allocated and detroyed by WoshKernel on constructor/destructor respectively. | |
| WRESULT | updateSystemInfo_ (bool lock_props, bool force_update) |
| Update System information, the fields are OS-dependent. | |
CoreModule designed for diagnostic purposes, collects wosh::SystemInfo system information and provides access to profiling data (when enabled).
wosh::SystemMonitor UML diagram
Definition at line 108 of file SystemMonitor.h.
| wosh::SystemMonitor::SystemMonitor | ( | const WoshKernel * | parent = NULL ) |
[protected] |
Default constructor. Call base constructor and initialize some properties and hosted methods.
| parent | [in] WoshKernel singleton, passed to WoshModule constructor |
Definition at line 87 of file SystemMonitor.cpp.
References _METHOD_Retrieve, wosh::LOG_DEBUG, wosh::LOG_INFO, and wosh::LOG_VERBOSE.
| wosh::SystemMonitor::~SystemMonitor | ( | ) | [virtual] |
Destructor. SystemInfo list is destroyed (nested).
Definition at line 136 of file SystemMonitor.cpp.
References wosh::LOG_DEBUG, and wosh::LOG_VERBOSE.
Method raised by the Bus when it processes a new message. Implementations will probably analyze the message and perform actions.
| [in] | message | the incoming message |
| [in] | source | the source Bus of the incoming message |
Reimplemented from wosh::WoshModule.
Definition at line 268 of file SystemMonitor.cpp.
References wosh::Message::getContent(), wosh::Message::getSourceUUID(), wosh::Message::isEmpty(), wosh::MessageContent::isSystemInfo(), and wosh::LOG_INFO.
| SystemMonitor * wosh::SystemMonitor::getInstance | ( | ) | [static, private] |
Access the SystemMonitor singleton. Gamma Pattern. Static reference is allocated and detroyed by WoshKernel on constructor/destructor respectively.
Definition at line 75 of file SystemMonitor.cpp.
| WRESULT wosh::SystemMonitor::onKernelInitialized | ( | ) | [protected, virtual] |
Event raised synchonously by the Kernel when switching to WoshKernel::STATE_INITIALIZED state.
Reimplemented from wosh::WoshModule.
Definition at line 170 of file SystemMonitor.cpp.
References wosh::LOG_INFO, and WRET_OK.
| WRESULT wosh::SystemMonitor::onKernelInitializing | ( | ) | [protected, virtual] |
Call base class implementation and (synch) update system informations.
Reimplemented from wosh::WoshModule.
Definition at line 157 of file SystemMonitor.cpp.
References getCurrentProcessPID(), and wosh::LOG_INFO.
| WRESULT wosh::SystemMonitor::onKernelStopped | ( | ) | [protected, virtual] |
Eventually save SystemInfos list and call base class implementation.
Reimplemented from wosh::WoshModule.
Definition at line 187 of file SystemMonitor.cpp.
References wosh::LOG_CRITICAL, wosh::LOG_INFO, and WRET_OK.
| WRESULT wosh::SystemMonitor::save | ( | SystemInfo * | error, |
| const Object * | source = NULL, |
||
| bool | raise_message = false |
||
| ) | [static, protected] |
Definition at line 377 of file SystemMonitor.cpp.
References wosh::ISerializable::clone(), wosh::LOG_INFO, wosh::Message::setDestinationBroadcast(), wosh::Message::setDestinationBus(), wosh::Message::setSource(), WRET_ERR_INTERNAL, WRET_ERR_PARAM, and WRET_OK.
| WRESULT wosh::SystemMonitor::updateSystemInfo | ( | ) | [inline] |
Update System information, the fields are OS-dependent. Reentrant.
Definition at line 158 of file SystemMonitor.h.
References updateSystemInfo_().
| WRESULT wosh::SystemMonitor::updateSystemInfo_ | ( | bool | lock_props, |
| bool | force_update | ||
| ) | [private] |
Update System information, the fields are OS-dependent.
| lock_props | [in] when true the method is reentrant, else it won't lock Properties list |
| force_update | [in] flag used to ignore data-timeout evaluation |
Definition at line 214 of file SystemMonitor.cpp.
References getCurrentProcessPID(), wosh::LOG_CRITICAL, wosh::LOG_VERBOSE, retrieveProcessInfo(), WRET_ERR_ILLEGAL_USE, WRET_ERR_INTERNAL, and WRET_OK.
Referenced by updateSystemInfo().
friend class wosh::SystemInfo [friend] |
allow some access from my child-object
Definition at line 187 of file SystemMonitor.h.
long wosh::SystemMonitor::systemInfoTs [private] |
timestamp of system-info data (epoch in seconds)
Definition at line 216 of file SystemMonitor.h.