#ifndef SPATEMCODEC_H
#define SPATEMCODEC_H

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

#include "LibItsMapemSpatem_TestSystem.hh"

class SpatemPDUCodec : public PERCodec <SPATEM__PDU__Descriptions::SPATEM>
{
public:
  SpatemPDUCodec() { loggers::get_instance().log("SpatemPDUCodec::SpatemPDUCodec(D)"); };
  virtual int encode (const SPATEM__PDU__Descriptions::SPATEM& spatem, BITSTRING& data);
  virtual int decode (const BITSTRING& data, SPATEM__PDU__Descriptions::SPATEM&);
};

class SpatemCodec : public Codec<SPATEM__PDU__Descriptions::SPATEM, SPATEM__PDU__Descriptions::SPATEM>
{
  SpatemPDUCodec asnCodec;

public:
  SpatemCodec() : Codec<SPATEM__PDU__Descriptions::SPATEM, SPATEM__PDU__Descriptions::SPATEM>(), asnCodec() { loggers::get_instance().log("SpatemCodec::SpatemCodec(D)"); };
  virtual ~SpatemCodec() { loggers::get_instance().log("SpatemCodec::~SpatemCodec"); };

  virtual int encode (const SPATEM__PDU__Descriptions::SPATEM& spatem, OCTETSTRING& data);
  virtual int decode (const OCTETSTRING& data, SPATEM__PDU__Descriptions::SPATEM&, Params* params = NULL);
};

#endif
