IDLΒΆ
IDL is a language to defined data types and interfaces that are platform and language agnostic. There are tools that have been developed to then consume that IDL and emit code and infrastructure that allows you target a specific platform or language.
All IDL type support is contained within the subpackage cyclonedds.idl, which enables you to use it even in contexts where you do not need the full Eclipse Cyclone DDS ecosystem.
For example, the following IDL code:
module HelloWorldData
{
struct Msg
{
@key
long userID;
string message;
};
};
idlc
(the IDL compiler) converts this to:
typedef struct HelloWorldData_Msg
{
int32_t userID;
char * message;
} HelloWorldData_Msg;
namespace HelloWorldData
{
class Msg OSPL_DDS_FINAL
{
public:
int32_t userID_;
std::string message_;
/** SNIP THE REST OF THE METHODS **/
}
}
@dataclass
class HelloWorld(IdlStruct, typename="HelloWorld.Msg"):
usedID: int32
message: str
See also: HelloWorld IDL.