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.

86 lines
1.8 KiB

  1. /*++
  2. Copyright (C) 1997-2001 Microsoft Corporation
  3. Module Name:
  4. INDEXCAC.H
  5. Abstract:
  6. Declares the CCacheEntry and CIndexCache classes.
  7. History:
  8. a-davj 04-Mar-97 Created.
  9. --*/
  10. #ifndef _INDEXCAC_H_
  11. #define _INDEXCAC_H_
  12. //***************************************************************************
  13. //
  14. // CLASS NAME:
  15. //
  16. // CCacheEntry
  17. //
  18. // DESCRIPTION:
  19. //
  20. // This "object" is used as a structure. It holds a cache entry.
  21. //
  22. //***************************************************************************
  23. class CCacheEntry : public CObject {
  24. public:
  25. CCacheEntry(TCHAR * pValue, int iIndex);
  26. CCacheEntry(WCHAR * pValue);
  27. ~CCacheEntry();
  28. int m_iIndex;
  29. TCHAR * m_ptcValue;
  30. WCHAR * m_pwcValue;
  31. };
  32. //***************************************************************************
  33. //
  34. // CLASS NAME:
  35. //
  36. // CIndexCache
  37. //
  38. // DESCRIPTION:
  39. //
  40. // Holds a cache for string/integer combinations that the perf monitor
  41. // provider uses to speed up lookup.
  42. //
  43. //***************************************************************************
  44. class CIndexCache : public CObject {
  45. public:
  46. CIndexCache();
  47. ~CIndexCache(){Empty();};
  48. void Empty();
  49. // this routine returns -1, if the entry isnt found. The second
  50. // argument can be used to find subsequent entries.
  51. int Find(const TCHAR * pFind, DWORD dwWhichEntry = 0);
  52. // this routine returns TRUE if the add worked
  53. BOOL Add(TCHAR * pAdd, int iIndex);
  54. // this routine returns NULL if the index isnt found. Note that
  55. // the index isnt necessarily the m_iIndex value as found in the entry
  56. WCHAR * GetWString(int iIndex);
  57. BOOL SetAt(WCHAR * pwcAdd, int iIndex);
  58. private:
  59. CFlexArray m_Array;
  60. };
  61. #endif //_INDEXCAC_H_