29 _has_fixed_byte_size =
false;
30 _has_fixed_structure =
false;
31 _num_nested_fields = -1;
40 _typedef(copy._typedef)
63 as_parameter()
const {
71 as_simple_parameter() {
79 as_simple_parameter()
const {
87 as_class_parameter() {
95 as_class_parameter()
const {
103 as_switch_parameter() {
111 as_switch_parameter()
const {
119 as_array_parameter() {
127 as_array_parameter()
const {
164 output(ostream &out,
bool brief)
const {
169 output_instance(out, brief,
"", name,
"");
176 write(ostream &out,
bool brief,
int indent_level)
const {
188 const string &prename,
const string &name,
189 const string &postname)
const {
190 indent(out, indent_level);
191 output_instance(out, brief, prename, name, postname);
192 output_keywords(out);
194 if (!brief && _number >= 0) {
195 out <<
" // field " << _number;
206 const string &name,
const string &postname)
const {
208 if (!prename.empty() || !name.empty() || !postname.empty()) {
209 out <<
" " << prename << name << postname;
219 const string &prename,
const string &name,
220 const string &postname)
const {
223 if (!prename.empty() || !name.empty() || !postname.empty()) {
224 out <<
" " << prename << name << postname;
226 output_keywords(out);
228 if (!brief && _number >= 0) {
229 out <<
" // field " << _number;
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
virtual void generate_hash(HashGenerator &hashgen) const
Accumulates the properties of this type into the hash.
This represents a single typedef declaration in the dc file.
const std::string & get_name() const
Returns the name of this field, or empty string if the field is unnamed.
This represents a class (or struct) object used as a parameter itself.
A single field of a Distributed Class, either atomic or molecular.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
This is the most fundamental kind of parameter type: a single number or string, one of the DCSubatomi...
void set_typedef(const DCTypedef *dtypedef)
Records the DCTypedef object that generated this parameter.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
This represents a switch object used as a parameter itself, which packs the appropriate fields of the...
virtual void write_instance(std::ostream &out, bool brief, int indent_level, const std::string &prename, const std::string &name, const std::string &postname) const
Formats the parameter in the C++-like dc syntax as a typename and identifier.
virtual DCParameter * append_array_specification(const DCUnsignedIntRange &size)
Returns the type represented by this_type[size].
Represents the type specification for a single parameter within a field specification.
This represents an array of some other kind of object, meaning this parameter type accepts an arbitra...
int get_num_keywords() const
Returns the number of keywords in the list.
void output_typedef_name(std::ostream &out, bool brief, const std::string &prename, const std::string &name, const std::string &postname) const
Formats the instance like output_instance, but uses the typedef name instead.
std::ostream & indent(std::ostream &out, int indent_level)
A handy function for doing text formatting.
const std::string & get_name() const
Returns the name of this typedef.
This class generates an arbitrary hash number from a sequence of ints.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
void write_typedef_name(std::ostream &out, bool brief, int indent_level, const std::string &prename, const std::string &name, const std::string &postname) const
Formats the instance like write_instance, but uses the typedef name instead.
const DCTypedef * get_typedef() const
If this type has been referenced from a typedef, returns the DCTypedef instance, or NULL if the type ...
void generate_hash(HashGenerator &hashgen) const
Accumulates the properties of these keywords into the hash.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.