Panda3D

pStatClientControlMessage.h

00001 // Filename: pStatClientControlMessage.h
00002 // Created by:  drose (09Jul00)
00003 //
00004 ////////////////////////////////////////////////////////////////////
00005 //
00006 // PANDA 3D SOFTWARE
00007 // Copyright (c) Carnegie Mellon University.  All rights reserved.
00008 //
00009 // All use of this software is subject to the terms of the revised BSD
00010 // license.  You should have received a copy of this license along
00011 // with this source code in a file named "LICENSE."
00012 //
00013 ////////////////////////////////////////////////////////////////////
00014 
00015 #ifndef PSTATCLIENTCONTROLMESSAGE_H
00016 #define PSTATCLIENTCONTROLMESSAGE_H
00017 
00018 #include "pandabase.h"
00019 
00020 #include "pStatCollectorDef.h"
00021 
00022 #include "pvector.h"
00023 
00024 class Datagram;
00025 class PStatClientVersion;
00026 
00027 ////////////////////////////////////////////////////////////////////
00028 //       Class : PStatClientControlMessage
00029 // Description : This kind of message is sent from the client to the
00030 //               server on the TCP socket to establish critical
00031 //               control information.
00032 ////////////////////////////////////////////////////////////////////
00033 class EXPCL_PANDA_PSTATCLIENT PStatClientControlMessage {
00034 public:
00035   PStatClientControlMessage();
00036 
00037   void encode(Datagram &datagram) const;
00038   bool decode(const Datagram &datagram, PStatClientVersion *version);
00039 
00040   enum Type {
00041     T_datagram = 0,
00042     T_hello,
00043     T_define_collectors,
00044     T_define_threads,
00045     T_invalid
00046   };
00047 
00048   Type _type;
00049 
00050   // Used for T_hello
00051   string _client_hostname;
00052   string _client_progname;
00053   int _major_version;
00054   int _minor_version;
00055 
00056   // Used for T_define_collectors
00057   pvector<PStatCollectorDef *> _collectors;
00058 
00059   // Used for T_define_threads
00060   int _first_thread_index;
00061   pvector<string> _names;
00062 };
00063 
00064 
00065 #endif
00066 
 All Classes Functions Variables Enumerations