IODA Bundle
odc::core::Codec Class Referenceabstract

#include <Codec.h>

Inheritance diagram for odc::core::Codec:
[legend]

Public Member Functions

 Codec (const std::string &name, api::ColumnType type)
 
virtual ~Codec ()
 
virtual std::unique_ptr< Codecclone ()
 
const std::string & name () const
 
char * encode (char *p, const double &d)
 
virtual unsigned char * encode (unsigned char *p, const double &d)=0
 
virtual void decode (double *out)=0
 
virtual void skip ()=0
 
void setDataStream (GeneralDataStream &ds)
 
virtual void setDataStream (DataStream< SameByteOrder > &ds)
 
virtual void setDataStream (DataStream< OtherByteOrder > &ds)
 
virtual void clearDataStream ()=0
 
void load (GeneralDataStream &ds)
 
virtual void load (DataStream< SameByteOrder > &ds)
 
virtual void load (DataStream< OtherByteOrder > &ds)
 
void save (GeneralDataStream &ds)
 
virtual void save (DataStream< SameByteOrder > &ds)
 
virtual void save (DataStream< OtherByteOrder > &ds)
 
void resetStats ()
 
virtual void gatherStats (const double &v)
 
void hasMissing (bool h)
 
int32_t hasMissing () const
 
void min (double m)
 
double min () const
 
void max (double m)
 
double max () const
 
void missingValue (double v)
 
double missingValue () const
 
virtual size_t numStrings () const
 
virtual void copyStrings (Codec &rhs)
 
virtual size_t dataSizeDoubles () const
 
virtual void dataSizeDoubles (size_t count)
 

Protected Attributes

std::string name_
 
int32_t hasMissing_
 
double missingValue_
 
double min_
 
double max_
 
api::ColumnType type_
 

Private Member Functions

virtual void print (std::ostream &s) const
 
 Codec (const Codec &)
 
Codecoperator= (const Codec &)
 

Friends

std::ostream & operator<< (std::ostream &s, const Codec &p)
 

Detailed Description

Definition at line 31 of file Codec.h.

Constructor & Destructor Documentation

◆ Codec() [1/2]

odc::core::Codec::Codec ( const std::string &  name,
api::ColumnType  type 
)

Definition at line 24 of file Codec.cc.

◆ ~Codec()

odc::core::Codec::~Codec ( )
virtual

Definition at line 42 of file Codec.cc.

◆ Codec() [2/2]

odc::core::Codec::Codec ( const Codec )
private

Member Function Documentation

◆ clearDataStream()

◆ clone()

std::unique_ptr< Codec > odc::core::Codec::clone ( )
virtual

Creates a clone of this codec. NOTE: the clone is not really usefull for coding/decoding, but has the same stats/missing values as the original codec, which can be useful sometimes.

Reimplemented in odc::codec::IntStringCodecBase< ByteOrder, InternalCodec >, odc::codec::IntStringCodecBase< ByteOrder, CodecInt8< ByteOrder, int64_t > >, odc::codec::IntStringCodecBase< ByteOrder, CodecInt16< ByteOrder, int64_t > >, and odc::codec::CodecChars< ByteOrder >.

Definition at line 32 of file Codec.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ copyStrings()

virtual void odc::core::Codec::copyStrings ( Codec rhs)
inlinevirtual

Reimplemented in odc::codec::CodecChars< ByteOrder >.

Definition at line 77 of file Codec.h.

◆ dataSizeDoubles() [1/2]

virtual size_t odc::core::Codec::dataSizeDoubles ( ) const
inlinevirtual

Reimplemented in odc::codec::CodecChars< ByteOrder >.

Definition at line 79 of file Codec.h.

Here is the caller graph for this function:

◆ dataSizeDoubles() [2/2]

virtual void odc::core::Codec::dataSizeDoubles ( size_t  count)
inlinevirtual

Reimplemented in odc::codec::CodecChars< ByteOrder >.

Definition at line 80 of file Codec.h.

Here is the call graph for this function:

◆ decode()

virtual void odc::core::Codec::decode ( double *  out)
pure virtual

Implemented in odc::codec::IntStringCodecBase< ByteOrder, InternalCodec >, odc::codec::IntStringCodecBase< ByteOrder, CodecInt8< ByteOrder, int64_t > >, odc::codec::IntStringCodecBase< ByteOrder, CodecInt16< ByteOrder, int64_t > >, odc::codec::CodecChars< ByteOrder >, odc::codec::ShortRealBase< ByteOrder, InternalMissing >, odc::codec::ShortRealBase< ByteOrder, real2MissingAsInt >, odc::codec::ShortRealBase< ByteOrder, minFloatAsInt >, odc::codec::CodecLongReal< ByteOrder >, odc::codec::BaseCodecMissing< ByteOrder, ValueType, InternalValueType, DerivedCodec >, odc::codec::BaseCodecMissing< ByteOrder, ValueType, uint8_t, CodecInt8Missing< ByteOrder, ValueType > >, odc::codec::BaseCodecMissing< ByteOrder, ValueType, uint16_t, CodecInt16Missing< ByteOrder, ValueType > >, odc::codec::BaseCodecMissing< ByteOrder, ValueType, uint8_t, CodecConstantOrMissing< ByteOrder, ValueType > >, odc::codec::CodecIntegerDirect< ByteOrder, ValueType, InternalValueType, DerivedCodec >, odc::codec::CodecIntegerDirect< ByteOrder, ValueType, int32_t, CodecInt32< ByteOrder, ValueType > >, odc::codec::CodecIntegerOffset< ByteOrder, ValueType, InternalValueType, DerivedCodec >, odc::codec::CodecIntegerOffset< ByteOrder, ValueType, uint8_t, CodecInt8< ByteOrder, ValueType > >, odc::codec::CodecIntegerOffset< ByteOrder, ValueType, uint16_t, CodecInt16< ByteOrder, ValueType > >, odc::codec::CodecConstantString< ByteOrder >, odc::codec::CodecConstant< ByteOrder, ValueType >, and odc::codec::CodecConstant< ByteOrder, double >.

◆ encode() [1/2]

char* odc::core::Codec::encode ( char *  p,
const double &  d 
)
inline

Definition at line 42 of file Codec.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ encode() [2/2]

virtual unsigned char* odc::core::Codec::encode ( unsigned char *  p,
const double &  d 
)
pure virtual

Implemented in odc::codec::IntStringCodecBase< ByteOrder, InternalCodec >, odc::codec::IntStringCodecBase< ByteOrder, CodecInt8< ByteOrder, int64_t > >, odc::codec::IntStringCodecBase< ByteOrder, CodecInt16< ByteOrder, int64_t > >, odc::codec::CodecChars< ByteOrder >, odc::codec::ShortRealBase< ByteOrder, InternalMissing >, odc::codec::ShortRealBase< ByteOrder, real2MissingAsInt >, odc::codec::ShortRealBase< ByteOrder, minFloatAsInt >, odc::codec::CodecLongReal< ByteOrder >, odc::codec::BaseCodecMissing< ByteOrder, ValueType, InternalValueType, DerivedCodec >, odc::codec::BaseCodecMissing< ByteOrder, ValueType, uint8_t, CodecInt8Missing< ByteOrder, ValueType > >, odc::codec::BaseCodecMissing< ByteOrder, ValueType, uint16_t, CodecInt16Missing< ByteOrder, ValueType > >, odc::codec::BaseCodecMissing< ByteOrder, ValueType, uint8_t, CodecConstantOrMissing< ByteOrder, ValueType > >, odc::codec::CodecIntegerDirect< ByteOrder, ValueType, InternalValueType, DerivedCodec >, odc::codec::CodecIntegerDirect< ByteOrder, ValueType, int32_t, CodecInt32< ByteOrder, ValueType > >, odc::codec::CodecIntegerOffset< ByteOrder, ValueType, InternalValueType, DerivedCodec >, odc::codec::CodecIntegerOffset< ByteOrder, ValueType, uint8_t, CodecInt8< ByteOrder, ValueType > >, odc::codec::CodecIntegerOffset< ByteOrder, ValueType, uint16_t, CodecInt16< ByteOrder, ValueType > >, odc::codec::CodecConstantString< ByteOrder >, odc::codec::CodecConstant< ByteOrder, ValueType >, and odc::codec::CodecConstant< ByteOrder, double >.

◆ gatherStats()

void odc::core::Codec::gatherStats ( const double &  v)
virtual

Reimplemented in odc::codec::CodecChars< ByteOrder >, odc::codec::CodecLongReal< ByteOrder >, odc::codec::BaseCodecInteger< ByteOrder, ValueType >, odc::codec::CodecConstant< ByteOrder, ValueType >, and odc::codec::CodecConstant< ByteOrder, double >.

Definition at line 98 of file Codec.cc.

Here is the caller graph for this function:

◆ hasMissing() [1/2]

int32_t odc::core::Codec::hasMissing ( ) const
inline

Definition at line 64 of file Codec.h.

◆ hasMissing() [2/2]

void odc::core::Codec::hasMissing ( bool  h)
inline

Definition at line 63 of file Codec.h.

Here is the caller graph for this function:

◆ load() [1/3]

void odc::core::Codec::load ( DataStream< OtherByteOrder > &  ds)
virtual

Definition at line 72 of file Codec.cc.

◆ load() [2/3]

void odc::core::Codec::load ( DataStream< SameByteOrder > &  ds)
virtual

Definition at line 68 of file Codec.cc.

◆ load() [3/3]

void odc::core::Codec::load ( GeneralDataStream ds)

Definition at line 60 of file Codec.cc.

Here is the call graph for this function:

◆ max() [1/2]

double odc::core::Codec::max ( ) const
inline

Definition at line 70 of file Codec.h.

Here is the caller graph for this function:

◆ max() [2/2]

void odc::core::Codec::max ( double  m)
inline

Definition at line 69 of file Codec.h.

Here is the caller graph for this function:

◆ min() [1/2]

double odc::core::Codec::min ( ) const
inline

Definition at line 67 of file Codec.h.

Here is the caller graph for this function:

◆ min() [2/2]

void odc::core::Codec::min ( double  m)
inline

Definition at line 66 of file Codec.h.

Here is the caller graph for this function:

◆ missingValue() [1/2]

double odc::core::Codec::missingValue ( ) const
inline

Definition at line 73 of file Codec.h.

◆ missingValue() [2/2]

void odc::core::Codec::missingValue ( double  v)

Definition at line 92 of file Codec.cc.

Here is the caller graph for this function:

◆ name()

const std::string& odc::core::Codec::name ( ) const
inline

Definition at line 40 of file Codec.h.

Here is the caller graph for this function:

◆ numStrings()

virtual size_t odc::core::Codec::numStrings ( ) const
inlinevirtual

Reimplemented in odc::codec::CodecChars< ByteOrder >, and odc::codec::CodecConstantString< ByteOrder >.

Definition at line 76 of file Codec.h.

Here is the caller graph for this function:

◆ operator=()

Codec& odc::core::Codec::operator= ( const Codec )
private

◆ print()

◆ resetStats()

void odc::core::Codec::resetStats ( )
inline

Definition at line 59 of file Codec.h.

◆ save() [1/3]

void odc::core::Codec::save ( DataStream< OtherByteOrder > &  ds)
virtual

Definition at line 88 of file Codec.cc.

◆ save() [2/3]

void odc::core::Codec::save ( DataStream< SameByteOrder > &  ds)
virtual

Definition at line 84 of file Codec.cc.

◆ save() [3/3]

void odc::core::Codec::save ( GeneralDataStream ds)

Definition at line 76 of file Codec.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setDataStream() [1/3]

void odc::core::Codec::setDataStream ( DataStream< OtherByteOrder > &  ds)
virtual

Definition at line 56 of file Codec.cc.

◆ setDataStream() [2/3]

void odc::core::Codec::setDataStream ( DataStream< SameByteOrder > &  ds)
virtual

Definition at line 52 of file Codec.cc.

◆ setDataStream() [3/3]

void odc::core::Codec::setDataStream ( GeneralDataStream ds)

Definition at line 44 of file Codec.cc.

Here is the call graph for this function:

◆ skip()

virtual void odc::core::Codec::skip ( )
pure virtual

Implemented in odc::codec::IntStringCodecBase< ByteOrder, InternalCodec >, odc::codec::IntStringCodecBase< ByteOrder, CodecInt8< ByteOrder, int64_t > >, odc::codec::IntStringCodecBase< ByteOrder, CodecInt16< ByteOrder, int64_t > >, odc::codec::CodecChars< ByteOrder >, odc::codec::ShortRealBase< ByteOrder, InternalMissing >, odc::codec::ShortRealBase< ByteOrder, real2MissingAsInt >, odc::codec::ShortRealBase< ByteOrder, minFloatAsInt >, odc::codec::CodecLongReal< ByteOrder >, odc::codec::BaseCodecMissing< ByteOrder, ValueType, InternalValueType, DerivedCodec >, odc::codec::BaseCodecMissing< ByteOrder, ValueType, uint8_t, CodecInt8Missing< ByteOrder, ValueType > >, odc::codec::BaseCodecMissing< ByteOrder, ValueType, uint16_t, CodecInt16Missing< ByteOrder, ValueType > >, odc::codec::BaseCodecMissing< ByteOrder, ValueType, uint8_t, CodecConstantOrMissing< ByteOrder, ValueType > >, odc::codec::CodecIntegerDirect< ByteOrder, ValueType, InternalValueType, DerivedCodec >, odc::codec::CodecIntegerDirect< ByteOrder, ValueType, int32_t, CodecInt32< ByteOrder, ValueType > >, odc::codec::CodecIntegerOffset< ByteOrder, ValueType, InternalValueType, DerivedCodec >, odc::codec::CodecIntegerOffset< ByteOrder, ValueType, uint8_t, CodecInt8< ByteOrder, ValueType > >, odc::codec::CodecIntegerOffset< ByteOrder, ValueType, uint16_t, CodecInt16< ByteOrder, ValueType > >, odc::codec::CodecConstantString< ByteOrder >, odc::codec::CodecConstant< ByteOrder, ValueType >, and odc::codec::CodecConstant< ByteOrder, double >.

Friends And Related Function Documentation

◆ operator<<

std::ostream& operator<< ( std::ostream &  s,
const Codec p 
)
friend

Definition at line 89 of file Codec.h.

Member Data Documentation

◆ hasMissing_

int32_t odc::core::Codec::hasMissing_
protected

Definition at line 98 of file Codec.h.

◆ max_

double odc::core::Codec::max_
protected

Definition at line 101 of file Codec.h.

◆ min_

double odc::core::Codec::min_
protected

Definition at line 100 of file Codec.h.

◆ missingValue_

double odc::core::Codec::missingValue_
protected

Definition at line 99 of file Codec.h.

◆ name_

std::string odc::core::Codec::name_
protected

Definition at line 96 of file Codec.h.

◆ type_

api::ColumnType odc::core::Codec::type_
protected

Definition at line 103 of file Codec.h.


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