Leaked source code of windows server 2003
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.

116 lines
2.5 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. DWORD m_dwFirstCtr;
  77. DWORD m_dwLastCtr;
  78. // Methods
  79. // =======
  80. HRESULT CreateClassList( DWORD dwType );
  81. public:
  82. CPerfLibSchema( WCHAR* pwcsServiceName, CLocaleCache* pLocaleCache );
  83. virtual ~CPerfLibSchema();
  84. HRESULT Initialize( BOOL bDelta, DWORD * LoadStatus);
  85. HRESULT GetClassList( DWORD dwType, CClassList** ppClassList );
  86. };
  87. #endif // _PERFLIBSCHEMA_H_