OpendTect-6_4  6.4
Public Member Functions | Static Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | List of all members
DataInterpreter< T > Class Template Reference

Byte-level data interpreter. More...

Inheritance diagram for DataInterpreter< T >:
[legend]

Public Member Functions

 DataInterpreter (const DataCharacteristics &, bool ignoreendianness=false)
 
 DataInterpreter (const DataInterpreter< T > &)
 
void set (const DataCharacteristics &, bool ignoreendianness=false)
 use ignoreendianness when you pre-byteswap the data More...
 
DataInterpreter< T > & operator= (const DataInterpreter< T > &)
 
DataInterpreter< T > & operator= (const DataCharacteristics &dc)
 
bool needSwap () const
 
void swap (void *buf, od_int64 bufsz_in_elements) const
 
get (od_istream &) const
 
get (const void *buf, od_int64 nr) const
 
void put (void *buf, od_int64 nr, T t) const
 
bool operator== (const DataInterpreter &di) const
 
bool operator!= (const DataInterpreter &di) const
 
bool isSUCompat () const
 
int nrBytes () const
 
DataCharacteristics dataChar () const
 
template<>
void set (const DataCharacteristics &dc, bool ignend)
 
template<>
 DataInterpreter (const DataCharacteristics &dc, bool ignend)
 
template<>
 DataInterpreter (const DataInterpreter &di)
 
template<>
DataInterpreter< mTheType > & operator= (const DataInterpreter< mTheType > &di)
 
template<>
int nrBytes () const
 
template<>
DataCharacteristics dataChar () const
 
template<>
bool needSwap () const
 

Static Public Member Functions

static DataInterpreter< T > create ()
 
static DataInterpreter< T > * create (const DataCharacteristics &, bool alsoifequal)
 
static DataInterpreter< T > * create (const char *, bool alsoifequal)
 
static DataInterpreter< T > * create (const IOPar &par, const char *key, bool alsoifequal)
 
static T get (const DataInterpreter< T > *, od_istream &)
 
static bool get (const DataInterpreter< T > *, od_istream &, T &)
 

Protected Types

typedef T(DataInterpreter< T >::* GetFn) (const void *, od_int64) const
 
typedef void(DataInterpreter< T >::* PutFn) (void *, od_int64, T) const
 
typedef void(DataInterpreter< T >::* SwapFn) (void *, od_int64) const
 

Protected Member Functions

void swap2 (void *, od_int64) const
 
void swap4 (void *, od_int64) const
 
void swap8 (void *, od_int64) const
 
getS1 (const void *, od_int64) const
 
getS2 (const void *, od_int64) const
 
getS4 (const void *, od_int64) const
 
getS8 (const void *, od_int64) const
 
getU1 (const void *, od_int64) const
 
getU2 (const void *, od_int64) const
 
getU4 (const void *, od_int64) const
 
getF (const void *, od_int64) const
 
getD (const void *, od_int64) const
 
getS2Ibm (const void *, od_int64) const
 
getS4Ibm (const void *, od_int64) const
 
getFIbm (const void *, od_int64) const
 
getS2swp (const void *, od_int64) const
 
getS4swp (const void *, od_int64) const
 
getS8swp (const void *, od_int64) const
 
getU2swp (const void *, od_int64) const
 
getU4swp (const void *, od_int64) const
 
getFswp (const void *, od_int64) const
 
getDswp (const void *, od_int64) const
 
getS2Ibmswp (const void *, od_int64) const
 
getS4Ibmswp (const void *, od_int64) const
 
getFIbmswp (const void *, od_int64) const
 
void putS1 (void *, od_int64, T) const
 
void putS2 (void *, od_int64, T) const
 
void putS4 (void *, od_int64, T) const
 
void putS8 (void *, od_int64, T) const
 
void putU1 (void *, od_int64, T) const
 
void putU2 (void *, od_int64, T) const
 
void putU4 (void *, od_int64, T) const
 
void putF (void *, od_int64, T) const
 
void putD (void *, od_int64, T) const
 
void putS2Ibm (void *, od_int64, T) const
 
void putS4Ibm (void *, od_int64, T) const
 
void putFIbm (void *, od_int64, T) const
 
void putS2swp (void *, od_int64, T) const
 
void putS4swp (void *, od_int64, T) const
 
void putS8swp (void *, od_int64, T) const
 
void putU2swp (void *, od_int64, T) const
 
void putU4swp (void *, od_int64, T) const
 
void putFswp (void *, od_int64, T) const
 
void putDswp (void *, od_int64, T) const
 
void putS2Ibmswp (void *, od_int64, T) const
 
void putS4Ibmswp (void *, od_int64, T) const
 
void putFIbmswp (void *, od_int64, T) const
 
void swap0 (void *, od_int64) const
 
get0 (const void *, od_int64) const
 
void put0 (void *, od_int64, T) const
 
void swpSwap ()
 
template<>
void swpSwap ()
 

Protected Attributes

GetFn getfn
 
PutFn putfn
 
SwapFn swpfn
 

Detailed Description

template<class T>
class DataInterpreter< T >

Byte-level data interpreter.

Efficient (one function call overhead) get and set of data, usually in a data buffer. Facility to swap bytes in advance. The interpretation is into/from the template parameter. At present, float, double, int and long long are supported and instantiated.

Member Typedef Documentation

template<class T>
typedef T(DataInterpreter<T>::* DataInterpreter< T >::GetFn) (const void *, od_int64) const
protected
template<class T>
typedef void(DataInterpreter<T>::* DataInterpreter< T >::PutFn) (void *, od_int64, T) const
protected
template<class T>
typedef void(DataInterpreter<T>::* DataInterpreter< T >::SwapFn) (void *, od_int64) const
protected

Constructor & Destructor Documentation

template<class T>
DataInterpreter< T >::DataInterpreter ( const DataCharacteristics ,
bool  ignoreendianness = false 
)
template<class T>
DataInterpreter< T >::DataInterpreter ( const DataInterpreter< T > &  )
template<>
DataInterpreter< mTheType >::DataInterpreter ( const DataCharacteristics dc,
bool  ignend 
)
template<>
DataInterpreter< mTheType >::DataInterpreter ( const DataInterpreter< T > &  di)

Member Function Documentation

template<class T>
static DataInterpreter<T> DataInterpreter< T >::create ( )
static
template<class T>
static DataInterpreter<T>* DataInterpreter< T >::create ( const DataCharacteristics ,
bool  alsoifequal 
)
static
Parameters
alsoifequaldetermines whether an interpreter should be created if the format in DataChar is identical to the current machine's.
template<class T>
static DataInterpreter<T>* DataInterpreter< T >::create ( const char *  ,
bool  alsoifequal 
)
static
Parameters
alsoifequaldetermines whether an interpreter should be created if the format in DataChar is identical to the current machine's.
template<class T>
static DataInterpreter<T>* DataInterpreter< T >::create ( const IOPar par,
const char *  key,
bool  alsoifequal 
)
static
Parameters
alsoifequaldetermines whether an interpreter should be created if the format in DataChar is identical to the current machine's.
template<class T>
DataCharacteristics DataInterpreter< T >::dataChar ( ) const
template<>
DataCharacteristics DataInterpreter< mTheType >::dataChar ( ) const
template<class T>
T DataInterpreter< T >::get ( od_istream ) const
template<class T>
static T DataInterpreter< T >::get ( const DataInterpreter< T > *  ,
od_istream  
)
static
template<class T>
static bool DataInterpreter< T >::get ( const DataInterpreter< T > *  ,
od_istream ,
T &   
)
static
template<class T>
T DataInterpreter< T >::get ( const void *  buf,
od_int64  nr 
) const
inline
template<class T>
T DataInterpreter< T >::get0 ( const void *  ,
od_int64   
) const
inlineprotected
template<class T>
T DataInterpreter< T >::getD ( const void *  ,
od_int64   
) const
protected
template<class T>
T DataInterpreter< T >::getDswp ( const void *  ,
od_int64   
) const
protected
template<class T>
T DataInterpreter< T >::getF ( const void *  ,
od_int64   
) const
protected
template<class T>
T DataInterpreter< T >::getFIbm ( const void *  ,
od_int64   
) const
protected
template<class T>
T DataInterpreter< T >::getFIbmswp ( const void *  ,
od_int64   
) const
protected
template<class T>
T DataInterpreter< T >::getFswp ( const void *  ,
od_int64   
) const
protected
template<class T>
T DataInterpreter< T >::getS1 ( const void *  ,
od_int64   
) const
protected
template<class T>
T DataInterpreter< T >::getS2 ( const void *  ,
od_int64   
) const
protected
template<class T>
T DataInterpreter< T >::getS2Ibm ( const void *  ,
od_int64   
) const
protected
template<class T>
T DataInterpreter< T >::getS2Ibmswp ( const void *  ,
od_int64   
) const
protected
template<class T>
T DataInterpreter< T >::getS2swp ( const void *  ,
od_int64   
) const
protected
template<class T>
T DataInterpreter< T >::getS4 ( const void *  ,
od_int64   
) const
protected
template<class T>
T DataInterpreter< T >::getS4Ibm ( const void *  ,
od_int64   
) const
protected
template<class T>
T DataInterpreter< T >::getS4Ibmswp ( const void *  ,
od_int64   
) const
protected
template<class T>
T DataInterpreter< T >::getS4swp ( const void *  ,
od_int64   
) const
protected
template<class T>
T DataInterpreter< T >::getS8 ( const void *  ,
od_int64   
) const
protected
template<class T>
T DataInterpreter< T >::getS8swp ( const void *  ,
od_int64   
) const
protected
template<class T>
T DataInterpreter< T >::getU1 ( const void *  ,
od_int64   
) const
protected
template<class T>
T DataInterpreter< T >::getU2 ( const void *  ,
od_int64   
) const
protected
template<class T>
T DataInterpreter< T >::getU2swp ( const void *  ,
od_int64   
) const
protected
template<class T>
T DataInterpreter< T >::getU4 ( const void *  ,
od_int64   
) const
protected
template<class T>
T DataInterpreter< T >::getU4swp ( const void *  ,
od_int64   
) const
protected
template<class T>
bool DataInterpreter< T >::isSUCompat ( ) const
inline
template<class T>
bool DataInterpreter< T >::needSwap ( ) const
template<>
bool DataInterpreter< mTheType >::needSwap ( ) const
template<class T>
int DataInterpreter< T >::nrBytes ( ) const
template<>
int DataInterpreter< mTheType >::nrBytes ( ) const
template<class T>
bool DataInterpreter< T >::operator!= ( const DataInterpreter< T > &  di) const
inline
template<class T>
DataInterpreter<T>& DataInterpreter< T >::operator= ( const DataInterpreter< T > &  )
template<class T>
DataInterpreter<T>& DataInterpreter< T >::operator= ( const DataCharacteristics dc)
inline
template<>
DataInterpreter< mTheType > & DataInterpreter< mTheType >::operator= ( const DataInterpreter< mTheType > &  di)
template<class T>
bool DataInterpreter< T >::operator== ( const DataInterpreter< T > &  di) const
inline
template<class T>
void DataInterpreter< T >::put ( void *  buf,
od_int64  nr,
t 
) const
inline
template<class T>
void DataInterpreter< T >::put0 ( void *  ,
od_int64  ,
 
) const
inlineprotected
template<class T>
void DataInterpreter< T >::putD ( void *  ,
od_int64  ,
 
) const
protected
template<class T>
void DataInterpreter< T >::putDswp ( void *  ,
od_int64  ,
 
) const
protected
template<class T>
void DataInterpreter< T >::putF ( void *  ,
od_int64  ,
 
) const
protected
template<class T>
void DataInterpreter< T >::putFIbm ( void *  ,
od_int64  ,
 
) const
protected
template<class T>
void DataInterpreter< T >::putFIbmswp ( void *  ,
od_int64  ,
 
) const
protected
template<class T>
void DataInterpreter< T >::putFswp ( void *  ,
od_int64  ,
 
) const
protected
template<class T>
void DataInterpreter< T >::putS1 ( void *  ,
od_int64  ,
 
) const
protected
template<class T>
void DataInterpreter< T >::putS2 ( void *  ,
od_int64  ,
 
) const
protected
template<class T>
void DataInterpreter< T >::putS2Ibm ( void *  ,
od_int64  ,
 
) const
protected
template<class T>
void DataInterpreter< T >::putS2Ibmswp ( void *  ,
od_int64  ,
 
) const
protected
template<class T>
void DataInterpreter< T >::putS2swp ( void *  ,
od_int64  ,
 
) const
protected
template<class T>
void DataInterpreter< T >::putS4 ( void *  ,
od_int64  ,
 
) const
protected
template<class T>
void DataInterpreter< T >::putS4Ibm ( void *  ,
od_int64  ,
 
) const
protected
template<class T>
void DataInterpreter< T >::putS4Ibmswp ( void *  ,
od_int64  ,
 
) const
protected
template<class T>
void DataInterpreter< T >::putS4swp ( void *  ,
od_int64  ,
 
) const
protected
template<class T>
void DataInterpreter< T >::putS8 ( void *  ,
od_int64  ,
 
) const
protected
template<class T>
void DataInterpreter< T >::putS8swp ( void *  ,
od_int64  ,
 
) const
protected
template<class T>
void DataInterpreter< T >::putU1 ( void *  ,
od_int64  ,
 
) const
protected
template<class T>
void DataInterpreter< T >::putU2 ( void *  ,
od_int64  ,
 
) const
protected
template<class T>
void DataInterpreter< T >::putU2swp ( void *  ,
od_int64  ,
 
) const
protected
template<class T>
void DataInterpreter< T >::putU4 ( void *  ,
od_int64  ,
 
) const
protected
template<class T>
void DataInterpreter< T >::putU4swp ( void *  ,
od_int64  ,
 
) const
protected
template<>
void DataInterpreter< mTheType >::set ( const DataCharacteristics dc,
bool  ignend 
)
template<class T>
void DataInterpreter< T >::set ( const DataCharacteristics ,
bool  ignoreendianness = false 
)

use ignoreendianness when you pre-byteswap the data

template<class T>
void DataInterpreter< T >::swap ( void *  buf,
od_int64  bufsz_in_elements 
) const
inline
template<class T>
void DataInterpreter< T >::swap0 ( void *  ,
od_int64   
) const
inlineprotected
template<class T>
void DataInterpreter< T >::swap2 ( void *  ,
od_int64   
) const
protected
template<class T>
void DataInterpreter< T >::swap4 ( void *  ,
od_int64   
) const
protected
template<class T>
void DataInterpreter< T >::swap8 ( void *  ,
od_int64   
) const
protected
template<class T>
void DataInterpreter< T >::swpSwap ( )
protected
template<>
void DataInterpreter< mTheType >::swpSwap ( )
protected

Member Data Documentation

template<class T>
GetFn DataInterpreter< T >::getfn
protected
template<class T>
PutFn DataInterpreter< T >::putfn
protected
template<class T>
SwapFn DataInterpreter< T >::swpfn
protected

Generated at for the OpendTect seismic interpretation project. Copyright (C): dGB Beheer B. V. 2019