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.

113 lines
2.4 KiB

  1. /*++
  2. Copyright (C) 1999-2001 Microsoft Corporation
  3. Module Name:
  4. PERFLIBSCHEMA.H
  5. Abstract:
  6. interface for the CPerfLibSchema class.
  7. History:
  8. --*/
  9. #ifndef _PERFLIBSCHEMA_H_
  10. #define _PERFLIBSCHEMA_H_
  11. #include <flexarry.h>
  12. #include "perfndb.h"
  13. #include "adapelem.h"
  14. #include "adapcls.h"
  15. #include "adapperf.h"
  16. #include "perfthrd.h"
  17. class CIndexTable
  18. {
  19. enum { not_found = -1 };
  20. private:
  21. CFlexArray m_array; // Array of indices
  22. protected:
  23. int Locate( int nIndex );
  24. public:
  25. BOOL Add( int nIndex );
  26. void Empty();
  27. };
  28. class CPerfLibBlobDefn
  29. {
  30. protected:
  31. PERF_OBJECT_TYPE* m_pPerfBlock;
  32. DWORD m_dwNumBytes;
  33. DWORD m_dwNumObjects;
  34. BOOL m_fCostly;
  35. public:
  36. CPerfLibBlobDefn() : m_pPerfBlock( NULL ), m_dwNumBytes ( 0 ), m_dwNumObjects ( 0 ), m_fCostly ( FALSE )
  37. {}
  38. virtual ~CPerfLibBlobDefn()
  39. {
  40. if ( NULL != m_pPerfBlock )
  41. delete m_pPerfBlock;
  42. }
  43. PERF_OBJECT_TYPE* GetBlob() { return m_pPerfBlock; }
  44. DWORD GetNumObjects() { return m_dwNumObjects; }
  45. DWORD GetSize() { return m_dwNumBytes; }
  46. BOOL GetCostly() { return m_fCostly; }
  47. void SetCostly( BOOL fCostly ) { m_fCostly = fCostly; }
  48. PERF_OBJECT_TYPE** GetPerfBlockPtrPtr() { return &m_pPerfBlock; }
  49. DWORD* GetSizePtr() { return &m_dwNumBytes; }
  50. DWORD* GetNumObjectsPtr() { return &m_dwNumObjects; }
  51. };
  52. class CAdapPerfLib;
  53. class CPerfThread;
  54. class CLocaleCache;
  55. class CPerfLibSchema
  56. {
  57. protected:
  58. // Perflib data
  59. // ============
  60. // The service name of the perflib
  61. // ===============================
  62. WString m_wstrServiceName;
  63. // The blobs
  64. // =========
  65. enum { GLOBAL, COSTLY, NUMBLOBS };
  66. CPerfLibBlobDefn m_aBlob[NUMBLOBS];
  67. // The look aside table for blob processing
  68. // ========================================
  69. CIndexTable m_aIndexTable[WMI_ADAP_NUM_TYPES];
  70. // The repository with all localized names databases
  71. // =================================================
  72. CLocaleCache* m_pLocaleCache;
  73. // The unified class list for the perflib schema
  74. // =============================================
  75. CPerfClassList* m_apClassList[WMI_ADAP_NUM_TYPES];
  76. // Methods
  77. // =======
  78. HRESULT CreateClassList( DWORD dwType );
  79. public:
  80. CPerfLibSchema( WCHAR* pwcsServiceName, CLocaleCache* pLocaleCache );
  81. virtual ~CPerfLibSchema();
  82. HRESULT Initialize( BOOL bDelta, DWORD * LoadStatus);
  83. HRESULT GetClassList( DWORD dwType, CClassList** ppClassList );
  84. };
  85. #endif // _PERFLIBSCHEMA_H_