-
Notifications
You must be signed in to change notification settings - Fork 75
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PSMX support for C++ #453
PSMX support for C++ #453
Conversation
The addition of the PSMX model of data exchange in CycloneDDS requires the addition of PSMX specific serdata functions: from_loaned_sample and from_psmx, these have been implemented It also requires the removal of the hardcoded iceoryx code, as this is now handled through PSMX functionality and any loaded module's implementation Signed-off-by: Martijn Reicher <[email protected]>
Signed-off-by: Martijn Reicher <[email protected]>
As this type of exchange is now abstracted away behind PSMX calls, it is no longer necessary Signed-off-by: Martijn Reicher <[email protected]>
As per clang's recommendation. Signed-off-by: Erik Boasson <[email protected]>
Signed-off-by: Erik Boasson <[email protected]>
Signed-off-by: Erik Boasson <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The datatopic
changes and the PSMX qos implementation look fine to me.
A few details on other things:
- wrong indenting for an
if
statement, see below getSampleSize
defined insrc/ddscxx/include/org/eclipse/cyclonedds/topic/TopicTraits.hpp:113
seems to be unused.
And I think we need a replacement for the shared memory tests that are removed with this PR.
void PSMXInstancesDelegate::check() const | ||
{ | ||
if (instances_.size() > DDS_MAX_PSMX_INSTANCES) | ||
ISOCPP_THROW_EXCEPTION(ISOCPP_INVALID_ARGUMENT_ERROR, "Invalid size of PSMXInstances::instances value (%ld > %d).", instances_.size(), DDS_MAX_PSMX_INSTANCES); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wrong indenting
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are correct.
|
||
if (!m_t.compare_exchange_strong(t, static_cast<T*>(newloan->sample_ptr), std::memory_order_seq_cst)) | ||
{ | ||
//something went wrong |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is error handling required here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let me go through this a bit.
if (!serialize_data) | ||
metadata->sample_state = (key ? DDS_LOANED_SAMPLE_STATE_RAW_KEY : DDS_LOANED_SAMPLE_STATE_RAW_DATA); | ||
|
||
metadata->cdr_identifier = hdr[0]; //remove endianness? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think there's no need to 'remove' any endianness, as the endianness in the header is native
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are correct.
I will fix this.
This reverts commit 99b708e.
Signed-off-by: Erik Boasson <[email protected]>
Signed-off-by: Erik Boasson <[email protected]>
Signed-off-by: Dennis Potman <[email protected]>
…in from_psmx Signed-off-by: Dennis Potman <[email protected]>
Signed-off-by: Dennis Potman <[email protected]>
Signed-off-by: Dennis Potman <[email protected]>
Signed-off-by: Dennis Potman <[email protected]>
…me as sertype_default) Signed-off-by: Dennis Potman <[email protected]>
Signed-off-by: Dennis Potman <[email protected]>
Now that Iceoryx is loaded as a PSMX plugin there is no longer any dependency on Iceoryx in the C++ API. The Iceoryx-based test uses the C++ API of Iceoryx, and so the Iceoryx C binding is no longer relevant. Signed-off-by: Erik Boasson <[email protected]>
* ENABLE_SHM => ENABLE_ICEORYX, which now only has to do with testing * SharedMemoryTest => IceoryxTest Signed-off-by: Erik Boasson <[email protected]>
Signed-off-by: Erik Boasson <[email protected]>
Signed-off-by: Erik Boasson <[email protected]>
@@ -1887,6 +1887,19 @@ class TTypeConsistencyEnforcement : public dds::core::Value<D> | |||
//============================================================================== | |||
|
|||
|
|||
template <typename D> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we still need to add documentation to this.
@@ -195,6 +198,7 @@ OMG_DDS_POLICY_TRAITS(DataRepresentation, 23) | |||
OMG_DDS_POLICY_TRAITS(TypeConsistencyEnforcement, 24) | |||
#endif // OMG_DDS_EXTENSIBLE_AND_DYNAMIC_TOPIC_TYPE_SUPPORT | |||
OMG_DDS_POLICY_TRAITS(WriterBatching, 25) | |||
OMG_DDS_POLICY_TRAITS(PSMXInstances, 34) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe this comment should be on the CycloneDDS-C repository's PR, but are we sure that this new Policy-ID will not conflict with other vendors' stuff?
if (!serialize_data) | ||
metadata->sample_state = (key ? DDS_LOANED_SAMPLE_STATE_RAW_KEY : DDS_LOANED_SAMPLE_STATE_RAW_DATA); | ||
|
||
metadata->cdr_identifier = hdr[0]; //remove endianness? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are correct.
I will fix this.
|
||
if (!m_t.compare_exchange_strong(t, static_cast<T*>(newloan->sample_ptr), std::memory_order_seq_cst)) | ||
{ | ||
//something went wrong |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let me go through this a bit.
void PSMXInstancesDelegate::check() const | ||
{ | ||
if (instances_.size() > DDS_MAX_PSMX_INSTANCES) | ||
ISOCPP_THROW_EXCEPTION(ISOCPP_INVALID_ARGUMENT_ERROR, "Invalid size of PSMXInstances::instances value (%ld > %d).", instances_.size(), DDS_MAX_PSMX_INSTANCES); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are correct.
- Added documentation to new PSMXInstances QoSPolicy - Added exception thrown when loan setting fails. - Small layout fixes Signed-off-by: Martijn Reicher <[email protected]>
Companion to eclipse-cyclonedds/cyclonedds#1676