OpendTect-6_4  6.4
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
BinDataDesc Class Reference

Description of binary data. More...

Inheritance diagram for BinDataDesc:
[legend]

Public Types

enum  ByteCount { N1 =1, N2 =2, N4 =4, N8 =8 }
 

Public Member Functions

 BinDataDesc (bool ii=false, bool is=true, ByteCount b=N4)
 
 BinDataDesc (bool ii, bool is, int b)
 
 BinDataDesc (unsigned char c1, unsigned char c2)
 
 BinDataDesc (const char *s)
 
virtual ~BinDataDesc ()
 
bool isInteger () const
 
bool isSigned () const
 
ByteCount nrBytes () const
 
void set (bool ii, bool is, ByteCount b)
 
void set (bool ii, bool is, int b)
 
void setInteger (bool yn)
 
void setSigned (bool yn)
 
void setNrBytes (ByteCount n)
 
void setNrBytes (int n)
 
virtual int maxStringifiedSize () const
 
virtual void toString (BufferString &) const
 
virtual void set (const char *)
 
virtual void dump (unsigned char &, unsigned char &) const
 
virtual void set (unsigned char, unsigned char)
 
 BinDataDesc (const signed char *)
 
 BinDataDesc (const signed char &)
 
 BinDataDesc (const short *)
 
 BinDataDesc (const short &)
 
 BinDataDesc (const int *)
 
 BinDataDesc (const int &)
 
 BinDataDesc (const unsigned char *)
 
 BinDataDesc (const unsigned char &)
 
 BinDataDesc (const unsigned short *)
 
 BinDataDesc (const unsigned short &)
 
 BinDataDesc (const unsigned int *)
 
 BinDataDesc (const unsigned int &)
 
 BinDataDesc (const float *)
 
 BinDataDesc (const float &)
 
 BinDataDesc (const double *)
 
 BinDataDesc (const double &)
 
bool operator== (const BinDataDesc &dc) const
 
bool operator!= (const BinDataDesc &dc) const
 
bool isEqual (const BinDataDesc &dc) const
 
int sizeFor (int n) const
 
virtual bool convertsWellTo (const BinDataDesc &) const
 

Static Public Member Functions

static ByteCount nearestByteCount (bool is_int, int s)
 
static int nextSize (bool is_int, int s)
 

Protected Member Functions

void setFrom (unsigned char, bool)
 

Protected Attributes

bool isint_
 
bool issigned_
 
ByteCount nrbytes_
 

Detailed Description

Description of binary data.

Binary data in 'blobs' can usually be described by only a few pieces of info. These are:

Is the data of floating point type or integer? Is the data signed or unsigned? Usually, floating point data cannot be unsigned. How big is each number in terms of bytes? This can be 1, 2, 4 or 8 bytes.

The info from this class can be stringified (user readable string) or dumped binary into two unsigned chars.

In normal work one will use the DataCharacteristics subclass, which can also provide a 'run-time' data interpreter class for fast conversion to internal data types.

Member Enumeration Documentation

Enumerator
N1 
N2 
N4 
N8 

Constructor & Destructor Documentation

BinDataDesc::BinDataDesc ( bool  ii = false,
bool  is = true,
ByteCount  b = N4 
)
inline
BinDataDesc::BinDataDesc ( bool  ii,
bool  is,
int  b 
)
inline
BinDataDesc::BinDataDesc ( unsigned char  c1,
unsigned char  c2 
)
inline
BinDataDesc::BinDataDesc ( const char *  s)
inline
virtual BinDataDesc::~BinDataDesc ( )
inlinevirtual
BinDataDesc::BinDataDesc ( const signed char *  )
inline
BinDataDesc::BinDataDesc ( const signed char &  )
inline
BinDataDesc::BinDataDesc ( const short *  )
inline
BinDataDesc::BinDataDesc ( const short &  )
inline
BinDataDesc::BinDataDesc ( const int *  )
inline
BinDataDesc::BinDataDesc ( const int &  )
inline
BinDataDesc::BinDataDesc ( const unsigned char *  )
inline
BinDataDesc::BinDataDesc ( const unsigned char &  )
inline
BinDataDesc::BinDataDesc ( const unsigned short *  )
inline
BinDataDesc::BinDataDesc ( const unsigned short &  )
inline
BinDataDesc::BinDataDesc ( const unsigned int *  )
inline
BinDataDesc::BinDataDesc ( const unsigned int &  )
inline
BinDataDesc::BinDataDesc ( const float *  )
inline
BinDataDesc::BinDataDesc ( const float &  )
inline
BinDataDesc::BinDataDesc ( const double *  )
inline
BinDataDesc::BinDataDesc ( const double &  )
inline

Member Function Documentation

virtual bool BinDataDesc::convertsWellTo ( const BinDataDesc ) const
virtual
virtual void BinDataDesc::dump ( unsigned char &  ,
unsigned char &   
) const
virtual

Reimplemented in DataCharacteristics.

bool BinDataDesc::isEqual ( const BinDataDesc dc) const
inline
bool BinDataDesc::isInteger ( ) const
inline
bool BinDataDesc::isSigned ( ) const
inline
virtual int BinDataDesc::maxStringifiedSize ( ) const
inlinevirtual

Reimplemented in DataCharacteristics.

static ByteCount BinDataDesc::nearestByteCount ( bool  is_int,
int  s 
)
inlinestatic
static int BinDataDesc::nextSize ( bool  is_int,
int  s 
)
inlinestatic
ByteCount BinDataDesc::nrBytes ( ) const
inline
bool BinDataDesc::operator!= ( const BinDataDesc dc) const
inline
bool BinDataDesc::operator== ( const BinDataDesc dc) const
inline
void BinDataDesc::set ( bool  ii,
bool  is,
ByteCount  b 
)
inline
void BinDataDesc::set ( bool  ii,
bool  is,
int  b 
)
inline
virtual void BinDataDesc::set ( const char *  )
virtual

Reimplemented in DataCharacteristics.

virtual void BinDataDesc::set ( unsigned  char,
unsigned  char 
)
virtual

Reimplemented in DataCharacteristics.

void BinDataDesc::setFrom ( unsigned  char,
bool   
)
protected
void BinDataDesc::setInteger ( bool  yn)
inline
void BinDataDesc::setNrBytes ( ByteCount  n)
inline
void BinDataDesc::setNrBytes ( int  n)
inline
void BinDataDesc::setSigned ( bool  yn)
inline
int BinDataDesc::sizeFor ( int  n) const
inline
virtual void BinDataDesc::toString ( BufferString ) const
virtual

Reimplemented in DataCharacteristics.

Member Data Documentation

bool BinDataDesc::isint_
protected
bool BinDataDesc::issigned_
protected
ByteCount BinDataDesc::nrbytes_
protected

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