My Project
 All Classes Files Functions Variables Enumerations Enumerator Friends Macros Pages
NetVar.h
1 // $Id: NetVar.h,v 1.2 2009/08/17 21:18:31 eml Exp $
2 
3 #ifndef GCP_UTIL_NETVAR_H
4 #define GCP_UTIL_NETVAR_H
5 
15 #include "gcp/util/common/DataType.h"
16 
17 #include "gcp/util/common/NetDat.h"
18 
19 namespace gcp {
20  namespace util {
21 
22  class NetStruct;
23 
24  class NetVar : public NetDat {
25  public:
26 
30  NetVar(gcp::util::DataType::Type type, void* vPtr, unsigned nEl);
31 
35  virtual ~NetVar();
36 
40  NetVar(const NetVar& netVar);
41  NetVar(NetVar& netVar);
42 
46  void deserialize(const std::vector<unsigned char>& bytes);
47 
48  unsigned size();
49 
50  // The type of this variable
51 
52  gcp::util::DataType::Type type_;
53 
54  private:
55 
56  // Pointer to where the start of the memory resides for this
57  // variable
58 
59  void* vPtr_;
60 
61  // Number of elements in this variable
62 
63  unsigned nEl_;
64 
68  unsigned size_;
69 
73  void serialize();
74 
78  void deserialize(const unsigned char* bytes);
79 
83  void resize(unsigned size);
84 
85  }; // End class NetVar
86 
87  } // End namespace util
88 } // End namespace gcp
89 
90 
91 
92 #endif // End #ifndef GCP_UTIL_NETVAR_H
unsigned size()
Definition: NetVar.cc:91
virtual ~NetVar()
Definition: NetVar.cc:41
Definition: compress.c:1548
NetVar(gcp::util::DataType::Type type, void *vPtr, unsigned nEl)
Definition: NetVar.cc:11
void deserialize(const std::vector< unsigned char > &bytes)
Definition: NetVar.cc:72
Definition: NetVar.h:24
Definition: NetDat.h:23