Index

Package: DDS.TypeCodeFactory

Description

package DDS.TypeCodeFactory is

Summary: A singleton factory for creating, copying, and deleting data type definitions dynamically.

You can access the singleton with the DDS_TypeCodeFactory.get_instance procedure.

If you want to publish and subscribe to data of types that are not known to you at system design time, this class will be your starting point. After creating a data type definition with this class, you will modify that definition using the DDS_TypeCode class and then register it with the DDSDynamicDataModule API.

The procedures of this class fall into several categories:

Getting definitions for primitive types:
Type definitions for primitive types (e.g. integers, floating point values, etc.) are pre-defined; your application only needs to get them, not create them.

  • DDS_TypeCodeFactory.get_primitive_tc

    Creating definitions for strings, arrays, and sequences:
    Type definitions for strings, arrays, and sequences (i.e. variables-size lists) must be created as you need them, because the type definition includes the maximum length of those containers.

  • DDS_TypeCodeFactory.create_string_tc
  • DDS_TypeCodeFactory.create_wstring_tc
  • DDS_TypeCodeFactory.create_array_tc
  • DDS_TypeCodeFactory::create_array_tc
  • DDS_TypeCodeFactory.create_sequence_tc

    Creating definitions for structured types:
    Structured types include structures, value types, and unions.

  • DDS_TypeCodeFactory.create_struct_tc
  • DDS_TypeCodeFactory.create_value_tc
  • DDS_TypeCodeFactory.create_union_tc

    Creating definitions for other types:
    The type system also supports enumerations and aliases (i.e. typedefs in C and C++).

  • DDS_TypeCodeFactory.create_enum_tc
  • DDS_TypeCodeFactory.create_alias_tc

    Deleting type definitions:
    When you're finished using a type definition, you should delete it. ( Note that you only need to delete a DDS_TypeCode that you created; if you got the object from DDS_TypeCodeFactory.get_primitive_tc, you must not delete it.)

  • DDS_TypeCodeFactory.delete_tc

    Copying type definitions:
    You can also create deep copies of type definitions:

  • DDS_TypeCodeFactory.clone_tc

  • Types

    Ref (abstract)

    type Ref is interface;
    Just a stub to be compleated.

    Ref_Access

    type Ref_Access is access all Ref'Class;

    StructMember

    type StructMember is new Integer;

    EnumMember

    type EnumMember is new Integer;

    ValueMember

    type ValueMember is new Integer;

    UnionMember

    type UnionMember is new Integer;

    CdrInputStream

    type CdrInputStream is new Integer;

    TCKind

    type TCKind is new Integer;

    Subprograms & Entries

    Get_Instance

    function Get_Instance return Ref_Access;

    Create_Alias_Tc (abstract)

    function Create_Alias_Tc 
    (This: not null access Ref;
    S: in String;
    Tc: in TypeCode;
    Flag: in Boolean) return TypeCode is abstract;

    Summary: Constructs a DDS.TK_ALIAS (typedef) DDS_TypeCode.

    self: <<in>> Cannot be NULL

    name: <<in>> Name of the alias. Cannot be ull_value.

    original_type: <<in>> Aliased type code. Cannot be ull_value.

    is_pointer: <<in>> Indicates if the alias is a pointer to the aliased type code.

    Raises: DDS.BAD_PARAM_SYSTEM_EXCEPTION_CODE. Illegal parameter value.

    Returns: A newly-created DDS_TypeCode object describing an alias.

    Create_Array_Tc (abstract)

    function Create_Array_Tc 
    (This: not null access Ref;
    Ai: in Long_Array;
    Tc: in TypeCode) return TypeCode is abstract;

    Summary: Constructs a DDS.TK_ARRAY DDS_TypeCode.

    self: <<in>> Cannot be NULL

    dimensions: <<in>> Dimensions of the array. Each dimension has to be greater than 0.

    element_type: <<in>> DDS_TypeCode describing the array elements. Cannot be ull_value.

    Raises: DDS.BAD_PARAM_SYSTEM_EXCEPTION_CODE. Illegal parameter value.

    Returns: A newly-created DDS_TypeCode object describing a sequence.

    Create_Enum_Tc (abstract)

    function Create_Enum_Tc 
    (This: not null access Ref;
    S: in String;
    Aenummember: in EnumMember) return TypeCode is abstract;

    Summary: Constructs a DDS.TK_ENUM DDS_TypeCode.

    self: <<in>> Cannot be NULL

    name: <<in>> Name of the enum type. Cannot be ull_value.

    members: <<in>> Initial members of the enumeration. All members must have non- ull_value names, and both names and ordinal values must be unique within the type. Note that it is also possible to add members later with DDS_TypeCode.add_member_to_enum. This argument may be ull_value.

    Raises: DDS.BAD_PARAM_SYSTEM_EXCEPTION_CODE. Illegal parameter value.

    Returns: A newly-created DDS_TypeCode object describing an enumeration.

    Create_Sequence_Tc (abstract)

    function Create_Sequence_Tc 
    (This: not null access Ref;
    I: in Long;
    Tc: in TypeCode) return TypeCode is abstract;

    Summary: Constructs a DDS.TK_SEQUENCE DDS_TypeCode.

    self: <<in>> Cannot be NULL

    bound: <<in>> The bound for the sequence (> 0).

    element_type: <<in>> DDS_TypeCode object describing the sequence elements.

    Raises: DDS.BAD_PARAM_SYSTEM_EXCEPTION_CODE. Illegal parameter value.

    Returns: A newly-created DDS_TypeCode object describing a sequence.

    Create_Sparse_Tc (abstract)

    function Create_Sparse_Tc 
    (This: not null access Ref;
    S: in String;
    Word0: in Short;
    Tc: in TypeCode) return TypeCode is abstract;

    Summary: Constructs a DDS.TK_SPARSE DDS_TypeCode.

    A sparse value type is similar to other value types but with one major difference: not all members need to be present in every sample.

    It is not possible to generate code for sparse value types; they must be created at runtime using these APIs. You will interact with samples of sparse types using the DDSDynamicDataModule APIs.

    self: <<in>> Cannot be NULL

    name: <<in>> Name of the value type. Cannot be ull_value.

    type_modifier: <<in>> One of the value type modifier constants: DDS.VM_NONE, DDS.VM_CUSTOM, DDS.VM_ABSTRACT or DDS.VM_TRUNCATABLE.

    concrete_base: <<in>> DDS_TypeCode object describing the concrete valuetype base. It may be ull_value if the valuetype does not have a concrete base.

    Raises: DDS.BAD_PARAM_SYSTEM_EXCEPTION_CODE. Illegal parameter value.

    Returns: A newly-created DDS_TypeCode object describing a value.

    Create_String_Tc (abstract)

    function Create_String_Tc 
    (This: not null access Ref;
    I: in Long) return TypeCode is abstract;

    Summary: Constructs a DDS.TK_STRING DDS_TypeCode.

    self: <<in>> Cannot be NULL

    bound: <<in>> Maximum length of the string. It cannot be negative. \endif \if C_CPP_LANGUAGE_ONLY

    ex: <<out>> Parameter for error indications. The values that can take are:

    • DDS.NO_EXCEPTION_CODE
    • DDS.BAD_PARAM_SYSTEM_EXCEPTION_CODE
    • DDS.NO_MEMORY_SYSTEM_EXCEPTION_CODE

    Returns: A newly-created DDS_TypeCode object describing a string.

    Create_Struct_Tc (abstract)

    function Create_Struct_Tc 
    (This: not null access Ref;
    S: in String;
    Astructmember: in StructMember) return TypeCode is abstract;

    Summary: Constructs a DDS.TK_STRUCT DDS_TypeCode.

    self: <<in>> Cannot be NULL

    name: <<in>> Name of the struct type. Cannot be ull_value.

    members: <<in>> Initial members of the structure. This list may be empty (that is, FooSeq::length() may return zero). If the list is not empty, the elements must describe valid struct members. (For example, the names must be unique within the type.) This argument may be ull_value.

    Raises: DDS.BAD_PARAM_SYSTEM_EXCEPTION_CODE. Illegal parameter value.

    Returns: A newly-created DDS_TypeCode object describing a struct.

    Create_Tc_From_Stream (abstract)

    function Create_Tc_From_Stream 
    (This: not null access Ref;
    Inputstream: in CdrInputStream) return TypeCode is abstract;

    Create_Union_Tc (abstract)

    function Create_Union_Tc 
    (This: not null access Ref;
    S: in String;
    Tc: in TypeCode;
    I: in Long;
    Aunionmember: in UnionMember) return TypeCode is abstract;

    Summary: Constructs a DDS.TK_UNION DDS_TypeCode.

    self: <<in>> Cannot be NULL

    name: <<in>> Name of the union type. Cannot be ull_value.

    discriminator_type: <<in>> Discriminator Type Code. Cannot be ull_value.

    default_index: <<in>> Index of the default member, or -1 if there is no default member.

    members: <<in>> Initial members of the union. This list may be empty. If the list is not empty, the elements must describe valid struct members. (For example, the names must be unique within the type.) This argument may be ull_value.

    Raises: DDS.BAD_PARAM_SYSTEM_EXCEPTION_CODE. Illegal parameter value.

    Returns: A newly-created DDS_TypeCode object describing a union.

    Create_Value_Tc (abstract)

    function Create_Value_Tc 
    (This: not null access Ref;
    S: in String;
    Word0: in Short;
    Tc: in TypeCode;
    Avaluemember: in ValueMember) return TypeCode is abstract;

    Summary: Constructs a DDS.TK_VALUE DDS_TypeCode.

    self: <<in>> Cannot be NULL

    name: <<in>> Name of the value type. Cannot be ull_value.

    type_modifier: <<in>> One of the value type modifier constants: DDS.VM_NONE, DDS.VM_CUSTOM, DDS.VM_ABSTRACT or DDS.VM_TRUNCATABLE.

    concrete_base: <<in>> DDS_TypeCode object describing the concrete valuetype base. It may be ull_value if the valuetype does not have a concrete base.

    members: <<in>> Initial members of the value type. This list may be empty. If the list is not empty, the elements must describe valid value type members. (For example, the names must be unique within the type.) This argument may be ull_value.

    Raises: DDS.BAD_PARAM_SYSTEM_EXCEPTION_CODE. Illegal parameter value.

    Returns: A newly-created DDS_TypeCode object describing a value.

    Create_Wstring_Tc (abstract)

    function Create_Wstring_Tc 
    (This: not null access Ref;
    I: in Long) return TypeCode is abstract;

    Summary: Constructs a DDS.TK_WSTRING DDS_TypeCode.

    self: <<in>> Cannot be NULL

    bound: <<in>> Maximum length of the wide string. It cannot be negative. \endif \if C_CPP_LANGUAGE_ONLY

    ex: <<out>> Parameter for error indications. The values that can take are:

    • DDS.NO_EXCEPTION_CODE
    • DDS.BAD_PARAM_SYSTEM_EXCEPTION_CODE
    • DDS.NO_MEMORY_SYSTEM_EXCEPTION_CODE

    Returns: A newly-created DDS_TypeCode object describing a wide string.

    Get_Primitive_Tc (abstract)

    function Get_Primitive_Tc 
    (This: not null access Ref;
    Kind: in TCKind) return TypeCode is abstract;

    Summary: Get the DDS_TypeCode for a primitive type (integers, floating point values, etc.) identified by the given DDS.TCKind.


    See also: DDS_g_tc_long
    See also: DDS_g_tc_ulong
    See also: DDS_g_tc_short
    See also: DDS_g_tc_ushort
    See also: DDS_g_tc_float
    See also: DDS_g_tc_double
    See also: DDS_g_tc_longdouble
    See also: DDS_g_tc_octet
    See also: DDS_g_tc_boolean
    See also: DDS_g_tc_char
    See also: DDS_g_tc_wchar