Panda3D
Public Types | Public Member Functions | List of all members
ReferenceCountedVector< Element > Class Template Reference

This defines the object that is actually stored and reference-counted internally by a PointerToArray. More...

#include "pointerToArrayBase.h"

Inheritance diagram for ReferenceCountedVector< Element >:
NodeReferenceCount pvector< Element > ReferenceCount MemoryBase

Public Types

typedef pvector< Element >::iterator iterator
 
typedef pvector< Element >::size_type size_type
 
- Public Types inherited from pvector< Element >
typedef pallocator_array< Element > allocator
 
typedef vector< Element, allocatorbase_class
 
typedef base_class::size_type size_type
 

Public Member Functions

 ReferenceCountedVector (TypeHandle type_handle)
 
 ReferenceCountedVector (const ReferenceCountedVector< Element > &copy)
 
 ReferenceCountedVector (size_type initial_size, TypeHandle type_handle)
 
void clear ()
 
void erase (iterator position)
 
void erase (iterator first, iterator last)
 
iterator insert (iterator position, const Element &x)
 
void insert (iterator position, size_type n, const Element &x)
 
void pop_back ()
 
size_type size () const
 
- Public Member Functions inherited from NodeReferenceCount
int get_node_ref_count () const
 Returns the current reference count. More...
 
void node_ref () const
 Explicitly increments the node reference count and the normal reference count simultaneously. More...
 
bool node_unref () const
 Explicitly decrements the node reference count and the normal reference count simultaneously. More...
 
bool test_ref_count_integrity () const
 Does some easy checks to make sure that the reference count isn't completely bogus. More...
 
- Public Member Functions inherited from ReferenceCount
int get_ref_count () const
 Returns the current reference count. More...
 
WeakReferenceListget_weak_list () const
 Returns the WeakReferenceList associated with this ReferenceCount object. More...
 
bool has_weak_list () const
 Returns true if this particular ReferenceCount object has a WeakReferenceList created, false otherwise. More...
 
void local_object ()
 This function should be called, once, immediately after creating a new instance of some ReferenceCount-derived object on the stack. More...
 
void ref () const
 Explicitly increments the reference count. More...
 
bool test_ref_count_integrity () const
 Does some easy checks to make sure that the reference count isn't completely bogus. More...
 
bool test_ref_count_nonzero () const
 Does some easy checks to make sure that the reference count isn't zero, or completely bogus. More...
 
virtual bool unref () const
 Explicitly decrements the reference count. More...
 
void weak_ref (WeakPointerToVoid *ptv)
 Adds the indicated PointerToVoid as a weak reference to this object. More...
 
void weak_unref (WeakPointerToVoid *ptv)
 Removes the indicated PointerToVoid as a weak reference to this object. More...
 
- Public Member Functions inherited from pvector< Element >
 pvector (TypeHandle type_handle=pvector_type_handle)
 
 pvector (const pvector< Element > &copy)
 
 pvector (size_type n, TypeHandle type_handle=pvector_type_handle)
 
 pvector (size_type n, const Element &value, TypeHandle type_handle=pvector_type_handle)
 
 pvector (const Element *begin, const Element *end, TypeHandle type_handle=pvector_type_handle)
 

Additional Inherited Members

- Static Public Member Functions inherited from NodeReferenceCount
static TypeHandle get_class_type ()
 
static void init_type ()
 
- Static Public Member Functions inherited from ReferenceCount
static TypeHandle get_class_type ()
 
static void init_type ()
 

Detailed Description

template<class Element>
class ReferenceCountedVector< Element >

This defines the object that is actually stored and reference-counted internally by a PointerToArray.

It is basically a NodeReferenceCount-capable STL vector.

We use NodeReferenceCount (instead of just ReferenceCount), which adds node_ref() and node_unref() to the standard ref() and unref(). This is particularly useful for GeomVertexArrayData; other classes may or may not find this additional counter useful, but since it adds relatively little overhead (compared with what is presumably a largish array), we go ahead and add it here, even though it is inherited by many different parts of the system that may not use it.

Definition at line 43 of file pointerToArrayBase.h.


The documentation for this class was generated from the following files: