cartobase  4.6.2
carto::Converter< INP, OUTP > Class Template Reference

High-level converter, reimplementation of aims::Converter. More...

#include <cartobase/type/converter.h>

Inheritance diagram for carto::Converter< INP, OUTP >:
Collaboration diagram for carto::Converter< INP, OUTP >:

Public Member Functions

 Converter (bool rescale=false)
 
 Converter (bool rescale, const RescalerInfo &info)
 
virtual ~Converter ()
 
OUTP * operator() (const INP &in) const
 Converts an INP type data to an OUTP data. More...
 
virtual void convert (const INP &in, OUTP &out) const
 Converts INP into an existing OUTP object. More...
 

Protected Attributes

bool _rescale
 
RescalerInfo _info
 

Detailed Description

template<class INP, class OUTP>
class carto::Converter< INP, OUTP >

High-level converter, reimplementation of aims::Converter.

Definition at line 218 of file converter.h.

Constructor & Destructor Documentation

template<class INP , class OUTP >
carto::Converter< INP, OUTP >::Converter ( bool  rescale = false)
inline

Definition at line 221 of file converter.h.

template<class INP , class OUTP >
carto::Converter< INP, OUTP >::Converter ( bool  rescale,
const RescalerInfo info 
)
inline

Definition at line 222 of file converter.h.

template<class INP , class OUTP >
virtual carto::Converter< INP, OUTP >::~Converter ( )
inlinevirtual

Definition at line 224 of file converter.h.

Member Function Documentation

template<class INP , class OUTP >
void carto::Converter< INP, OUTP >::convert ( const INP &  in,
OUTP &  out 
) const
inlinevirtual

Converts INP into an existing OUTP object.

The output object must be already allocated with correct size: its contents will be replaced, but no reallocation or resizing will take place. To actually trigger allocation, use the operator () instead.

Definition at line 338 of file converter.h.

References carto::RawConverter< INP, OUTP >::convert(), and carto::min_limit().

template<class INP , class OUTP >
OUTP * carto::Converter< INP, OUTP >::operator() ( const INP &  in) const
inline

Converts an INP type data to an OUTP data.

If rescale mode is on, the conversion uses the parameters provided as a RescalerInfo object. If no such object is provided, it tries to use the whole dynamics of the OUTP type (int types).

In any case, all quantification info will be lost, unless put as a scale factor in the header (used for AimsData).

Definition at line 329 of file converter.h.

References carto::ConverterAllocator< INP, OUTP >::alloc(), and carto::Rescaler< INP, OUTP >::convert().

Member Data Documentation

template<class INP , class OUTP >
RescalerInfo carto::Converter< INP, OUTP >::_info
protected

Definition at line 245 of file converter.h.

template<class INP , class OUTP >
bool carto::Converter< INP, OUTP >::_rescale
protected

Definition at line 244 of file converter.h.


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