Raytrix Light Field SDK  5.0
Rx::CRxArray2DBase< TValue > Class Template Referenceabstract

Detailed Description

template<class TValue>
class Rx::CRxArray2DBase< TValue >

2D Array base class.

Template Parameters
TValueVALUE.

Inherits Rx::Interop::Runtime30::IMemory2D.

Public Member Functions

 CRxArray2DBase ()
 Default constructor. Creates an empty 2D array. More...
 
 CRxArray2DBase (const CRxArray2DBase &xArray)
 Copy constructor. Creates a copy of the given 2D array. More...
 
 CRxArray2DBase (size_t nRows, size_t nColumns)
 Constructor. Creates a 2D array with the given number of rows and columns. More...
 
virtual ~CRxArray2DBase ()
 Destructor. More...
 
virtual void CopyFrom (const IMemory2DAccess *pMemory)
 
virtual void CopyFrom (const IMemory2DAccess *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 ()
 Gets the pointer to the internal data. More...
 
const TValue * GetDataPtr () const
 Gets the pointer to the internal data. More...
 
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 void * GetPointer ()
 Gets the pointer to the memory block. More...
 
virtual const void * GetPointer () const
 Gets the pointer to memory. More...
 
virtual void GetSize (size_t &nRows, size_t &nCols) const
 Gets the number of elements in the memory block. The total number of bytes allocated by the memory block is given by the nRows times nCols times the element size. 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 void New (size_t nRows, size_t nCols)
 Creates a new memory block of nRows times nCols elements. The size of an element is fixed by the implementation and can be read out with the function GetElementSize(). More...
 
TValue & operator() (size_t nRow, size_t nColumn)
 Get the element at the position described by the given row and column. More...
 
const TValue & operator() (size_t nRow, size_t nColumn) const
 Get the element at the position described by the given row and column. More...
 
CRxArray2DBaseoperator= (const CRxArray2DBase &xArray)
 Assignment operator. More...
 
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 nRows, size_t nCols)
 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

CRxMatrix< TValue > m_xMatrix
 The internal matrix. More...
 

Constructor & Destructor Documentation

◆ CRxArray2DBase() [1/3]

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

Default constructor. Creates an empty 2D array.

◆ CRxArray2DBase() [2/3]

template<class TValue >
Rx::CRxArray2DBase< TValue >::CRxArray2DBase ( size_t  nRows,
size_t  nColumns 
)
inline

Constructor. Creates a 2D array with the given number of rows and columns.

Parameters
nRowsThe number of rows.
nColumnsThe number of columns.

◆ CRxArray2DBase() [3/3]

template<class TValue >
Rx::CRxArray2DBase< TValue >::CRxArray2DBase ( const CRxArray2DBase< TValue > &  xArray)
inline

Copy constructor. Creates a copy of the given 2D array.

Parameters
xArrayThe array to copy.

◆ ~CRxArray2DBase()

template<class TValue >
virtual Rx::CRxArray2DBase< TValue >::~CRxArray2DBase ( )
inlinevirtual

Destructor.

Member Function Documentation

◆ CopyFrom() [1/2]

template<class TValue >
virtual void Rx::CRxArray2DBase< TValue >::CopyFrom ( const IMemory2DAccess *  pMemory)
inlinevirtual

◆ CopyFrom() [2/2]

virtual void Rx::Interop::Runtime30::IMemory2D::CopyFrom ( const IMemory2DAccess 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.

◆ Delete()

template<class TValue >
virtual void Rx::CRxArray2DBase< TValue >::Delete ( )
inlinevirtual

Deletes this memory block.

Implements Rx::Interop::Runtime30::IMemory2D.

◆ GetDataPtr() [1/2]

template<class TValue >
TValue* Rx::CRxArray2DBase< TValue >::GetDataPtr ( )
inline

Gets the pointer to the internal data.

Returns
The pointer.

◆ GetDataPtr() [2/2]

template<class TValue >
const TValue* Rx::CRxArray2DBase< TValue >::GetDataPtr ( ) const
inline

Gets the pointer to the internal data.

Returns
The pointer.

◆ GetElementSize()

template<class TValue >
virtual size_t Rx::CRxArray2DBase< 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::IMemory2DAccess.

◆ GetPointer() [1/2]

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

Gets the pointer to the memory block.

Returns
The pointer to memory.

Implements Rx::Interop::Runtime30::IMemory2D.

◆ GetPointer() [2/2]

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

Gets the pointer to memory.

Returns
The pointer to memory.

Implements Rx::Interop::Runtime30::IMemory2DAccess.

◆ GetSize()

template<class TValue >
virtual void Rx::CRxArray2DBase< TValue >::GetSize ( size_t &  nRows,
size_t &  nCols 
) const
inlinevirtual

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

Parameters
nRows[out] The number of rows.
nCols[out] The number of columns.

Implements Rx::Interop::Runtime30::IMemory2DAccess.

◆ IsValid()

template<class TValue >
virtual bool Rx::CRxArray2DBase< 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::IMemory2DAccess.

◆ New()

template<class TValue >
virtual void Rx::CRxArray2DBase< TValue >::New ( size_t  nRows,
size_t  nCols 
)
inlinevirtual

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

Parameters
nRowsThe amount of rows to allocate.
nColsThe amount of columns to allocate.

Implements Rx::Interop::Runtime30::IMemory2D.

◆ operator()() [1/2]

template<class TValue >
TValue& Rx::CRxArray2DBase< TValue >::operator() ( size_t  nRow,
size_t  nColumn 
)
inline

Get the element at the position described by the given row and column.

Parameters
nRowThe row.
nColumnThe column.
Returns
The element.

◆ operator()() [2/2]

template<class TValue >
const TValue& Rx::CRxArray2DBase< TValue >::operator() ( size_t  nRow,
size_t  nColumn 
) const
inline

Get the element at the position described by the given row and column.

Parameters
nRowThe row.
nColumnThe column.
Returns
The element.

◆ operator=()

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

Assignment operator.

Parameters
xArrayThe array to copy.
Returns
This array.

◆ Reset()

template<class TValue >
virtual void Rx::CRxArray2DBase< TValue >::Reset ( )
inlinevirtual

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::IMemory2D.

◆ Resize()

template<class TValue >
virtual void Rx::CRxArray2DBase< TValue >::Resize ( size_t  nRows,
size_t  nCols 
)
inlinevirtual

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
nRowsThe amount of rows to allocate.
nColsThe amount of columns to allocate.

Implements Rx::Interop::Runtime30::IMemory2D.

Member Data Documentation

◆ m_xMatrix

template<class TValue >
CRxMatrix<TValue> Rx::CRxArray2DBase< TValue >::m_xMatrix
protected

The internal matrix.