#include <dcClass.h>
Public Types | |
typedef pvector< DCClass * > | Parents |
typedef pvector< DCField * > | Fields |
typedef pmap< string, DCField * > | FieldsByName |
Public Member Functions | |
int | get_number () const |
Returns a unique index number associated with this class. | |
string | get_name () const |
Returns the name of this class. | |
bool | has_parent () const |
Returns true if this class inherits from some other class, false if it does not. | |
DCClass * | get_parent () const |
Returns the parent class this class inherits from, if any. | |
int | get_num_fields () |
Returns the number of fields defined directly in this class, ignoring inheritance. | |
DCField * | get_field (int n) |
Returns the nth field in the class. | |
DCField * | get_field_by_name (const string &name) |
Returns a pointer to the DCField that shares the indicated name. | |
int | get_num_inherited_fields () |
Returns the total number of field fields defined in this class and all ancestor classes. | |
DCField * | get_inherited_field (int n) |
Returns the nth field field in the class and all of its ancestors. | |
DCClass () | |
~DCClass () | |
void | write (ostream &out, int indent_level=0) const |
Generates a parseable description of the object to the indicated output stream. | |
void | generate_hash (HashGenerator &hash) const |
Accumulates the properties of this class into the hash. | |
bool | add_field (DCField *field) |
Adds the newly-allocated field to the class. | |
Public Attributes | |
int | _number |
string | _name |
Parents | _parents |
Fields | _fields |
FieldsByName | _fields_by_name |
Definition at line 39 of file dcClass.h.
|
|
|
|
|
|
|
Definition at line 220 of file dcClass.cxx. References _name, _parents, HashGenerator::add_int(), and HashGenerator::add_string(). |
|
Definition at line 231 of file dcClass.cxx. References _fields. |
|
Adds the newly-allocated field to the class. The class becomes the owner of the pointer and will delete it when it destructs. Returns true if the field is successfully added, or false if there was a name conflict. Definition at line 316 of file dcClass.cxx. |
|
Accumulates the properties of this class into the hash.
Definition at line 283 of file dcClass.cxx. |
|
Returns the nth field in the class. This is not necessarily the field with index n; this is the nth field defined in the class directly, ignoring inheritance. Definition at line 119 of file dcClass.cxx. Referenced by get_field_by_name(). |
|
Returns a pointer to the DCField that shares the indicated name. If the named field is not found in the current class, the parent classes will be searched, so the value returned may not actually be a field within this class. Returns NULL if there is no such field defined. Definition at line 143 of file dcClass.cxx. References _parents, and get_field(). |
|
Returns the nth field field in the class and all of its ancestors. This *is* the field corresponding to the given index number, since the fields are ordered consecutively beginning at the earliest inherited fields. Definition at line 199 of file dcClass.cxx. References _parents. |
|
Returns the name of this class.
Definition at line 52 of file dcClass.cxx. References _parents. |
|
Returns the number of fields defined directly in this class, ignoring inheritance.
Definition at line 100 of file dcClass.cxx. References _fields_by_name, _parents, and NULL. |
|
Returns the total number of field fields defined in this class and all ancestor classes.
Definition at line 174 of file dcClass.cxx. References _fields. |
|
Returns a unique index number associated with this class. This is defined implicitly when the .dc file(s) are read. Definition at line 39 of file dcClass.cxx. References _name. |
|
Returns the parent class this class inherits from, if any. It is an error to call this unless has_parent() returned true. Definition at line 84 of file dcClass.cxx. |
|
Returns true if this class inherits from some other class, false if it does not.
Definition at line 67 of file dcClass.cxx. |
|
Generates a parseable description of the object to the indicated output stream.
Definition at line 249 of file dcClass.cxx. References _fields_by_name. |
|
Definition at line 73 of file dcClass.h. Referenced by get_num_inherited_fields(), get_parent(), and ~DCClass(). |
|
Definition at line 79 of file dcClass.h. Referenced by get_num_fields(), and write(). |
|
Definition at line 67 of file dcClass.h. Referenced by DCClass(), DCFile::get_class(), and get_number(). |
|
|
|
Definition at line 70 of file dcClass.h. Referenced by DCClass(), get_field_by_name(), get_inherited_field(), get_name(), and get_num_fields(). |