AGX Dynamics  2.35.0.1
agx::RowAllocator< T > Class Template Reference

Class to allocate an array of elements where some other structure works on pointer. More...

#include <MLCP.h>

Public Member Functions

 RowAllocator ()
 Constructor. More...
 
 ~RowAllocator ()
 
void allocate ()
 
void allocate (size_t size)
 Allocate buffer of given size. More...
 
void allocate (size_t size, int val)
 Allocate a buffer of given size with initial value val. More...
 
size_t & count ()
 
void deallocate ()
 Deallocates the buffer and resets internal parameters. More...
 
T * get (size_t numElements)
 

Detailed Description

template<typename T>
class agx::RowAllocator< T >

Class to allocate an array of elements where some other structure works on pointer.

Suitable for solvers.

Definition at line 44 of file MLCP.h.

Constructor & Destructor Documentation

◆ RowAllocator()

template<typename T >
agx::RowAllocator< T >::RowAllocator ( )
inline

Constructor.

Definition at line 48 of file MLCP.h.

◆ ~RowAllocator()

template<typename T >
agx::RowAllocator< T >::~RowAllocator ( )
inline

Definition at line 50 of file MLCP.h.

References agx::RowAllocator< T >::deallocate().

Member Function Documentation

◆ allocate() [1/3]

template<typename T >
void agx::RowAllocator< T >::allocate ( )
inline

Definition at line 84 of file MLCP.h.

Referenced by agx::RowAllocator< T >::allocate().

◆ allocate() [2/3]

template<typename T >
void agx::RowAllocator< T >::allocate ( size_t  size)
inline

Allocate buffer of given size.

The elements are not initialized.

Parameters
size- size of the buffer

Definition at line 68 of file MLCP.h.

References agxAssert, agx::RowAllocator< T >::deallocate(), and m_size.

◆ allocate() [3/3]

template<typename T >
void agx::RowAllocator< T >::allocate ( size_t  size,
int  val 
)
inline

Allocate a buffer of given size with initial value val.

Parameters
size- size of the buffer
val- initial value to all elements (integer)

Definition at line 57 of file MLCP.h.

References agx::RowAllocator< T >::allocate().

◆ count()

template<typename T >
size_t& agx::RowAllocator< T >::count ( )
inline

Definition at line 111 of file MLCP.h.

◆ deallocate()

template<typename T >
void agx::RowAllocator< T >::deallocate ( )
inline

Deallocates the buffer and resets internal parameters.

Definition at line 92 of file MLCP.h.

Referenced by agx::RowAllocator< T >::~RowAllocator(), and agx::RowAllocator< T >::allocate().

◆ get()

template<typename T >
T* agx::RowAllocator< T >::get ( size_t  numElements)
inline

Definition at line 102 of file MLCP.h.

References agxAssert.


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