#ifndef CODEC_H
#define CODEC_H

#include "loggers.hh"

class OCTETSTRING;
class CHARSTRING;
class BITSTRING;

template<typename TPDUEnc, typename TPDUDec> class Codec
{
public:
  Codec() { 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) = 0;
};

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

#endif
