msgstat.h 2.2 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: msgstat.h
  20. // Project:
  21. // Author: Tom Spencer-Smith
  22. // Date:
  23. // Description: Send and receive stats for a single type of message.
  24. //
  25. //-----------------------------------------------------------------------------
  26. #if defined(_MSV_VER)
  27. #pragma once
  28. #endif
  29. #ifndef MSGSTAT_H
  30. #define MSGSTAT_H
  31. #pragma warning(disable:4514)
  32. #include "bittype.h"
  33. #ifndef NULL
  34. #define NULL 0L
  35. #endif
  36. //-----------------------------------------------------------------------------
  37. class cMsgStat
  38. {
  39. public:
  40. cMsgStat(void);
  41. ~cMsgStat(void);
  42. void Increment_Num_Msg_Sent( int increment = 1);
  43. void Increment_Num_Byte_Sent( int increment);
  44. void Increment_Num_Msg_Recd( int increment = 1);
  45. void Increment_Num_Byte_Recd( int increment);
  46. DWORD Get_Num_Msg_Sent(void) const {return NumMsgSent;}
  47. DWORD Get_Num_Byte_Sent(void) const {return NumByteSent;}
  48. DWORD Get_Num_Msg_Recd(void) const {return NumMsgRecd;}
  49. DWORD Get_Num_Byte_Recd(void) const {return NumByteRecd;}
  50. DWORD Compute_Avg_Num_Byte_Sent(void) const;
  51. DWORD Compute_Avg_Num_Byte_Recd(void) const;
  52. void Set_Name(LPCSTR name);
  53. LPCSTR Get_Name(void) const {return Name;}
  54. private:
  55. cMsgStat(const cMsgStat& source); // disallow
  56. cMsgStat& operator=(const cMsgStat& source); // disallow
  57. DWORD NumMsgSent;
  58. DWORD NumByteSent;
  59. DWORD NumMsgRecd;
  60. DWORD NumByteRecd;
  61. char Name[30];
  62. };
  63. //-----------------------------------------------------------------------------
  64. #endif // MSGSTAT_H