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); } }
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); } }
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); } }
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); } }
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; } }
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; } }
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; } }
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; } }