Codec.hh
Go to the documentation of this file.
#pragma once
#include "Params.hh"
class OCTETSTRING;
class CHARSTRING;
class BITSTRING;
template<typename TPDUEnc, typename TPDUDec>
class Codec
{
protected:
Params* _params;
// \todo Use smart pointer std::unique_ptr<Params>
public:
explicit Codec() : _params(nullptr) { };
virtual ~Codec() { };
virtual int encode(const TPDUEnc& p_message, OCTETSTRING& p_data) = 0;
virtual int decode(const OCTETSTRING& p_, TPDUDec& p_message, Params* p_params = NULL) = 0;
}; // End of class Codec
Codec::_params
Params * _params
Definition: Codec.hh:28
Codec::Codec
Codec()
Reference to Params stack.
Definition: Codec.hh:37
Codec::decode
virtual int decode(const OCTETSTRING &p_, TPDUDec &p_message, Params *p_params=NULL)=0
Encode typed message into an octet string format.
Params.hh
Header file for the parameter dictionary.
Codec
Declare TITAN class.
Definition: Codec.hh:25
Params
This class provides basic functionalities for an ITS dictionary.
Definition: Params.hh:21
Codec::~Codec
virtual ~Codec()
Default destructor .
Definition: Codec.hh:44
Codec::encode
virtual int encode(const TPDUEnc &p_message, OCTETSTRING &p_data)=0
Encode typed message into an octet string.
Definition: Codec.hh:44