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.

82 lines
1.9 KiB

  1. /*++
  2. Copyright (c) 1994-1999 Microsoft Corporation
  3. Module Name :
  4. scache.h
  5. Abstract:
  6. IIS Server cache definitions
  7. Author:
  8. Ronald Meijer (ronaldm)
  9. Project:
  10. Internet Services Manager
  11. Revision History:
  12. --*/
  13. #ifndef __SCACHE_H__
  14. #define __SCACHE_H__
  15. class CIISMachine;
  16. class CIISServerCache : public CPtrList
  17. /*++
  18. Class Description:
  19. Server cache. Server cache will be maintained in sorted order.
  20. Public Interface:
  21. CIISServerCache : Constructor
  22. ~CIISServerCache : Destructor
  23. IsDirty : TRUE if the cache is dirty
  24. SetDirty : Set the dirty bit
  25. Add : Add machine object to cache
  26. Remove : Remove machine object from cache
  27. GetFirst : Get first machine object in cache
  28. GetNext : Get next machine object in cache.
  29. GetFirst must have been called first.
  30. GetLast : Get last machine object in cache
  31. GetPrev : Get previous machine object in cache
  32. GetLast must have been called first.
  33. --*/
  34. {
  35. public:
  36. CIISServerCache() : m_pos(NULL), m_fDirty(FALSE) {};
  37. ~CIISServerCache() {};
  38. public:
  39. BOOL IsDirty() const { return m_fDirty; }
  40. void SetDirty(BOOL fDirty = TRUE) { m_fDirty = fDirty; }
  41. BOOL Add(CIISMachine * pMachine);
  42. BOOL Remove(CIISMachine * pMachine);
  43. CIISMachine * GetNext() { return m_pos ? (CIISMachine *)CPtrList::GetNext(m_pos) : NULL; }
  44. CIISMachine * GetFirst() { m_pos = GetHeadPosition(); return GetNext(); }
  45. CIISMachine * GetPrev() { return m_pos ? (CIISMachine *)CPtrList::GetPrev(m_pos) : NULL; }
  46. CIISMachine * GetLast() { m_pos = GetTailPosition(); return GetPrev(); }
  47. private:
  48. POSITION m_pos;
  49. BOOL m_fDirty;
  50. };
  51. #endif // __SCACHE_H__