本文整理汇总了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;
}
}
示例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;
}
}
示例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;
}
}
示例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;
}
}