15 #ifndef DCPACKERINTERFACE_H 16 #define DCPACKERINTERFACE_H 19 #include "dcSubatomicType.h" 78 INLINE
const string &get_name()
const;
79 int find_seek_index(
const string &name)
const;
82 virtual const DCField *as_field()
const;
89 bool check_match(
const string &description,
DCFile *dcfile = NULL)
const;
92 virtual void set_name(
const string &name);
93 INLINE
bool has_fixed_byte_size()
const;
94 INLINE
size_t get_fixed_byte_size()
const;
95 INLINE
bool has_fixed_structure()
const;
96 INLINE
bool has_range_limits()
const;
97 INLINE
size_t get_num_length_bytes()
const;
99 INLINE
bool has_nested_fields()
const;
100 INLINE
int get_num_nested_fields()
const;
101 virtual int calc_num_nested_fields(
size_t length_bytes)
const;
104 virtual bool validate_num_nested_fields(
int num_nested_fields)
const;
106 INLINE DCPackType get_pack_type()
const;
108 virtual void pack_double(
DCPackData &pack_data,
double value,
109 bool &pack_error,
bool &range_error)
const;
110 virtual void pack_int(
DCPackData &pack_data,
int value,
111 bool &pack_error,
bool &range_error)
const;
112 virtual void pack_uint(
DCPackData &pack_data,
unsigned int value,
113 bool &pack_error,
bool &range_error)
const;
114 virtual void pack_int64(
DCPackData &pack_data, PN_int64 value,
115 bool &pack_error,
bool &range_error)
const;
116 virtual void pack_uint64(
DCPackData &pack_data, PN_uint64 value,
117 bool &pack_error,
bool &range_error)
const;
118 virtual void pack_string(
DCPackData &pack_data,
const string &value,
119 bool &pack_error,
bool &range_error)
const;
120 virtual bool pack_default_value(
DCPackData &pack_data,
bool &pack_error)
const;
122 virtual void unpack_double(
const char *data,
size_t length,
size_t &p,
123 double &value,
bool &pack_error,
bool &range_error)
const;
124 virtual void unpack_int(
const char *data,
size_t length,
size_t &p,
125 int &value,
bool &pack_error,
bool &range_error)
const;
126 virtual void unpack_uint(
const char *data,
size_t length,
size_t &p,
127 unsigned int &value,
bool &pack_error,
bool &range_error)
const;
128 virtual void unpack_int64(
const char *data,
size_t length,
size_t &p,
129 PN_int64 &value,
bool &pack_error,
bool &range_error)
const;
130 virtual void unpack_uint64(
const char *data,
size_t length,
size_t &p,
131 PN_uint64 &value,
bool &pack_error,
bool &range_error)
const;
132 virtual void unpack_string(
const char *data,
size_t length,
size_t &p,
133 string &value,
bool &pack_error,
bool &range_error)
const;
134 virtual bool unpack_validate(
const char *data,
size_t length,
size_t &p,
135 bool &pack_error,
bool &range_error)
const;
136 virtual bool unpack_skip(
const char *data,
size_t length,
size_t &p,
137 bool &pack_error)
const;
142 INLINE
static void do_pack_int8(
char *buffer,
int value);
143 INLINE
static void do_pack_int16(
char *buffer,
int value);
144 INLINE
static void do_pack_int32(
char *buffer,
int value);
145 INLINE
static void do_pack_int64(
char *buffer, PN_int64 value);
146 INLINE
static void do_pack_uint8(
char *buffer,
unsigned int value);
147 INLINE
static void do_pack_uint16(
char *buffer,
unsigned int value);
148 INLINE
static void do_pack_uint32(
char *buffer,
unsigned int value);
149 INLINE
static void do_pack_uint64(
char *buffer, PN_uint64 value);
150 INLINE
static void do_pack_float64(
char *buffer,
double value);
152 INLINE
static int do_unpack_int8(
const char *buffer);
153 INLINE
static int do_unpack_int16(
const char *buffer);
154 INLINE
static int do_unpack_int32(
const char *buffer);
155 INLINE
static PN_int64 do_unpack_int64(
const char *buffer);
156 INLINE
static unsigned int do_unpack_uint8(
const char *buffer);
157 INLINE
static unsigned int do_unpack_uint16(
const char *buffer);
158 INLINE
static unsigned int do_unpack_uint32(
const char *buffer);
159 INLINE
static PN_uint64 do_unpack_uint64(
const char *buffer);
160 INLINE
static double do_unpack_float64(
const char *buffer);
162 INLINE
static void validate_int_limits(
int value,
int num_bits,
164 INLINE
static void validate_int64_limits(PN_int64 value,
int num_bits,
166 INLINE
static void validate_uint_limits(
unsigned int value,
int num_bits,
168 INLINE
static void validate_uint64_limits(PN_uint64 value,
int num_bits,
180 virtual bool do_check_match_simple_parameter(
const DCSimpleParameter *other)
const;
181 virtual bool do_check_match_class_parameter(
const DCClassParameter *other)
const;
182 virtual bool do_check_match_switch_parameter(
const DCSwitchParameter *other)
const;
183 virtual bool do_check_match_array_parameter(
const DCArrayParameter *other)
const;
184 virtual bool do_check_match_atomic_field(
const DCAtomicField *other)
const;
185 virtual bool do_check_match_molecular_field(
const DCMolecularField *other)
const;
192 bool _has_fixed_byte_size;
193 size_t _fixed_byte_size;
194 bool _has_fixed_structure;
195 bool _has_range_limits;
196 size_t _num_length_bytes;
197 bool _has_nested_fields;
198 int _num_nested_fields;
199 DCPackType _pack_type;
205 #include "dcPackerInterface.I" This is a block of data that receives the results of DCPacker.
This represents a class (or struct) object used as a parameter itself.
A single field of a Distributed Class, either atomic or molecular.
This is the most fundamental kind of parameter type: a single number or string, one of the DCSubatomi...
This represents a switch object used as a parameter itself, which packs the appropriate fields of the...
A single atomic field of a Distributed Class, as read from a .dc file.
Represents the complete list of Distributed Class descriptions as read from a .dc file...
This represents an array of some other kind of object, meaning this parameter type accepts an arbitra...
This object contains the names of all of the nested fields available within a particular field...
A single molecular field of a Distributed Class, as read from a .dc file.
This defines the internal interface for packing values into a DCField.