#ifndef CODEC_H
#define CODEC_H

#include "loggers.hh" // TODO To be removed
#include "Params.hh"

class OCTETSTRING;
class CHARSTRING;
class BITSTRING;

template<typename TPDUEnc, typename TPDUDec> class Codec
{
protected:
  Params* _params;
  
public:
  Codec() : _params(NULL) { loggers::get_instance().log("Codec::Codec"); };
  virtual ~Codec() { loggers::get_instance().log("Codec::~Codec"); };
  virtual int encode(const TPDUEnc& msg, OCTETSTRING& data) = 0;
  virtual int decode(const OCTETSTRING& data, TPDUDec& msg, Params* params = NULL) = 0;
};

template<typename TPDU> class PERCodec
{
public:
  virtual int encode(const TPDU& msg, BITSTRING& bits) = 0;
  virtual int decode(const BITSTRING& bits, TPDU& msg) = 0;
};

#endif
