00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040 #ifndef __ResourceMonitor_h__
00041 #define __ResourceMonitor_h__
00042
00043 #include "ResourceMonitorTypes.h"
00044 #include <stddef.h>
00045
00046 #ifdef __cplusplus
00047
00053 namespace ResourceMonitor
00054 {
00055 extern "C" {
00056 #endif
00057
00558
00559 int rmGetResourceMonitorVersion();
00560
00561
00562
00563
00564
00565
00566
00567
00568
00569
00576 size_t rmGetSubsystemCount();
00588 int rmGetAvailableSubsystems(rmSubsystemInfo *buffer, const size_t size);
00601 int rmGetActiveResources(const rmUID SubsystemId, rmResourceInfo *buffer, const size_t size);
00613 int rmGetAvailableStatistics(const rmUID SubsystemId, rmStatisticInfo *buffer, const size_t size);
00620 size_t rmGetMonitorCount();
00630 int rmGetMonitors(rmMonitorInfo *buffer, size_t *size);
00637 int rmGetSubsystemInfo(const rmUID SubsystemId, rmSubsystemInfo *buffer);
00646 rmString rmGetSubsystemDescription(const rmUID SubsystemId, const enum rmDescriptions which);
00655 int rmGetResourceInfo(const rmUID SubsystemId, const rmID ResourceId, rmResourceInfo *buffer);
00666 rmString rmGetResourceDescription(const rmUID SubsystemId, const rmID ResourceId, const enum rmDescriptions which);
00675 int rmGetResourceID(const rmUID SubsystemId, const rmString shortdescription, rmID *id);
00684 int rmGetStatisticInfo(const rmUID SubsystemId, const rmID statId, rmStatisticInfo *buffer);
00695 rmString rmGetStatisticDescription(const rmUID SubsystemId, const rmID statId, const enum rmDescriptions which);
00704 int rmGetStatisticID(const rmUID SubsystemId, const rmString shortdescription, rmID *id);
00705
00706 #ifdef RM_Doing_Aliases
00707
00708
00709 int rmGetSubsystemAliases(const rmUID SubsystemId, rmString buffer, size_t *size);
00710
00711 int rmGetResourceAliases(const rmUID SubsystemId, const rmID ResourceId, rmString buffer, size_t *size);
00712
00713 int rmGetStatisticAliases(const rmStatisticKey statisticKey, rmString buffer, size_t* size);
00714 #endif // RM_Doing_Aliases
00715
00716
00717
00718
00728 int rmGetCurrentValue(const rmStatisticKey id, rmValue *value);
00736 int rmGetUpperBound(const rmStatisticKey id, rmValue *value);
00737
00746 int rmResetCounterStatistic(const rmStatisticKey id, const rmValue *value);
00747
00771 rmHandle rmCreateMonitor(const rmMonitorConfiguration *config, rmMonitorControl *control);
00780 rmHandle rmAccessMonitor(const rmUID MonitorId);
00786 int rmDeleteMonitor(const rmHandle handle);
00792 int rmGetMonitorControl(const rmHandle handle, rmMonitorControl *control);
00805 int rmSetMonitorControl(const rmHandle handle, const rmMonitorControl *control);
00811 int rmGetMonitorConfiguration(const rmHandle handle, rmMonitorConfiguration *config);
00823 int rmSetMonitorConfiguration(const rmHandle handle, const rmMonitorConfiguration *config);
00830 int rmStartMonitor(const rmHandle handle);
00836 int rmStopMonitor(const rmHandle handle);
00844 int rmResetMonitor(const rmHandle handle);
00851 int rmPauseNotification(const rmHandle handle);
00859 int rmResetNotification(const rmHandle handle);
00866 int rmGetMonitorState(const rmHandle handle, rmMonitorState *state);
00873 int rmGetMonitorInfo(const rmHandle handle, rmMonitorInfo *info );
00882 rmString rmGetMonitorDescription(const rmHandle handle, const enum rmDescriptions which);
00890 int rmSetMonitorDescription(const rmHandle handle, const enum rmDescriptions which, const rmString description);
00891
00892 #ifdef RM_Doing_Groups
00893
00894
00895
00896
00897 rmHandle rmCreateStatisticGroup();
00898
00899 int rmDeleteStatisticGroup(rmHandle grpHandle);
00900
00901 int rmAddStatisticToGroup( rmHandle grpHandle, rmStatisticKey *stat );
00902
00903 int rmDeleteStatisticFromGroup( rmHandle grpHandle, rmStatisticKey * stat );
00904
00905 size_t rmGetStatisticGroupCount(rmHandle grpHandle);
00906
00907 int rmGetStatisticValues(rmHandle grpHandle, rmStatisticValue *values, size_t count);
00908
00909 int rmGetStatisticsInfo( rmHandle grpHandle, rmStatisticInfo *buffer, size_t count);
00910
00911
00912
00913
00914
00915 rmHandle rmCreateMonitorGroup();
00916
00917 int rmDeleteMonitorGroup(rmHandle grpHandle);
00918
00919
00920
00921
00922 int rmAddMonitorToGroup( rmHandle grphandle, rmHandle monitorHandle );
00923
00924 int rmDeleteMonitorFromGroup( rmHandle grpHandle, rmHandle monitorHandle );
00925
00926 size_t rmGetMonitorGroupCount(rmHandle grpHandle);
00927
00928 int rmGetMonitorStates( rmHandle grpHandle, rmMonitorState *state, size_t count);
00929
00930 int rmStartMonitors(rmHandle grpHandle);
00931
00932 int rmStopMonitors(rmHandle grpHandle);
00933
00934 int rmPauseNotifications(rmHandle grpHandle);
00935
00936 int rmResetMonitors(rmHandle grpHandle);
00937 #endif // RM_Doing_Groups
00938
00939 #ifdef __cplusplus
00940 }
00941
00946 typedef void * rmSessionHandle;
00947
00956 rmSessionHandle rmCreateConsumerSession();
00957
00963 int rmCloseConsumerSession(const rmSessionHandle handle);
00964
00965 class RMsession
00966 {
00967 public:
00968 RMsession();
00970 RMsession(rmSessionHandle handle);
00971 ~RMsession();
00972 rmSessionHandle getConsumerHandle() const;
00975 void setSessionHandle(rmSessionHandle a_SessionHandle);
00976 protected:
00977 rmSessionHandle m_SessionHandle;
00978 };
00979
00987 class RMdiscovery : virtual public RMsession
00988 {
00989 public:
00990 RMdiscovery();
00992 RMdiscovery(const rmSessionHandle session);
00993 ~RMdiscovery();
00995 size_t GetSubsystemCount() const;
00997 int GetAvailableSubsystems(rmSubsystemInfo *buffer, const size_t size) const;
00999 int GetActiveResources( const rmUID &uuid, rmResourceInfo *buffer, const size_t size) const;
01001 int GetAvailableStatistics( const rmUID &uuid, rmStatisticInfo *buffer, const size_t size) const;
01003 size_t GetMonitorCount() const;
01005 int GetMonitors(rmMonitorInfo *buffer, size_t *size) const;
01006 };
01007
01014 class RMsubsystem : virtual public RMsession
01015 {
01016 public:
01017 RMsubsystem(const rmUID &SubsystemId);
01019 RMsubsystem(const rmSessionHandle session, const rmUID &SubsystemId);
01020 ~RMsubsystem();
01021 void GetSubsystemId(rmUID &uuid) const;
01023 int GetSubsystemInfo( rmSubsystemInfo *buffer) const;
01025 rmString GetSubsystemDescription(rmDescriptions which) const;
01026
01027 #ifdef RM_Doing_Aliases
01028 int GetSubsystemAliases( rmString buffer, size_t *size) const;
01029 #endif // RM_Doing_Aliases
01030
01031 protected:
01032 RMsubsystem();
01033 RMsubsystem(const rmSessionHandle session);
01034 void SetSubsystemId(const rmUID &uuid);
01035 rmUID m_subsystemId;
01036 };
01037
01038
01045 class RMresource : public RMsubsystem
01046 {
01047 public:
01048 RMresource(const rmUID &SubsystemId, const rmID ResourceId);
01049 RMresource(const rmSessionHandle session, const rmUID &SubsystemId, const rmID ResourceId);
01050 ~RMresource();
01051 rmID GetResourceId() const;
01053 int GetResourceInfo( rmResourceInfo *buffer) const;
01055 rmString GetResourceDescription(rmDescriptions which) const;
01056
01057 #ifdef RM_Doing_Aliases
01058 int GetResourceAliases( rmString buffer, size_t *size) const;
01059 #endif // RM_Doing_Aliases
01060 protected:
01061 RMresource();
01062 RMresource(const rmSessionHandle session);
01063 void SetResourceId(const rmID id);
01064 rmID m_resourceId;
01065 };
01066
01073 class RMstatistic : public RMresource
01074 {
01075 public:
01076 RMstatistic(const rmStatisticKey &stat);
01077 RMstatistic(const rmSessionHandle session, const rmStatisticKey &stat);
01078 ~RMstatistic();
01080 void GetStatisticId(rmStatisticKey *statisticKey) const;
01081 rmID GetStatisticId() const;
01083 int GetValue(rmValue *val) const;
01085 int GetUpperBound(rmValue *val) const;
01087 int ResetCounterStatistic(rmValue *val);
01089
01091
01092 #ifdef RM_Doing_Aliases
01093 int GetStatisticAliases( rmString buffer, size_t *size) const;
01094 #endif // RM_Doing_Aliases
01095 protected:
01096 RMstatistic();
01097 RMstatistic(const rmSessionHandle session);
01098 void SetStatisticId(const rmStatisticKey &statisticKey);
01099 void SetStatisticId(const rmID id);
01100 rmID m_statisticId;
01101 };
01102
01110 class RMmonitor : public RMstatistic
01111 {
01112 public:
01115 RMmonitor(const rmMonitorConfiguration &config, rmMonitorControl *control);
01118 RMmonitor(const rmUID MonitorId);
01121 RMmonitor(const rmSessionHandle session, const rmMonitorConfiguration &config, rmMonitorControl *control);
01124 RMmonitor(const rmSessionHandle session, const rmUID MonitorId);
01127 ~RMmonitor();
01130 void OnDestructionDeleteMonitor();
01132 int GetMonitorControl( rmMonitorControl *control) const;
01134 int SetMonitorControl( const rmMonitorControl &control);
01136 int GetMonitorConfiguration( rmMonitorConfiguration *config) const;
01138 int SetMonitorConfiguration( const rmMonitorConfiguration &config);
01140 int GetMonitorState( rmMonitorState *state) const;
01142 int GetMonitorInfo( rmMonitorInfo *buffer ) const;
01144 rmString GetMonitorDescription(const rmDescriptions which) const;
01146 int SetMonitorDescription(const rmDescriptions which, const rmString description);
01148 int StartMonitor();
01150 int StopMonitor();
01152 int ResetMonitor();
01154 int PauseNotification();
01156 int ResetNotification();
01157 private:
01158 rmHandle m_MonitorHandle;
01159 bool m_deleteInDestructor;
01160 };
01161
01162
01163
01164 #ifdef RM_Doing_Groups
01165 class RMstatisticGroup
01166 {
01167 public:
01168 RMstatisticGroup();
01169 ~RMstatisticGroup();
01170 int AddStatistic( rmStatisticKey& stat );
01171 int DeleteStatistic( rmStatisticKey &stat );
01172 size_t GetStatisticCount();
01173 int GetValues( rmStatisticValue *values, size_t count);
01174 int GetStatisticInfo( rmStatisticInfo *buffer, size_t count);
01175 private:
01176 rmHandle m_GroupHandle;
01177 };
01178
01179
01180 class RMmonitorGroup
01181 {
01182 public:
01183 RMmonitorGroup();
01184 ~RMmonitorGroup();
01185 int AddMonitor( RMmonitor & monitor );
01186 int DeleteMonitor( RMmonitor &monitor );
01187 size_t GetMonitorCount();
01188 int GetStates( rmMonitorState *state, size_t count) ;
01189 int StartMonitors();
01190 int StopMonitors();
01191 int PauseNotifications();
01192 int ResetMonitors();
01193 private:
01194 rmHandle m_GroupHandle;
01195 };
01196 #endif // RM_Doing_Groups
01197
01198 }
01199 #endif // __cplusplus
01200
01201 #endif // __ResourceMonitor_h__