aimsdata  4.7.0
Neuroimaging data handling
aims::AnyTypeReaderProcess< T, TConvertorFamily > Class Template Reference

A process to read an object of type T, even if the type on file is different. More...

#include <aims/utility/anytype_reader.h>

Inheritance diagram for aims::AnyTypeReaderProcess< T, TConvertorFamily >:
Collaboration diagram for aims::AnyTypeReaderProcess< T, TConvertorFamily >:

Public Types

typedef T return_type
 
typedef TConvertorFamily convertor_type
 
- Public Types inherited from aims::Process
typedef bool(* ProcFunc) (Process &, const std::string &, Finder &)
 Process function type. More...
 

Public Member Functions

 AnyTypeReaderProcess (const T &init)
 Initialize result with init. More...
 
T & get ()
 Get data loaded from file. More...
 
T const & get () const
 Get data loaded from file. More...
 
- Public Member Functions inherited from aims::Process
 Process ()
 Attempts to read the header of filename and, if successful, calls the operator() of the process . More...
 
virtual ~Process ()
 
void registerProcessType (const std::string &objType, const std::string &dataType, ProcFunc procFunc)
 Registers the process to call on a given (object type, data type) couple (just fills the map) More...
 
bool execute (const std::string &filename)
 Executes the process on the object / data type found in the given file. More...
 
bool execute (Finder &f, const std::string &filename)
 Same as above but the header has already been read (or hand-made to fake it!) More...
 
const std::map< std::string, std::map< std::string, ProcFunc > > & processTypes () const
 Query registered process types. More...
 
void setReadOptions (carto::Object options)
 Set reading options. More...
 

Additional Inherited Members

- Protected Attributes inherited from aims::Process
std::map< std::string, std::map< std::string, ProcFunc > > _execs
 
carto::Object _options
 

Detailed Description

template<typename T, typename TConvertorFamily = TArgWrapper2<RawConverterWithAllocation>>
class aims::AnyTypeReaderProcess< T, TConvertorFamily >

A process to read an object of type T, even if the type on file is different.

This is the low-level layer: it has a strong Process flavor. If you don't need precise Process control and if your type T has a default constructor, use the AnyTypeReader class instead, that has a more Reader-like interface.

Definition at line 137 of file anytype_reader.h.

Member Typedef Documentation

◆ convertor_type

template<typename T , typename TConvertorFamily = TArgWrapper2<RawConverterWithAllocation>>
typedef TConvertorFamily aims::AnyTypeReaderProcess< T, TConvertorFamily >::convertor_type

Definition at line 141 of file anytype_reader.h.

◆ return_type

template<typename T , typename TConvertorFamily = TArgWrapper2<RawConverterWithAllocation>>
typedef T aims::AnyTypeReaderProcess< T, TConvertorFamily >::return_type

Definition at line 140 of file anytype_reader.h.

Constructor & Destructor Documentation

◆ AnyTypeReaderProcess()

template<typename T , typename TConvertorFamily >
aims::AnyTypeReaderProcess< T, TConvertorFamily >::AnyTypeReaderProcess ( const T &  init)
explicit

Initialize result with init.

NB: there is no default constructor for AnyTypeReader so that it compiles even if T itself does not have a default constructor.

Definition at line 80 of file anytype_reader_details.h.

References aims::Process::registerProcessType().

Member Function Documentation

◆ get() [1/2]

template<typename T , typename TConvertorFamily = TArgWrapper2<RawConverterWithAllocation>>
T& aims::AnyTypeReaderProcess< T, TConvertorFamily >::get ( )
inline

Get data loaded from file.

Definition at line 155 of file anytype_reader.h.

◆ get() [2/2]

template<typename T , typename TConvertorFamily = TArgWrapper2<RawConverterWithAllocation>>
T const& aims::AnyTypeReaderProcess< T, TConvertorFamily >::get ( ) const
inline

Get data loaded from file.

Definition at line 157 of file anytype_reader.h.


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