Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#ifndef CODECPER_H
#define CODECPER_H
#include "Params.hh"
class OCTETSTRING;
class CHARSTRING;
class BITSTRING;
class TTCN_Buffer;
class TTCN_EncDec;
class TTCN_Typedescriptor_t;
struct asn_TYPE_descriptor_s;
class ASN1RecodePer // FIXME Move into file ASN1RecodePer.hh
{
protected:
int ber2per (const asn_TYPE_descriptor_s & td, TTCN_Buffer & buf);
int per2ber (const asn_TYPE_descriptor_s & td, TTCN_Buffer & buf);
int recode (const asn_TYPE_descriptor_s & td, int from, int to, TTCN_Buffer & buf);
};
template<typename TPDU>
class PERCodec : public ASN1RecodePer
{
public:
virtual int encode(const TPDU& msg, BITSTRING& bits) = 0;
virtual int decode(const BITSTRING& bits, TPDU& msg) = 0;
protected:
int _decode (const TTCN_Typedescriptor_t& ttcn, const asn_TYPE_descriptor_s & td, const BITSTRING& p_data, TPDU& msg);
int _encode (const TTCN_Typedescriptor_t& ttcn, const asn_TYPE_descriptor_s & td, const TPDU& msg, BITSTRING& p_data);
}; // End of class PERCodec
#include "PERCodec.t.hh"
#endif