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

Static Public Member Functions

static DataInterpreter< T > create ()
 
static DataInterpreter< T > * create (const char *, bool alsoifequal)
 
static DataInterpreter< T > * create (const DataCharacteristics &, 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

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

◆ GetFn

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

◆ PutFn

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

◆ SwapFn

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

Constructor & Destructor Documentation

◆ DataInterpreter() [1/4]

template<class T >
DataInterpreter< T >::DataInterpreter ( const DataCharacteristics ,
bool  ignoreendianness = false 
)

◆ DataInterpreter() [2/4]

template<class T >
DataInterpreter< T >::DataInterpreter ( const DataInterpreter< T > &  )

◆ DataInterpreter() [3/4]

DataInterpreter< mTheType >::DataInterpreter ( const DataCharacteristics dc,
bool  ignend 
)

◆ DataInterpreter() [4/4]

DataInterpreter< mTheType >::DataInterpreter ( const DataInterpreter< T > &  di)

Member Function Documentation

◆ create() [1/4]

template<class T >
static DataInterpreter<T> DataInterpreter< T >::create ( )
static

◆ create() [2/4]

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.

◆ create() [3/4]

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.

◆ create() [4/4]

template<class T >
static DataInterpreter<T>* DataInterpreter< T >::create ( const IOPar par,
const char *  key,
bool  alsoifequal 
)
static
Parameters
par
key
alsoifequaldetermines whether an interpreter should be created if the format in DataChar is identical to the current machine's.

◆ dataChar() [1/2]

template<class T >
DataCharacteristics DataInterpreter< T >::dataChar ( ) const

◆ dataChar() [2/2]

DataCharacteristics DataInterpreter< mTheType >::dataChar ( ) const

◆ get() [1/4]

template<class T >
static T DataInterpreter< T >::get ( const DataInterpreter< T > *  ,
od_istream  
)
static

◆ get() [2/4]

template<class T >
static bool DataInterpreter< T >::get ( const DataInterpreter< T > *  ,
od_istream ,
T &   
)
static

◆ get() [3/4]

template<class T >
T DataInterpreter< T >::get ( const void *  buf,
od_int64  nr 
) const
inline

◆ get() [4/4]

template<class T >
T DataInterpreter< T >::get ( od_istream ) const

◆ get0()

template<class T >
T DataInterpreter< T >::get0 ( const void *  ,
od_int64   
) const
inlineprotected

◆ getD()

template<class T >
T DataInterpreter< T >::getD ( const void *  ,
od_int64   
) const
protected

◆ getDswp()

template<class T >
T DataInterpreter< T >::getDswp ( const void *  ,
od_int64   
) const
protected

◆ getF()

template<class T >
T DataInterpreter< T >::getF ( const void *  ,
od_int64   
) const
protected

◆ getFIbm()

template<class T >
T DataInterpreter< T >::getFIbm ( const void *  ,
od_int64   
) const
protected

◆ getFIbmswp()

template<class T >
T DataInterpreter< T >::getFIbmswp ( const void *  ,
od_int64   
) const
protected

◆ getFswp()

template<class T >
T DataInterpreter< T >::getFswp ( const void *  ,
od_int64   
) const
protected

◆ getS1()

template<class T >
T DataInterpreter< T >::getS1 ( const void *  ,
od_int64   
) const
protected

◆ getS2()

template<class T >
T DataInterpreter< T >::getS2 ( const void *  ,
od_int64   
) const
protected

◆ getS2Ibm()

template<class T >
T DataInterpreter< T >::getS2Ibm ( const void *  ,
od_int64   
) const
protected

◆ getS2Ibmswp()

template<class T >
T DataInterpreter< T >::getS2Ibmswp ( const void *  ,
od_int64   
) const
protected

◆ getS2swp()

template<class T >
T DataInterpreter< T >::getS2swp ( const void *  ,
od_int64   
) const
protected

◆ getS4()

template<class T >
T DataInterpreter< T >::getS4 ( const void *  ,
od_int64   
) const
protected

◆ getS4Ibm()

template<class T >
T DataInterpreter< T >::getS4Ibm ( const void *  ,
od_int64   
) const
protected

◆ getS4Ibmswp()

template<class T >
T DataInterpreter< T >::getS4Ibmswp ( const void *  ,
od_int64   
) const
protected

◆ getS4swp()

template<class T >
T DataInterpreter< T >::getS4swp ( const void *  ,
od_int64   
) const
protected

◆ getS8()

template<class T >
T DataInterpreter< T >::getS8 ( const void *  ,
od_int64   
) const
protected

◆ getS8swp()

template<class T >
T DataInterpreter< T >::getS8swp ( const void *  ,
od_int64   
) const
protected

◆ getU1()

template<class T >
T DataInterpreter< T >::getU1 ( const void *  ,
od_int64   
) const
protected

◆ getU2()

template<class T >
T DataInterpreter< T >::getU2 ( const void *  ,
od_int64   
) const
protected

◆ getU2swp()

template<class T >
T DataInterpreter< T >::getU2swp ( const void *  ,
od_int64   
) const
protected

◆ getU4()

template<class T >
T DataInterpreter< T >::getU4 ( const void *  ,
od_int64   
) const
protected

◆ getU4swp()

template<class T >
T DataInterpreter< T >::getU4swp ( const void *  ,
od_int64   
) const
protected

◆ isSUCompat()

template<class T >
bool DataInterpreter< T >::isSUCompat ( ) const
inline

◆ needSwap() [1/2]

template<class T >
bool DataInterpreter< T >::needSwap ( ) const

◆ needSwap() [2/2]

bool DataInterpreter< mTheType >::needSwap ( ) const

◆ nrBytes() [1/2]

template<class T >
int DataInterpreter< T >::nrBytes ( ) const

◆ nrBytes() [2/2]

int DataInterpreter< mTheType >::nrBytes ( ) const

◆ operator!=()

template<class T >
bool DataInterpreter< T >::operator!= ( const DataInterpreter< T > &  di) const
inline

◆ operator=() [1/3]

template<class T >
DataInterpreter<T>& DataInterpreter< T >::operator= ( const DataCharacteristics dc)
inline

◆ operator=() [2/3]

DataInterpreter< mTheType > & DataInterpreter< mTheType >::operator= ( const DataInterpreter< mTheType > &  di)

◆ operator=() [3/3]

template<class T >
DataInterpreter<T>& DataInterpreter< T >::operator= ( const DataInterpreter< T > &  )

◆ operator==()

template<class T >
bool DataInterpreter< T >::operator== ( const DataInterpreter< T > &  di) const
inline

◆ put()

template<class T >
void DataInterpreter< T >::put ( void *  buf,
od_int64  nr,
t 
) const
inline

◆ put0()

template<class T >
void DataInterpreter< T >::put0 ( void *  ,
od_int64  ,
 
) const
inlineprotected

◆ putD()

template<class T >
void DataInterpreter< T >::putD ( void *  ,
od_int64  ,
 
) const
protected

◆ putDswp()

template<class T >
void DataInterpreter< T >::putDswp ( void *  ,
od_int64  ,
 
) const
protected

◆ putF()

template<class T >
void DataInterpreter< T >::putF ( void *  ,
od_int64  ,
 
) const
protected

◆ putFIbm()

template<class T >
void DataInterpreter< T >::putFIbm ( void *  ,
od_int64  ,
 
) const
protected

◆ putFIbmswp()

template<class T >
void DataInterpreter< T >::putFIbmswp ( void *  ,
od_int64  ,
 
) const
protected

◆ putFswp()

template<class T >
void DataInterpreter< T >::putFswp ( void *  ,
od_int64  ,
 
) const
protected

◆ putS1()

template<class T >
void DataInterpreter< T >::putS1 ( void *  ,
od_int64  ,
 
) const
protected

◆ putS2()

template<class T >
void DataInterpreter< T >::putS2 ( void *  ,
od_int64  ,
 
) const
protected

◆ putS2Ibm()

template<class T >
void DataInterpreter< T >::putS2Ibm ( void *  ,
od_int64  ,
 
) const
protected

◆ putS2Ibmswp()

template<class T >
void DataInterpreter< T >::putS2Ibmswp ( void *  ,
od_int64  ,
 
) const
protected

◆ putS2swp()

template<class T >
void DataInterpreter< T >::putS2swp ( void *  ,
od_int64  ,
 
) const
protected

◆ putS4()

template<class T >
void DataInterpreter< T >::putS4 ( void *  ,
od_int64  ,
 
) const
protected

◆ putS4Ibm()

template<class T >
void DataInterpreter< T >::putS4Ibm ( void *  ,
od_int64  ,
 
) const
protected

◆ putS4Ibmswp()

template<class T >
void DataInterpreter< T >::putS4Ibmswp ( void *  ,
od_int64  ,
 
) const
protected

◆ putS4swp()

template<class T >
void DataInterpreter< T >::putS4swp ( void *  ,
od_int64  ,
 
) const
protected

◆ putS8()

template<class T >
void DataInterpreter< T >::putS8 ( void *  ,
od_int64  ,
 
) const
protected

◆ putS8swp()

template<class T >
void DataInterpreter< T >::putS8swp ( void *  ,
od_int64  ,
 
) const
protected

◆ putU1()

template<class T >
void DataInterpreter< T >::putU1 ( void *  ,
od_int64  ,
 
) const
protected

◆ putU2()

template<class T >
void DataInterpreter< T >::putU2 ( void *  ,
od_int64  ,
 
) const
protected

◆ putU2swp()

template<class T >
void DataInterpreter< T >::putU2swp ( void *  ,
od_int64  ,
 
) const
protected

◆ putU4()

template<class T >
void DataInterpreter< T >::putU4 ( void *  ,
od_int64  ,
 
) const
protected

◆ putU4swp()

template<class T >
void DataInterpreter< T >::putU4swp ( void *  ,
od_int64  ,
 
) const
protected

◆ set() [1/2]

template<class T >
void DataInterpreter< T >::set ( const DataCharacteristics ,
bool  ignoreendianness = false 
)

use ignoreendianness when you pre-byteswap the data

◆ set() [2/2]

void DataInterpreter< mTheType >::set ( const DataCharacteristics dc,
bool  ignend 
)

◆ swap()

template<class T >
void DataInterpreter< T >::swap ( void *  buf,
od_int64  bufsz_in_elements 
) const
inline

◆ swap0()

template<class T >
void DataInterpreter< T >::swap0 ( void *  ,
od_int64   
) const
inlineprotected

◆ swap2()

template<class T >
void DataInterpreter< T >::swap2 ( void *  ,
od_int64   
) const
protected

◆ swap4()

template<class T >
void DataInterpreter< T >::swap4 ( void *  ,
od_int64   
) const
protected

◆ swap8()

template<class T >
void DataInterpreter< T >::swap8 ( void *  ,
od_int64   
) const
protected

◆ swpSwap() [1/2]

template<class T >
void DataInterpreter< T >::swpSwap ( )
protected

◆ swpSwap() [2/2]

void DataInterpreter< mTheType >::swpSwap ( )
protected

Member Data Documentation

◆ getfn

template<class T >
GetFn DataInterpreter< T >::getfn
protected

◆ putfn

template<class T >
PutFn DataInterpreter< T >::putfn
protected

◆ swpfn

template<class T >
SwapFn DataInterpreter< T >::swpfn
protected

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