Panda3D
Loading...
Searching...
No Matches
Public Member Functions | Friends | List of all members
VertexDataBlock Class Reference

A block of bytes that stores the actual raw vertex data referenced by a GeomVertexArrayData object. More...

#include "vertexDataBlock.h"

Inheritance diagram for VertexDataBlock:
SimpleAllocatorBlock ReferenceCount LinkedListNode MemoryBase

Public Member Functions

VertexDataBlockget_next_block () const
 Returns a pointer to the next allocated block in the chain, or NULL if there are no more allocated blocks.
 
VertexDataPageget_page () const
 Returns the page from which this buffer was allocated.
 
unsigned char * get_pointer (bool force) const
 Returns a pointer to the start of the allocated memory for this buffer, or NULL if the data is not currently resident.
 
- Public Member Functions inherited from SimpleAllocatorBlock
 SimpleAllocatorBlock (const SimpleAllocatorBlock &copy)=delete
 
 SimpleAllocatorBlock (SimpleAllocatorBlock &&from)
 Transfers ownership from the given SimpleAllocatorBlock to this one.
 
 ~SimpleAllocatorBlock ()
 The block automatically frees itself when it destructs.
 
void free ()
 Releases the allocated space.
 
SimpleAllocatorget_allocator () const
 Returns the SimpleAllocator object that owns this block.
 
size_t get_max_size () const
 Returns the maximum size this block can be reallocated to, as limited by the following block.
 
SimpleAllocatorBlockget_next_block () const
 Returns a pointer to the next allocated block in the chain, or NULL if there are no more allocated blocks.
 
size_t get_size () const
 Returns the size of this block.
 
size_t get_start () const
 Returns the starting point of this block.
 
bool is_free () const
 Returns true if the block has been freed, false if it is still valid.
 
SimpleAllocatorBlockoperator= (const SimpleAllocatorBlock &copy)=delete
 
SimpleAllocatorBlockoperator= (SimpleAllocatorBlock &&from)
 Frees this block and instead takes ownership of the given other block.
 
void output (std::ostream &out) const
 
bool realloc (size_t size)
 Changes the size of this block to the specified size.
 
- Public Member Functions inherited from ReferenceCount
int get_ref_count () const
 
WeakReferenceListget_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.
 
void local_object ()
 This function should be called, once, immediately after creating a new instance of some ReferenceCount-derived object on the stack.
 
void ref () const
 Explicitly increments the reference count.
 
bool ref_if_nonzero () const
 Atomically increases the reference count of this object if it is not zero.
 
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.
 
bool unref_if_one () const
 Atomically decreases the reference count of this object if it is one.
 
WeakReferenceListweak_ref ()
 Adds the indicated PointerToVoid as a weak reference to this object.
 
void weak_unref ()
 Removes the indicated PointerToVoid as a weak reference to this object.
 
- Public Member Functions inherited from MemoryBase
void operator delete (void *, void *)
 
void operator delete (void *ptr)
 
void operator delete[] (void *, void *)
 
void operator delete[] (void *ptr)
 
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)
 

Friends

class VertexDataPage
 

Additional Inherited Members

- Static Public Member Functions inherited from ReferenceCount
static TypeHandle get_class_type ()
 
static void init_type ()
 
- Public Attributes inherited from ReferenceCount
 get_ref_count
 Returns the current reference count.
 

Detailed Description

A block of bytes that stores the actual raw vertex data referenced by a GeomVertexArrayData object.

Definition at line 29 of file vertexDataBlock.h.

Member Function Documentation

◆ get_next_block()

VertexDataBlock * VertexDataBlock::get_next_block ( ) const
inline

Returns a pointer to the next allocated block in the chain, or NULL if there are no more allocated blocks.

Definition at line 54 of file vertexDataBlock.I.

References SimpleAllocatorBlock::get_next_block().

◆ get_page()

VertexDataPage * VertexDataBlock::get_page ( ) const
inline

Returns the page from which this buffer was allocated.

Definition at line 26 of file vertexDataBlock.I.

References SimpleAllocatorBlock::get_allocator().

Referenced by get_pointer().

◆ get_pointer()

unsigned char * VertexDataBlock::get_pointer ( bool force) const
inline

Returns a pointer to the start of the allocated memory for this buffer, or NULL if the data is not currently resident.

If the data is not currently resident, this will implicitly request it to become resident soon.

If force is true, this method will never return NULL, but may block until the data is available.

Definition at line 39 of file vertexDataBlock.I.

References get_page(), VertexDataPage::get_page_data(), and SimpleAllocatorBlock::get_start().

Friends And Related Symbol Documentation

◆ VertexDataPage

friend class VertexDataPage
friend

Definition at line 41 of file vertexDataBlock.h.


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