ADLINK Knowledge Base ADLINK Knowledge Base

  • Home
  • Vortex DDS
  • Vortex OpenSplice
  • Vortex Tools and Licensing
  • ADLINK Edge
  • Spectra SDR
  • Contact Support
Home / ADLINK DDS, Vortex OpenSplice, API and IDL / Vortex OpenSplice API/IDL User Questions

Vortex OpenSplice API/IDL User Questions

Table Of Contents
    • Is the OpenSplice DDS Java API Operating System independent?
    • What are the differences between the DDS language compilation processes?
    • Does OpenSplice support Unicode strings?
    • How can I create a datetime field in a DDS Topic?
    •  Can I use String and Sequence data types in my IDL file?
    • Can I a struct as an IDL keylist in OpenSplice?
  • Related

This article contains some API/IDL-related, submitted Vortex OpenSplice questions that may prove useful to others.

See the Vortex OpenSplice Homepage for more information or look at the OpenSplice documentation.

 


Is the OpenSplice DDS Java API Operating System independent?

All the OpenSplice API’s are Operating System independent as the source code is provided, allowing you to recompile with your preferred compiler. An additional advantage of Java applications is that these applications do not need to be recompiled to run on different operating systems (following the Java slogan ‘write once, run anywhere’). For optimal performance and minimal footprint, the OpenSplice core modules are implemented in C and the application API’s (for C, C++ and Java) are plugable extensions to allow the use of the various programming languages. This gives two advantages. The first is that there is extremely low overhead for Java, for example. Running the “ping pong” benchmark, provided in the distribution, shows that the peer-to-peer latency between a Java-based writer and reader is only slightly slower slower than a C-based writer and reader (65 microseconds versus 57 microseconds on a 2GHz Windows notebook). The second is that one ‘instance’ of OpenSplice can serve multiple applications written in multiple programming languages, thus reducing the footprint on a computing node considerably.


What are the differences between the DDS language compilation processes?

For JAVA, the process is OS-independent that is, just invoke the javac compiler and run the applications.
For C/C++/C#, the compilation process differs a little bit between windows and Unix (Solaris and/or Linux). The main difference is that for UNIX platforms, we typically use the gcc compiler-suite (C-preprocessor, Compiler, Linker) and make utility whereas for Windows we use the Microsoft Visual Studio compiler and linker. Please note that for preprocessing the IDL data-structures, the C-preprocessor is required (gcc for Unix, cl for Windows).


Does OpenSplice support Unicode strings?

Unfortunately not. Adding this support would require significant development and is not currently planned. As a workaround we suggest that you encode your string as an octet sequence and provide handling logic at application level. This approach obviously has some drawbacks as you will not be able to make use of the filtering features of OpenSplice.


How can I create a datetime field in a DDS Topic?

The Vortex OpenSplice IDL Pre-processor and the Vortex OpenSplice runtime system support the following DDS data types to be used in application IDL definitions:

  • Duration_t
  • Time_t

More information on Build-In IDL preprocessor types can be found in the OpenSplice IDL Pre-Processor guide – see the OpenSplice documentation.


 Can I use String and Sequence data types in my IDL file?

All data distributed using the DDS has to be defined as a topic. A topic is a structured data type, like a C++-struct with several members. Whenever the application needs to read or write data, it will be reading or writing topics. The definition of each topic it will be using has to be written in (a subset of) OMG IDL.

The Data Distribution Service is capable of distributing more complex topics as well. In fact, any definition following the OpenSplice IDL subset is allowed. It is important to know that the preprocessor accepts all IDL constructs but only the subset is being processed. Apart from the trivial data types, the Data Distribution Service is capable of handling fixed-length arrays, bounded and unbounded sequences, union types and enumerations. Types can be nested, e.g. a struct can contain a struct field or an array of structs, or a sequence of strings or an array of sequences containing structs.

The Ping/Pong example program also uses an IDL with both Strings and Sequences use throughout. Our documentation for use of IDL within DDS is very verbose see the OpenSplice IDL Preprocessor User Manual for more information. This is part of the OpenSplice documentation.


Can I a struct as an IDL keylist in OpenSplice?

While it’s not possible to use a struct itself as a keylist it is possible to use the contents of a struct as follows:

module KeyedTypeData

module KeyedTypeData

{

struct FirstKeyedType {

long member1;

long member2;

};

#pragma keylist FirstKeyedType member1

struct SecondKeyedType {

FirstKeyedType myKey;

};

#pragma keylist SecondKeyedType myKey.member1 myKey.member2

};

This will allow you to use the contents of the struct FirstKeyedType as the keylist for SecondKeyedType


Related

Vortex OpenSplicefaqAPIIDL ADLINK DDSVortex OpenSpliceAPI and IDL
twitter logo facebook logo linkedin logo slideshrare logo
Blog News and Events
adlink logo
Copyright © 2020 ADLINK Technology Inc. All Rights Reserved