|
|
|
This represents an array of some other kind of object, meaning this parameter type accepts an arbitrary (or possibly fixed) number of nested fields, all of which are of the same type.
More...
#include "dcArrayParameter.h"
List of all members.
Public Member Functions |
|
| DCArrayParameter (DCParameter *element_type, const DCUnsignedIntRange &size=DCUnsignedIntRange()) |
|
| DCArrayParameter (const DCArrayParameter ©) |
| virtual DCParameter * | append_array_specification (const DCUnsignedIntRange &size) |
| | Returns the type represented by this_type[size].
|
|
virtual DCArrayParameter * | as_array_parameter () |
|
virtual const DCArrayParameter * | as_array_parameter () const |
| virtual int | calc_num_nested_fields (size_t length_bytes) const |
| | This flavor of get_num_nested_fields is used during unpacking.
|
| virtual void | generate_hash (HashGenerator &hashgen) const |
| | Accumulates the properties of this type into the hash.
|
| int | get_array_size () const |
| | Returns the fixed number of elements in this array, or -1 if the array may contain a variable number of elements.
|
| DCParameter * | get_element_type () const |
| | Returns the type of the individual elements of this array.
|
| virtual DCPackerInterface * | get_nested_field (int n) const |
| | Returns the DCPackerInterface object that represents the nth nested field.
|
| virtual bool | is_valid () const |
| | Returns false if the type is an invalid type (e.g.
|
|
virtual DCParameter * | make_copy () const |
| virtual void | output_instance (ostream &out, bool brief, const string &prename, const string &name, const string &postname) const |
| | Formats the parameter in the C++-like dc syntax as a typename and identifier.
|
| virtual bool | pack_default_value (DCPackData &pack_data, bool &pack_error) const |
| | Packs the arrayParameter's specified default value (or a sensible default if no value is specified) into the stream.
|
| virtual void | pack_string (DCPackData &pack_data, const string &value, bool &pack_error, bool &range_error) const |
| | Packs the indicated numeric or string value into the stream.
|
| virtual void | unpack_string (const char *data, size_t length, size_t &p, string &value, bool &pack_error, bool &range_error) const |
| | Unpacks the current numeric or string value from the stream.
|
| virtual bool | validate_num_nested_fields (int num_nested_fields) const |
| | After a number of fields have been packed via push()
|
Protected Member Functions |
| virtual bool | do_check_match (const DCPackerInterface *other) const |
| | Returns true if the other interface is bitwise the same as this one--that is, a uint32 only matches a uint32, etc.
|
| virtual bool | do_check_match_array_parameter (const DCArrayParameter *other) const |
| | Returns true if this field matches the indicated array parameter, false otherwise.
|
| virtual bool | do_check_match_class_parameter (const DCClassParameter *other) const |
| | Returns true if this field matches the indicated class parameter, false otherwise.
|
| virtual bool | do_check_match_simple_parameter (const DCSimpleParameter *other) const |
| | Returns true if this field matches the indicated simple parameter, false otherwise.
|
Detailed Description
This represents an array of some other kind of object, meaning this parameter type accepts an arbitrary (or possibly fixed) number of nested fields, all of which are of the same type.
Definition at line 29 of file dcArrayParameter.h.
Member Function Documentation
Returns false if the type is an invalid type (e.g.
declared from an undefined typedef), true if it is valid.
Implements DCParameter.
Definition at line 137 of file dcArrayParameter.cxx.
Packs the arrayParameter's specified default value (or a sensible default if no value is specified) into the stream.
Returns true if the default value is packed, false if the arrayParameter doesn't know how to pack its default value.
Reimplemented from DCField.
Definition at line 318 of file dcArrayParameter.cxx.
References DCPackData::append_data(), DCPacker::begin_pack(), DCPacker::end_pack(), DCPacker::get_data(), DCPacker::get_length(), DCNumericRange< NUM >::get_min(), DCNumericRange< NUM >::is_empty(), DCPacker::pack_default_value(), DCPacker::pop(), and DCPacker::push().
| void DCArrayParameter::unpack_string |
( |
const char * |
data, |
|
|
size_t |
length, |
|
|
size_t & |
p, |
|
|
string & |
value, |
|
|
bool & |
pack_error, |
|
|
bool & |
range_error |
|
) |
| const [virtual] |
After a number of fields have been packed via push()
. pack_*() .. pop(), this is called to confirm that the number of nested fields that were added is valid for this type. This is primarily useful for array types with dynamic ranges that can't validate the number of fields any other way.
Reimplemented from DCPackerInterface.
Definition at line 228 of file dcArrayParameter.cxx.
References DCNumericRange< NUM >::validate().
The documentation for this class was generated from the following files:
| | |