Raytrix Light Field SDK  v3.0
Logo
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Properties Events Groups Pages
Rx::CRxArrayBase< TValue > Class Template Referenceabstract

Detailed Description

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

Basic array operations.

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

Public Member Functions

 CRxArrayBase ()
 
 CRxArrayBase (size_t nElementCount)
 
 CRxArrayBase (size_t nElementCount, const TValue &dInitValue)
 Constructor. More...
 
 CRxArrayBase (const CRxArrayBase &xArray)
 
virtual ~CRxArrayBase ()
 
virtual void CopyFrom (const IMemoryAccess *pMemory)
 
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 Delete ()
 Deletes this memory block. More...
 
TValue * GetDataPtr ()
 
const TValue * GetDataPtr () const
 
virtual size_t GetElementSize () const
 Gets the element size. The memory block is made up of blocks of the given number of bytes. The function Length() returns the number of elements in the memory block, where each element is of the size given in GetElementSize(). For example, an array of 10 doubles has element size 8 and length 10. More...
 
virtual const void * GetPointer () const
 Gets the pointer to memory. More...
 
virtual void * GetPointer ()
 Gets the pointer to the memory block. More...
 
virtual bool IsValid () const
 Query if this object is valid. This function returns also true if the object itself is valid but the memory block has size zero. More...
 
virtual size_t Length () const
 Gets the number of elements in the memory block. The total number of bytes allocated by the memory block is given by the length times the element size. More...
 
virtual void New (size_t nElementCount)
 Creates a new memory block of nElementCount elements. The size of an element is fixed by the implementation and can be read out with the function GetElementSize(). More...
 
CRxArrayBaseoperator= (const CRxArrayBase &xArray)
 
TValue & operator[] (size_t nIdx)
 
const TValue & operator[] (size_t nIdx) const
 
virtual void Reset ()
 Reset all values in the memory block. The actual value the elements in the memory block are reset to depends on the implementation. More...
 
virtual void Resize (size_t nNewElementCount)
 Resizes the memory block to the given number of elements. The size of an element is fixed by the implementation and can be read out with the function GetElementSize(). More...
 

Protected Attributes

std::vector< TValue > m_vecData
 

Constructor & Destructor Documentation

template<class TValue >
Rx::CRxArrayBase< TValue >::CRxArrayBase ( )
template<class TValue >
Rx::CRxArrayBase< TValue >::CRxArrayBase ( size_t  nElementCount)
template<class TValue >
Rx::CRxArrayBase< TValue >::CRxArrayBase ( size_t  nElementCount,
const TValue &  dInitValue 
)

Constructor.

Parameters
uiLengthThe length of this double array.
dInitValueThis value is used to initialize every value in this array.
template<class TValue >
Rx::CRxArrayBase< TValue >::CRxArrayBase ( const CRxArrayBase< TValue > &  xArray)
template<class TValue >
virtual Rx::CRxArrayBase< TValue >::~CRxArrayBase ( )
virtual

Member Function Documentation

template<class TValue >
virtual void Rx::CRxArrayBase< TValue >::CopyFrom ( const IMemoryAccess *  pMemory)
virtual
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 >::Delete ( )
virtual

Deletes this memory block.

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

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

Gets the element size. The memory block is made up of blocks of the given number of bytes. The function Length() returns the number of elements in the memory block, where each element is of the size given in GetElementSize(). For example, an array of 10 doubles has element size 8 and length 10.

Returns
The element size in bytes.

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

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

Gets the pointer to memory.

Returns
The pointer to memory.

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

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

Gets the pointer to the memory block.

Returns
The pointer to memory.

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

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

Query if this object is valid. This function returns also true if the object itself is valid but the memory block has size zero.

Returns
True if valid, false if not.

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

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

Gets the number of elements in the memory block. The total number of bytes allocated by the memory block is given by the length times the element size.

Returns
The size in bytes.

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

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

Creates a new memory block of nElementCount elements. The size of an element is fixed by the implementation and can be read out with the function GetElementSize().

Parameters
nElementCountThe memory size in bytes.

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

template<class TValue >
CRxArrayBase& Rx::CRxArrayBase< TValue >::operator= ( const CRxArrayBase< TValue > &  xArray)
template<class TValue >
TValue& Rx::CRxArrayBase< TValue >::operator[] ( size_t  nIdx)
template<class TValue >
const TValue& Rx::CRxArrayBase< TValue >::operator[] ( size_t  nIdx) const
template<class TValue >
virtual void Rx::CRxArrayBase< TValue >::Reset ( )
virtual

Reset all values in the memory block. The actual value the elements in the memory block are reset to depends on the implementation.

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

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

Resizes the memory block to the given number of elements. The size of an element is fixed by the implementation and can be read out with the function GetElementSize().

Parameters
nNewElementCountThe new number of elements stored in the memory block.

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

Member Data Documentation

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