Skip to content

Commit ea46021

Browse files
samuelraeburnalexcamposruizrkorteadelleolsonSam Raeburn
authored
Release/connector/1.1.0 (#75)
* Feature/con 177 (#38) * CON-177: Added support/tests for addition sampleinfo fields * CON-177: Added unit tests for sample/view/instance state * CON-177: PR Feedback - Added possible values of the strings to the docs - Updated unit tests with new possible values * CON-188: docs + tests (#40) * CON-188: docs + tests * CON-188: Functionality changes - Always return all fields (not None for non-key members) - updated docs + tests for this * CON-188: PR feedback Applied the feedback from the JS review * CON-188: Fix typo * Performance tests for Python get/set sequence (#41) * Performance tests for Python get/set sequence * Separated tests * Update test/python/test_rticonnextdds_performance.py Co-authored-by: Alex Campos <[email protected]> * You can now set the number of iterations on the command line * Minor changes Co-authored-by: Alex Campos <[email protected]> * Feature/native dd perf (#42) * Added additional performance tests that use native DD API * Disable tests by default * CON-188: Fixed code block in docs (#44) * Feature/con 209 (#43) * CON-209: Test support for multiple urls in connector creation * CON-209: Update docs * CON-163: Added a unit test for license error (fix is in core) (#46) * CON-163: Added a (currently failing) unit test for license error * CON-163: Updated copyright * CON-163: PR feedback * CON-212: Added CONTRIBUTING.md file (#45) * CON-214: Added test for creating Connector with participant_qos (#47) * CON-211: updating all links to other docs per new doc tree structure, for python connector * CON-211: fixed a couple of link-related issues in connector-py that I missed in first update * CON-211: updated title of core GSG to remove "Core Libraries" * CORE-10744: Update documentation for new default system resources (#50) * CON-215: Added release notes (#48) * CON-215: Added release notes * CON-215: Fixed issue IDs * CON-215: Fix IDs again * CON-215: Fix title indentation * CON-215: Added notes from CON-188 * CON-215: Added more issues * CON-215: Fix codeblock * CON-215: Add issue # * Apply suggestions from code review * Update docs/release_notes.rst * CON-215: release notes review and edits, and a few other tweaks to capitalization in other files * Update docs/release_notes.rst * CON-215: Reverted LICENSE.pdf Co-authored-by: rkorte <[email protected]> * CON-194: added statement and link to Python API doc so users can understand the differences * CON-188: Updates instance support section of features.rst (#53) * PLATFORMS-1925. Updated supported platforms to match Hercules PAM. * PLATFORMS-1925. Added trademark symbols. * Introduce EOL normalisation (#58) With this, License.pdf should not longer show up as changed on Windows * Feature/core 11069 (#59) * CORE-11069: Replaced deprecated XML tags in documentation and public XML * CORE-11069: Also update test XML * Feature/con 174 armv8 (#57) * CON-174: Handle ARMV8 arch * CON-174: Minor edit * Fix string * CON-174: Handle other arm strings - Handle all of aarch64, aarch64_be, armv8b, armv8l - Also load the library for (deprecated) armv6 * GREEN-2058: Fixed string checking when setting invalid my_enum from dict (#61) * GREEN-2058: Added tests for new functionality in DD Parser (#62) Co-authored-by: Sam Raeburn <[email protected]> * Feature/dir renames (#64) * Updated the loading of native libraries * - Update common libs - Remove support for 32 bit Win + Linux * Updated native libs * Explicitly load the nddsc and nddscore libraries on Windows Co-authored-by: Sam Raeburn <[email protected]> * CON-221: Added docs for ability to load libs (#55) * CON-221: Added docs for ability to load libs * PR feedback * PR Feedback * working on LICENSE.pdf and gitattributes Co-authored-by: rkorte <[email protected]> Co-authored-by: Sam Raeburn <[email protected]> * Updated platforms in the relaese notes (#65) * Updated platforms in the relaese notes * Removed symbol from ARMv7 platform name Co-authored-by: Sam Raeburn <[email protected]> * Feature/update version (#66) * Update README for 1.1.0 preview * Update setup.py for version 1.1.0 preview * Updated version in setup.py to 1.1.0.rc2 * Updated submodule to use commit feature/update-libs-internal-rel Co-authored-by: Sam Raeburn <[email protected]> * Updated version in documentation to 1.1.0.rc2 (#67) * Updated version in documentation to 1.1.0.rc2 * - Now possible to do rti.Connector.version() to obtain current version * - Updated blue colour used in docs - Updated docs version to 1.1.0 - Removed version() API - needs further thought before implementation Co-authored-by: Sam Raeburn <[email protected]> * Update release_notes.rst Add 16.04 Ubuntu * Updated the Platforms notes to include Ubuntu 16.04 (x64 + ARMv8) (#68) * Updated the Platforms notes to include Ubuntu 16.04 (x64 + ARMv8) * Added support for ARMv8 to whats new 1.1.0 * fix typo Co-authored-by: Sam Raeburn <[email protected]> * CON-211: testing all links to core docs, fixing few that were broken - python * CON-194: python changes: update copyright page and copyright year tagline * Accept 32-bit archs if libraries are swapped * HERCULES-186: updates to licenses doc for python * HERCULES-186: modified lua and json-parser in Connector doc python * Document dependency on Connext version for dynamic libs (#74) * Document dependency on Connext version for dynamic libs * - PR feedback to clarify wording - Adding missing sentence from release notes about Connext DDS version * PR feedback Co-authored-by: Sam Raeburn <[email protected]> * Update setup.py for version 1.1.0 * Update native libraries to version 6.1.0 Co-authored-by: Alex Campos <[email protected]> Co-authored-by: rkorte <[email protected]> Co-authored-by: Adelle Olson <[email protected]> Co-authored-by: rkorte <[email protected]> Co-authored-by: Sam Raeburn <[email protected]>
1 parent b84f8ea commit ea46021

31 files changed

+1287
-209
lines changed

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
LICENSE.pdf filter=lfs diff=lfs merge=lfs -text
2+
* text=auto

CONTRIBUTING.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Contributing to RTI Connector for Python
2+
3+
### Contributor License Agreement (CLA)
4+
In order to accept your pull request, we need you to sign a Contributor License Agreement (CLA). Complete your CLA here: http://community.rti.com/cla. You only need to do this once, we cross-check your Github username with the list of contributors who have signed the CLA.

LICENSE.pdf

-122 KB
Binary file not shown.

README.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ RTI Connector for Python
22
========================
33

44
RTI® Connext® DDS is a connectivity software framework for integrating
5-
data sources of all types. At its core is the worlds leading ultra-high
5+
data sources of all types. At its core is the world's leading ultra-high
66
performance, distributed networking databus.
77

88
*RTI Connector* provides a quick and easy way to write applications that

docs/advanced.rst

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Advanced topics
1+
Advanced Topics
22
===============
33

44
.. toctree::
@@ -8,4 +8,3 @@ Advanced topics
88
threading
99
errors
1010
features
11-

docs/conf.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@
1818
# -- Project information -----------------------------------------------------
1919

2020
project = 'RTI Connector for Python'
21-
copyright = '2019, Real-Time Innovations, Inc'
21+
copyright = '2021, Real-Time Innovations, Inc'
2222
author = 'Real-Time Innovations, Inc.'
2323

2424
# The full version, including alpha/beta/rc tags
25-
version = '1.0.0'
26-
release = '1.0.0'
25+
version = '1.1.0'
26+
release = '1.1.0'
2727

2828
master_doc = 'index'
2929

docs/configuration.rst

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
.. py:currentmodule:: rticonnextdds_connector
33
4-
Defining a DDS system in XML
4+
Defining a DDS System in XML
55
============================
66

77
*Connector* loads the definition of a DDS system from an XML configuration file
@@ -13,7 +13,7 @@ that includes the definition of domains, *DomainParticipants*, *Topics*,
1313

1414
*Connector* uses the XML schema defined by RTI's
1515
`XML-Based Application Creation feature
16-
<https://community.rti.com/static/documentation/connext-dds/current/doc/manuals/connext_dds/xml_application_creation/html_files/RTI_ConnextDDS_CoreLibraries_XML_AppCreation_GettingStarted/index.htm>`__.
16+
<https://community.rti.com/static/documentation/connext-dds/current/doc/manuals/connext_dds_professional/xml_application_creation/index.htm>`__.
1717

1818
.. hint::
1919
The *Connext DDS* C, C++, Java and .NET APIs can also load the same XML files
@@ -77,11 +77,11 @@ and ``shapesize``:
7777
Types are associated with *Topics*, as explained in the next section, :ref:`Domain Library`.
7878

7979
.. hint::
80-
You can define your types in IDL and convert them to XML with `rtiddsgen <https://community.rti.com/static/documentation/connext-dds/current/doc/manuals/connext_dds/code_generator/html_files/RTI_CodeGenerator_UsersManual/index.htm#code_generator/UsersManual/UsersManual_Title.htm>`__.
80+
You can define your types in IDL and convert them to XML with `rtiddsgen <https://community.rti.com/static/documentation/connext-dds/current/doc/manuals/connext_dds_professional/code_generator/users_manual/index.htm>`__.
8181
For example: ``rtiddsgen -convertToXml MyTypes.idl``
8282

8383
For more information about defining types, see
84-
`Creating User Data Types with XML <https://community.rti.com/static/documentation/connext-dds/current/doc/manuals/connext_dds/html_files/RTI_ConnextDDS_CoreLibraries_UsersManual/index.htm#UsersManual/Creating_User_Data_Types_with_Extensible.htm>`__
84+
`Creating User Data Types with XML <https://community.rti.com/static/documentation/connext-dds/current/doc/manuals/connext_dds_professional/users_manual/index.htm#users_manual/Creating_User_Data_Types_with_Extensible.htm>`__
8585
in the *RTI Connext DDS Core Libraries User's Manual*.
8686

8787
For more information about accessing data samples, see :ref:`Accessing the data`.
@@ -91,10 +91,10 @@ Domain library
9191

9292
A domain library is a collection of domains. A domain specifies:
9393

94-
* A `domain id <https://community.rti.com/static/documentation/connext-dds/current/doc/manuals/connext_dds/html_files/RTI_ConnextDDS_CoreLibraries_UsersManual/index.htm#UsersManual/ChoosingDomainID.htm>`__.
94+
* A `domain id <https://community.rti.com/static/documentation/connext-dds/current/doc/manuals/connext_dds_professional/users_manual/index.htm#users_manual/ChoosingDomainID.htm>`__.
9595
* A set of registered types (from a subset of the types in ``<types>``).
9696
A registered type can have a local name.
97-
* A set of `topics <https://community.rti.com/static/documentation/connext-dds/current/doc/manuals/connext_dds/html_files/RTI_ConnextDDS_CoreLibraries_UsersManual/index.htm>`__,
97+
* A set of `topics <https://community.rti.com/static/documentation/connext-dds/current/doc/manuals/connext_dds_professional/users_manual/index.htm#users_manual/WorkingWithTopics.htm>`__,
9898
which are used by *DataReaders* and *DataWriters*.
9999

100100
.. code-block:: xml
@@ -108,7 +108,7 @@ A domain library is a collection of domains. A domain specifies:
108108
</domain_library>
109109
110110
For more information about the format of a domain library, see
111-
`XML-Based Application Creation: Domain Library <https://community.rti.com/static/documentation/connext-dds/current/doc/manuals/connext_dds/xml_application_creation/html_files/RTI_ConnextDDS_CoreLibraries_XML_AppCreation_GettingStarted/index.htm#XMLBasedAppCreation/UnderstandingPrototyper/DomainLibrary.htm>`__.
111+
`XML-Based Application Creation: Domain Library <https://community.rti.com/static/documentation/connext-dds/current/doc/manuals/connext_dds_professional/xml_application_creation/index.htm#xml_based_app_creation_guide/UnderstandingXMLBased/DomainLibrary.htm>`__.
112112

113113
Participant library
114114
~~~~~~~~~~~~~~~~~~~
@@ -140,14 +140,14 @@ an :class:`Input`, as described in :ref:`Reading data (Input)`.
140140
</domain_participant>
141141
</domain_participant_library>
142142
143-
For more information about the format of a participant library, see the
144-
`XML-Based Application Creation Getting Started Guide
145-
<https://community.rti.com/static/documentation/connext-dds/current/doc/manuals/connext_dds/xml_application_creation/html_files/RTI_ConnextDDS_CoreLibraries_XML_AppCreation_GettingStarted/index.htm#XMLBasedAppCreation/UnderstandingPrototyper/ParticipantLibrary.htm>`__.
143+
For more information about the format of a participant library, see
144+
`XML-Based Application Creation: Participant Library
145+
<https://community.rti.com/static/documentation/connext-dds/current/doc/manuals/connext_dds_professional/xml_application_creation/index.htm#xml_based_app_creation_guide/UnderstandingXMLBased/ParticipantLibrary.htm>`__.
146146

147147
Quality of service
148148
~~~~~~~~~~~~~~~~~~
149149

150-
All DDS entities have an associated `quality of service (QoS) <https://community.rti.com/static/documentation/connext-dds/current/doc/manuals/connext_dds/html_files/RTI_ConnextDDS_CoreLibraries_UsersManual/index.htm#UsersManual/QosPolicies.htm>`__.
150+
All DDS entities have an associated `quality of service (QoS) <https://community.rti.com/static/documentation/connext-dds/current/doc/manuals/connext_dds_professional/users_manual/index.htm#users_manual/QosPolicies.htm>`__.
151151
There are several ways to configure it.
152152

153153
You can define a QoS profile and make it the default. The following example
@@ -181,7 +181,7 @@ You can define the QoS for each individual entity:
181181
.. code-block:: xml
182182
183183
<domain_participant name="MyPubParticipant" domain_ref="MyDomainLibrary::MyDomain">
184-
<participant_qos> <!-- ... --> </participant_qos>
184+
<domain_participant_qos> <!-- ... --> </domain_participant_qos>
185185
<publisher name="MyPublisher">
186186
<publisher_qos> <!-- ... --> </publisher_qos>
187187
<data_writer name="MySquareWriter" topic_ref="Square">
@@ -203,9 +203,9 @@ entity:
203203
.. code-block:: xml
204204
205205
<domain_participant name="MyPubParticipant" domain_ref="MyDomainLibrary::MyDomain">
206-
<participant_qos base_name="MyQosLibrary::MyQosProfile">
206+
<domain_participant_qos base_name="MyQosLibrary::MyQosProfile">
207207
<!-- override or configure additional QoS policies -->
208-
</participant_qos>
208+
</domain_participant_qos>
209209
<publisher name="MyPublisher">
210210
<publisher_qos base_name="MyQosLibrary::MyQosProfile">
211211
<!-- override or configure additional QoS policies -->
@@ -234,12 +234,12 @@ profile is equivalent to *MyQosProfile* above:
234234
235235
You can read more in the *RTI Connext DDS Core Libraries User's Manual*,
236236
`Configuring QoS with XML
237-
<https://community.rti.com/static/documentation/connext-dds/current/doc/manuals/connext_dds/html_files/RTI_ConnextDDS_CoreLibraries_UsersManual/index.htm#UsersManual/XMLConfiguration.htm>`__.
237+
<https://community.rti.com/static/documentation/connext-dds/current/doc/manuals/connext_dds_professional/users_manual/index.htm#users_manual/XMLConfiguration.htm>`__.
238238

239239
Logging
240240
^^^^^^^
241241

242-
Logging can be configured as explained in `Configuring Logging via XML <https://community.rti.com/static/documentation/connext-dds/current/doc/manuals/connext_dds/html_files/RTI_ConnextDDS_CoreLibraries_UsersManual/index.htm#UsersManual/Configuring_Logging_via_XML1.htm>`__.
242+
Logging can be configured as explained in `Configuring Logging via XML <https://community.rti.com/static/documentation/connext-dds/current/doc/manuals/connext_dds_professional/users_manual/index.htm#users_manual/Configuring_Logging_via_XML1.htm>`__.
243243

244244
For example, to increase the logging verbosity from the default (ERROR) to
245245
WARNING, define a ``qos_profile`` with the attribute

docs/connector.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ To create a new :class:`Connector`, pass an XML file and a configuration name:
2222
connector = rti.Connector("MyParticipantLibrary::MyParticipant", "ShapeExample.xml");
2323

2424
The XML file defines your types, QoS profiles, and DDS Entities. *Connector*
25-
uses the XML schema of `RTI's XML-Based Application Creation <https://community.rti.com/static/documentation/connext-dds/current/doc/manuals/connext_dds/xml_application_creation/html_files/RTI_ConnextDDS_CoreLibraries_XML_AppCreation_GettingStarted/index.htm#XMLBasedAppCreation/UnderstandingPrototyper/XMLTagsConfigEntities.htm%3FTocPath%3D5.%2520Understanding%2520XML-Based%2520Application%2520Creation%7C5.5%2520XML%2520Tags%2520for%2520Configuring%2520Entities%7C_____0>`__.
25+
uses the XML schema of `RTI's XML-Based Application Creation <https://community.rti.com/static/documentation/connext-dds/current/doc/manuals/connext_dds_professional/xml_application_creation/index.htm#xml_based_app_creation_guide/UnderstandingXMLBased/XMLTagsConfigEntities.htm>`__.
2626

2727
The previous code loads the ``<domain_participant>`` named *MyParticipant* in
2828
the ``<domain_participant_library>`` named *MyParticipantLibrary*, which is defined in the
@@ -40,7 +40,7 @@ When you create a :class:`Connector`, the DDS *DomainParticipant* that you selec
4040
and all its contained entities (*Topics*, *Subscribers*, *DataReaders*,
4141
*Publishers*, *DataWriters*) are created.
4242

43-
For more information about the DDS entities, see `Part 2 - Core Concepts <https://community.rti.com/static/documentation/connext-dds/current/doc/manuals/connext_dds/html_files/RTI_ConnextDDS_CoreLibraries_UsersManual/index.htm#UsersManual/PartCoreConcepts.htm#partcoreconcepts_4109331811_915546%3FTocPath%3DPart%25202%253A%2520Core%2520Concepts%7C_____0>`__
43+
For more information about the DDS entities, see `Core Concepts <https://community.rti.com/static/documentation/connext-dds/current/doc/manuals/connext_dds_professional/users_manual/index.htm#users_manual/PartCoreConcepts.htm>`__
4444
in the *RTI Connext DDS Core Libraries User's Manual*.
4545

4646
.. note::

docs/copyright_license.rst

Lines changed: 66 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@
66
Copyrights and License
77
**********************
88

9-
© 2019 Real-Time Innovations, Inc. |br|
9+
© 2021 Real-Time Innovations, Inc. |br|
1010
All rights reserved. |br|
1111
Printed in U.S.A. First printing. |br|
12-
November 2019. |br|
12+
April 2021. |br|
1313

1414

1515
.. rubric:: License
@@ -43,7 +43,10 @@ This is an independent publication and is neither affiliated with, nor
4343
authorized, sponsored, or approved by, Microsoft Corporation.
4444

4545
The security features of this product include software developed by the
46-
OpenSSL Project for use in the OpenSSL Toolkit (http://www.openssl.org/).
46+
OpenSSL Project for use in the OpenSSL Toolkit (http://www.openssl.org/).
47+
This product includes cryptographic software written by Eric Young
48+
([email protected]). This product includes software written by Tim Hudson
49+
4750

4851
Technical Support |br|
4952
Real-Time Innovations, Inc. |br|
@@ -53,4 +56,63 @@ Phone: (408) 990-7444 |br|
5356
Email: [email protected] |br|
5457
Website: https://support.rti.com/ |br|
5558

56-
© 2019 RTI
59+
© 2021 RTI
60+
61+
.. rubric:: External Third-Party Software Used in Connector
62+
63+
**Lua**
64+
* The source code of this software is used to build the native libraries
65+
provided by *RTI Connector*.
66+
67+
* License (https://www.lua.org/license.html):
68+
Copyright © 1994–2021 Lua.org, PUC-Rio.
69+
70+
Permission is hereby granted, free of charge, to any person obtaining a
71+
copy of this software and associated documentation files (the "Software"),
72+
to deal in the Software without restriction, including without limitation
73+
the rights to use, copy, modify, merge, publish, distribute, sublicense,
74+
and/or sell copies of the Software, and to permit persons to whom the
75+
Software is furnished to do so, subject to the following conditions:
76+
77+
The above copyright notice and this permission notice shall be included
78+
in all copies or substantial portions of the Software.
79+
80+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
81+
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
82+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
83+
THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
84+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
85+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
86+
THE SOFTWARE.
87+
88+
**json-parser**
89+
* The source code of this software (from https://github.com/udp/json-parser)
90+
is used to build the native libraries provided by *RTI Connector*.
91+
92+
* License:
93+
94+
Copyright (C) 2012, 2013, 2014 James McLaughlin et al. All rights reserved.
95+
https://github.com/udp/json-parser
96+
97+
Redistribution and use in source and binary forms, with or without
98+
modification, are permitted provided that the following conditions
99+
are met:
100+
101+
1. Redistributions of source code must retain the above copyright
102+
notice, this list of conditions and the following disclaimer.
103+
104+
2. Redistributions in binary form must reproduce the above copyright
105+
notice, this list of conditions and the following disclaimer in the
106+
documentation and/or other materials provided with the distribution.
107+
108+
THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
109+
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
110+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
111+
ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
112+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
113+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
114+
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
115+
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
116+
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
117+
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
118+
SUCH DAMAGE.

docs/data.rst

Lines changed: 51 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -411,7 +411,7 @@ To clear a member, set it to ``None`` explicitly::
411411

412412
For more information about optional members in DDS, see the *Getting Started Guide
413413
Addendum for Extensible Types*,
414-
`Section 3.2 Optional Members <https://community.rti.com/static/documentation/connext-dds/current/doc/manuals/connext_dds/getting_started_extras/html_files/RTI_ConnextDDS_CoreLibraries_GettingStarted_ExtensibleAddendum/index.htm#ExtensibleTypesAddendum/Optional_Members.htm>`__.
414+
`Optional Members <https://community.rti.com/static/documentation/connext-dds/current/doc/manuals/connext_dds_professional/extensible_types_guide/index.htm#extensible_types/Optional_Members.htm>`__.
415415

416416
Accessing unions
417417
^^^^^^^^^^^^^^^^
@@ -448,3 +448,53 @@ The type returned by the operator is a dict for unions.
448448
The same limitations described in
449449
:ref:`Accessing basic members (numbers, strings and booleans)`
450450
about using ``__getitem__`` apply here.
451+
452+
Accessing key values of disposed samples
453+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
454+
455+
Using :meth:`Output.write`, an :class:`Output` can write data, or dispose or
456+
unregister an instance.
457+
Depending on which of these operations is performed, the ``instance_state`` of the
458+
received sample will be ``'ALIVE'``, ``'NOT_ALIVE_NO_WRITERS'`` or ``'NOT_ALIVE_DISPOSED'``.
459+
If the instance was disposed, this ``instance_state`` will be ``'NOT_ALIVE_DISPOSED'``.
460+
In this state, it is possible to access the key fields of the instance that was disposed.
461+
462+
.. note::
463+
:attr:`SampleInfo.valid_data` will be false when the :attr:`SampleInfo.instance_state`
464+
is ``'NOT_ALIVE_DISPOSED'``. In this situation it's possible to access the
465+
key fields in the received sample.
466+
467+
The key fields can be accessed as follows:
468+
469+
.. testcode::
470+
471+
# The output and input are using the following type:
472+
# struct ShapeType {
473+
# @key string<128> color;
474+
# long x;
475+
# long y;
476+
# long shapesize;
477+
# }
478+
479+
output.instance["x"] = 4
480+
output.instance["color"] = "Green"
481+
# Assume that some data associated with this instance has already been sent
482+
output.write(action="dispose")
483+
input.wait()
484+
input.take()
485+
sample = input.samples[0]
486+
487+
if sample.info["instance_state"] == "NOT_ALIVE_DISPOSED":
488+
# sample.info.get('valid_data') will be false in this situation
489+
# Only the key-fields should be accessed
490+
color = sample["color"] # 'Green'
491+
# The fields 'x','y' and 'shapesize' cannot be retrieved because they're
492+
# not part of the key
493+
# You can also call get_dictionary() to get all of the key fields.
494+
# Again, only the key fields returned within the dictionary should
495+
# be accessed.
496+
key_values = sample.get_dictionary() # { "color": "Green", "x": 0, "y": 0, "shapesize": 0 }
497+
498+
.. warning::
499+
When the sample has an instance state of ``'NOT_ALIVE_DISPOSED'`` only the
500+
key fields should be accessed.

0 commit comments

Comments
 (0)