当前位置: 首页>>代码示例>>C#>>正文


C# DDS.create_struct_tc方法代码示例

本文整理汇总了C#中DDS.create_struct_tc方法的典型用法代码示例。如果您正苦于以下问题:C# DDS.create_struct_tc方法的具体用法?C# DDS.create_struct_tc怎么用?C# DDS.create_struct_tc使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在DDS的用法示例。


在下文中一共展示了DDS.create_struct_tc方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: type_w_sequence_get_typecode

    private static DDS.TypeCode type_w_sequence_get_typecode(
    DDS.TypeCodeFactory tcf )
    {
        DDS.StructMemberSeq members = new DDS.StructMemberSeq();

        try {
            DDS.TypeCode sequence_tc = sequence_get_typecode(tcf);
            if (sequence_tc == null) {
                Console.WriteLine("Error to create sequence_get_typecode");
                return null;
            }
            /* We create the typeCode for struct which contains the sequence */
            DDS.TypeCode tc = tcf.create_struct_tc("TypeWithSequence",
                members);

            tc.add_member(sequence_member_name, DDS.TypeCode.MEMBER_ID_INVALID,
                sequence_tc, DDS.TypeCode.NONKEY_MEMBER);

            return tc;
        } catch (DDS.Exception e) {
            Console.WriteLine("register_type error {0}", e);
            return null;
        }
    }
开发者ID:hakiri,项目名称:rticonnextdds-examples,代码行数:24,代码来源:dynamic_data_sequences.cs

示例2: outer_struct_get_type_code

    private static DDS.TypeCode outer_struct_get_type_code(
        DDS.TypeCodeFactory tcf )
    {
        DDS.StructMemberSeq members = new DDS.StructMemberSeq();

        try {
            /* First, we create the typeCode for a struct */
            DDS.TypeCode tc = tcf.create_struct_tc("OuterStruct", members);

            DDS.TypeCode inner_tc = inner_struct_get_type_code(tcf);

            /* Member 1 of outer struct will be a struct of type inner_struct
             * called inner*/
            tc.add_member("inner", DDS.TypeCode.MEMBER_ID_INVALID,
                    inner_tc, DDS.TypeCode.NONKEY_MEMBER);

            return tc;
        } catch (Exception e) {
            Console.WriteLine("register_type error {0}", e);
            return null;
        }
    }
开发者ID:hakiri,项目名称:rticonnextdds-examples,代码行数:22,代码来源:dynamic_data_nested_structs.cs

示例3: sequence_element_get_typecode

    private static DDS.TypeCode sequence_element_get_typecode(
        DDS.TypeCodeFactory tcf)
    {
        DDS.StructMemberSeq members = new DDS.StructMemberSeq();

        try {
            /* First, we create the typeCode for the simple struct */
            DDS.TypeCode tc = tcf.create_struct_tc("SimpleStruct", members);

            tc.add_member("a_member", DDS.TypeCode.MEMBER_ID_INVALID,
                    DDS.TypeCode.TC_LONG, DDS.TypeCode.NONKEY_MEMBER);

            return tc;
        } catch (DDS.Exception e) {
            Console.WriteLine("register_type error {0}", e);
            return null;
        }
    }
开发者ID:hakiri,项目名称:rticonnextdds-examples,代码行数:18,代码来源:dynamic_data_sequences.cs

示例4: inner_struct_get_type_code

    private static DDS.TypeCode inner_struct_get_type_code(
        DDS.TypeCodeFactory tcf)
    {
        DDS.StructMemberSeq members = new DDS.StructMemberSeq();

        /* First, we create the typeCode for a struct */
        try {
            DDS.TypeCode tc = tcf.create_struct_tc("InnerStruct", members);

            /* Member 1 will be a double named x */
            tc.add_member("x", DDS.TypeCode.MEMBER_ID_INVALID,
                    DDS.TypeCode.TC_DOUBLE, DDS.TypeCode.NONKEY_MEMBER);

            /* Member 2 will be a double named y */
            tc.add_member("y", DDS.TypeCode.MEMBER_ID_INVALID,
                DDS.TypeCode.TC_DOUBLE, DDS.TypeCode.NONKEY_MEMBER);

            return tc;
        } catch (Exception e) {
            Console.WriteLine("register_type error {0}", e);
            return null;
        }
    }
开发者ID:hakiri,项目名称:rticonnextdds-examples,代码行数:23,代码来源:dynamic_data_nested_structs.cs


注:本文中的DDS.create_struct_tc方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。