ETSI STF525 / Internal Testing test suite This project provides an internal testing test suite and its associated Test Adapter/Codec

Codec.hh
Go to the documentation of this file.
1
11 #pragma once
12
13 #include "Params.hh"
14
15 class OCTETSTRING;
16 class CHARSTRING;
17 class BITSTRING;
18
24 template<typename TPDUEnc, typename TPDUDec>
25 class Codec
26 {
27 protected:
28 Params* _params;
29 // \todo Use smart pointer std::unique_ptr<Params>
30
31 public:
32
37 explicit Codec() : _params(nullptr) { };
44 virtual ~Codec() { };
53 virtual int encode(const TPDUEnc& p_message, OCTETSTRING& p_data) = 0;
62 virtual int decode(const OCTETSTRING& p_, TPDUDec& p_message, Params* p_params = NULL) = 0;
63 }; // End of class Codec
64
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