Panda3D
|
Similar to PointerToArray, except that its contents may not be modified. More...
#include "pointerToArray.h"
Public Types | |
typedef pvector< Element > ::const_iterator | const_iterator |
typedef pvector< Element > ::const_reference | const_reference |
typedef pvector< Element > ::const_reverse_iterator | const_reverse_iterator |
typedef pvector< Element > ::difference_type | difference_type |
typedef pvector< Element > ::const_iterator | iterator |
typedef pvector< Element > ::const_reference | reference |
typedef pvector< Element > ::const_reverse_iterator | reverse_iterator |
typedef pvector< Element > ::size_type | size_type |
typedef PointerToArrayBase < Element >::To | To |
typedef pvector< Element > ::value_type | value_type |
Public Member Functions | |
ConstPointerToArray (TypeHandle type_handle=get_type_handle(Element)) | |
ConstPointerToArray (const PointerToArray< Element > ©) | |
ConstPointerToArray (const ConstPointerToArray< Element > ©) | |
const Element & | __getitem__ (size_type n) const |
Same as get_element(), this returns the nth element of the array. | |
reference | back () const |
iterator | begin () const |
size_type | capacity () const |
PointerToArray< Element > | cast_non_const () const |
Casts away the constness of the CPTA(Element), and returns an equivalent PTA(Element). | |
void | clear () |
To empty the PTA, use the clear() method, since assignment to NULL is problematic (given the ambiguity of the pointer type of NULL). | |
bool | empty () const |
iterator | end () const |
reference | front () const |
string | get_data () const |
This method exists mainly to access the data of the array easily from a high-level language such as Python. | |
const Element & | get_element (size_type n) const |
This method exists mainly to access the elements of the array easily from a high-level language such as Python, especially on Windows, where the above index element accessor methods can't be defined because of a confusion with the pointer typecast operator. | |
int | get_node_ref_count () const |
Returns the node_ref of the underlying vector. | |
int | get_ref_count () const |
Returns the reference count of the underlying vector. | |
string | get_subdata (size_type n, size_type count) const |
This method exists mainly to access the data of the array easily from a high-level language such as Python. | |
size_type | max_size () const |
void | node_ref () const |
Increments the node_ref of the underlying vector. | |
bool | node_unref () const |
Decrements the node_ref of the underlying vector. | |
operator const Element * () const | |
The pointer typecast operator is convenient for maintaining the fiction that we actually have a C-style array. | |
ConstPointerToArray< Element > & | operator= (const ConstPointerToArray< Element > ©) |
ConstPointerToArray< Element > & | operator= (ReferenceCountedVector< Element > *ptr) |
ConstPointerToArray< Element > & | operator= (const PointerToArray< Element > ©) |
reference | operator[] (int n) const |
reference | operator[] (size_type n) const |
const Element * | p () const |
Function p() is similar to the function from ConstPointerTo. | |
ConstPointerToArray< Element > ::reverse_iterator | rbegin () const |
ConstPointerToArray< Element > ::reverse_iterator | rend () const |
size_type | size () const |
const pvector< Element > & | v () const |
To access the vector itself, for more direct fiddling with some of the vector's esoteric functionality. | |
const ReferenceCountedVector < Element > * | v0 () const |
To access the internal ReferenceCountedVector object, for very low-level fiddling. | |
Friends | |
class | PointerToArray< Element > |
Similar to PointerToArray, except that its contents may not be modified.
Definition at line 259 of file pointerToArray.h.
const Element & ConstPointerToArray< Element >::__getitem__ | ( | size_type | n | ) | const [inline] |
Same as get_element(), this returns the nth element of the array.
Definition at line 1074 of file pointerToArray.I.
PointerToArray< Element > ConstPointerToArray< Element >::cast_non_const | ( | ) | const [inline] |
Casts away the constness of the CPTA(Element), and returns an equivalent PTA(Element).
Definition at line 1045 of file pointerToArray.I.
Referenced by Texture::do_set_ram_image().
void ConstPointerToArray< Element >::clear | ( | ) | [inline] |
To empty the PTA, use the clear() method, since assignment to NULL is problematic (given the ambiguity of the pointer type of NULL).
Reimplemented from PointerToBase< ReferenceCountedVector< Element > >.
Definition at line 1209 of file pointerToArray.I.
string ConstPointerToArray< Element >::get_data | ( | ) | const [inline] |
This method exists mainly to access the data of the array easily from a high-level language such as Python.
It returns the entire contents of the vector as a block of raw data in a string.
Definition at line 1090 of file pointerToArray.I.
References PointerToArray< Element >::get_subdata().
const Element & ConstPointerToArray< Element >::get_element | ( | size_type | n | ) | const [inline] |
This method exists mainly to access the elements of the array easily from a high-level language such as Python, especially on Windows, where the above index element accessor methods can't be defined because of a confusion with the pointer typecast operator.
Definition at line 1062 of file pointerToArray.I.
int ConstPointerToArray< Element >::get_node_ref_count | ( | ) | const [inline] |
Returns the node_ref of the underlying vector.
Definition at line 1132 of file pointerToArray.I.
References PointerToArray< Element >::get_node_ref_count().
int ConstPointerToArray< Element >::get_ref_count | ( | ) | const [inline] |
Returns the reference count of the underlying vector.
Definition at line 1121 of file pointerToArray.I.
References PointerToArray< Element >::get_ref_count().
string ConstPointerToArray< Element >::get_subdata | ( | size_type | n, |
size_type | count | ||
) | const [inline] |
This method exists mainly to access the data of the array easily from a high-level language such as Python.
It returns the contents of a portion of the vector--from element (n) through element (n + count - 1)--as a block of raw data in a string.
Definition at line 1107 of file pointerToArray.I.
References PointerToArray< Element >::p().
void ConstPointerToArray< Element >::node_ref | ( | ) | const [inline] |
Increments the node_ref of the underlying vector.
Definition at line 1143 of file pointerToArray.I.
References PointerToArray< Element >::node_ref().
bool ConstPointerToArray< Element >::node_unref | ( | ) | const [inline] |
Decrements the node_ref of the underlying vector.
Definition at line 1157 of file pointerToArray.I.
ConstPointerToArray< Element >::operator const Element * | ( | ) | const [inline] |
The pointer typecast operator is convenient for maintaining the fiction that we actually have a C-style array.
It returns the address of the first element in the array, unless the pointer is unassigned, in which case it returns NULL.
Definition at line 991 of file pointerToArray.I.
const Element * ConstPointerToArray< Element >::p | ( | ) | const [inline] |
Function p() is similar to the function from ConstPointerTo.
It does the same thing: it returns the same thing as the typecast operator, above.
Definition at line 1005 of file pointerToArray.I.
Referenced by WebBrowserTexture::cull_callback(), and TexturePeeker::lookup().
const pvector< Element > & ConstPointerToArray< Element >::v | ( | ) | const [inline] |
To access the vector itself, for more direct fiddling with some of the vector's esoteric functionality.
Definition at line 1018 of file pointerToArray.I.
Referenced by Datagram::copy_array().
const ReferenceCountedVector< Element > * ConstPointerToArray< Element >::v0 | ( | ) | const [inline] |
To access the internal ReferenceCountedVector object, for very low-level fiddling.
Know what you are doing!
Definition at line 1033 of file pointerToArray.I.