Counter Strike : Global Offensive Source Code
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. #ifndef _IDATACENTER_H_
  2. #define _IDATACENTER_H_
  3. class IDatacenter;
  4. class IDatacenterCmdBatch;
  5. #include "imatchsystem.h"
  6. abstract_class IDatacenter
  7. {
  8. public:
  9. //
  10. // GetStats
  11. // retrieves the last received datacenter stats
  12. //
  13. virtual KeyValues * GetStats() = 0;
  14. //
  15. // CreateCmdBatch
  16. // creates a new instance of cmd batch to communicate
  17. // with datacenter backend
  18. //
  19. virtual IDatacenterCmdBatch * CreateCmdBatch( bool bMustSupportPII ) = 0;
  20. //
  21. // CanReachDatacenter
  22. // returns true if we were able to establish a connection with the
  23. // datacenter backend regardless if it returned valid data or not.
  24. virtual bool CanReachDatacenter() = 0;
  25. };
  26. abstract_class IDatacenterCmdBatch
  27. {
  28. public:
  29. //
  30. // AddCommand
  31. // enqueues a command in command batch queue
  32. //
  33. virtual void AddCommand( KeyValues *pCommand ) = 0;
  34. //
  35. // IsFinished
  36. // whether command batch queue has finished running / error occurred
  37. //
  38. virtual bool IsFinished() = 0;
  39. //
  40. // GetNumResults
  41. // returns number of results retrieved for which data is available
  42. //
  43. virtual int GetNumResults() = 0;
  44. //
  45. // GetResult
  46. // returns the result by index
  47. //
  48. virtual KeyValues * GetResult( int idx ) = 0;
  49. //
  50. // Destroy
  51. // destroys the command batch object and all contained results
  52. //
  53. virtual void Destroy() = 0;
  54. //
  55. // SetDestroyWhenFinished
  56. // destroys the command batch object automatically after
  57. // it finishes communication with datacenter
  58. //
  59. virtual void SetDestroyWhenFinished( bool bDestroyWhenFinished ) = 0;
  60. //
  61. // SetNumRetriesAllowedPerCmd
  62. // configures retry attempts per command
  63. //
  64. virtual void SetNumRetriesAllowedPerCmd( int numRetriesAllowed ) = 0;
  65. //
  66. // SetRetryCmdTimeout
  67. // configures retry timeout per command
  68. //
  69. virtual void SetRetryCmdTimeout( float flRetryCmdTimeout ) = 0;
  70. };
  71. #endif // _IDATACENTER_H_