IODA Bundle
odc::codec::CodecChars< ByteOrder > Class Template Reference

#include <String.h>

Inheritance diagram for odc::codec::CodecChars< ByteOrder >:
[legend]
Collaboration diagram for odc::codec::CodecChars< ByteOrder >:
[legend]

Public Member Functions

 CodecChars (api::ColumnType type, const std::string &name=codec_name())
 
 ~CodecChars () override
 
void load (core::DataStream< ByteOrder > &ds) override
 
void save (core::DataStream< ByteOrder > &ds) override
 
- Public Member Functions inherited from odc::core::DataStreamCodec< ByteOrder >
 DataStreamCodec (const std::string &name, api::ColumnType type)
 
void setDataStream (DataStream< ByteOrder > &ds) override
 
void clearDataStream () override
 
void setDataStream (GeneralDataStream &ds)
 
virtual void setDataStream (DataStream< SameByteOrder > &ds)
 
virtual void setDataStream (DataStream< OtherByteOrder > &ds)
 
- Public Member Functions inherited from odc::core::Codec
 Codec (const std::string &name, api::ColumnType type)
 
virtual ~Codec ()
 
const std::string & name () const
 
char * encode (char *p, const double &d)
 
void setDataStream (GeneralDataStream &ds)
 
virtual void setDataStream (DataStream< SameByteOrder > &ds)
 
virtual void setDataStream (DataStream< OtherByteOrder > &ds)
 
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 ()
 
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
 

Static Public Member Functions

constexpr static const char * codec_name ()
 

Protected Member Functions

std::unique_ptr< core::Codecclone () override
 
- Protected Member Functions inherited from odc::core::DataStreamCodec< ByteOrder >
void load (DataStream< ByteOrder > &ds) override
 
void save (DataStream< ByteOrder > &ds) override
 
DataStream< ByteOrder > & ds ()
 
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)
 

Protected Attributes

std::map< std::string, int64_t > stringLookup_
 
std::vector< std::string > strings_
 
size_t decodedSizeDoubles_
 
- Protected Attributes inherited from odc::core::DataStreamCodec< ByteOrder >
DataStream< ByteOrder > * ds_
 
- Protected Attributes inherited from odc::core::Codec
std::string name_
 
int32_t hasMissing_
 
double missingValue_
 
double min_
 
double max_
 
api::ColumnType type_
 

Private Member Functions

unsigned char * encode (unsigned char *p, const double &d) override
 
void decode (double *out) override
 
void skip () override
 
void gatherStats (const double &v) override
 
size_t numStrings () const override
 
void copyStrings (core::Codec &rhs) override
 
size_t dataSizeDoubles () const override
 
void dataSizeDoubles (size_t count) override
 
void print (std::ostream &s) const override
 

Detailed Description

template<typename ByteOrder>
class odc::codec::CodecChars< ByteOrder >

Note
CodecChars is only used as an intermediate codec. It encodes data during the normal Writer phase that is then reencoded using Int16String,... We should NEVER see 'chars' in the output data.

Definition at line 27 of file String.h.

Constructor & Destructor Documentation

◆ CodecChars()

template<typename ByteOrder >
odc::codec::CodecChars< ByteOrder >::CodecChars ( api::ColumnType  type,
const std::string &  name = codec_name() 
)

Definition at line 234 of file String.h.

◆ ~CodecChars()

template<typename ByteOrder >
odc::codec::CodecChars< ByteOrder >::~CodecChars ( )
inlineoverride

Definition at line 36 of file String.h.

Member Function Documentation

◆ clone()

template<typename ByteOrder >
std::unique_ptr< core::Codec > odc::codec::CodecChars< ByteOrder >::clone
overrideprotectedvirtual

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 from odc::core::Codec.

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

Definition at line 298 of file String.h.

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

◆ codec_name()

template<typename ByteOrder >
constexpr static const char* odc::codec::CodecChars< ByteOrder >::codec_name ( )
inlinestaticconstexpr

Definition at line 31 of file String.h.

◆ copyStrings()

template<typename ByteOrder >
void odc::codec::CodecChars< ByteOrder >::copyStrings ( core::Codec rhs)
overrideprivatevirtual

Reimplemented from odc::core::Codec.

Definition at line 311 of file String.h.

◆ dataSizeDoubles() [1/2]

template<typename ByteOrder >
size_t odc::codec::CodecChars< ByteOrder >::dataSizeDoubles ( ) const
inlineoverrideprivatevirtual

Reimplemented from odc::core::Codec.

Definition at line 57 of file String.h.

◆ dataSizeDoubles() [2/2]

template<typename ByteOrder >
void odc::codec::CodecChars< ByteOrder >::dataSizeDoubles ( size_t  count)
inlineoverrideprivatevirtual

Reimplemented from odc::core::Codec.

Definition at line 58 of file String.h.

Here is the call graph for this function:

◆ decode()

◆ encode()

template<typename ByteOrder >
unsigned char * odc::codec::CodecChars< ByteOrder >::encode ( unsigned char *  p,
const double &  d 
)
overrideprivatevirtual

n.b. Yes this is ugly. This is a hack into the existing API - and it assumes that the double& provided actually is the first element of a longer string.

Implements odc::core::Codec.

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

Definition at line 239 of file String.h.

◆ gatherStats()

template<typename ByteOrder >
void odc::codec::CodecChars< ByteOrder >::gatherStats ( const double &  v)
overrideprivatevirtual

Reimplemented from odc::core::Codec.

Definition at line 260 of file String.h.

◆ load()

template<typename ByteOrder >
void odc::codec::CodecChars< ByteOrder >::load ( core::DataStream< ByteOrder > &  ds)
override

Definition at line 282 of file String.h.

Here is the call graph for this function:

◆ numStrings()

template<typename ByteOrder >
size_t odc::codec::CodecChars< ByteOrder >::numStrings ( ) const
inlineoverrideprivatevirtual

Reimplemented from odc::core::Codec.

Definition at line 54 of file String.h.

Here is the caller graph for this function:

◆ print()

template<typename ByteOrder >
void odc::codec::CodecChars< ByteOrder >::print ( std::ostream &  s) const
overrideprivatevirtual

Reimplemented from odc::core::Codec.

Definition at line 319 of file String.h.

◆ save()

template<typename ByteOrder >
void odc::codec::CodecChars< ByteOrder >::save ( core::DataStream< ByteOrder > &  ds)
override

Definition at line 291 of file String.h.

Here is the call graph for this function:

◆ skip()

Member Data Documentation

◆ decodedSizeDoubles_

template<typename ByteOrder >
size_t odc::codec::CodecChars< ByteOrder >::decodedSizeDoubles_
protected

Definition at line 66 of file String.h.

◆ stringLookup_

template<typename ByteOrder >
std::map<std::string, int64_t> odc::codec::CodecChars< ByteOrder >::stringLookup_
protected

Definition at line 64 of file String.h.

◆ strings_

template<typename ByteOrder >
std::vector<std::string> odc::codec::CodecChars< ByteOrder >::strings_
protected

Definition at line 65 of file String.h.


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