libpniio
Public Types | Public Member Functions | Private Attributes
pni::io::nx::read_visitor< ATYPE, GTYPE, FTYPE, ATTYPE, LTYPE > Class Template Reference

read visitor More...

#include <read.hpp>

Inheritance diagram for pni::io::nx::read_visitor< ATYPE, GTYPE, FTYPE, ATTYPE, LTYPE >:
Inheritance graph
[legend]
Collaboration diagram for pni::io::nx::read_visitor< ATYPE, GTYPE, FTYPE, ATTYPE, LTYPE >:
Collaboration graph
[legend]

Public Types

typedef std::vector
< pni::core::slice > 
selection_t
 selection type for partial IO More...
 
using result_type = void
 result type More...
 
using group_type = GTYPE
 Nexus group type. More...
 
using field_type = FTYPE
 Nexus field type. More...
 
using attribute_type = ATTYPE
 Nexus attribute type. More...
 
using link_type = LTYPE
 NeXus link type. More...
 

Public Member Functions

 read_visitor (ATYPE &data, const selection_t &s=selection_t())
 constructor More...
 
result_type operator() (const group_type &) const
 process group instances More...
 
result_type operator() (const field_type &f) const
 process field instances More...
 
result_type operator() (const attribute_type &a) const
 process attribute instances More...
 
result_type operator() (const link_type &) const
 process link instances More...
 

Private Attributes

ATYPE & _data
 reference to the data holding object More...
 
selection_t _selection
 selection vector More...
 

Detailed Description

template<typename ATYPE, typename GTYPE, typename FTYPE, typename ATTYPE, typename LTYPE>
class pni::io::nx::read_visitor< ATYPE, GTYPE, FTYPE, ATTYPE, LTYPE >

Template Parameters
ATYPEtarget array type
GTYPEgroup type
FTYPEfield_type
ATTYPEattribute type

Member Typedef Documentation

template<typename ATYPE , typename GTYPE , typename FTYPE , typename ATTYPE , typename LTYPE >
using pni::io::nx::read_visitor< ATYPE, GTYPE, FTYPE, ATTYPE, LTYPE >::attribute_type = ATTYPE
template<typename ATYPE , typename GTYPE , typename FTYPE , typename ATTYPE , typename LTYPE >
using pni::io::nx::read_visitor< ATYPE, GTYPE, FTYPE, ATTYPE, LTYPE >::field_type = FTYPE
template<typename ATYPE , typename GTYPE , typename FTYPE , typename ATTYPE , typename LTYPE >
using pni::io::nx::read_visitor< ATYPE, GTYPE, FTYPE, ATTYPE, LTYPE >::group_type = GTYPE
template<typename ATYPE , typename GTYPE , typename FTYPE , typename ATTYPE , typename LTYPE >
using pni::io::nx::read_visitor< ATYPE, GTYPE, FTYPE, ATTYPE, LTYPE >::link_type = LTYPE
template<typename ATYPE , typename GTYPE , typename FTYPE , typename ATTYPE , typename LTYPE >
using pni::io::nx::read_visitor< ATYPE, GTYPE, FTYPE, ATTYPE, LTYPE >::result_type = void
template<typename ATYPE , typename GTYPE , typename FTYPE , typename ATTYPE , typename LTYPE >
typedef std::vector<pni::core::slice> pni::io::nx::read_visitor< ATYPE, GTYPE, FTYPE, ATTYPE, LTYPE >::selection_t

Constructor & Destructor Documentation

template<typename ATYPE , typename GTYPE , typename FTYPE , typename ATTYPE , typename LTYPE >
pni::io::nx::read_visitor< ATYPE, GTYPE, FTYPE, ATTYPE, LTYPE >::read_visitor ( ATYPE &  data,
const selection_t s = selection_t() 
)
inline
Parameters
datareference to the data holding instance
sselection of what to read

Member Function Documentation

template<typename ATYPE , typename GTYPE , typename FTYPE , typename ATTYPE , typename LTYPE >
result_type pni::io::nx::read_visitor< ATYPE, GTYPE, FTYPE, ATTYPE, LTYPE >::operator() ( const group_type ) const
inline

Cannot read data to a group - thus an exception is thrown.

Exceptions
nxgroup_error
Parameters
ggroup instance
Returns
nothing
template<typename ATYPE , typename GTYPE , typename FTYPE , typename ATTYPE , typename LTYPE >
result_type pni::io::nx::read_visitor< ATYPE, GTYPE, FTYPE, ATTYPE, LTYPE >::operator() ( const field_type f) const
inline

Read data from a field

Exceptions
shape_mismatch_errorif selection and field rank do not match
invalid_object_errorif the field is not valid
io_errorif reading the data fails
type_errorif the data type of ATYPE is not supported
memory_not_allocated_errorif ATYPE is an array type and its internal buffer has no memory associated with it
size_mismatch_errorif the number of elements of ATYPE and the field do not match
object_errorin case of any other error
Parameters
ffield instance
Returns
nothing
template<typename ATYPE , typename GTYPE , typename FTYPE , typename ATTYPE , typename LTYPE >
result_type pni::io::nx::read_visitor< ATYPE, GTYPE, FTYPE, ATTYPE, LTYPE >::operator() ( const attribute_type a) const
inline

Read data from an attribute. If the selection member is not empty an exception will be thrown as partial IO is not supported on attributes.

Exceptions
invalid_object_errorif the field is not valid
io_errorif reading the data fails
type_errorif the data type of ATYPE is not supported
memory_not_allocated_errorif ATYPE is an array type and its internal buffer has no memory associated with it
size_mismatch_errorif the number of elements of ATYPE and the field do not match
object_errorin case of any other error
Parameters
aattribute instance
Returns
nothing
template<typename ATYPE , typename GTYPE , typename FTYPE , typename ATTYPE , typename LTYPE >
result_type pni::io::nx::read_visitor< ATYPE, GTYPE, FTYPE, ATTYPE, LTYPE >::operator() ( const link_type ) const
inline

Cannot read data from a link - thus an exception is thrown.

Exceptions
type_error- in all cases
Parameters
ggroup instance
Returns
nothing

Field Documentation

template<typename ATYPE , typename GTYPE , typename FTYPE , typename ATTYPE , typename LTYPE >
ATYPE& pni::io::nx::read_visitor< ATYPE, GTYPE, FTYPE, ATTYPE, LTYPE >::_data
private
template<typename ATYPE , typename GTYPE , typename FTYPE , typename ATTYPE , typename LTYPE >
selection_t pni::io::nx::read_visitor< ATYPE, GTYPE, FTYPE, ATTYPE, LTYPE >::_selection
private

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