AGX Dynamics  2.37.2.0
agx::Container Class Reference

The Container is the base class for several of the container classes proided by AGX, such as agx::Vector and agx::HashSet. More...

#include <Container.h>

+ Inheritance diagram for agx::Container:

Public Types

enum  ClearPolicy { SHRINK_BUFFER, SHRINK_BUFFER_AVERAGED, MAINTAIN_BUFFER }
 agxData::Values from this enumeration is passed to the subclasses' 'clear' method in order to control what should become of the container's memory. More...
 

Public Member Functions

size_t capacity () const
 Returns the size of the memory are used by the container to store its elements. More...
 
bool empty () const
 
void * ptr ()
 
const void * ptr () const
 
size_t size () const
 

Protected Member Functions

 Container ()
 
 Container (Container &&other)
 
 Container (const Container &other)
 
 ~Container ()
 

Protected Attributes

void * m_buffer
 
size_t m_capacity
 
size_t m_size
 

Detailed Description

The Container is the base class for several of the container classes proided by AGX, such as agx::Vector and agx::HashSet.

Definition at line 34 of file Container.h.

Member Enumeration Documentation

◆ ClearPolicy

agxData::Values from this enumeration is passed to the subclasses' 'clear' method in order to control what should become of the container's memory.

Enumerator
SHRINK_BUFFER 

Buffer is deallocated and replaced by an newly allocated empty buffer.

SHRINK_BUFFER_AVERAGED 

Buffer is shrunk if a smoothing average (which is updated each clear call) goes below a threshold.

MAINTAIN_BUFFER 

Buffer is maintained (normal stl behavior).

Definition at line 42 of file Container.h.

Constructor & Destructor Documentation

◆ Container() [1/3]

agx::Container::Container ( )
protected

Definition at line 102 of file Container.h.

◆ Container() [2/3]

agx::Container::Container ( Container &&  other)
protected

Definition at line 111 of file Container.h.

References m_buffer, m_capacity, and m_size.

◆ Container() [3/3]

agx::Container::Container ( const Container &  other)
protected

Definition at line 103 of file Container.h.

References m_buffer, m_capacity, and m_size.

◆ ~Container()

agx::Container::~Container ( )
protected

Definition at line 127 of file Container.h.

References m_buffer, m_capacity, and m_size.

Member Function Documentation

◆ capacity()

size_t agx::Container::capacity ( ) const

Returns the size of the memory are used by the container to store its elements.

Some types of containers, e.g. the agx::Vector, will not do a reallocation until the size of the container reaches the capacity. However, this is not the case for e.g., agx::HashTable, which may perform a reallocation earlier.

Returns
The size of the allocated memory area, in number of elements.

Definition at line 135 of file Container.h.

References m_capacity.

Referenced by agx::Vector< WireContactConstraintRef >::operator=().

◆ empty()

bool agx::Container::empty ( ) const

◆ ptr() [1/2]

void * agx::Container::ptr ( )
Returns
Pointer to the container's memory area.

Definition at line 137 of file Container.h.

References m_buffer.

◆ ptr() [2/2]

const void * agx::Container::ptr ( ) const

Definition at line 138 of file Container.h.

References m_buffer.

◆ size()

size_t agx::Container::size ( ) const
Returns
The number of elements in the container.

Definition at line 134 of file Container.h.

References m_size.

Referenced by agxData::Array< JacobianElementT >::Array(), agx::HashVector< agx::UInt32, agx::ref_ptr< RenderProxy > >::back(), agx::SetVector< agx::ref_ptr< agxSDK::EventListener > >::back(), agx::MemoryPoolOld< T >::clear(), agxData::BufferT< T >::commit(), agxSDK::copyVectors(), agx::createMissingTiers(), agxCollide::Space::disableForContacts(), agxSDK::LinkedSegmentIterator< T >::end(), agxSDK::LinkedSegmentIterator< T >::findPrevIndex(), agx::ConstraintImplementation::findSecondaryConstraintGivenType(), agx::MemoryPoolOld< T >::garbageCollect(), agx::ConstraintImplementation::BodyView::getNumBodies(), agx::ConstraintImplementation::SolverBodyView::getPermutedBodyAt(), agxSDK::LinkedSegmentIterator< T >::isEnd(), agxPowerLine::ConnectionIterator< T >::isValid(), agxPowerLine::PhysicalDimensionIterator< UnitPtr >::isValid(), agx::Vector< WireContactConstraintRef >::operator!=(), agx::VectorPOD< agx::Vec6 >::operator!=(), agxSDK::LinkedSegmentIterator< T >::operator+(), agxPowerLine::PhysicalDimensionIterator< UnitPtr >::operator++(), agxSDK::LinkedSegmentIterator< T >::operator-(), agx::Vector< WireContactConstraintRef >::operator=(), agx::HashSetImplementation< CellPtr, HashFn< CellPtr >, ByteAllocator >::operator=(), agx::QuadraticProbingHashTableImplementation< SymmetricMaterialPair, agx::ContactMaterialRef, HashFn< SymmetricMaterialPair >, ByteAllocator >::operator=(), agx::VectorPOD< agx::Vec6 >::operator=(), agx::Vector< WireContactConstraintRef >::operator==(), agx::VectorPOD< agx::Vec6 >::operator==(), agx::HashVector< agx::UInt32, agx::ref_ptr< RenderProxy > >::operator[](), agx::SetVector< agx::ref_ptr< agxSDK::EventListener > >::operator[](), agxOSG::RenderStateManager::parseUniform(), agx::HashVector< agx::UInt32, agx::ref_ptr< RenderProxy > >::purge(), agx::SetVector< agx::ref_ptr< agxSDK::EventListener > >::purge(), agx::HashVector< agx::UInt32, agx::ref_ptr< RenderProxy > >::push_back(), agx::SetVector< agx::ref_ptr< agxSDK::EventListener > >::push_back(), agx::HashSetImplementation< CellPtr, HashFn< CellPtr >, ByteAllocator >::rebuild(), agx::QuadraticProbingHashTableImplementation< SymmetricMaterialPair, agx::ContactMaterialRef, HashFn< SymmetricMaterialPair >, ByteAllocator >::rebuild(), agxRender::HeightFieldProxy::setHeights(), agx::HashVector< agx::UInt32, agx::ref_ptr< RenderProxy > >::size(), agx::SetVector< agx::ref_ptr< agxSDK::EventListener > >::size(), agxVehicle::utils::splitNonconsecutive(), agxWire::transformPointToShape(), agxWire::transformPointToWorld(), agxWire::transformVectorToShape(), agxWire::transformVectorToWorld(), agxModel::triangleIterator(), agx::Event::trigger(), and agxStream::StoreObjects< T >::~StoreObjects().

Member Data Documentation

◆ m_buffer

◆ m_capacity

◆ m_size


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