Team Fortress 2 Source Code as on 22/4/2020
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.

80 lines
2.1 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. //=======================================================================================//
  4. #ifndef MANAGERTEST_H
  5. #define MANAGERTEST_H
  6. #ifdef _WIN32
  7. #pragma once
  8. #endif
  9. //----------------------------------------------------------------------------------------
  10. #include "genericpersistentmanager.h"
  11. #include "replay/replayhandle.h"
  12. #include "replay/irecordingsessionblockmanager.h"
  13. #include "utlstring.h"
  14. #include "baserecordingsession.h"
  15. #include "replay/basereplayserializeable.h"
  16. #include "baserecordingsessionblock.h"
  17. //----------------------------------------------------------------------------------------
  18. class CTestObj : public CBaseReplaySerializeable
  19. {
  20. typedef CBaseReplaySerializeable BaseClass;
  21. public:
  22. CTestObj();
  23. ~CTestObj();
  24. virtual const char *GetSubKeyTitle() const;
  25. virtual const char *GetPath() const;
  26. virtual void OnDelete();
  27. virtual bool Read( KeyValues *pIn );
  28. virtual void Write( KeyValues *pOut );
  29. CUtlString m_strTest;
  30. int m_nTest;
  31. int *m_pTest;
  32. };
  33. //----------------------------------------------------------------------------------------
  34. class ITestManager : public IBaseInterface
  35. {
  36. public:
  37. virtual void SomeTest() = 0;
  38. };
  39. //----------------------------------------------------------------------------------------
  40. class CTestManager : public CGenericPersistentManager< CTestObj >,
  41. public ITestManager
  42. {
  43. typedef CGenericPersistentManager< CTestObj > BaseClass;
  44. public:
  45. CTestManager();
  46. static void Test();
  47. //
  48. // CGenericPersistentManager
  49. //
  50. virtual CTestObj *Create();
  51. virtual bool ShouldSerializeToIndividualFiles() const { return true; }
  52. virtual const char *GetIndexPath() const;
  53. virtual const char *GetDebugName() const { return "test manager"; }
  54. virtual int GetVersion() const;
  55. virtual const char *GetIndexFilename() const { return "test_index." GENERIC_FILE_EXTENSION; }
  56. //
  57. // ITestManager
  58. //
  59. virtual void SomeTest() {}
  60. };
  61. //----------------------------------------------------------------------------------------
  62. #endif // MANAGERTEST_H