rasdaman API
Classes | Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
r_Convertor Class Referenceabstract

#include <convertor.hh>

Inheritance diagram for r_Convertor:
r_Conv_BMP r_Conv_CSV r_Conv_DEM r_Conv_ECW r_Conv_HDF r_Conv_TOR r_Conv_VFF r_Convert_Memory

Classes

struct  convert_string_s
 

Public Types

enum  convert_type_e {
  ctype_void, ctype_bool, ctype_char, ctype_rgb,
  ctype_int8, ctype_uint8, ctype_int16, ctype_uint16,
  ctype_int32, ctype_uint32, ctype_int64, ctype_uint64,
  ctype_float32, ctype_float64, ctype_struct
}
 base type shortcuts More...
 
typedef struct
r_Convertor::convert_string_s 
convert_string_t
 

Public Member Functions

 r_Convertor (void)
 default constructor (should not be used) More...
 
 r_Convertor (const char *src, const r_Minterval &interv, const r_Type *tp, bool fullTypes=false) throw (r_Error)
 constructor using an r_Type object More...
 
 r_Convertor (const char *src, const r_Minterval &interv, int type) throw (r_Error)
 constructor using convert_type_e shortcut More...
 
virtual ~r_Convertor (void)
 destructor More...
 
virtual r_convDescconvertTo (const char *options=NULL)=0 throw (r_Error)
 convert array to DEF More...
 
virtual r_convDescconvertFrom (const char *options=NULL)=0 throw (r_Error)
 convert DEF to array More...
 
virtual r_Convertorclone (void) const =0
 cloning More...
 
virtual const char * get_name (void) const =0
 identification More...
 
virtual r_Data_Format get_data_format (void) const =0
 
void set_storage_handler (const r_Storage_Man &newStore)
 set storage handler, default is malloc/free More...
 
const r_Storage_Manget_storage_handler () const
 get storage handler, default is malloc/free More...
 

Static Public Member Functions

static std::string type_to_string (int ctype) throw (r_Error)
 get a string representation of the internal type More...
 
static r_Typeget_external_type (int ctype) throw (r_Error)
 get a r_Type from an internal type More...
 
static convert_type_e get_internal_type (const r_Type *type, bool fullTypes=false) throw (r_Error)
 get a internal type from a r_Type More...
 

Protected Member Functions

void initShare (const char *src, const r_Minterval &interv)
 initialize internal structures More...
 
template<class baseType >
void applyColorScheme ()
 convert unsupported type to rgb by applying the default color scheme More...
 

Protected Attributes

bool destroySrc
 true if we should free the src area (in case the input was converted to rgb) More...
 
r_convDesc desc
 conversion context More...
 
r_Parse_Paramsparams
 parameter parser More...
 
r_Storage_Man mystore
 storage manager More...
 

Member Typedef Documentation

Member Enumeration Documentation

base type shortcuts

Enumerator
ctype_void 
ctype_bool 
ctype_char 
ctype_rgb 
ctype_int8 
ctype_uint8 
ctype_int16 
ctype_uint16 
ctype_int32 
ctype_uint32 
ctype_int64 
ctype_uint64 
ctype_float32 
ctype_float64 
ctype_struct 

Constructor & Destructor Documentation

r_Convertor::r_Convertor ( void  )

default constructor (should not be used)

r_Convertor::r_Convertor ( const char *  src,
const r_Minterval interv,
const r_Type tp,
bool  fullTypes = false 
)
throw (r_Error
)

constructor using an r_Type object

r_Convertor::r_Convertor ( const char *  src,
const r_Minterval interv,
int  type 
)
throw (r_Error
)

constructor using convert_type_e shortcut

virtual r_Convertor::~r_Convertor ( void  )
virtual

destructor

convert_type_e is an enumerator that acts as a shortcut to base types relevant for DEFs. The values and what they correspond to are listed below (the types below the line are for HDF):

{tabular}{ll} ctype_void && No type, used for errors\ ctype_bool && bool\ ctype_char && char\ ctype_rgb && struct {char, char, char}\ ctype_int8 && signed char\ ctype_uint8 && unsigned char\ ctype_int16 && short\ ctype_uint16 && unsigned short\ ctype_int32 && int\ ctype_uint32 && unsigned int\ ctype_int64 && (unsupported)\ ctype_uint64 && (unsupported)\ ctype_float32 && float\ ctype_float64 && double\ ctype_struct && struct \ {tabular}

Member Function Documentation

template<class baseType >
void r_Convertor::applyColorScheme ( )
protected

convert unsupported type to rgb by applying the default color scheme

virtual r_Convertor* r_Convertor::clone ( void  ) const
pure virtual
virtual r_convDesc& r_Convertor::convertFrom ( const char *  options = NULL)
throw (r_Error
)
pure virtual
virtual r_convDesc& r_Convertor::convertTo ( const char *  options = NULL)
throw (r_Error
)
pure virtual
virtual r_Data_Format r_Convertor::get_data_format ( void  ) const
pure virtual
static r_Type* r_Convertor::get_external_type ( int  ctype)
throw (r_Error
)
static

get a r_Type from an internal type

static convert_type_e r_Convertor::get_internal_type ( const r_Type type,
bool  fullTypes = false 
)
throw (r_Error
)
static

get a internal type from a r_Type

virtual const char* r_Convertor::get_name ( void  ) const
pure virtual
const r_Storage_Man& r_Convertor::get_storage_handler ( ) const

get storage handler, default is malloc/free

void r_Convertor::initShare ( const char *  src,
const r_Minterval interv 
)
protected

initialize internal structures

void r_Convertor::set_storage_handler ( const r_Storage_Man newStore)

set storage handler, default is malloc/free

static std::string r_Convertor::type_to_string ( int  ctype)
throw (r_Error
)
static

get a string representation of the internal type

Member Data Documentation

r_convDesc r_Convertor::desc
protected

conversion context

bool r_Convertor::destroySrc
protected

true if we should free the src area (in case the input was converted to rgb)

r_Storage_Man r_Convertor::mystore
protected

storage manager

r_Parse_Params* r_Convertor::params
protected

parameter parser


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