Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

77 lines
3.5 KiB

  1. // EventManager.h: interface for the CEventManager class.
  2. //
  3. //////////////////////////////////////////////////////////////////////
  4. #if !defined(AFX_EVENTMANAGER_H__988BB45B_8C93_11D3_BE83_0000F87A3912__INCLUDED_)
  5. #define AFX_EVENTMANAGER_H__988BB45B_8C93_11D3_BE83_0000F87A3912__INCLUDED_
  6. #if _MSC_VER > 1000
  7. #pragma once
  8. #endif // _MSC_VER > 1000
  9. #include "SystemEventContainer.h"
  10. #include "WbemClassObject.h"
  11. #include "Tree.h"
  12. #include "DataElementEvent.h"
  13. #include "RuleEvent.h"
  14. #include "HMStatistics.h"
  15. #include "DataPointStatistics.h"
  16. #include "DataPointEventContainer.h"
  17. //////////////////////////////////////////////////////////////////////
  18. // CEventManager - manages events, status and statistics for console
  19. class CEventManager : public CObject
  20. {
  21. // Construction/Destruction
  22. public:
  23. CEventManager();
  24. virtual ~CEventManager();
  25. // Operations
  26. public:
  27. void ProcessEvent(CWbemClassObject* pEventObject);
  28. void ProcessUnknownEvent(const CString& sSystemName, CRuleEvent* pEvent);
  29. void ProcessActionEvent(CWbemClassObject* pActionEventObject);
  30. void ProcessStatisticEvent(CWbemClassObject* pStatObject);
  31. void GetEventContainer(const CString& sSystemName, const CString& sGuid, CEventContainer*& pContainer);
  32. void DeleteEvents(const CString& sSystemName, const CString& sStatusGuid);
  33. void AddContainer(const CString& sSystemName, const CString& sParentGuid, const CString& sGuid, CHMObject* pObject, CRuntimeClass* pClass = RUNTIME_CLASS(CEventContainer));
  34. void RemoveContainer(const CString& sSystemName, const CString& sGuid);
  35. void AddSystemContainer(const CString& sParentGuid, const CString& sSystemName, CHMObject* pObject);
  36. void RemoveSystemContainer(const CString& sSystemName);
  37. void AddSystemShortcutAssociation(const CString& sParentGuid, const CString& sSystemName);
  38. void RemoveSystemShortcutAssociation(const CString& sParentGuid, const CString& sSystemName);
  39. int GetStatus(const CString& sSystemName, const CString& sGuid);
  40. int GetSystemStatus(const CString& sSystemName);
  41. void ActivateStatisticsEvents(const CString& sSystemName, const CString& sGuid);
  42. void DeactivateStatisticsEvents(const CString& sSystemName, const CString& sGuid);
  43. void ActivateSystemEventListener(const CString& sSystemName);
  44. protected:
  45. void ProcessSystemStatusEvent(CWbemClassObject* pEventObject);
  46. void ProcessDataGroupStatusEvent(CWbemClassObject* pEventObject);
  47. void ProcessDataElementStatusEvent(CWbemClassObject* pEventObject, EventArray& NewEvents);
  48. void ProcessRuleStatusEvent(CWbemClassObject* pEventObject);
  49. void ProcessRuleStatusInstanceEvent(CWbemClassObject* pEventObject, EventArray& NewEvents);
  50. void DeleteEvents(CTreeNode<CEventContainer*>* pNode,const CString& sSystemName, const CString& sStatusGuid);
  51. CString GetCompositeGuid(const CString& sSystemName, const CString& sGuid);
  52. void PropogateStatisticsToChildren(const CString& sSystemName, const CString& sParentGuid, StatsArray& Statistics);
  53. // Attributes
  54. protected:
  55. CTree<CEventContainer*> m_EventContainers; // tree of event containers
  56. CTypedPtrMap<CMapStringToPtr,CString,CTreeNode<CEventContainer*>*> m_GuidToContainerMap; // maps Guid of a config object to a event container
  57. CTypedPtrMap<CMapStringToPtr,CString,CTreeNode<CEventContainer*>*> m_SystemNameToContainerMap; // maps the system name to a system event container
  58. };
  59. #include "EventManager.inl"
  60. extern CEventManager theEvtManager;
  61. inline CEventManager* EvtGetEventManager()
  62. {
  63. return &theEvtManager;
  64. }
  65. #endif // !defined(AFX_EVENTMANAGER_H__988BB45B_8C93_11D3_BE83_0000F87A3912__INCLUDED_)