msgstatlist.h 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  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: msgstatlist.h
  20. // Project:
  21. // Author: Tom Spencer-Smith
  22. // Date:
  23. // Description: Collection of message stats for all message types
  24. //
  25. //-----------------------------------------------------------------------------
  26. #if defined(_MSV_VER)
  27. #pragma once
  28. #endif
  29. #ifndef MSGSTATLIST_H
  30. #define MSGSTATLIST_H
  31. #include "msgstat.h"
  32. #ifndef NULL
  33. #define NULL 0L
  34. #endif
  35. //-----------------------------------------------------------------------------
  36. class cMsgStatList
  37. {
  38. public:
  39. cMsgStatList(void);
  40. ~cMsgStatList(void);
  41. enum {ALL_MESSAGES = -1};
  42. void Init(int num_stats);
  43. void Increment_Num_Msg_Sent( int message_type, int increment = 1);
  44. void Increment_Num_Byte_Sent( int message_type, int increment);
  45. void Increment_Num_Msg_Recd( int message_type, int increment = 1);
  46. void Increment_Num_Byte_Recd( int message_type, int increment);
  47. DWORD Get_Num_Msg_Sent( int message_type) const;
  48. DWORD Get_Num_Byte_Sent( int message_type) const;
  49. DWORD Get_Num_Msg_Recd( int message_type) const;
  50. DWORD Get_Num_Byte_Recd( int message_type) const;
  51. DWORD Compute_Avg_Num_Byte_Sent( int message_type) const;
  52. DWORD Compute_Avg_Num_Byte_Recd( int message_type) const;
  53. cMsgStat & Get_Stat(int message_type);
  54. int Get_Num_Stats(void) const {return NumStats;}
  55. void Set_Name(int message_type, LPCSTR name);
  56. LPCSTR Get_Name(int message_type) const;
  57. private:
  58. cMsgStatList(const cMsgStatList& source); // disallow
  59. cMsgStatList& operator=(const cMsgStatList& source); // disallow
  60. cMsgStat * PStat;
  61. int NumStats;
  62. };
  63. //-----------------------------------------------------------------------------
  64. #endif // MSGSTATLIST_H