Jump to content
OpenSplice DDS Forum

Search the Community

Showing results for tags 'idl'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • About OpenSplice DDS
    • News and Events
    • Site Feedback
  • Using OpenSplice DDS
    • General
    • Troubleshooting
  • Understanding OpenSplice DDS
    • OpenSplice DDS Slideshows
    • OpenSplice DDS Movies
  • Community
    • Project: SIMD
    • Project: CamelOS
    • Project: DDS Touchstone
    • Project: RESTful DDS
    • Mac OS X

Calendars

  • Community Calendar

Found 13 results

  1. ACE/TAO

    Hi All, I'm looking at ACE/TAO supported IDL compiler version supported by OpenSplice. It's seems that two IDL compiler are available ACE/TAO (DOC Group) and OpenFusion (Microfocus). Which one is recommended with OpenSplice ? OpenSlice seems to support ACE/TAO up to the version 5.6.6 (the last one is 6.4.4). Is there any reason to keep ACE/TAO 5.6.6 ? Best regards, Romain Naour
  2. Assign Values for Enums?

    Sorry if this is a repeat question but I couldn't find it by searching "enum" in the forums. Is it possible to define values for enums in the IDL? I saw a post from 2010 which said it was not possible at the time, but since it has been 7 years I thought that may have changed. We have a large project with a lot of existing IDL that defines values for enums. This works just fine with our current DDS solution but I am looking at transitioning to OpenSplice. When I run the idlpp on a simple enum it throws an error as soon as I attempt to assign a value. Non-valued enums work just fine. If it does not currently support this, is there a standard way of working around this? Thanks
  3. Hello Everyone, I am trying to compile an .idl file created in order to generate the Java classes that I am going to use for a Publish/Subscribe component. Everything is ok with the .idl file (named HelloWorldData), both syntax and location of the compiler and the .idl file (or at least, that´s what it seems). The command that I am using is: /.../OpenSplice/V6.4.14/HDE/x86.linux/bin/idlpp –f /home/phd/CompatibilityOSPLNBPrj/idl/HelloWorldData.idl –l java But I get an error message that says: /.../OpenSplice/V6.4.14/HDE/x86.linux/bin/idlpp: error while loading shared libraries: libddshts.so: cannot open shared object file: No such file or directory What is what I am missing here? Should I include the libddshts.so library? I am sorry if my questions are too simple, I just do not know how to do this. I am using Ubuntu LTS 12.04 as the operating system. Java version is 8. Kind regards.
  4. Data Types for IDL files

    Hello, I am using Community edition Opensplice DDS. I have gone through the documentation regarding the data types that DDS support. (IDL file). Doesn't DDS support usigned int ? If not can I use usigned long? I have read some articles that it is implementation dependent. For example, under Windows they are the same, but for example on Alpha systems a long was 64 bits whereas an int was 32 bits. In this case I am using Lubuntu 32-bit on a Windows 7 64-bit host. Regards, Akhil
  5. JVM Access Violation

    Hi, I have got the next jvm crash when running a java proccess which writes 2 topics (Topic1,Topic2) with sequences and another process which read this 2 topics. The crash happens in the writting process. I attach the two idl files. the crash is: # # A fatal error has been detected by the Java Runtime Environment: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x000007feda2128e3, pid=10572, tid=11044idls.zip # # JRE version: Java SE Runtime Environment (8.0_60-b27) (build 1.8.0_60-b27) # Java VM: Java HotSpot 64-Bit Server VM (25.60-b23 mixed mode windows-amd64 compressed oops) # Problematic frame: # C [ddskernel.dll+0x28e3] Topic1.idl module com { module ik { module dds { module topics { module topic1 { struct BasicStruct { String UT; }; typedef sequence<BasicStruct> ListaTipos; struct Topic1 { String id; ListaTipos IdVI; }; #pragma keylist Topic1 id };};};};}; Topic2.idl module com { module ik { module dds { module topics { module topic2 { struct BasicStruct { String UT; long indice; }; typedef sequence<BasicStruct> ListaTipos; struct Topic2 { String id; ListaTipos IdVI; }; #pragma keylist Topic2 id };};};};}; The problem is solved not using the same name for the structures. Is it a bug ???
  6. Invoking IDL pre processor

    Hello, I am working on a linux 4.20 and ubuntu 15.10 virtual machine and my host is windows 7. I am trying to implement a simple chat message example using Data Distribution Service (DDS) protocol provided by Prismtech (Community Edition). I came across a tutorial where I have to invoke the Chat.idl. Below there is the code in the file, which contains body for interconnection between a server and a client. module Chat { const long MAX_NAME = 32; typedef string<MAX_NAME> nameType; struct ChatMessage { long userID; // owner of message long index; // message number string content; // message body }; #pragma keylist ChatMessage userID struct NameService { long userID; // unique user identification nameType name; // name of the user }; #pragma keylist NameService userID struct NamedMessage { long userID; //unique user identification nameType userName //user name long index; //message number string content; //message body }; #pragma keylist NamedMessage userID }; to invoke this i am supposed to type in "idlpp -S -l c Chat.idl" in my command-line (terminal). Below is my output from the terminal showing "IDL parser error: opening file chat.idl". -virtual-machine:~/HDE/x86.linux$ idlpp Usage: idlpp [-c preprocessor-path] [-b ORB-template-path] [-n <include-suffix>] [-I path] [-D macro[=definition]] [-S | -C] [-l (c | c++ | cpp | isocpp | isoc++ | cs | java)] [-j [old]:<new>] [-d directory] [-i] [-P dll_macro_name[,<h-file>]] [-o (dds-types | custom-psm | no-equality)] <filename> akhil@akhil-virtual-machine:~/HDE/x86.linux$ idlpp -S -l c chat.dil IDL parser error: opening file chat.dil Regards, Akhil
  7. Hi I have an IDL as follows: module myPacket { module Building { module IDL_Floor { struct Sensors { boolean enable; float bonjefir; }; #pragma keylist Sensors enable }; }; }; In my code, I try to set a value for the float variable "bonjefir" as follows: myPacket::Building::IDL_Floor::Sensors data; data.bonjefir(100); But getting the following error: error: call of overloaded 'bonjefir(int)' is ambiguous I can solve this problem by modifying the files generated by "idlpp" command: file <myIDL.h> ... DDS::Float bonjefir() const { return this->bonefir_; } DDS::Float& bonjefir() { return this->bonjefir_; } void bonjrfir(DDS::Float _val_) { this->bonjefir_ = _val_; } #ifdef OSPL_DDS_CXX11 void bonjefir(DDS::Float&& _val_) { this->bonjefir_ = _val_; } // Comment this line #endif ... However setting the value of IDL like below is OK and working: data.bonjefir() = 100; // I don't like it data.bonjefir_ = 100; Is there any solution for this problem? Thanks in advance for your helps. Bonjefir
  8. Hello all, I have a somewhat confusing problem that I am hoping someone can shed some light on to help debug. All the source code is attached at the bottom. Background: All the following attached code is from a DDS module I have been developing as part of a bigger piece of software. The DDS code is compiled into an archive and then linked to the software's main executable. The point of the module is to take the software's data residing in a global common and publish them to stand-alone helper applications over the network elsewhere. The module is developed as one class (HostDDS.cpp) , with initialization / writing / stopping the DDS middle ware written as public member functions; and all the referred to variables in the class are attributes of the class. The class is instantiated and its method called from a C function entry point that interfaces with the rest of the system (dds_write.cpp). The problem: When I have a simple topic (Basic.idl), the program works fine. I have a test reader that performs perfectly in subscribing to the topic and reading the data coming across the network. However, when I introduced a more complex topic, (newsfd.idl), I get a "glibc detected, malloc() memory corruption" error as soon as the instance handle of the message is used in any function (register_instance, write, etc.) I'm really at a complete loss for why the same code would work on one topic but not the other... and an equally important question is whether this is due to some limitation of the larger software and something outside of the DDS module itself. Any pointers / suggestions would be greatly appreciated! Also please let me know if further information is required (note in the code below, skipped lines are due to large comment blocks, not any missing code). ---------------------------- OUTPUT ---------------------------- gdb stack output at memory corruption freeze 1 #0 0xffffe424 in __kernel_vsyscall () 2 #1 0x4126d1a3 in __lll_lock_wait_private () from /lib/libc.so.6 3 #2 0x411f4131 in _L_lock_9450 () from /lib/libc.so.6 4 #3 0x411f1ef4 in malloc () from /lib/libc.so.6 5 #4 0x411e7b9f in __libc_message () from /lib/libc.so.6 6 #5 0x411ee041 in malloc_printerr () from /lib/libc.so.6 7 #6 0x411f13b9 in _int_malloc () from /lib/libc.so.6 8 #7 0x411f1efe in malloc () from /lib/libc.so.6 9 #8 0xb7db4c0e in os_malloc (size=88) at /home/dds/OvernightTests/tmp.Z9PhthuYz4/build/src/abstraction/os/includ 10 #9 0xb7de1bf3 in c_mmMalloc (mm=0xb71005e0, size=88) at /home/dds/OvernightTests/tmp.Z9PhthuYz4/build/src/datab 11 #10 0xb7dcab2d in c_new (type=0xa430518) at /home/dds/OvernightTests/tmp.Z9PhthuYz4/build/src/database/database/ 12 #11 0xb7e5cbbe in v_writerInstanceNew (writer=0xa4311f0, message=0xa5e5a68) 13 at /home/dds/OvernightTests/tmp.Z9PhthuYz4/build/src/kernel/code/v_writerInstance.c:44 14 #12 0xb7e59b7f in v_writerWrite (w=0xa4311f0, message=0xa5e5a68, timestamp=..., instance=0x0) 15 at /home/dds/OvernightTests/tmp.Z9PhthuYz4/build/src/kernel/code/v_writer.c:2169 16 #13 0xb7e7ea92 in u_writeWithHandleAction (_this=0xa432150, data=0xbfffcaa4, timestamp=..., handle=0, action=0xb 17 getWriteClaim=OS_TRUE) at /home/dds/OvernightTests/tmp.Z9PhthuYz4/build/src/user/code/u_writer.c:378 18 #14 0xb7e95be2 in gapi_fooDataWriter_write (_this=0xa430ed8, instance_data=0xa432740 "", handle=0) 19 at /home/dds/OvernightTests/tmp.Z9PhthuYz4/build/src/api/dcps/gapi/code/gapi_fooDataWriter.c:167 20 #15 0xb7f882f5 in DDS::DataWriter_impl::write (this=0xa432098, instance_data=0xa432740, handle=0) 21 at /home/dds/OvernightTests/tmp.Z9PhthuYz4/build/src/api/dcps/ccpp/code/ccpp_DataWriter_impl.cpp:351 22 #16 0x081a9d0a in newsfd::SFD_spi_msgDataWriter_impl::write (this=0xa432098, instance_data=..., handle=0) at new 23 #17 0x081a7abc in HostDDS::writePublishDDS (this=0xa3dfde0) at HostDDS.cpp:227 24 #18 0x081a72ca in dds_write () at dds_write.cpp:80 25 #19 0x0805632b in RunModel (pMAT=0x98aee30) at modsch.c:1162 26 #20 0x080568dc in RunModels () at modsch.c:1572 27 #21 0x080551fa in main (argC=1, argV=0xbfffcca4) at modsch.c:426 ------------------------------ CODE ------------------------------ Basic.idl 4 module Basic 5 { 6 struct BasicMessage { 7 float dyn_heading; // aircraft magnetic heading 8 float dyn_altitude; // real altitude from equations of motion 9 float dyn_tas; // true airspeed 10 long time_simtime; // total elapsed simulation time in seconds 11 }; 12 #pragma keylist BasicMessage time_simtime 13 }; newsfd.idl 13 module newsfd 14 { 15 typedef string<40> string_40; 16 17 struct SurfGen { 18 float surfCmd; 19 float surfPos; 20 unsigned short surfTrans; 21 unsigned short surfCmdState; 22 unsigned short surfState; 23 }; 24 25 struct SFD_spi_msg 26 { 27 //~ 28 SurfGen surfTest[5]; 29 // 30 unsigned long block; 31 unsigned long count; 32 33 char a_char; 34 octet a_octet; 35 short a_short; 36 unsigned short a_ushort; 37 long a_long; 38 unsigned long a_ulong; 39 long long a_longlong; 40 unsigned long long a_ulonglong; 41 float a_float; 42 double a_double; 43 boolean a_boolean; 44 string_40 a_bstring; 45 //~ 46 char str_arr_char[10]; 47 octet str_arr_octet[10]; 48 short str_arr_short[10]; 49 unsigned short str_arr_ushort[10]; 50 long str_arr_long[10]; 51 unsigned long str_arr_ulong[10]; 52 long long str_arr_longlong[10]; 53 unsigned long long str_arr_ulonglong[10]; 54 float str_arr_float[10]; 55 double str_arr_double[10]; 56 boolean str_arr_boolean[11]; 57 // 58 }; 59 #pragma keylist SFD_spi_msg block 60 61 struct SFD_quit_msg 62 { 63 boolean quit; 64 }; 65 #pragma keylist SFD_quit_msg 66 }; dds_externals.h 24 #ifndef __mcpexternals_h 25 #define __mcpexternals_h 46 #ifdef __cplusplus 47 extern "C" { 48 #endif 49 50 //void dds_read( void ); 51 void dds_write( void ); 52 53 #ifdef __cplusplus 54 } 55 #endif 61 #endif // __mcpexternals_h dds_write.cpp 33 #include <stdio.h> 34 #include <stdlib.h> 35 36 #include "HostDDS.h" 37 #include "dds_externals.h" 38 #include "g_exec.h" 39 #include "g_eos.h" 53 HostDDS *TheHostDDS = new HostDDS(); 69 70 void dds_write() 71 { 72 if ( g_exec.initialize ) { 73 TheHostDDS -> initializeDDS(); 74 } else if ( g_exec.reset || g_eos.trim || g_eos.resetting ) { 75 //printf("\n\nENTERING DDS_WRITE RESET\n\n"); 76 } else if ( g_exec.stop ) { 77 TheHostDDS -> stopDDS(); 78 } else { 79 //printf("\n\nENTERING PUBLISH FUNCTIONn\n"); 80 TheHostDDS -> writePublishDDS(); 81 //printf("\n\nEXITING PUBLISH FUNCTIONn\n"); 82 } 83 } 84 HostDDS.h 29 #ifndef __HostDDS_h 30 #define __HostDDS_h 35 #include <unistd.h> 36 #include <string> 37 #include "ccpp_dds_dcps.h" 38 //#include "ccpp_Basic.h" 39 #include "ccpp_newsfd.h" 53 using namespace DDS; 54 //using namespace Basic; 55 using namespace newsfd; 56 57 class HostDDS 58 { 59 public: 60 61 HostDDS(); 62 ~HostDDS(); 63 64 void initializeDDS(); 65 void writePublishDDS(); 66 void stopDDS(); 67 68 private: 69 70 const char *getErrorName( DDS::ReturnCode_t status ); 71 void checkStatus( DDS::ReturnCode_t status, const char *info ); 72 void checkHandle( void *handle, const char *info ); 73 74 // generic DDS entities 75 DomainParticipantFactory_var dpf; 76 DomainParticipant_var dp; 77 //Topic_var basicMessageTopic; 78 Topic_var sfd_spi_msgTopic; 79 Publisher_var basicPublisher; 80 DataWriter_ptr parentWriter; 81 82 // QosPolicy Holders 83 TopicQos reliableTopicQos; 84 PublisherQos pubQos; 85 DataWriterQos dwQos; 86 87 // DDS identifiers 88 DomainId_t domain; 89 InstanceHandle_t userHandle; 90 ReturnCode_t status; 91 92 // Basic type specific DDS entities 93 //BasicMessageTypeSupport_var basicMessageTS; 94 //BasicMessageDataWriter_var basicWriter; 95 // SFD_spi_msg specific DDS entities 96 SFD_spi_msgTypeSupport_var sfd_spi_msgTS; 97 SFD_spi_msgDataWriter_var sfdWriter; 98 99 // topic sample 100 //BasicMessage *basicMsg; 101 SFD_spi_msg *sfdMsg; 102 103 // etc 104 const char *basicPartitionName; 105 char *basicMessageTypeName; 106 char *sfd_spi_msgTypeName; 107 108 const char *RetCodeName[13]; 109 110 }; 111 112 #endif // __HostDDS_h HostDDS.cpp 32 #include <unistd.h> 33 #include <iostream> 34 #include <string> 35 36 #include "HostDDS.h" 37 #include "gc_dyn.h" // header file to access software-wide data populated in global common 38 39 #include "ccpp_newsfd.h" 40 #include "ccpp_dds_dcps.h" 72 void HostDDS:: 73 initializeDDS() 74 { 75 // create DomainParticipantFactory and DomainParticipant 76 dpf = DomainParticipantFactory::get_instance(); 77 this -> checkHandle( dpf.in(), "DDS::DomainParticipantFactory::get_instance" ); 78 dp = dpf -> create_participant( 79 domain, 80 PARTICIPANT_QOS_DEFAULT, 81 NULL, 82 STATUS_MASK_NONE); 83 this -> checkHandle( dp.in(), "DDS::DomainParticipantFactory_create_participant" ); 84 85 // register datatypes for topics 86 /* 87 basicMessageTS = new BasicMessageTypeSupport(); 88 this -> checkHandle( basicMessageTS.in(), "new ChatMessateTypeSupport" ); 89 basicMessageTypeName = basicMessageTS -> get_type_name(); 90 status = basicMessageTS -> register_type( 91 dp.in(), 92 basicMessageTypeName); 93 this -> checkStatus( status, "Basic::NameServiceTypeSupport::register_type" ); 94 */ 95 96 sfd_spi_msgTS = new SFD_spi_msgTypeSupport(); 97 this -> checkHandle( sfd_spi_msgTS.in(), "new SFD_spi_msgTypeSupport" ); 98 sfd_spi_msgTypeName = sfd_spi_msgTS -> get_type_name(); 99 status = sfd_spi_msgTS -> register_type( 100 dp.in(), 101 sfd_spi_msgTypeName); 102 this -> checkStatus( status, "sfd::NameServeTypeSupport::reigster_type" ); 103 104 // get Qos, and set ReliabilityQOSPolicy to RELIABLE 105 status = dp -> get_default_topic_qos( reliableTopicQos ); 106 this -> checkStatus( status, "DDS::DomainParticipant::get_default_topic_qos" ); 107 reliableTopicQos.reliability.kind = RELIABLE_RELIABILITY_QOS; 108 status = dp -> set_default_topic_qos( reliableTopicQos ); 109 this -> checkStatus( status, "DDS::DomainParticipant::set_default_topic_qos" ); 110 111 // define topics 112 /* 113 basicMessageTopic = dp -> create_topic( 114 "Basic_BasicMessage", 115 basicMessageTypeName, 116 reliableTopicQos, 117 NULL, 118 STATUS_MASK_NONE); 119 this -> checkHandle( basicMessageTopic.in(), "DDS::DomainParticipant::create_topic( BasicMessage )" ); 120 */ 121 122 sfd_spi_msgTopic = dp -> create_topic( 123 "SFD_spi_topic", 124 sfd_spi_msgTypeName, 125 reliableTopicQos, 126 NULL, 127 STATUS_MASK_NONE); 128 this -> checkHandle( sfd_spi_msgTopic.in(), "DDS::DomainParticipant::create_topic( sfd_spi_msgTopic )" ); 129 130 // change default PublisherQos to write into "BasicPart" partition 131 status = dp -> get_default_publisher_qos( pubQos ); 132 this -> checkStatus( status, "DDS::DomainParticipant::get_default_publisher_qos" ); 133 pubQos.partition.name.length(1); 134 //pubQos.partition.name[0] = basicPartitionName; 135 pubQos.partition.name[0] = "HOSTEXPORT"; 136 137 // create publisher 138 basicPublisher = dp -> create_publisher( 139 pubQos, 140 NULL, 141 STATUS_MASK_NONE); 142 this -> checkHandle( basicPublisher.in(), "DDS::DomainParticipant::create_publisher" ); 143 144 // create datawriters for topics 145 /* 146 parentWriter = basicPublisher -> create_datawriter( 147 basicMessageTopic.in(), 148 DATAWRITER_QOS_USE_TOPIC_QOS, 149 NULL, 150 STATUS_MASK_NONE); 151 this -> checkHandle( parentWriter, "DDS::Publisher::create_datawriter( basicMessage )" ); 152 // narrow abstract parent into typed writer 153 basicWriter = BasicMessageDataWriter::_narrow( parentWriter ); 154 this -> checkHandle( basicWriter.in(), "DDS::BasicMessageDataWriter::_narrow" ); 155 */ 156 157 parentWriter = basicPublisher -> create_datawriter( 158 sfd_spi_msgTopic.in(), 159 DATAWRITER_QOS_USE_TOPIC_QOS, 160 NULL, 161 STATUS_MASK_NONE); 162 this -> checkHandle( parentWriter, "DDS::Publisher::create_datawriter( basicMessage )" ); 163 // narrow abstract parent into typed writer 164 sfdWriter = SFD_spi_msgDataWriter::_narrow( parentWriter ); 165 this -> checkHandle (sfdWriter.in(), "DDS::SFD_spi_msgDataWriter::_narrow" ); 166 167 // instantiate topics samples 168 /* 169 basicMsg = new BasicMessage(); 170 this -> checkHandle( basicMsg, "new BasicMessage" ); 171 */ 172 sfdMsg = new SFD_spi_msg(); 173 memset( sfdMsg, 0, sizeof( *sfdMsg ) ); 174 std::cout << "HANDLE " << sfdMsg << std::endl; 175 this -> checkHandle( sfdMsg, "new SFD_spi_msg" ); 176 } 177 190 191 void HostDDS:: 192 writePublishDDS() 193 { 194 std::cout << "------------------------------" << std::endl << "ENTERING WRITE" << std::endl << std::endl; 195 /* 196 if( basicMsg ){ // necessary check? maybe not... 197 basicMsg -> dyn_heading = g_dyn.heading; 198 basicMsg -> dyn_altitude = g_dyn.altitude; 199 basicMsg -> dyn_tas = g_dyn.tas; 200 basicMsg -> time_simtime = g_time.simtime; 201 202 // register topic instance to allocate resources for it; 203 userHandle = basicWriter -> register_instance( *basicMsg ); 204 205 // write message using instance handle 206 status = basicWriter -> write( *basicMsg, userHandle ); 207 this -> checkStatus( status, "Basic::BasicMessageDataWriter::write" ); 208 209 // dispose and unregister of topic instance 210 status = basicWriter -> dispose( *basicMsg, userHandle ); 211 this -> checkStatus( status, "Basic::BasicMessageDataWriter::dispose" ); 212 status = basicWriter -> unregister_instance( *basicMsg, userHandle ); 213 this -> checkStatus( status, "Basic::BasicMessageDataWriter::unregister_instance" ); 214 } 215 */ 216 217 if( sfdMsg ){ 218 sfdMsg -> str_arr_double[5] = 999; 219 220 std::cout << "------------------------------" << std::endl << "WRITING SFDMSG: " << sfdMsg -> str_arr_do 221 // register topic isntance to allocat resource for it; 222 // userHandle = sfdWriter -> register_instance( *sfdMsg ); 223 std::cout << "------------------------------" << std::endl << "ASSIGN USR HDL" << std::endl << std::endl 224 225 // write message using instance handle 226 // status = sfdWriter -> write( *sfdMsg, userHandle ); 227 status = sfdWriter -> write( *sfdMsg, HANDLE_NIL ); 228 this -> checkStatus( status, "SFD::SFD_spi_msgDataWriter::write" ); 229 230 // dispose and unregister of topic instance 231 // status = sfdWriter -> dispose( *sfdMsg, userHandle ); 232 status = sfdWriter -> dispose( *sfdMsg, HANDLE_NIL ); 233 this -> checkStatus( status, "SFD::SFD_spi_msgDataWriter::dispose" ); 234 // status = sfdWriter -> unregister_instance( *sfdMsg, userHandle ); 235 status = sfdWriter -> unregister_instance( *sfdMsg, HANDLE_NIL ); 236 this -> checkStatus( status, "SFD::SFD_spi_msgDataWriter::unregister_instance" ); 237 std::cout << "------------------------------" << std::endl << "FINISH SFDMSG: " << sfdMsg -> str_arr_do 238 } 239 } 240 253 254 void HostDDS:: 255 stopDDS() 256 { 257 // release topic instance sample from heap 258 /* 259 delete basicMsg; 260 */ 261 delete sfdMsg; 262 263 // remove data writers 264 /* 265 status = basicPublisher -> delete_datawriter( basicWriter.in() ); 266 this -> checkStatus( status, "DDS::Publisher::delete_datawriter( basicWriter )" ); 267 */ 268 status = basicPublisher -> delete_datawriter( sfdWriter.in() ); 269 this -> checkStatus( status, "DDS::Publisher::delete_datawriter( basicWriter )" ); 270 271 // remove publishers 272 status = dp -> delete_publisher ( basicPublisher.in() ); 273 this -> checkStatus( status, "DDS::DomainParticipant::delete_publisher( basicPublisher )" ); 274 275 // remove topics 276 /* 277 status = dp -> delete_topic( basicMessageTopic.in() ); 278 this -> checkStatus( status, "DDS::DomainParticipant::delete_topic( basicMessageTopic )" ); 279 */ 280 status = dp -> delete_topic( sfd_spi_msgTopic.in() ); 281 this -> checkStatus( status, "DDS::DomainParticipant::delete_topic( sfd_spi_msgTopic )" ); 282 283 // remove type_names 284 /* 285 CORBA::string_free(basicMessageTypeName); 286 */ 287 CORBA::string_free(sfd_spi_msgTypeName); 288 289 // remove DomainParticipant 290 status = dpf -> delete_participant( dp.in() ); 291 this -> checkStatus( status, "DDS::DomainParticipantFactory::delete_participant( dp )" ); 292 } 293 309 const char *HostDDS:: 310 getErrorName( DDS::ReturnCode_t status ) 311 { 312 return RetCodeName[status]; 313 } 329 330 void HostDDS:: 331 checkStatus( DDS::ReturnCode_t status, const char *info ) 332 { 333 if( status != DDS::RETCODE_OK && status != DDS::RETCODE_NO_DATA) { 334 std::cerr << "Error in " << info << ": " << getErrorName(status) << std::endl; 335 exit(0); 336 } 337 } 338 355 void HostDDS:: 356 checkHandle( void *handle, const char *info ) 357 { 358 if( !handle ){ 359 std::cerr << "Error in " << info << ": Creation failed / invalid handle" << std::endl; 360 exit(0); 361 } 362 } 363 377 HostDDS:: 378 HostDDS() 379 { 380 DomainId_t domain = DOMAIN_ID_DEFAULT; 381 const char *basicPartitionName = "HOSTDDS"; 382 char *basicMessageTypeName = NULL; 383 char *sfd_spi_msgTypeName = NULL; 384 const char *RetCodeName[13] = { 385 "DDS_RETCODE_OK", 386 "DDS_RETCODE_ERROR", 387 "DDS_RETCODE_UNSUPPORTED", 388 "DDS_RETCODE_BAD_PARAMETER", 389 "DDS_RETCODE_PRECONDITION_NOT_SET", 390 "DDS_RETCODE_OUT_OF_RESOURCES", 391 "DDS_RETCODE_NOT_ENABLED", 392 "DDS_RETCODE_IMMUTABLE_POLICY", 393 "DDS_RETCODE_INCONSISTENT_POLICY", 394 "DDS_RETCODE_ALREADY_DELETED", 395 "DDS_RETCODE_TIMEOUT", 396 "DDS_RETCODE_NO_DATA", 397 "DDS_RETCODE_ILLEGAL_OPERATION" }; 398 } 399 412 413 HostDDS:: 414 ~HostDDS() 415 { 416 417 }
  9. Using #include in IDL files

    Hi I've written an IDL file, "myIDL.idl" , as shown below: module IDL_Request { struct payload { octet ID; };// end of struct #pragma keylist payload };// end of module Now, for some reason, I want to add the following header file, "enum.h", ... enum myEnums { L1, L2, L3 }; within this IDL. So I modified the IDL file like below: #include "enum.h" module IDL_Request { struct payload { octet ID; myEnums me; };// end of struct #pragma keylist payload };// end of module After executing idlpp command, I faced the following compile error: "error: enumSplDcps.h: No such file or directory". What should I do for solving this problem? Thanks in advance for your help Bonjefir
  10. Complex data type in idl files

    Hi, I am wondering whether it is possible to define a Complex data type in IDL files, a simple example of a data type that I need to define is as follows: struct info{ .. }; struct state { info inf; .... } Cheers, Sara
  11. Hi all, I am building an OpenSplice application, and I created the IDL topic I need. Into that, I have to use some sequence, that the pre-processor convert as array. Bi the way, at the moment, I cant figure out which the best solution for adding/removing elements from this sequence is. Is there an already implemented solutions in IDL ? Shall I create separately in my codes these ? Thank you all in advance. Best regards.
  12. Hi, What is the way to instantiate sequences in C++? I have found it in Java (pretty simple with arrays) but I did not find any documentation or example for my problem. Let's say I have this IDL module HelloWorldData { struct Msg { /** User ID */ long userID; /** message */ string message; }; #pragma keylist Msg userID typedef sequence<Msg> seq_msg; struct OtherMsg { long userID; string message; seq_msg mySeq; }; #pragma keylist OtherMsg userID }; And this code Msg msg1; msg1.userID = 10; msg1.message = "aaa"; Msg msg2; msg2.userID = 20; msg2.message = "bbb"; OherrMsg msgInstance; msgInstance.userID = 1; msgInstance.message = DDS::string_dup("Hello World"); How do I instantiate my sequence in C++ since mySeq is not generated as array like in java? msgInstance.mySeq = ? Thank you
  13. IDL forward references

    We have IDL coming from an autogeneration tool which includes forward references. A reduced example is something like the following: struct Foo { Bar bar; }; struct Bar { long test; }; When providing this as input to idlpp, it fails with # idlpp -S -l cpp FooBar.idl ***DDS parse error Bar undefined at line: 3 Other than manually editing the files to reorder all of the struct definitions, what do you suggest? We tried adding a struct Bar; line before the definition of Foo, but it did not help.
×