39 INLINE
void clear_data();
44 void set_unpack_data(
const vector_uchar &data);
46 void set_unpack_data(
const char *unpack_data,
size_t unpack_length,
47 bool owns_unpack_data);
56 bool seek(
const std::string &field_name);
57 bool seek(
int seek_index);
59 INLINE
bool has_nested_fields()
const;
60 INLINE
int get_num_nested_fields()
const;
61 INLINE
bool more_nested_fields()
const;
66 INLINE DCPackType get_pack_type()
const;
67 INLINE std::string get_current_field_name()
const;
72 INLINE
void pack_double(
double value);
73 INLINE
void pack_int(
int value);
74 INLINE
void pack_uint(
unsigned int value);
75 INLINE
void pack_int64(int64_t value);
76 INLINE
void pack_uint64(uint64_t value);
77 INLINE
void pack_string(
const std::string &value);
78 INLINE
void pack_blob(
const vector_uchar &value);
79 INLINE
void pack_literal_value(
const vector_uchar &value);
80 void pack_default_value();
82 INLINE
double unpack_double();
83 INLINE
int unpack_int();
84 INLINE
unsigned int unpack_uint();
85 INLINE int64_t unpack_int64();
86 INLINE uint64_t unpack_uint64();
87 INLINE std::string unpack_string();
88 INLINE vector_uchar unpack_blob();
89 INLINE vector_uchar unpack_literal_value();
90 void unpack_validate();
96 INLINE
void unpack_double(
double &value);
97 INLINE
void unpack_int(
int &value);
98 INLINE
void unpack_uint(
unsigned int &value);
99 INLINE
void unpack_int64(int64_t &value);
100 INLINE
void unpack_uint64(uint64_t &value);
101 INLINE
void unpack_string(std::string &value);
102 INLINE
void unpack_blob(vector_uchar &value);
103 INLINE
void unpack_literal_value(vector_uchar &value);
108 void pack_object(PyObject *
object);
109 PyObject *unpack_object();
112 bool parse_and_pack(
const std::string &formatted_object);
113 bool parse_and_pack(std::istream &in);
114 std::string unpack_and_format(
bool show_field_names =
true);
115 void unpack_and_format(std::ostream &out,
bool show_field_names =
true);
117 INLINE
bool had_parse_error()
const;
118 INLINE
bool had_pack_error()
const;
119 INLINE
bool had_range_error()
const;
120 INLINE
bool had_error()
const;
121 INLINE
size_t get_num_unpacked_bytes()
const;
123 INLINE
size_t get_length()
const;
124 INLINE std::string get_string()
const;
125 INLINE vector_uchar get_bytes()
const;
126 INLINE
size_t get_unpack_length()
const;
127 INLINE std::string get_unpack_string()
const;
129 INLINE
void get_string(std::string &data)
const;
130 INLINE
const char *get_data()
const;
131 INLINE
char *take_data();
133 INLINE
void append_data(
const unsigned char *buffer,
size_t size);
134 INLINE
char *get_write_pointer(
size_t size);
136 INLINE
const char *get_unpack_data()
const;
139 INLINE
static int get_num_stack_elements_ever_allocated();
145 INLINE
void raw_pack_int8(
int value);
146 INLINE
void raw_pack_int16(
int value);
147 INLINE
void raw_pack_int32(
int value);
148 INLINE
void raw_pack_int64(int64_t value);
149 INLINE
void raw_pack_uint8(
unsigned int value);
150 INLINE
void raw_pack_uint16(
unsigned int value);
151 INLINE
void raw_pack_uint32(
unsigned int value);
152 INLINE
void raw_pack_uint64(uint64_t value);
153 INLINE
void raw_pack_float64(
double value);
154 INLINE
void raw_pack_string(
const std::string &value);
155 INLINE
void raw_pack_blob(
const vector_uchar &value);
159 #define RAW_PACK_CHANNEL(in) raw_pack_uint64(in) 160 #define RAW_UNPACK_CHANNEL() raw_unpack_uint64() 163 INLINE
int raw_unpack_int8();
164 INLINE
int raw_unpack_int16();
165 INLINE
int raw_unpack_int32();
166 INLINE int64_t raw_unpack_int64();
167 INLINE
unsigned int raw_unpack_uint8();
168 INLINE
unsigned int raw_unpack_uint16();
169 INLINE
unsigned int raw_unpack_uint32();
170 INLINE uint64_t raw_unpack_uint64();
171 INLINE
double raw_unpack_float64();
172 INLINE std::string raw_unpack_string();
173 INLINE vector_uchar raw_unpack_blob();
176 INLINE
void raw_unpack_int8(
int &value);
177 INLINE
void raw_unpack_int16(
int &value);
178 INLINE
void raw_unpack_int32(
int &value);
179 INLINE
void raw_unpack_int64(int64_t &value);
180 INLINE
void raw_unpack_uint8(
unsigned int &value);
181 INLINE
void raw_unpack_uint16(
unsigned int &value);
182 INLINE
void raw_unpack_uint32(
unsigned int &value);
183 INLINE
void raw_unpack_uint64(uint64_t &value);
184 INLINE
void raw_unpack_float64(
double &value);
185 INLINE
void raw_unpack_string(std::string &value);
186 INLINE
void raw_unpack_blob(vector_uchar &value);
189 static void enquote_string(std::ostream &out,
char quote_mark,
const std::string &str);
190 static void output_hex_string(std::ostream &out,
const vector_uchar &str);
193 INLINE
void advance();
199 void pack_class_object(
const DCClass *dclass, PyObject *
object);
200 PyObject *unpack_class_object(
const DCClass *dclass);
201 void set_class_element(PyObject *class_def, PyObject *&
object,
203 void get_class_element(
const DCClass *dclass, PyObject *
object,
217 const char *_unpack_data;
218 size_t _unpack_length;
219 bool _owns_unpack_data;
230 INLINE
void *
operator new(
size_t size);
231 INLINE
void operator delete(
void *ptr);
234 int _current_field_index;
239 static StackElement *_deleted_chain;
240 static int _num_ever_allocated;
242 StackElement *_stack;
246 int _current_field_index;
255 int _num_nested_fields;
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
This is a block of data that receives the results of DCPacker.
ostream & enquote_string(ostream &out, const string &str, int indent_level, bool always_quote)
Writes the string to the indicated output stream.
A single field of a Distributed Class, either atomic or molecular.
This represents a switch object used as a parameter itself, which packs the appropriate fields of the...
Defines a particular DistributedClass as read from an input .dc file.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
This class can be used for packing a series of numeric and string data into a binary stream,...
This object contains the names of all of the nested fields available within a particular field.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
This defines the internal interface for packing values into a DCField.