Raytrix Light Field SDK  4.0
Logo
Public Member Functions | Protected Attributes | List of all members
Rx::CRxArrayBase< TValue > Class Template Referenceabstract

Detailed Description

template<class TValue>
class Rx::CRxArrayBase< TValue >

Basic array operations.

Template Parameters
TValueVALUE.

Inherits Rx::Interop::Runtime30::IMemory.

Public Member Functions

 CRxArrayBase ()
 Default constructor. Creates an empty array. More...
 
 CRxArrayBase (size_t nElementCount)
 Constructor. Creates a new array with the given number of uninitialized elements. More...
 
 CRxArrayBase (size_t nElementCount, const TValue &tInitValue)
 Constructor. Creates a new array with the given number of initialized elements. More...
 
 CRxArrayBase (const CRxArrayBase &xArray)
 Copy constructor. Creates a copy of the given array. More...
 
virtual ~CRxArrayBase ()
 Destructor. Removes all elements from this array. More...
 
virtual void CopyFrom (const IMemoryAccess *pMemory)=0
 Copies the memory block described by pMemory into this memory block. This memory block is automatically resized. The function throws an exception if the element sizes of the given memory block does not agree with the element size of this memory block. More...
 
virtual void CopyFrom (const IMemoryAccess *pxSrcMemory)
 Copies the content of the given source memory into this array. Sets the size of this array to the size of the memory. More...
 
virtual void Delete ()
 Clears the array. More...
 
virtual size_t GetElementSize () const
 Gets the size of a single value in this array. More...
 
virtual const void * GetPointer () const
 Gets the pointer to the internal data. More...
 
virtual void * GetPointer ()
 Gets the pointer to the internal data. More...
 
virtual bool IsValid () const
 Query if this object is valid. Returns always true. More...
 
virtual size_t Length () const
 Gets the number of elements in this array. More...
 
virtual void New (size_t nElementCount)
 Set the size of this array to the given number of elements. More...
 
CRxArrayBaseoperator= (const CRxArrayBase &xArray)
 Assignment operator. More...
 
TValue & operator[] (size_t nIdx)
 Array indexer operator. More...
 
const TValue & operator[] (size_t nIdx) const
 Array indexer operator. More...
 
virtual void Reset ()
 Sets the internal memory to zeros. More...
 
virtual void Resize (size_t nElementCount)
 Set the size of this array to the given number of elements. More...
 

Protected Attributes

std::vector< TValue > m_vtData
 The internal vector that holds all data. More...
 

Constructor & Destructor Documentation

template<class TValue>
Rx::CRxArrayBase< TValue >::CRxArrayBase ( )
inline

Default constructor. Creates an empty array.

template<class TValue>
Rx::CRxArrayBase< TValue >::CRxArrayBase ( size_t  nElementCount)
inline

Constructor. Creates a new array with the given number of uninitialized elements.

Parameters
nElementCountThe number of elements.
template<class TValue>
Rx::CRxArrayBase< TValue >::CRxArrayBase ( size_t  nElementCount,
const TValue &  tInitValue 
)
inline

Constructor. Creates a new array with the given number of initialized elements.

Parameters
nElementCountThe number of elements.
tInitValueThe initial value of each element in this array.
template<class TValue>
Rx::CRxArrayBase< TValue >::CRxArrayBase ( const CRxArrayBase< TValue > &  xArray)
inline

Copy constructor. Creates a copy of the given array.

Parameters
xArrayThe array to copy.
template<class TValue>
virtual Rx::CRxArrayBase< TValue >::~CRxArrayBase ( )
inlinevirtual

Destructor. Removes all elements from this array.

Member Function Documentation

virtual void Rx::Interop::Runtime30::IMemory::CopyFrom ( const IMemoryAccess pMemory)
pure virtualinherited

Copies the memory block described by pMemory into this memory block. This memory block is automatically resized. The function throws an exception if the element sizes of the given memory block does not agree with the element size of this memory block.

Parameters
pMemory[in] The memory to copy into this memory block.
template<class TValue>
virtual void Rx::CRxArrayBase< TValue >::CopyFrom ( const IMemoryAccess *  pxSrcMemory)
inlinevirtual

Copies the content of the given source memory into this array. Sets the size of this array to the size of the memory.

Parameters
pxSrcMemoryThe source memory.
template<class TValue>
virtual void Rx::CRxArrayBase< TValue >::Delete ( )
inlinevirtual

Clears the array.

Implements Rx::Interop::Runtime30::IMemory.

template<class TValue>
virtual size_t Rx::CRxArrayBase< TValue >::GetElementSize ( ) const
inlinevirtual

Gets the size of a single value in this array.

Returns
The element size.

Implements Rx::Interop::Runtime30::IMemoryAccess.

template<class TValue>
virtual const void* Rx::CRxArrayBase< TValue >::GetPointer ( ) const
inlinevirtual

Gets the pointer to the internal data.

Returns
The pointer.

Implements Rx::Interop::Runtime30::IMemoryAccess.

template<class TValue>
virtual void* Rx::CRxArrayBase< TValue >::GetPointer ( )
inlinevirtual

Gets the pointer to the internal data.

Returns
The pointer.

Implements Rx::Interop::Runtime30::IMemory.

template<class TValue>
virtual bool Rx::CRxArrayBase< TValue >::IsValid ( ) const
inlinevirtual

Query if this object is valid. Returns always true.

Returns
True if valid, false if not.

Implements Rx::Interop::Runtime30::IMemoryAccess.

template<class TValue>
virtual size_t Rx::CRxArrayBase< TValue >::Length ( ) const
inlinevirtual

Gets the number of elements in this array.

Returns
The length.

Implements Rx::Interop::Runtime30::IMemoryAccess.

template<class TValue>
virtual void Rx::CRxArrayBase< TValue >::New ( size_t  nElementCount)
inlinevirtual

Set the size of this array to the given number of elements.

Parameters
nElementCountNumber of elements.

Implements Rx::Interop::Runtime30::IMemory.

template<class TValue>
CRxArrayBase& Rx::CRxArrayBase< TValue >::operator= ( const CRxArrayBase< TValue > &  xArray)
inline

Assignment operator.

Parameters
xArrayThe array to copy.
Returns
This array.
template<class TValue>
TValue& Rx::CRxArrayBase< TValue >::operator[] ( size_t  nIdx)
inline

Array indexer operator.

Parameters
nIdxThe index.
Returns
The indexed value.
template<class TValue>
const TValue& Rx::CRxArrayBase< TValue >::operator[] ( size_t  nIdx) const
inline

Array indexer operator.

Parameters
nIdxThe index.
Returns
The indexed value.
template<class TValue>
virtual void Rx::CRxArrayBase< TValue >::Reset ( )
inlinevirtual

Sets the internal memory to zeros.

Implements Rx::Interop::Runtime30::IMemory.

template<class TValue>
virtual void Rx::CRxArrayBase< TValue >::Resize ( size_t  nElementCount)
inlinevirtual

Set the size of this array to the given number of elements.

Parameters
nElementCountNumber of elements.

Implements Rx::Interop::Runtime30::IMemory.

Member Data Documentation

template<class TValue>
std::vector<TValue> Rx::CRxArrayBase< TValue >::m_vtData
protected

The internal vector that holds all data.