eclipse-cyclonedds / cyclonedds-cxx

Other
96 stars 75 forks source link

builin_subscriber not supported #435

Closed showmethejinw closed 1 year ago

showmethejinw commented 1 year ago

The current builtin_subscriber function doesn't seem to support it. It seems that the implementation is underway. When will the implementation be completed?

eboasson commented 1 year ago

With all the stuff going on it is hard for me to give you a date, at least a date by which we will finally complete the built-in topic support in the C++ binding — and I certainly can't say anything about when someone else might decide to sit down, do it and contribute it.

There are basically two parts to it:

You do have the option of using the C API directly for the built-in topics: you really don't need to deal with a lot of C for that, just a few lines really: thanks to get_ddsc_entity() you should be able to do something like:

#include "dds/dds.h"
auto dp = dds::domain::DomainParticipant(0);
auto reader = dds_create_reader(dp.get_ddsc_entity(), DDS_BUILTIN_TOPIC_DCPSPARTICIPANT, nullptr, nullptr);
void *sampleptr = nullptr;
dds_sample_info_t info;
int32_t n = dds_take(reader, &sampleptr, &info, 1, 1);
if (n > 0) { // really means n=1 because we limited dds_take to at most one sample
  dds_builtintopic_participant_t const * const sample = static_cast< dds_builtintopic_participant_t const *>(sampleptr);
  // do something with sample
  dds_return_loan (reader, &sampleptr, n);
}

(beware: I only copy-pasted some things together ...)

showmethejinw commented 1 year ago

@eboasson, Thank you for your quick and kind reply.

Is there any document for checking unsupported functionality or planning document?

eboasson commented 1 year ago

In theory, there's a roadmap document, but it is always out-of-date ...

As for current features and long-term plans, it is pretty much as the README for the main repository says:

Cyclone DDS aims at full coverage of the specs and today already covers most of this. With references to the individual OMG specifications, the following is available:

  • DCPS the base specification
    • zero configuration discovery (if multicast works)
    • publish/subscribe messaging
    • configurable storage of data in subscribers
    • many QoS settings - liveliness monitoring, deadlines, historical data, ...
    • coverage includes the Minimum, Ownership and (partially) Content profiles
  • DDS Security - providing authentication, access control and encryption
  • DDS XTypes - the structural type system (some caveats here)
  • DDSI-RTPS - the interoperable network protocol

I just realise that some of the limitations in the "XTypes caveats" have been lifted since — the core library (a.k.a. the C API) for example now supports dynamic types, but the statement is still true insofar as it concerns support for the API defined in the spec.

The C++ API is supposed to support all that the C API supports, at least for the non-dynamically-typed bits. This is mostly true, but every now and then someone bumps into a missing bit. It doesn't help that I personally don't enjoy using C++ and moreover dislike this using or working on this particular C++ API, because it seems that the structure defined by the OMG makes everything that ought to be simple a fair bit of work.

The lack of support for the built-in topics in the C++ API is something of these that several people have run into, and I can try to see if some of the main contributors are willing to have a look at it. I know they're all rather busy with other things, but it's worth a try.

showmethejinw commented 1 year ago

@eboasson , Thank you for kind reply. I could understand current status Have a nice day 😄