32static const bool dc_multiple_inheritance =
true;
33static const bool dc_virtual_inheritance =
true;
34static const bool dc_sort_inheritance_by_file =
false;
46 DCClass(
DCFile *dc_file,
const std::string &name,
51 virtual DCClass *as_class();
52 virtual const DCClass *as_class()
const;
56 INLINE
const std::string &
get_name()
const;
81 virtual void output(std::ostream &out)
const;
84 bool has_class_def()
const;
85 void set_class_def(PyObject *class_def);
86 PyObject *get_class_def()
const;
87 bool has_owner_class_def()
const;
88 void set_owner_class_def(PyObject *owner_class_def);
89 PyObject *get_owner_class_def()
const;
92 void receive_update_broadcast_required(PyObject *distobj,
DatagramIterator &di)
const;
93 void receive_update_broadcast_required_owner(PyObject *distobj,
DatagramIterator &di)
const;
94 void receive_update_all_required(PyObject *distobj,
DatagramIterator &di)
const;
97 void direct_update(PyObject *distobj,
const std::string &field_name,
98 const vector_uchar &value_blob);
99 void direct_update(PyObject *distobj,
const std::string &field_name,
101 bool pack_required_field(
Datagram &datagram, PyObject *distobj,
102 const DCField *field)
const;
103 bool pack_required_field(
DCPacker &packer, PyObject *distobj,
104 const DCField *field)
const;
108 Datagram client_format_update(
const std::string &field_name,
109 DOID_TYPE do_id, PyObject *args)
const;
110 Datagram ai_format_update(
const std::string &field_name, DOID_TYPE do_id,
111 CHANNEL_TYPE to_id, CHANNEL_TYPE from_id, PyObject *args)
const;
112 Datagram ai_format_update_msg_type(
const std::string &field_name, DOID_TYPE do_id,
113 CHANNEL_TYPE to_id, CHANNEL_TYPE from_id,
int msg_type, PyObject *args)
const;
114 Datagram ai_format_generate(PyObject *distobj, DOID_TYPE do_id, ZONEID_TYPE parent_id, ZONEID_TYPE zone_id,
115 CHANNEL_TYPE district_channel_id, CHANNEL_TYPE from_channel_id,
116 PyObject *optional_fields)
const;
117 Datagram client_format_generate_CMU(PyObject *distobj, DOID_TYPE do_id,
118 ZONEID_TYPE zone_id, PyObject *optional_fields)
const;
123 virtual void output(std::ostream &out,
bool brief)
const;
124 virtual void write(std::ostream &out,
bool brief,
int indent_level)
const;
125 void output_instance(std::ostream &out,
bool brief,
const std::string &prename,
126 const std::string &name,
const std::string &postname)
const;
136 void shadow_inherited_field(
const std::string &name);
152 typedef pvector<DCClass *> Parents;
155 DCField *_constructor;
157 typedef pvector<DCField *> Fields;
158 Fields _fields, _inherited_fields;
160 typedef pmap<std::string, DCField *> FieldsByName;
161 FieldsByName _fields_by_name;
163 typedef pmap<int, DCField *> FieldsByIndex;
164 FieldsByIndex _fields_by_index;
167 PyObject *_class_def;
168 PyObject *_owner_class_def;
171 friend class DCField;
This is a convenience class to specialize ConfigVariable as a boolean type.
int get_num_fields() const
Returns the number of fields defined directly in this class, ignoring inheritance.
DCField * get_field(int n) const
Returns the nth field in the class.
void generate_hash(HashGenerator &hashgen) const
Accumulates the properties of this class into the hash.
bool is_struct() const
Returns true if the class has been identified with the "struct" keyword in the dc file,...
void start_generate()
Starts the PStats timer going on the "generate" task, that is, marks the beginning of the process of ...
DCField * get_inherited_field(int n) const
Returns the nth field field in the class and all of its ancestors.
DCClass * get_parent(int n) const
Returns the nth parent class this class inherits from.
DCField * get_constructor() const
Returns the constructor method for this class if it is defined, or NULL if the class uses the default...
void stop_generate()
Stops the PStats timer on the "generate" task.
void set_number(int number)
Assigns the unique number to this class.
void add_parent(DCClass *parent)
Adds a new parent to the inheritance hierarchy of the class.
int get_number() const
Returns a unique index number associated with this class.
DCFile * get_dc_file() const
Returns the DCFile object that contains the class.
bool add_field(DCField *field)
Adds the newly-allocated field to the class.
bool has_constructor() const
Returns true if this class has a constructor method, false if it just uses the default constructor.
void output_instance(std::ostream &out, bool brief, const std::string &prename, const std::string &name, const std::string &postname) const
Generates a parseable description of the object to the indicated output stream.
bool is_bogus_class() const
Returns true if the class has been flagged as a bogus class.
int get_num_inherited_fields() const
Returns the total number of field fields defined in this class and all ancestor classes.
void rebuild_inherited_fields()
Recomputes the list of inherited fields for the class.
void clear_inherited_fields()
Empties the list of inherited fields for the class, so that it may be rebuilt.
const std::string & get_name() const
Returns the name of this class.
int get_num_parents() const
Returns the number of base classes this class inherits from.
DCField * get_field_by_index(int index_number) const
Returns a pointer to the DCField that has the indicated index number.
bool inherits_from_bogus_class() const
Returns true if this class, or any class in the inheritance heirarchy for this class,...
DCField * get_field_by_name(const std::string &name) const
Returns a pointer to the DCField that shares the indicated name.
This is a common interface for a declaration in a DC file.
virtual void output(std::ostream &out) const
Write a string representation of this instance to <out>.
void write(std::ostream &out, int indent_level) const
Write a string representation of this instance to <out>.
Represents the complete list of Distributed Class descriptions as read from a .dc file.
This class can be used for packing a series of numeric and string data into a binary stream,...
Represents the type specification for a single parameter within a field specification.
A class to retrieve the individual data elements previously stored in a Datagram.
An ordered list of data elements, formatted in memory for transmission over a socket or writing to a ...
This class generates an arbitrary hash number from a sequence of ints.
A lightweight class that represents a single element that may be timed and/or counted via stats.
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.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.