TTCN-3 CODEC
           // TTCN-3 // TUTORIAL // USAGE // INTERFACES // DOWNLOAD // ABOUT

THE TTCN-3 INTERFACES

// INTERFACES // STIMULI // RESPONSES // CODEC // ADAPTER TYPES // CODEC TYPES // STANDARDS

CODEC

The user's codec must implement the interface TciCDProvided which defines the methods encode and decode (the codec may also be derived from class Codec which has dummy implementations for encode and decode).

These methods are defined in Part 6 of the TTCN-3 Standard: TTCN-3 Control Interface (TCI).

The result and parameter type TriMessage is described in

Types for Adapter Implementation

The types Type and Value are described in

Types for Codec Implementation

encode

public virtual TriMessage encode (
   Value value
)
A call
encode(value)
returns a TriMessage that contains the paramemeter value encoded as an array of bytes.

decode

public virtual Value decode (
   TriMessage message,
   Type decodingHypothesis
)
A call
decode(message, decodingHypothesis)
tries to decode the byte array contained in message according to decodingHypothesis. If the byte array can be interpreted as a value of type decodingHypothesis this value is returned. Otherwise the function returns null.