19 #include "dcPackerInterface.h"
20 #include "dcSubatomicType.h"
21 #include "dcPackData.h"
22 #include "dcPackerCatalog.h"
43 INLINE
void clear_data();
48 void set_unpack_data(
const string &data);
50 void set_unpack_data(
const char *unpack_data,
size_t unpack_length,
51 bool owns_unpack_data);
60 bool seek(
const string &field_name);
61 bool seek(
int seek_index);
63 INLINE
bool has_nested_fields()
const;
64 INLINE
int get_num_nested_fields()
const;
65 INLINE
bool more_nested_fields()
const;
70 INLINE DCPackType get_pack_type()
const;
71 INLINE
string get_current_field_name()
const;
76 INLINE
void pack_double(
double value);
77 INLINE
void pack_int(
int value);
78 INLINE
void pack_uint(
unsigned int value);
79 INLINE
void pack_int64(PN_int64 value);
80 INLINE
void pack_uint64(PN_uint64 value);
81 INLINE
void pack_string(
const string &value);
82 INLINE
void pack_literal_value(
const string &value);
83 void pack_default_value();
85 INLINE
double unpack_double();
86 INLINE
int unpack_int();
87 INLINE
unsigned int unpack_uint();
88 INLINE PN_int64 unpack_int64();
89 INLINE PN_uint64 unpack_uint64();
90 INLINE
string unpack_string();
91 INLINE
string unpack_literal_value();
92 void unpack_validate();
98 INLINE
void unpack_double(
double &value);
99 INLINE
void unpack_int(
int &value);
100 INLINE
void unpack_uint(
unsigned int &value);
101 INLINE
void unpack_int64(PN_int64 &value);
102 INLINE
void unpack_uint64(PN_uint64 &value);
103 INLINE
void unpack_string(
string &value);
104 INLINE
void unpack_literal_value(
string &value);
109 void pack_object(PyObject *
object);
110 PyObject *unpack_object();
113 bool parse_and_pack(
const string &formatted_object);
114 bool parse_and_pack(istream &in);
115 string unpack_and_format(
bool show_field_names =
true);
116 void unpack_and_format(ostream &out,
bool show_field_names =
true);
118 INLINE
bool had_parse_error()
const;
119 INLINE
bool had_pack_error()
const;
120 INLINE
bool had_range_error()
const;
121 INLINE
bool had_error()
const;
122 INLINE
size_t get_num_unpacked_bytes()
const;
124 INLINE
size_t get_length()
const;
125 INLINE
string get_string()
const;
126 INLINE
size_t get_unpack_length()
const;
127 INLINE
string get_unpack_string()
const;
129 INLINE
void get_string(
string &data)
const;
130 INLINE
const char *get_data()
const;
131 INLINE
char *take_data();
133 INLINE
void append_data(
const 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(PN_int64 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(PN_uint64 value);
153 INLINE
void raw_pack_float64(
double value);
154 INLINE
void raw_pack_string(
const string &value);
158 #define RAW_PACK_CHANNEL(in) raw_pack_uint64(in)
159 #define RAW_UNPACK_CHANNEL() raw_unpack_uint64()
162 INLINE
int raw_unpack_int8();
163 INLINE
int raw_unpack_int16();
164 INLINE
int raw_unpack_int32();
165 INLINE PN_int64 raw_unpack_int64();
166 INLINE
unsigned int raw_unpack_uint8();
167 INLINE
unsigned int raw_unpack_uint16();
168 INLINE
unsigned int raw_unpack_uint32();
169 INLINE PN_uint64 raw_unpack_uint64();
170 INLINE
double raw_unpack_float64();
171 INLINE
string raw_unpack_string();
174 INLINE
void raw_unpack_int8(
int &value);
175 INLINE
void raw_unpack_int16(
int &value);
176 INLINE
void raw_unpack_int32(
int &value);
177 INLINE
void raw_unpack_int64(PN_int64 &value);
178 INLINE
void raw_unpack_uint8(
unsigned int &value);
179 INLINE
void raw_unpack_uint16(
unsigned int &value);
180 INLINE
void raw_unpack_uint32(
unsigned int &value);
181 INLINE
void raw_unpack_uint64(PN_uint64 &value);
182 INLINE
void raw_unpack_float64(
double &value);
183 INLINE
void raw_unpack_string(
string &value);
186 static void enquote_string(ostream &out,
char quote_mark,
const string &str);
187 static void output_hex_string(ostream &out,
const string &str);
190 INLINE
void advance();
196 void pack_class_object(
const DCClass *dclass, PyObject *
object);
197 PyObject *unpack_class_object(
const DCClass *dclass);
198 void set_class_element(PyObject *class_def, PyObject *&
object,
200 void get_class_element(
const DCClass *dclass, PyObject *
object,
214 const char *_unpack_data;
215 size_t _unpack_length;
216 bool _owns_unpack_data;
223 class EXPCL_DIRECT StackElement {
227 INLINE
void *
operator new(
size_t size);
228 INLINE
void operator delete(
void *ptr);
231 int _current_field_index;
236 static StackElement *_deleted_chain;
237 static int _num_ever_allocated;
239 StackElement *_stack;
243 int _current_field_index;
254 int _num_nested_fields;
262 #include "dcPacker.I"
This is a block of data that receives the results of DCPacker.
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.
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...
This defines the internal interface for packing values into a DCField.