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

write visitor More...

#include <write.hpp>

Inheritance diagram for pni::io::nx::write_visitor< ATYPE, GTYPE, FTYPE, AATYPE, LTYPE >:
Inheritance graph
[legend]
Collaboration diagram for pni::io::nx::write_visitor< ATYPE, GTYPE, FTYPE, AATYPE, 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 = AATYPE
 Nexus attribute type. More...
 
using link_type = LTYPE
 Nexus link type. More...
 

Public Member Functions

 write_visitor (const 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

const 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 AATYPE, typename LTYPE>
class pni::io::nx::write_visitor< ATYPE, GTYPE, FTYPE, AATYPE, LTYPE >

Template Parameters
ATYPEsource type
GTYPEgroup type
FTYPEfield type
AATYPEattribute type
LTYPElink type
See also
write

Member Typedef Documentation

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

Constructor & Destructor Documentation

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

Member Function Documentation

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

Cannot write 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 AATYPE , typename LTYPE >
result_type pni::io::nx::write_visitor< ATYPE, GTYPE, FTYPE, AATYPE, LTYPE >::operator() ( const field_type f) const
inline

Write data to a field

Exceptions
shape_mismatch_errorif selection and field rank do not match
invalid_object_errorif the field is not valid
io_errorif writing 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 AATYPE , typename LTYPE >
result_type pni::io::nx::write_visitor< ATYPE, GTYPE, FTYPE, AATYPE, LTYPE >::operator() ( const attribute_type a) const
inline

Write data to 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 or the selection is not empty
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 AATYPE , typename LTYPE >
result_type pni::io::nx::write_visitor< ATYPE, GTYPE, FTYPE, AATYPE, LTYPE >::operator() ( const link_type ) const
inline

Cannot write data to a link - thus an exception is thrown.

Exceptions
type_error

Field Documentation

template<typename ATYPE , typename GTYPE , typename FTYPE , typename AATYPE , typename LTYPE >
const ATYPE& pni::io::nx::write_visitor< ATYPE, GTYPE, FTYPE, AATYPE, LTYPE >::_data
private
template<typename ATYPE , typename GTYPE , typename FTYPE , typename AATYPE , typename LTYPE >
selection_t pni::io::nx::write_visitor< ATYPE, GTYPE, FTYPE, AATYPE, LTYPE >::_selection
private

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