Panda3D
|
An array of nested data elements. More...
#include "xFileDataObjectArray.h"
Public Member Functions | |
XFileDataObjectArray (const XFileDataDef *data_def) | |
XFileDataObject & | add_Coords2d (XFile *x_file, const LVecBase2d &coords) |
Appends a new Coords2d instance. | |
XFileDataObject & | add_double (double double_value) |
Appends a new floating-point value to the data object, if it makes sense to do so. | |
virtual bool | add_element (XFileDataObject *element) |
Adds the indicated element as a nested data element, if this data object type supports it. | |
XFileDataObject & | add_IndexedColor (XFile *x_file, int index, const Colorf &color) |
Appends a new IndexedColor instance. | |
XFileDataObject & | add_int (int int_value) |
Appends a new integer value to the data object, if it makes sense to do so. | |
XFileDataObject & | add_MeshFace (XFile *x_file) |
Appends a new MeshFace instance. | |
XFileDataObject & | add_string (const string &string_value) |
Appends a new string value to the data object, if it makes sense to do so. | |
XFileDataObject & | add_Vector (XFile *x_file, const LVecBase3d &vector) |
Appends a new Vector instance. | |
double | d () const |
Unambiguously returns the object's representation as a double, or 0.0 if the object has no double representation. | |
virtual TypeHandle | force_init_type () |
const XFileDataDef * | get_data_def () const |
Returns the data object that this object is represented by, if any, or NULL if there is none. | |
int | get_ref_count () const |
Returns the current reference count. | |
virtual TypeHandle | get_type () const |
virtual string | get_type_name () const |
Returns a string that represents the type of object this data object represents. | |
WeakReferenceList * | get_weak_list () const |
Returns the WeakReferenceList associated with this ReferenceCount object. | |
bool | has_weak_list () const |
Returns true if this particular ReferenceCount object has a WeakReferenceList created, false otherwise. | |
int | i () const |
Unambiguously returns the object's representation as an integer, or 0 if the object has no integer representation. | |
virtual bool | is_complex_object () const |
Returns true if this kind of data object is a complex object that can hold nested data elements, false otherwise. | |
void | local_object () |
This function should be called, once, immediately after creating a new instance of some ReferenceCount-derived object on the stack. | |
LMatrix4d | mat4 () const |
Returns the object's representation as an LMatrix4d. | |
void | operator delete (void *ptr) |
void | operator delete (void *ptr, void *) |
void | operator delete[] (void *ptr) |
void | operator delete[] (void *, void *) |
void * | operator new (size_t size) |
void * | operator new (size_t size, void *ptr) |
void * | operator new[] (size_t size) |
void * | operator new[] (size_t size, void *ptr) |
const XFileDataObject & | operator[] (const string &name) const |
Returns the named nested object within this object. | |
XFileDataObject & | operator[] (int n) |
Returns the nth nested object within this object. | |
const XFileDataObject & | operator[] (int n) const |
Returns the nth nested object within this object. | |
XFileDataObject & | operator[] (const string &name) |
Returns the named nested object within this object. | |
virtual void | output_data (ostream &out) const |
Writes a suitable representation of this node to an .x file in text mode. | |
void | ref () const |
Explicitly increments the reference count. | |
string | s () const |
Unambiguously returns the object's representation as a string, or empty string if the object has no string representation. | |
void | set (const LVecBase3d &vec) |
Stores the indicated Vec3 value into the object, if it makes sense to do so. | |
void | set (double double_value) |
Stores the indicated floating-point value into the object, if it makes sense to do so. | |
void | set (int int_value) |
Stores the indicated integer value into the object, if it makes sense to do so. | |
void | set (const LMatrix4d &mat) |
Stores the indicated Matrix value into the object, if it makes sense to do so. | |
void | set (const string &string_value) |
Stores the indicated string value into the object, if it makes sense to do so. | |
void | set (const LVecBase2d &vec) |
Stores the indicated Vec2 value into the object, if it makes sense to do so. | |
void | set (const LVecBase4d &vec) |
Stores the indicated Vec4 value into the object, if it makes sense to do so. | |
int | size () const |
Returns the number of nested data objects within this object. | |
bool | test_ref_count_integrity () const |
Does some easy checks to make sure that the reference count isn't completely bogus. | |
bool | test_ref_count_nonzero () const |
Does some easy checks to make sure that the reference count isn't zero, or completely bogus. | |
virtual bool | unref () const |
Explicitly decrements the reference count. | |
LVecBase2d | vec2 () const |
Returns the object's representation as an LVecBase2d. | |
LVecBase3d | vec3 () const |
Returns the object's representation as an LVecBase3d. | |
LVecBase4d | vec4 () const |
Returns the object's representation as an LVecBase4d. | |
void | weak_ref (WeakPointerToVoid *ptv) |
Adds the indicated PointerToVoid as a weak reference to this object. | |
void | weak_unref (WeakPointerToVoid *ptv) |
Removes the indicated PointerToVoid as a weak reference to this object. | |
virtual void | write_data (ostream &out, int indent_level, const char *separator) const |
Writes a suitable representation of this node to an .x file in text mode. | |
Static Public Member Functions | |
static TypeHandle | get_class_type () |
static void | init_type () |
Protected Member Functions | |
bool | do_test_ref_count_integrity () const |
Does some easy checks to make sure that the reference count isn't completely bogus. | |
bool | do_test_ref_count_nonzero () const |
Returns true if the reference count is nonzero, false otherwise. | |
void | get_double_array (int num_elements, double *values) const |
Fills the indicated array of doubles with the values from the nested elements within this object. | |
virtual double | get_double_value () const |
Returns the object's representation as a double, if it has one. | |
virtual XFileDataObject * | get_element (const string &name) |
Returns the nested data element within the object that has the indicated name. | |
virtual XFileDataObject * | get_element (int n) |
Returns the nth nested data element within the object. | |
virtual int | get_int_value () const |
Returns the object's representation as an integer, if it has one. | |
virtual int | get_num_elements () const |
Returns the number of nested data elements within the object. | |
virtual string | get_string_value () const |
Returns the object's representation as a string, if it has one. | |
virtual void | set_double_value (double double_value) |
Sets the object's value as a floating-point number, if this is legal. | |
virtual void | set_int_value (int int_value) |
Sets the object's value as an integer, if this is legal. | |
virtual void | set_string_value (const string &string_value) |
Sets the object's value as a string, if this is legal. | |
void | store_double_array (int num_elements, const double *values) |
Stores the indicated array of doubles in the nested elements within this object. | |
Protected Attributes | |
const XFileDataDef * | _data_def |
An array of nested data elements.
Definition at line 25 of file xFileDataObjectArray.h.
XFileDataObject & XFileDataObject::add_Coords2d | ( | XFile * | x_file, |
const LVecBase2d & | coords | ||
) | [inherited] |
Appends a new Coords2d instance.
Definition at line 169 of file xFileDataObject.cxx.
References XFileDataObject::add_element(), XFile::find_standard_template(), XFileDataObject::set(), and XFileDataNodeTemplate::zero_fill().
Referenced by XFileMesh::make_x_uvs().
XFileDataObject & XFileDataObject::add_double | ( | double | double_value | ) | [inherited] |
Appends a new floating-point value to the data object, if it makes sense to do so.
Normally, this is valid only for a DataObjectArray, or in certain special cases for a DataNodeTemplate.
Definition at line 84 of file xFileDataObject.cxx.
References XFileDataObject::add_element(), and XFileDataObject::get_data_def().
bool XFileDataObjectArray::add_element | ( | XFileDataObject * | element | ) | [virtual] |
Adds the indicated element as a nested data element, if this data object type supports it.
Returns true if added successfully, false if the data object type does not support nested data elements.
Reimplemented from XFileDataObject.
Definition at line 42 of file xFileDataObjectArray.cxx.
XFileDataObject & XFileDataObject::add_IndexedColor | ( | XFile * | x_file, |
int | index, | ||
const Colorf & | color | ||
) | [inherited] |
Appends a new IndexedColor instance.
Definition at line 149 of file xFileDataObject.cxx.
References XFileDataObject::add_element(), XFile::find_standard_template(), and XFileDataNodeTemplate::zero_fill().
Referenced by XFileMesh::make_x_colors().
XFileDataObject & XFileDataObject::add_int | ( | int | int_value | ) | [inherited] |
Appends a new integer value to the data object, if it makes sense to do so.
Normally, this is valid only for a DataObjectArray, or in certain special cases for a DataNodeTemplate.
Definition at line 68 of file xFileDataObject.cxx.
References XFileDataObject::add_element(), and XFileDataObject::get_data_def().
Referenced by XFileMesh::make_x_material_list(), XFileMesh::make_x_mesh(), and XFileMesh::make_x_normals().
XFileDataObject & XFileDataObject::add_MeshFace | ( | XFile * | x_file | ) | [inherited] |
Appends a new MeshFace instance.
Definition at line 132 of file xFileDataObject.cxx.
References XFileDataObject::add_element(), XFile::find_standard_template(), and XFileDataNodeTemplate::zero_fill().
Referenced by XFileMesh::make_x_mesh(), and XFileMesh::make_x_normals().
XFileDataObject & XFileDataObject::add_string | ( | const string & | string_value | ) | [inherited] |
Appends a new string value to the data object, if it makes sense to do so.
Normally, this is valid only for a DataObjectArray, or in certain special cases for a DataNodeTemplate.
Definition at line 100 of file xFileDataObject.cxx.
References XFileDataObject::add_element(), and XFileDataObject::get_data_def().
XFileDataObject & XFileDataObject::add_Vector | ( | XFile * | x_file, |
const LVecBase3d & | vector | ||
) | [inherited] |
Appends a new Vector instance.
Definition at line 113 of file xFileDataObject.cxx.
References XFileDataObject::add_element(), XFile::find_standard_template(), XFileDataObject::set(), and XFileDataNodeTemplate::zero_fill().
Referenced by XFileMesh::make_x_mesh(), and XFileMesh::make_x_normals().
double XFileDataObject::d | ( | ) | const [inline, inherited] |
Unambiguously returns the object's representation as a double, or 0.0 if the object has no double representation.
See also get_data_def() to determine what kind of representation this object has.
Definition at line 240 of file xFileDataObject.I.
References XFileDataObject::get_double_value().
Referenced by XFileMesh::fill_skin_weights().
bool ReferenceCount::do_test_ref_count_integrity | ( | ) | const [protected, inherited] |
Does some easy checks to make sure that the reference count isn't completely bogus.
Returns true if ok, false otherwise.
Reimplemented in NodeReferenceCount, CachedTypedWritableReferenceCount, and NodeCachedReferenceCount.
Definition at line 29 of file referenceCount.cxx.
Referenced by ReferenceCount::do_test_ref_count_nonzero(), and ReferenceCount::test_ref_count_integrity().
bool ReferenceCount::do_test_ref_count_nonzero | ( | ) | const [protected, inherited] |
Returns true if the reference count is nonzero, false otherwise.
Definition at line 56 of file referenceCount.cxx.
References ReferenceCount::do_test_ref_count_integrity().
Referenced by ReferenceCount::test_ref_count_nonzero().
const XFileDataDef * XFileDataObject::get_data_def | ( | ) | const [inline, inherited] |
Returns the data object that this object is represented by, if any, or NULL if there is none.
Definition at line 34 of file xFileDataObject.I.
Referenced by XFileDataObject::add_double(), XFileDataObject::add_int(), and XFileDataObject::add_string().
void XFileDataObject::get_double_array | ( | int | num_elements, |
double * | values | ||
) | const [protected, inherited] |
Fills the indicated array of doubles with the values from the nested elements within this object.
There must be exactly the indicated number of nested values, and they must all return a double.
Definition at line 319 of file xFileDataObject.cxx.
References XFileDataObject::get_num_elements(), XFileDataObject::get_type_name(), and XFileDataObject::i().
Referenced by XFileDataObject::mat4(), XFileDataObject::vec2(), XFileDataObject::vec3(), and XFileDataObject::vec4().
double XFileDataObject::get_double_value | ( | ) | const [protected, virtual, inherited] |
Returns the object's representation as a double, if it has one.
Reimplemented in XFileDataObjectDouble, and XFileDataObjectInteger.
Definition at line 295 of file xFileDataObject.cxx.
Referenced by XFileDataObject::d().
XFileDataObject * XFileDataObjectArray::get_element | ( | int | n | ) | [protected, virtual] |
Returns the nth nested data element within the object.
Reimplemented from XFileDataObject.
Definition at line 116 of file xFileDataObjectArray.cxx.
XFileDataObject * XFileDataObject::get_element | ( | const string & | name | ) | [protected, virtual, inherited] |
Returns the nested data element within the object that has the indicated name.
Reimplemented in XFileDataNodeReference, and XFileDataNodeTemplate.
Definition at line 365 of file xFileDataObject.cxx.
References XFileDataObject::get_type_name().
int XFileDataObject::get_int_value | ( | ) | const [protected, virtual, inherited] |
Returns the object's representation as an integer, if it has one.
Reimplemented in XFileDataObjectDouble, and XFileDataObjectInteger.
Definition at line 284 of file xFileDataObject.cxx.
Referenced by XFileDataObject::i().
int XFileDataObjectArray::get_num_elements | ( | ) | const [protected, virtual] |
Returns the number of nested data elements within the object.
This may be, e.g. the size of the array, if it is an array.
Reimplemented from XFileDataObject.
Definition at line 105 of file xFileDataObjectArray.cxx.
int ReferenceCount::get_ref_count | ( | ) | const [inline, inherited] |
Returns the current reference count.
Definition at line 155 of file referenceCount.I.
References ReferenceCount::test_ref_count_integrity().
Referenced by TransformState::clear_cache(), RenderState::clear_cache(), RenderState::finalize(), RenderEffects::finalize(), RenderEffect::finalize(), RenderAttrib::finalize(), InternalName::finalize(), TransformState::get_num_unused_states(), RenderState::get_num_unused_states(), TransformState::list_cycles(), RenderState::list_cycles(), GeomVertexFormat::remove_column(), TransformState::unref(), RenderState::unref(), RenderState::~RenderState(), and TransformState::~TransformState().
string XFileDataObject::get_string_value | ( | ) | const [protected, virtual, inherited] |
Returns the object's representation as a string, if it has one.
Reimplemented in XFileDataObjectDouble, XFileDataObjectInteger, and XFileDataObjectString.
Definition at line 306 of file xFileDataObject.cxx.
Referenced by XFileDataObject::s().
string XFileDataObject::get_type_name | ( | ) | const [virtual, inherited] |
Returns a string that represents the type of object this data object represents.
Reimplemented in XFileDataNode.
Definition at line 55 of file xFileDataObject.cxx.
References TypeHandle::get_name().
Referenced by XFileDataObject::get_double_array(), XFileDataObject::get_element(), XFileDataObject::set_double_value(), XFileDataObject::set_int_value(), XFileDataObject::set_string_value(), and XFileDataObject::store_double_array().
WeakReferenceList * ReferenceCount::get_weak_list | ( | ) | const [inline, inherited] |
Returns the WeakReferenceList associated with this ReferenceCount object.
If there has never been a WeakReferenceList associated with this object, creates one now.
Definition at line 307 of file referenceCount.I.
Referenced by ReferenceCount::weak_ref().
bool ReferenceCount::has_weak_list | ( | ) | const [inline, inherited] |
Returns true if this particular ReferenceCount object has a WeakReferenceList created, false otherwise.
In general, this will be true if there was ever a WeakPointerTo created for this object (even if there is not any for it now).
Definition at line 294 of file referenceCount.I.
Referenced by ReferenceCount::weak_unref().
int XFileDataObject::i | ( | ) | const [inline, inherited] |
Unambiguously returns the object's representation as an integer, or 0 if the object has no integer representation.
See also get_data_def() to determine what kind of representation this object has.
Definition at line 227 of file xFileDataObject.I.
References XFileDataObject::get_int_value().
Referenced by XFileMesh::fill_colors(), XFileMesh::fill_material_list(), XFileMesh::fill_mesh(), XFileMesh::fill_normals(), XFileMesh::fill_skin_weights(), XFileDataObject::get_double_array(), XFileDataObject::store_double_array(), write_data(), and XFileDataNodeTemplate::write_data().
bool XFileDataObjectArray::is_complex_object | ( | ) | const [virtual] |
Returns true if this kind of data object is a complex object that can hold nested data elements, false otherwise.
Reimplemented from XFileDataObject.
Definition at line 29 of file xFileDataObjectArray.cxx.
void ReferenceCount::local_object | ( | ) | [inline, inherited] |
This function should be called, once, immediately after creating a new instance of some ReferenceCount-derived object on the stack.
This allows the object to be passed to functions that will increment and decrement the object's reference count temporarily, and it will prevent the object from being deleted (inappropriately), when the reference count returns to zero. It actually achieves this by setting a large positive value in the reference count field.
Definition at line 276 of file referenceCount.I.
Referenced by PGTop::cull_callback(), BoundingSphere::extend_by_hexahedron(), AsyncTaskManager::find_task(), AsyncTaskManager::find_tasks(), and AsyncTaskManager::find_tasks_matching().
LMatrix4d XFileDataObject::mat4 | ( | ) | const [inline, inherited] |
Returns the object's representation as an LMatrix4d.
It is an error if the object does not have sixteen nested objects that store a double value.
Definition at line 307 of file xFileDataObject.I.
References XFileDataObject::get_double_array().
XFileDataObject & XFileDataObject::operator[] | ( | const string & | name | ) | [inline, inherited] |
Returns the named nested object within this object.
It is an error if the named object does not exist. Call find_child() instead if there is any doubt.
Definition at line 374 of file xFileDataObject.I.
References XFileDataObject::get_element().
const XFileDataObject & XFileDataObject::operator[] | ( | int | n | ) | const [inline, inherited] |
Returns the nth nested object within this object.
Call get_num_children() to determine the number of nested objects.
Definition at line 332 of file xFileDataObject.I.
References XFileDataObject::get_element().
const XFileDataObject & XFileDataObject::operator[] | ( | const string & | name | ) | const [inline, inherited] |
Returns the named nested object within this object.
It is an error if the named object does not exist. Call find_child() instead if there is any doubt.
Definition at line 346 of file xFileDataObject.I.
References XFileDataObject::get_element().
XFileDataObject & XFileDataObject::operator[] | ( | int | n | ) | [inline, inherited] |
Returns the nth nested object within this object.
Call get_num_children() to determine the number of nested objects.
Definition at line 360 of file xFileDataObject.I.
References XFileDataObject::get_element().
void XFileDataObject::output_data | ( | ostream & | out | ) | const [virtual, inherited] |
Writes a suitable representation of this node to an .x file in text mode.
Reimplemented in XFileDataObjectDouble, XFileDataObjectInteger, and XFileDataObjectString.
Definition at line 202 of file xFileDataObject.cxx.
void ReferenceCount::ref | ( | ) | const [inline, inherited] |
Explicitly increments the reference count.
User code should avoid using ref() and unref() directly, which can result in missed reference counts. Instead, let a PointerTo object manage the reference counting automatically.
This function is const, even though it changes the object, because generally fiddling with an object's reference count isn't considered part of fiddling with the object. An object might be const in other ways, but we still need to accurately count the number of references to it.
Definition at line 179 of file referenceCount.I.
References ReferenceCount::test_ref_count_integrity().
Referenced by CachedTypedWritableReferenceCount::cache_ref(), TypedWritable::decode_raw_from_bam_stream(), NodeCachedReferenceCount::node_ref(), NodeReferenceCount::node_ref(), BamCacheRecord::set_data(), CullableObject::set_draw_callback(), and ModelRoot::set_reference().
string XFileDataObject::s | ( | ) | const [inline, inherited] |
Unambiguously returns the object's representation as a string, or empty string if the object has no string representation.
See also get_data_def() to determine what kind of representation this object has.
Definition at line 253 of file xFileDataObject.I.
References XFileDataObject::get_string_value().
void XFileDataObject::set | ( | double | double_value | ) | [inline, inherited] |
Stores the indicated floating-point value into the object, if it makes sense to do so.
It is an error to call this on an object that cannot accept a floating-point value.
Definition at line 149 of file xFileDataObject.I.
References XFileDataObject::set_double_value().
void XFileDataObject::set | ( | const LVecBase4d & | vec | ) | [inline, inherited] |
Stores the indicated Vec4 value into the object, if it makes sense to do so.
It is an error to call this on an object that does not store four floating-point values.
Definition at line 201 of file xFileDataObject.I.
References LVecBase4d::get_data(), and XFileDataObject::store_double_array().
void XFileDataObject::set | ( | const LMatrix4d & | mat | ) | [inline, inherited] |
Stores the indicated Matrix value into the object, if it makes sense to do so.
It is an error to call this on an object that does not store sixteen floating-point values.
Definition at line 214 of file xFileDataObject.I.
References LMatrix4d::get_data(), and XFileDataObject::store_double_array().
void XFileDataObject::set | ( | const LVecBase2d & | vec | ) | [inline, inherited] |
Stores the indicated Vec2 value into the object, if it makes sense to do so.
It is an error to call this on an object that does not store two floating-point values.
Definition at line 175 of file xFileDataObject.I.
References LVecBase2d::get_data(), and XFileDataObject::store_double_array().
void XFileDataObject::set | ( | int | int_value | ) | [inline, inherited] |
Stores the indicated integer value into the object, if it makes sense to do so.
It is an error to call this on an object that cannot accept an integer value.
Definition at line 136 of file xFileDataObject.I.
References XFileDataObject::set_int_value().
Referenced by XFileDataObject::add_Coords2d(), and XFileDataObject::add_Vector().
void XFileDataObject::set | ( | const string & | string_value | ) | [inline, inherited] |
Stores the indicated string value into the object, if it makes sense to do so.
It is an error to call this on an object that cannot accept a string value.
Definition at line 162 of file xFileDataObject.I.
References XFileDataObject::set_string_value().
void XFileDataObject::set | ( | const LVecBase3d & | vec | ) | [inline, inherited] |
Stores the indicated Vec3 value into the object, if it makes sense to do so.
It is an error to call this on an object that does not store three floating-point values.
Definition at line 188 of file xFileDataObject.I.
References LVecBase3d::get_data(), and XFileDataObject::store_double_array().
void XFileDataObject::set_double_value | ( | double | double_value | ) | [protected, virtual, inherited] |
Sets the object's value as a floating-point number, if this is legal.
Reimplemented in XFileDataObjectDouble.
Definition at line 237 of file xFileDataObject.cxx.
References XFileDataObject::get_type_name().
Referenced by XFileDataObject::set(), and XFileDataObject::store_double_array().
void XFileDataObject::set_int_value | ( | int | int_value | ) | [protected, virtual, inherited] |
Sets the object's value as an integer, if this is legal.
Reimplemented in XFileDataObjectDouble, and XFileDataObjectInteger.
Definition at line 225 of file xFileDataObject.cxx.
References XFileDataObject::get_type_name().
Referenced by XFileDataObject::set().
void XFileDataObject::set_string_value | ( | const string & | string_value | ) | [protected, virtual, inherited] |
Sets the object's value as a string, if this is legal.
Reimplemented in XFileDataObjectString.
Definition at line 249 of file xFileDataObject.cxx.
References XFileDataObject::get_type_name().
Referenced by XFileDataObject::set().
int XFileDataObject::size | ( | ) | const [inline, inherited] |
Returns the number of nested data objects within this object.
Definition at line 320 of file xFileDataObject.I.
References XFileDataObject::get_num_elements().
Referenced by XFileMesh::fill_colors(), XFileMesh::fill_material_list(), XFileMesh::fill_mesh(), XFileMesh::fill_normals(), XFileMesh::fill_skin_weights(), XFileMesh::fill_uvs(), XFileMesh::make_x_colors(), XFileMesh::make_x_material_list(), XFileMesh::make_x_mesh(), XFileMesh::make_x_normals(), and XFileMesh::make_x_uvs().
void XFileDataObject::store_double_array | ( | int | num_elements, |
const double * | values | ||
) | [protected, inherited] |
Stores the indicated array of doubles in the nested elements within this object.
There must be exactly the indicated number of nested values, and they must all accept a double.
Definition at line 263 of file xFileDataObject.cxx.
References XFileDataObject::get_element(), XFileDataObject::get_num_elements(), XFileDataObject::get_type_name(), XFileDataObject::i(), and XFileDataObject::set_double_value().
Referenced by XFileDataObject::set().
bool ReferenceCount::test_ref_count_integrity | ( | ) | const [inline, inherited] |
Does some easy checks to make sure that the reference count isn't completely bogus.
Returns true if ok, false otherwise.
Reimplemented in NodeReferenceCount, CachedTypedWritableReferenceCount, and NodeCachedReferenceCount.
Definition at line 236 of file referenceCount.I.
References ReferenceCount::do_test_ref_count_integrity().
Referenced by EggGroupNode::add_child(), InternalName::find_ancestor(), InternalName::get_ancestor(), ReferenceCount::get_ref_count(), InternalName::get_top(), ReferenceCount::ref(), EggVertex::test_gref_integrity(), EggVertex::test_pref_integrity(), EggNode::test_under_integrity(), EggPrimitive::test_vref_integrity(), EggGroup::test_vref_integrity(), MouseWatcher::throw_event_pattern(), ReferenceCount::unref(), and EggNode::update_under().
bool ReferenceCount::test_ref_count_nonzero | ( | ) | const [inline, inherited] |
Does some easy checks to make sure that the reference count isn't zero, or completely bogus.
Returns true if ok, false otherwise.
Definition at line 252 of file referenceCount.I.
References ReferenceCount::do_test_ref_count_nonzero().
Referenced by CopyOnWritePointer::test_ref_count_nonzero().
bool ReferenceCount::unref | ( | ) | const [inline, virtual, inherited] |
Explicitly decrements the reference count.
Note that the object will not be implicitly deleted by unref() simply because the reference count drops to zero. (Having a member function delete itself is problematic.) However, see the helper function unref_delete().
User code should avoid using ref() and unref() directly, which can result in missed reference counts. Instead, let a PointerTo object manage the reference counting automatically.
This function is const, even though it changes the object, because generally fiddling with an object's reference count isn't considered part of fiddling with the object. An object might be const in other ways, but we still need to accurately count the number of references to it.
The return value is true if the new reference count is nonzero, false if it is zero.
Reimplemented in GeomVertexArrayFormat, GeomVertexFormat, InternalName, RenderAttrib, RenderEffects, RenderState, and TransformState.
Definition at line 214 of file referenceCount.I.
References ReferenceCount::test_ref_count_integrity().
Referenced by CachedTypedWritableReferenceCount::cache_unref(), TypedWritable::decode_raw_from_bam_stream(), RenderEffect::finalize(), NodeCachedReferenceCount::node_unref(), NodeReferenceCount::node_unref(), TransformState::unref(), RenderState::unref(), RenderEffects::unref(), RenderAttrib::unref(), InternalName::unref(), GeomVertexFormat::unref(), and GeomVertexArrayFormat::unref().
LVecBase2d XFileDataObject::vec2 | ( | ) | const [inline, inherited] |
Returns the object's representation as an LVecBase2d.
It is an error if the object does not have two nested objects that store a double value.
Definition at line 265 of file xFileDataObject.I.
References XFileDataObject::get_double_array().
Referenced by XFileMesh::fill_uvs().
LVecBase3d XFileDataObject::vec3 | ( | ) | const [inline, inherited] |
Returns the object's representation as an LVecBase3d.
It is an error if the object does not have three nested objects that store a double value.
Definition at line 279 of file xFileDataObject.I.
References XFileDataObject::get_double_array().
Referenced by XFileMesh::fill_mesh(), and XFileMesh::fill_normals().
LVecBase4d XFileDataObject::vec4 | ( | ) | const [inline, inherited] |
Returns the object's representation as an LVecBase4d.
It is an error if the object does not have four nested objects that store a double value.
Definition at line 293 of file xFileDataObject.I.
References XFileDataObject::get_double_array().
void ReferenceCount::weak_ref | ( | WeakPointerToVoid * | ptv | ) | [inline, inherited] |
Adds the indicated PointerToVoid as a weak reference to this object.
Definition at line 321 of file referenceCount.I.
References WeakReferenceList::add_reference(), and ReferenceCount::get_weak_list().
void ReferenceCount::weak_unref | ( | WeakPointerToVoid * | ptv | ) | [inline, inherited] |
Removes the indicated PointerToVoid as a weak reference to this object.
It must have previously been added via a call to weak_ref().
Definition at line 334 of file referenceCount.I.
References WeakReferenceList::clear_reference(), and ReferenceCount::has_weak_list().
void XFileDataObjectArray::write_data | ( | ostream & | out, |
int | indent_level, | ||
const char * | separator | ||
) | const [virtual] |
Writes a suitable representation of this node to an .x file in text mode.
Reimplemented from XFileDataObject.
Definition at line 54 of file xFileDataObjectArray.cxx.
References XFileDataObject::i(), and XFileDataObject::is_complex_object().