TTCN-3 TCI TYPES
           // TTCN-3 // TUTORIAL // USAGE // INTERFACES // DOWNLOAD // ABOUT

THE TTCN-3 INTERFACES

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

TYPES FOR CODEC IMPLEMENTATION

This section describes the data types required for codec implementation. They provide meta information and allow to access and create TTCN-3 values.

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

Type

Objects of type Type represent predefined and user-defined TTCN-3 types at runtime.

TciModuleId getDefiningModule ()
T.getDefiningModule() returns the identifier of the module in which the type represented by T is defined.
string getName ()
T.getName() returns the name of the type represented by T.
int getTypeClass ()
T.getTypeClass() returns the type class of the type represented by T.
Value newInstance ()
T.newInstance() creates and returns a new value for the type represented by T.
string getTypeEncoding ()
T.getTypeEncoding() returns the type encoding for the type represented by T.
string getTypeEncodingVariant ()
T.getTypeEncodingVariant() returns the type encoding variant for the type represented by T.

Value

Objects of type Value represent values of predifined or user-defined TTCN-3 types.

Value is an abstract type from which more specific types such as IntegerValue or RecordValue are derived.

Type getType()
V.getType() returns TTCN-3 type of V
bool notPresent ()
T.notPresent() returns true iff if V corresponds to omit.
string getValueEncoding ()
V.getValueEncoding() returns the value encoding for V.
string getValueEncodingVariant ()
V.getValueEncodingVariant() returns the value encoding variant for V.

IntegerValue

Objects of type IntegerValue represent values of the TTCN-3 type integer.

int getInteger ()
V.getInteger() returns the TTCN-3 integer value represented by V.
void setInteger (
   int value
)
V.setInteger(value) sets the value represented by V to value.

FloatValue

Objects of type FloatValue represent values of the TTCN-3 type float.

double getFloat ()
V.getFloat() returns the TTCN-3 float value represented by V.
void setFloat (
   double value
)
V.setFloat(value) sets the value represented by V to value.

BooleanValue

Objects of type BooleanValue represent values of the TTCN-3 type boolean.

bool getBoolean ()
V.getBoolean() returns the TTCN-3 boolean value represented by V.
void setBoolean (
   bool value
)
V.setBoolean(value) sets the value represented by V to value.

CharstringValue

Objects of type CharstringValue represent values of the TTCN-3 type charstring.

string getString ()
V.getString() returns the TTCN-3 charstring value represented by V.
void setString (
   string value
)
V.setString(value) sets the value represented by V to value.
char getChar (
   int position
)
V.getChar(i) returns the i-th character of the string represented by V.
void setChar (
   int position,
   char value
)
V.setChar(i, c) sets the i-th character of the string represented by V to c.
int getLength ()
V.getLength() returns the length of the string represented by V
void setLength (
   int len
)
V.setLength(len) sets the length of the string represented by V to len.

UniversalCharstringValue

Objects of type UniversalCharstringValue represent values of the TTCN-3 type universal charstring.

string getString ()
V.getString() returns the TTCN-3 universal charstring value represented by V.
void setString (
   string value
)
V.setString(value) sets the value represented by V to value.
int getChar (
   int position
)
V.getChar(i) returns the i-the character of the string represented by V.
void setChar (
   int position,
   int value
)
V.setChar(i, c) sets the i-the character of the string represented by V to c.
int getLength ()
V.getLength() returns the length of the string represented by V
void setLength (
   int len
)
V.setLength(len) sets the length of the string represented by V to len.

BitstringValue

Objects of type BitstringValue represent values of the TTCN-3 type bitstring.

getString ()
V.getString() returns the TTCN-3 bitstring value represented by V.
void setString (
   string value
)
V.setString(value) sets the value represented by V to value.
int getBit (
   int position
)
V.getBit(i, c) returns the i-th bit of the string represented by V.
void setBit (
   int position,
   int value
)
V.setBit(i, c) sets the i-th bit of the string represented by V to c.
int getLength ()
V.getLength() returns the length of the string represented by V
void setLength (
   int len
)
V.setLength(len) sets the length of the string represented by V to len.

OctetstringValue

Objects of type OctetstringValue represent values of the TTCN-3 type octetstring.

string getString ()
V.getString() returns the TTCN-3 octetstring value represented by V.
void setString (
   string value
)
V.setString(value) sets the value represented by V to value.
int getOctet (
   int position
)
V.setChar(i) returns the i-th octet of the string represented by V.
void setOctet (
   int position,
   int value
)
V.setChar(i, c) sets the i-th octet of the string represented by V to c.
int getLength ()
V.getLength() returns the length of the string represented by V
void setLength (
   int len
)
V.setLength(len) sets the length of the string represented by V to len.

HexstringValue

Objects of type HexstringValue represent values of the TTCN-3 type hexstring.

string getString ()
V.getString() returns the TTCN-3 hexstring value represented by V.
void setString (
   string value
)
V.setString(value) sets the value represented by V to value.
int getHex (
   int position
)
V.setHex(i, c) returns the i-th hex digit of the string represented by V to c.
void setHex (
   int position,
   int value
)
V.setHex(i, c) sets the i-th hex digit of the string represented by V to c.
int getLength ()
V.getLength() returns the length of the string represented by V
void setLength (
   int len
)
V.setLength(len) sets the length of the string represented by V to len.

RecordValue

Objects of type RecordValue represent values of user-defined record types.

Value getField (
   string fieldName
)
If R represents a record that has field with name fieldName, then R.getField(fieldName) returns the value of that field.
void setField (
   string fieldName,
   Value value
)
If R represents a record that has field with name fieldName, then R.setField(fieldName, value) sets the value of that field to value.
string[] getFieldNames ()
R.getFieldName() returns an array of the field names for the record type of the value represented by R.

RecordOfValue

Objects of type RecordOfValue represent values of user-defined record of types.

Value getField (
   int position
)
R.getField(i) returns the i-th field of the record-of value represented by R.
void setField (
   int position,
   Value value
)
R.setField(i, value) sets the i-th field of the record-of value represented by R to value.
void appendField (Value value)
R.appendField(value) append a field with value value to the record-of value represented by R.
Type getElementType ()
If R represents a record of T value then R.getElementType() returns a Type object representing T.
int getLength ()
R.getLength() returns the number of elements of the record-of value represented by R.
void setLength (
   int len
)
R.setLength(len) sets the number of elements of the record-of value represented by R to len, thereby shortening the list of elements or extendending it by omit values.

UnionValue

Objects of type UnionValue represent values of user-defined union types.

Value getVariant (
   string fieldName
)
If U represents a union value whose selected variant is equal to fieldName, then U.getVariant(fieldName) returns a Value representing the value of the selected field. Otherwise null is returned.
void setVariant (
   string fieldName,
   Value value
)
If Urepresents a value of a union that has a field with name equal to FieldName and value represents a value of a the type of this field, then U.setVaraint(fieldName, value) selects this field and assign it this value.
string getPresentVariantName ()
U.getPresentVariantName() return ths name of the selected variant of the union value represented by U.
string[] getVariantNames ()
If U represents a value of a unition type then U.getVariantNames() returns an array of string specifying the names of the fields of this type.

EnumeratedValue

Objects of type EnumeratedValue represent values of user-defined enumerated types.

string getEnum ()
If E represents a value of enumerated type then E.getEnum returns a string denoting this value.
void setEnum (
   string enumValue
)
If E denotes a value of an enumerated type with a constant whose name is equal to enumValue, E.setEnum(enumValue) lets E represent this constant.

VerdictValue

Objects of type VerdictValue represent values of the TTCN-3 type verdicttype.

int getVerdict ()
V.getVerdict() returns the verdictype value represented by V as integer code. none is coded as 0, pass as 1, inconc as 2, fail as 3, error as 4. These values may be denoted by constants VerdictValue.NONE, VerdictValue.PASS, VerdictValue.INCONC, VerdictValue.FAIL, VerdictValue.ERROR.
void setVerdict (
   int value
)
V.setValue(value) lets V represent the verdicttype value coded by value.

TciCDRequired

The interface TciCDRequired provides methods that return instances of the classes described above. It also provides an error message method. (The singleton object of a class that implements this interface is obtained by Framework.GetTciCDReqired().)

Type getTypeForName(string typeName)
If typeName is the name of a predefined or user-defined TTCN-3 type, then getTypeForName(typeName) returns the Type object representing this type. If typeName stands for a user-defined type T defined in module M then typeName must have the form M.T. If typeName stands for predefined type T it must have the form T.

Type getInteger()
getInteger() returns the Type object representing the TTCN-3 type integer.

Type getFloat()
getFloat() returns the Type object representing the TTCN-3 type float.

Type getBoolean()
getBoolean() returns the Type object representing the TTCN-3 type boolean.

Type getCharstring()
Type getUniversalCharstring()
getUniversalCharstring() returns the Type object representing the TTCN-3 type universal charstring.

Type getHexstring()
getHexstring() returns the Type object representing the TTCN-3 type hexstring.

Type getBitstring()
getBitstring() returns the Type object representing the TTCN-3 type bitstring.

Type getOctetstring()
Type getVerdict()
getVerdict() returns the Type object representing the TTCN-3 type verdicttype.

void tciErrorReq(string message)
tciErrorRequest(message) emits message and terminates the test case with verdict error.