14#ifndef DCATOMICFIELD_H
15#define DCATOMICFIELD_H
30class EXPCL_DIRECT_DCPARSER DCAtomicField :
public DCField {
32 DCAtomicField(
const std::string &name,
DCClass *dclass,
bool bogus_field);
33 virtual ~DCAtomicField();
52 virtual void output(std::ostream &out,
bool brief)
const;
53 virtual void write(std::ostream &out,
bool brief,
int indent_level)
const;
59 virtual bool do_check_match(
const DCPackerInterface *other)
const;
63 void output_element(std::ostream &out,
bool brief,
DCParameter *element)
const;
65 typedef pvector<DCParameter *> Elements;
bool has_element_default(int n) const
Returns true if the nth element of the field has a default value specified, false otherwise.
int get_element_divisor(int n) const
Returns the divisor associated with the nth element of the field.
void add_element(DCParameter *element)
Adds a new element (parameter) to the field.
int get_num_elements() const
Returns the number of elements (parameters) of the atomic field.
std::string get_element_name(int n) const
Returns the name of the nth element of the field.
DCSubatomicType get_element_type(int n) const
Returns the numeric type of the nth element of the field.
DCParameter * get_element(int n) const
Returns the parameter object describing the nth element.
std::vector< unsigned char > get_element_default(int n) const
Returns the pre-formatted default value associated with the nth element of the field.
Defines a particular DistributedClass as read from an input .dc file.
void write(std::ostream &out, int indent_level) const
Write a string representation of this instance to <out>.
virtual void generate_hash(HashGenerator &hashgen) const
Accumulates the properties of this field into the hash.
virtual DCAtomicField * as_atomic_field()
Returns the same field pointer converted to an atomic field pointer, if this is in fact an atomic fie...
void output(std::ostream &out) const
Write a string representation of this instance to <out>.
virtual bool do_check_match_atomic_field(const DCAtomicField *other) const
Returns true if this field matches the indicated atomic field, false otherwise.
virtual DCPackerInterface * get_nested_field(int n) const
Returns the DCPackerInterface object that represents the nth nested field.
Represents the type specification for a single parameter within a field specification.
This class generates an arbitrary hash number from a sequence of ints.
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.
DCSubatomicType
This defines the numeric type of each element of a DCAtomicField; that is, the particular values that...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.