pStatClientControlMessage.h 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. // Filename: pStatClientControlMessage.h
  2. // Created by: drose (09Jul00)
  3. //
  4. ////////////////////////////////////////////////////////////////////
  5. //
  6. // PANDA 3D SOFTWARE
  7. // Copyright (c) 2001 - 2004, Disney Enterprises, Inc. All rights reserved
  8. //
  9. // All use of this software is subject to the terms of the Panda 3d
  10. // Software license. You should have received a copy of this license
  11. // along with this source code; you will also find a current copy of
  12. // the license at http://etc.cmu.edu/panda3d/docs/license/ .
  13. //
  14. // To contact the maintainers of this program write to
  15. // [email protected] .
  16. //
  17. ////////////////////////////////////////////////////////////////////
  18. #ifndef PSTATCLIENTCONTROLMESSAGE_H
  19. #define PSTATCLIENTCONTROLMESSAGE_H
  20. #include "pandabase.h"
  21. #include "pStatCollectorDef.h"
  22. #include "pvector.h"
  23. class Datagram;
  24. class PStatClientVersion;
  25. ////////////////////////////////////////////////////////////////////
  26. // Class : PStatClientControlMessage
  27. // Description : This kind of message is sent from the client to the
  28. // server on the TCP socket to establish critical
  29. // control information.
  30. ////////////////////////////////////////////////////////////////////
  31. class EXPCL_PANDA PStatClientControlMessage {
  32. public:
  33. PStatClientControlMessage();
  34. void encode(Datagram &datagram) const;
  35. bool decode(const Datagram &datagram, PStatClientVersion *version);
  36. enum Type {
  37. T_datagram = 0,
  38. T_hello,
  39. T_define_collectors,
  40. T_define_threads,
  41. T_invalid
  42. };
  43. Type _type;
  44. // Used for T_hello
  45. string _client_hostname;
  46. string _client_progname;
  47. int _major_version;
  48. int _minor_version;
  49. // Used for T_define_collectors
  50. pvector<PStatCollectorDef *> _collectors;
  51. // Used for T_define_threads
  52. int _first_thread_index;
  53. pvector<string> _names;
  54. };
  55. #endif