NPL
Neurological Programs and Libraries
npl::NDConstView< T > Class Template Reference

This is a basic accessor class, which allows for accessing array data in the type specified by the template. More...

#include <accessors.h>

Inherited by npl::LanczosInterpNDView< T >, npl::LinInterpNDView< T >, npl::NNInterpNDView< T >, and npl::Vector3DConstView< T >.

Public Member Functions

 NDConstView (std::shared_ptr< const NDArray > in)
 
 NDConstView ()
 
void setArray (ptr< const NDArray > in)
 
operator[] (int64_t index)
 Gets value linear position in array, then casts to T. More...
 
get (const std::vector< int64_t > &index)
 Gets value at array index and then casts to T. More...
 
get (size_t len, int64_t *index)
 Gets value at array index and then casts to T. More...
 
operator[] (const std::vector< int64_t > &index)
 Gets value at array index and then casts to T. More...
 
int64_t tlen ()
 

Static Protected Member Functions

template<typename U >
static T castgetStatic (void *ptr)
 This is a wrapper function that will be called to safely cast from the underlying type. More...
 

Protected Attributes

std::shared_ptr< const NDArrayparent
 Where to get the dat a from. Also the shared_ptr prevents dealloc. More...
 
T(* castget )(void *ptr)
 Function pointer to the correct function for casting from the underlying type. More...
 

Detailed Description

template<typename T>
class npl::NDConstView< T >

This is a basic accessor class, which allows for accessing array data in the type specified by the template.

Template Parameters
TValue to return on access

Definition at line 324 of file accessors.h.

Constructor & Destructor Documentation

template<typename T>
npl::NDConstView< T >::NDConstView ( std::shared_ptr< const NDArray in)
inline

Definition at line 327 of file accessors.h.

template<typename T>
npl::NDConstView< T >::NDConstView ( )
inline

Definition at line 332 of file accessors.h.

Member Function Documentation

template<typename T>
template<typename U >
static T npl::NDConstView< T >::castgetStatic ( void *  ptr)
inlinestaticprotected

This is a wrapper function that will be called to safely cast from the underlying type.

Template Parameters
UUnderlying type of pixel, figured out in the constructor
Parameters
ptrPointer to memory where the pixel is.
Returns
Correctly cast value

Definition at line 467 of file accessors.h.

template<typename T>
T npl::NDConstView< T >::get ( const std::vector< int64_t > &  index)
inline

Gets value at array index and then casts to T.

Parameters
indexn-d index to access
Returns
value

Definition at line 414 of file accessors.h.

template<typename T>
T npl::NDConstView< T >::get ( size_t  len,
int64_t *  index 
)
inline

Gets value at array index and then casts to T.

Parameters
lenlength of index array
indexn-d index to access
Returns
value

Definition at line 430 of file accessors.h.

template<typename T>
T npl::NDConstView< T >::operator[] ( int64_t  index)
inline

Gets value linear position in array, then casts to T.

Returns
value

Definition at line 399 of file accessors.h.

template<typename T>
T npl::NDConstView< T >::operator[] ( const std::vector< int64_t > &  index)
inline

Gets value at array index and then casts to T.

Parameters
indexn-d index to access
Returns
value

Definition at line 445 of file accessors.h.

template<typename T>
void npl::NDConstView< T >::setArray ( ptr< const NDArray in)
inline

Definition at line 334 of file accessors.h.

template<typename T>
int64_t npl::NDConstView< T >::tlen ( )
inline

Definition at line 453 of file accessors.h.

Member Data Documentation

template<typename T>
T(* npl::NDConstView< T >::castget) (void *ptr)
protected

Function pointer to the correct function for casting from the underlying type.

Parameters
ptrlocation in memory where the pixel is stored

Definition at line 483 of file accessors.h.

template<typename T>
std::shared_ptr<const NDArray> npl::NDConstView< T >::parent
protected

Where to get the dat a from. Also the shared_ptr prevents dealloc.

Definition at line 470 of file accessors.h.


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