Skip to content

Coder

#include <tpau-cpp-kernal/Coder.h>

INCLUDE FILE
#include <tpau-cpp-kernal/Coder.h>

class Coder

DEFINITION
class Coder;

constructor Coder

DEFINITION
Coder ( CoderEngine & engine );
PARAMETERDESCRIPTION
engine

destructor ~Codervirtual

DEFINITION
virtual ~Coder ( );

method finish

Finish the coding process.

Subclasses should call this method in their end() method.

DEFINITION
void  finish ( );

method process

Process the given data.

DEFINITION
void  process ( std::string_view  data );
PARAMETERDESCRIPTION
data

The data to process.

method process

Process the given byte.

DEFINITION
void  process ( uint8_t  datum );
PARAMETERDESCRIPTION
datum

The byte to process.

class CoderEngine

DEFINITION
class CoderEngine;

constructor CoderEngine

DEFINITION
CoderEngine ( CoderOutput & output );
PARAMETERDESCRIPTION
output

destructor ~CoderEnginevirtual

DEFINITION
virtual ~CoderEngine ( );

method end

DEFINITION
void  end ( );

method finish

Finish the coding process.

DEFINITION
void  finish ( );

method finish_implementationvirtual

Finish the coding process.

DEFINITION
virtual void  finish_implementation ( );

method process

Process the given byte.

DEFINITION
void  process ( uint8_t  datum );
PARAMETERDESCRIPTION
datum

The byte to process.

method process_implementationvirtual

Process the given byte.

DEFINITION
virtual void  process_implementation ( uint8_t  datum ) = 0;
PARAMETERDESCRIPTION
datum

The byte to process.

method write

DEFINITION
void  write ( uint8_t  datum );
PARAMETERDESCRIPTION
datum

member error

DEFINITION
bool  error;

member finished

DEFINITION
bool  finished;

member output

DEFINITION
CoderOutput & output;

class CoderOutput

DEFINITION
class CoderOutput;

destructor ~CoderOutputvirtual

DEFINITION
virtual ~CoderOutput ( );

method end

All output has been written.

DEFINITION
void  end ( );
THROWSDESCRIPTION
Exception

if the output has already been ended.

std::runtime_error

if an error occurs while ending the output.

method end_implementationvirtual

End the output. This is called by end().

DEFINITION
virtual void  end_implementation ( );
THROWSDESCRIPTION
std::runtime_error

if an error occurs while ending the output.

method write

Write the given byte to the output.

DEFINITION
void  write ( uint8_t  datum );
PARAMETERDESCRIPTION
datum

The byte to write.

THROWSDESCRIPTION
Exception

if the output has already been ended.

std::runtime_error

if an error occurs while writing the byte.

method write_implementationvirtual

Write the given byte to the output. This is called by write().

DEFINITION
virtual void  write_implementation ( uint8_t  datum ) = 0;
PARAMETERDESCRIPTION
datum

The byte to write.

THROWSDESCRIPTION
std::runtime_error

if an error occurs while writing the byte.

member ended

DEFINITION
bool  ended;

class StreamCoderOutput

DEFINITION
class StreamCoderOutput;

constructor StreamCoderOutput

DEFINITION
StreamCoderOutput ( std::ostream & stream,
size_t  line_length = 0,
size_t  indent = 0 );
PARAMETERDESCRIPTION
stream
line_length
indent

method write_implementationvirtual

Write the given byte to the output. This is called by write().

DEFINITION
virtual void  write_implementation ( uint8_t  datum );
PARAMETERDESCRIPTION
datum

The byte to write.

THROWSDESCRIPTION
std::runtime_error

if an error occurs while writing the byte.

class StringCoderOutput

DEFINITION
class StringCoderOutput;

constructor StringCoderOutput

DEFINITION
StringCoderOutput ( );

method get_string

Get the string that has been written to the output.

DEFINITION
std::string  get_string ( );
RETURNSDESCRIPTION
std::string

The string that has been written to the output.

THROWSDESCRIPTION
Exception

if the output has not been ended yet.

method write_implementationvirtual

Write the given byte to the output. This is called by write().

DEFINITION
virtual void  write_implementation ( uint8_t  datum );
PARAMETERDESCRIPTION
datum

The byte to write.

THROWSDESCRIPTION
std::runtime_error

if an error occurs while writing the byte.