msgstatlistgroup.h 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. /*
  2. ** Command & Conquer Renegade(tm)
  3. ** Copyright 2025 Electronic Arts Inc.
  4. **
  5. ** This program is free software: you can redistribute it and/or modify
  6. ** it under the terms of the GNU General Public License as published by
  7. ** the Free Software Foundation, either version 3 of the License, or
  8. ** (at your option) any later version.
  9. **
  10. ** This program is distributed in the hope that it will be useful,
  11. ** but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. ** GNU General Public License for more details.
  14. **
  15. ** You should have received a copy of the GNU General Public License
  16. ** along with this program. If not, see <http://www.gnu.org/licenses/>.
  17. */
  18. //
  19. // Filename: msgstatlistgroup.h
  20. // Project:
  21. // Author: Tom Spencer-Smith
  22. // Date:
  23. // Description: Collection of msgstatlists. The server will need one
  24. // of these to sum send and receive data to multiple clients.
  25. //
  26. //-----------------------------------------------------------------------------
  27. #if defined(_MSV_VER)
  28. #pragma once
  29. #endif
  30. #ifndef MSGSTATLISTGROUP_H
  31. #define MSGSTATLISTGROUP_H
  32. #include "msgstatlist.h"
  33. #ifndef NULL
  34. #define NULL 0L
  35. #endif
  36. //-----------------------------------------------------------------------------
  37. class cMsgStatListGroup
  38. {
  39. public:
  40. cMsgStatListGroup(void);
  41. ~cMsgStatListGroup(void);
  42. void Init(int num_lists, int num_stats);
  43. enum {ALL_LISTS = -1};
  44. enum {ALL_MESSAGES = -1};
  45. void Increment_Num_Msg_Sent( int list_num, int message_type, int increment = 1);
  46. void Increment_Num_Byte_Sent( int list_num, int message_type, int increment);
  47. void Increment_Num_Msg_Recd( int list_num, int message_type, int increment = 1);
  48. void Increment_Num_Byte_Recd( int list_num, int message_type, int increment);
  49. DWORD Get_Num_Msg_Sent( int list_num, int message_type) const;
  50. DWORD Get_Num_Byte_Sent( int list_num, int message_type) const;
  51. DWORD Get_Num_Msg_Recd( int list_num, int message_type) const;
  52. DWORD Get_Num_Byte_Recd( int list_num, int message_type) const;
  53. DWORD Compute_Avg_Num_Byte_Sent( int list_num, int message_type) const;
  54. DWORD Compute_Avg_Num_Byte_Recd( int list_num, int message_type) const;
  55. cMsgStatList * Get_Stat_List(int list_num);
  56. void Set_Name(int message_type, LPCSTR name);
  57. //LPCSTR Get_Name(int message_type) const;
  58. private:
  59. cMsgStatListGroup(const cMsgStatListGroup& source); // disallow
  60. cMsgStatListGroup& operator=(const cMsgStatListGroup& source); // disallow
  61. cMsgStatList * PStatList;
  62. int NumLists;
  63. };
  64. //-----------------------------------------------------------------------------
  65. #endif // MSGSTATLISTGROUP_H