Skip to content

Commit

Permalink
Release/connector/1.1.0 (#75)
Browse files Browse the repository at this point in the history
* 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]>
  • Loading branch information
6 people authored May 3, 2021
1 parent b84f8ea commit ea46021
Show file tree
Hide file tree
Showing 31 changed files with 1,287 additions and 209 deletions.
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
LICENSE.pdf filter=lfs diff=lfs merge=lfs -text
* text=auto
4 changes: 4 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Contributing to RTI Connector for Python

### Contributor License Agreement (CLA)
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.
Binary file modified LICENSE.pdf
Binary file not shown.
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ RTI Connector for Python
========================

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

*RTI Connector* provides a quick and easy way to write applications that
Expand Down
3 changes: 1 addition & 2 deletions docs/advanced.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Advanced topics
Advanced Topics
===============

.. toctree::
Expand All @@ -8,4 +8,3 @@ Advanced topics
threading
errors
features

6 changes: 3 additions & 3 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@
# -- Project information -----------------------------------------------------

project = 'RTI Connector for Python'
copyright = '2019, Real-Time Innovations, Inc'
copyright = '2021, Real-Time Innovations, Inc'
author = 'Real-Time Innovations, Inc.'

# The full version, including alpha/beta/rc tags
version = '1.0.0'
release = '1.0.0'
version = '1.1.0'
release = '1.1.0'

master_doc = 'index'

Expand Down
32 changes: 16 additions & 16 deletions docs/configuration.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

.. py:currentmodule:: rticonnextdds_connector
Defining a DDS system in XML
Defining a DDS System in XML
============================

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

*Connector* uses the XML schema defined by RTI's
`XML-Based Application Creation feature
<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>`__.
<https://community.rti.com/static/documentation/connext-dds/current/doc/manuals/connext_dds_professional/xml_application_creation/index.htm>`__.

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

.. hint::
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>`__.
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>`__.
For example: ``rtiddsgen -convertToXml MyTypes.idl``

For more information about defining types, see
`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>`__
`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>`__
in the *RTI Connext DDS Core Libraries User's Manual*.

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

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

* 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>`__.
* 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>`__.
* A set of registered types (from a subset of the types in ``<types>``).
A registered type can have a local name.
* 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>`__,
* 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>`__,
which are used by *DataReaders* and *DataWriters*.

.. code-block:: xml
Expand All @@ -108,7 +108,7 @@ A domain library is a collection of domains. A domain specifies:
</domain_library>
For more information about the format of a domain library, see
`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>`__.
`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>`__.

Participant library
~~~~~~~~~~~~~~~~~~~
Expand Down Expand Up @@ -140,14 +140,14 @@ an :class:`Input`, as described in :ref:`Reading data (Input)`.
</domain_participant>
</domain_participant_library>
For more information about the format of a participant library, see the
`XML-Based Application Creation Getting Started Guide
<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>`__.
For more information about the format of a participant library, see
`XML-Based Application Creation: Participant 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/ParticipantLibrary.htm>`__.

Quality of service
~~~~~~~~~~~~~~~~~~

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>`__.
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>`__.
There are several ways to configure it.

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

Logging
^^^^^^^

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>`__.
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>`__.

For example, to increase the logging verbosity from the default (ERROR) to
WARNING, define a ``qos_profile`` with the attribute
Expand Down
4 changes: 2 additions & 2 deletions docs/connector.rst
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ To create a new :class:`Connector`, pass an XML file and a configuration name:
connector = rti.Connector("MyParticipantLibrary::MyParticipant", "ShapeExample.xml");

The XML file defines your types, QoS profiles, and DDS Entities. *Connector*
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>`__.
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>`__.

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

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>`__
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>`__
in the *RTI Connext DDS Core Libraries User's Manual*.

.. note::
Expand Down
70 changes: 66 additions & 4 deletions docs/copyright_license.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
Copyrights and License
**********************

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


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

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

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

© 2019 RTI
© 2021 RTI

.. rubric:: External Third-Party Software Used in Connector

**Lua**
* The source code of this software is used to build the native libraries
provided by *RTI Connector*.

* License (https://www.lua.org/license.html):
Copyright © 1994–2021 Lua.org, PUC-Rio.

Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

**json-parser**
* The source code of this software (from https://github.com/udp/json-parser)
is used to build the native libraries provided by *RTI Connector*.

* License:

Copyright (C) 2012, 2013, 2014 James McLaughlin et al. All rights reserved.
https://github.com/udp/json-parser

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:

1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE.
52 changes: 51 additions & 1 deletion docs/data.rst
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,7 @@ To clear a member, set it to ``None`` explicitly::

For more information about optional members in DDS, see the *Getting Started Guide
Addendum for Extensible Types*,
`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>`__.
`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>`__.

Accessing unions
^^^^^^^^^^^^^^^^
Expand Down Expand Up @@ -448,3 +448,53 @@ The type returned by the operator is a dict for unions.
The same limitations described in
:ref:`Accessing basic members (numbers, strings and booleans)`
about using ``__getitem__`` apply here.

Accessing key values of disposed samples
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Using :meth:`Output.write`, an :class:`Output` can write data, or dispose or
unregister an instance.
Depending on which of these operations is performed, the ``instance_state`` of the
received sample will be ``'ALIVE'``, ``'NOT_ALIVE_NO_WRITERS'`` or ``'NOT_ALIVE_DISPOSED'``.
If the instance was disposed, this ``instance_state`` will be ``'NOT_ALIVE_DISPOSED'``.
In this state, it is possible to access the key fields of the instance that was disposed.

.. note::
:attr:`SampleInfo.valid_data` will be false when the :attr:`SampleInfo.instance_state`
is ``'NOT_ALIVE_DISPOSED'``. In this situation it's possible to access the
key fields in the received sample.

The key fields can be accessed as follows:

.. testcode::

# The output and input are using the following type:
# struct ShapeType {
# @key string<128> color;
# long x;
# long y;
# long shapesize;
# }

output.instance["x"] = 4
output.instance["color"] = "Green"
# Assume that some data associated with this instance has already been sent
output.write(action="dispose")
input.wait()
input.take()
sample = input.samples[0]

if sample.info["instance_state"] == "NOT_ALIVE_DISPOSED":
# sample.info.get('valid_data') will be false in this situation
# Only the key-fields should be accessed
color = sample["color"] # 'Green'
# The fields 'x','y' and 'shapesize' cannot be retrieved because they're
# not part of the key
# You can also call get_dictionary() to get all of the key fields.
# Again, only the key fields returned within the dictionary should
# be accessed.
key_values = sample.get_dictionary() # { "color": "Green", "x": 0, "y": 0, "shapesize": 0 }

.. warning::
When the sample has an instance state of ``'NOT_ALIVE_DISPOSED'`` only the
key fields should be accessed.
2 changes: 1 addition & 1 deletion docs/errors.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Error Handling
Error handling
===============

.. py:currentmodule:: rticonnextdds_connector
Expand Down
Loading

0 comments on commit ea46021

Please sign in to comment.