SlideShare a Scribd company logo
OpenSplice DDS
                                      Delivering Performance, Openness, and Freedom




                                 The DDS Tutorial
Angelo Corsaro, Ph.D.
      Chief Technology Officer
        OMG DDS SIG Co-Chair
angelo.corsaro@prismtech.com



                                            ::Part I
Addressing Data Distribution Challenges
                                                          DDS is standard designed to address the data-distribution challenges across
                                                                                 a wide class of Defense and Aerospace Applications

The OMG DDS Standard
‣ Introduced in 2004, DDS is a standard
    for Real-Time, Dependable and High-
    Performance Publish/Subscribe
‣   DDS behaviour and semantics can be
    controlled via a rich set of QoS Policies
‣ DDS is today recommended by key
    administration worldwide and widely
    adopted across several different
    application domains, such as, Automated
    Trading, Simulations, SCADA, Telemetry,
    etc.

                                                © 2009, PrismTech. All Rights Reserved
The OMG Data Distribution Service (DDS)
DDS v1.2 API Standard
‣ Language Independent, OS and HW architecture                                                         Application

    independent                                                                                            Object/Relational Mapping
‣   DCPS. Standard API for Data-Centric, Topic-                                                     Data Local Reconstruction Layer (DLRL)
    Based, Real-Time Publish/Subscribe
                                                                                                                               Content
‣   DLRL. Standard API for creating Object Views out                                  Ownership           Durability
                                                                                                                             Subscription

    of collection of Topics                                                                           Minimum Profile

                                                                                           Data Centric Publish/Subscribe (DCPS)
DDSI/RTPS v2.1 Wire Protocol Standard
‣ Standard wire protocol allowing interoperability                                          Real-Time Publish/Subscribe Protocol


    between different implementations of the DDS                                              DDS Interoperability Wire Protocol

    standard                                                                                               UDP/IP

‣   Interoperability demonstrated among key DDS
    vendors in March 2009
                                             © 2009, PrismTech. All Rights Reserved
Tutorial Scope
Scope & Goals
‣ The Tutorial will cover the DCPS layer of DDS                                                   Application

‣ It will give you enough details and examples                                                        Object/Relational Mapping

  to make sure that you can get started                                                        Data Local Reconstruction Layer (DLRL)

  writing DDS applications
                                                                                                                          Content
                                                                                 Ownership           Durability
                                                                                                                        Subscription
Software
‣ OpenSplice DDS
                                                                                                 Minimum Profile

                                                                                      Data Centric Publish/Subscribe (DCPS)

  ‣ http://www.opensplice.org                                                          Real-Time Publish/Subscribe Protocol
‣ SIMple Dds (SIMD)                                                                      DDS Interoperability Wire Protocol

  ‣http://code.google.com/p/simd-cxx                                                                  UDP/IP

Prerequisite
‣ Basic C++ understanding
                                        © 2009, PrismTech. All Rights Reserved
OpenSplice DDS
Delivering Performance, Openness, and Freedom


Your will learn:
- What is a Topic
- How to define Topic Types
- How to register a Topic               Step I
                             Defining the Data
Topics

Topic
‣ Unit of information atomically
  exchanged between Publisher and
  Subscribers.
‣ An association between a unique name,
  a type and a QoS setting




                                   © 2009, PrismTech. All Rights Reserved
Topic Types

A DDS Topic Type is described by an IDL Structure containing an arbitrary number for
fields whose types might be:
‣ IDL primitive types, e.g., octet, short, long, float, string (bound/unbound), etc.
‣ Enumeration
‣ Union
‣ Sequence (bounded or unbounded)
‣ Array
‣ Structure (nested)



                                    © 2009, PrismTech. All Rights Reserved
Examples

struct HelloTopicType {                                                     enum TemperatureScale {
   string message;                                                             CELSIUS,
};                                                                             FAHRENHEIT,
                              struct ShapeType {                               KELVIN
                                 long x;                                    };
                                 long y;
                                 long shapesize;                            struct TempSensorType {
struct PingType                  string color;                                 short id;
{                             };                                               float temp;
   long         counter;                                                       float hum;
   string<32>   vendor;                                                        TemperatureScale scale;
};                                                                          };


                           struct Counter {
                              long cID;
                              long count;
                           };



                                   © 2009, PrismTech. All Rights Reserved
Topic Types & Keys



‣ Each Topic Type has to define its key-set (which might be the empty set)
‣ There are no limitations on the number of attributes used to represent a key
‣ Keys can be top-level attributes as well as nested-attributes (i.e. attributes in nested
  structures)




                                        © 2009, PrismTech. All Rights Reserved
Key Examples -- Empty Key-Set


                                                                     struct PingType
struct HelloTopicType {                                              {
   string message;                                                      long         counter;
};                                                                      string<32>   vendor;
#pragma keylist HelloTopicType                                       };
                                                                     #pragma keylist PingType




                                 © 2009, PrismTech. All Rights Reserved
Key Examples -- User-Defined Keys

                                                                 enum TemperatureScale {
                                                                    CELSIUS,
                                                                    FAHRENHEIT,
struct ShapeType {
                                                                    KELVIN
   long x;
                                                                 };
   long y;
   long shapesize;
                                                                 struct TempSensorType {
   string color;
                                                                    short id;
};
                                                                    short roomid;
#pragma keylist ShapeType color
                                                                    float temp;
                                                                    float hum;
                                                                    TemperatureScale scale;
                  struct Counter {                               };
                     long cID;                                   #pragma keylist TempSensorType id roomid
                     long count;
                  };
                  #pragma keylist Counter cID


                                        © 2009, PrismTech. All Rights Reserved
Topic Keys Gotchas
‣ Keys are used to identify specific data “instances”
‣ It we want to make a parallel with OO then we could say that:
 ‣ Keyless Topic as singletons, e.g. there is only one instance!
 ‣ Keyed Topics identify a class of instances. Each instance is identified by a key value
 ‣ Think at each different key value as really instantiating a new “object” in your system. That will avoid
   making mistakes in your keys assignment
‣ Never do something like this:
                struct Counter {
                   long cID;
                   long count;
                };
                #pragma keylist Counter count


 ... As it will create a new topic instance for each ping you send thus consuming an unbounded
 amount of resources!
                                            © 2009, PrismTech. All Rights Reserved
Compiling Topic Types
‣ Topic types have to be compiled with the DDS-provided IDL compiler
‣ The compilation process will take care of generating code for
 ‣ Strongly typed Reader and Writers
 ‣ Type Serialization
‣ When compiling a target language should be chosen, such as C/C++/Java/C#

‣ Example:
             $ idlpp -S -l cpp -d gencxx ShapeType.idl

             $ idlpp -S -l java -d genjava ShapeType.idl


              Standalone mode
                                Target Language             Target Directory               Target File

                                                  © 2009, PrismTech. All Rights Reserved
IDL Compilation in SIMD

‣ SIMD provides a template makefile that you can use to compile your IDL files.
‣ The default language is C++ (as SIMD currently supports only C++)

       Makefile.idl

        #-*-Makefile-*-
        include $(SIMD_HOME)/config/apps/Macros-idl.GNU

        TARGET_IDL=ShapeType.idl

        include $(SIMD_HOME)/config/apps/Rules-idl.GNU




                                        © 2009, PrismTech. All Rights Reserved
Putting it all Together


                                             Circle


struct ShapeType {
   long   x;
   long   y;
   long   shapesize;                          Topic                        QoS
   string color;
};
#pragma keylist ShapeType color




                                  © 2009, PrismTech. All Rights Reserved
Registering Topics with SIMD

‣ SIMD provides several constructors that allow to register a topic:

     Topic(const std::string& name);

     Topic(const std::string& name, const TopicQos& qos);

     Topic(const std::string& name, const std::string& type_name);

     Topic(const std::string& name, const std::string& type_name, const TopicQos& qos);




                                         © 2009, PrismTech. All Rights Reserved
Registering the Circle Topic
                                    Circle


struct ShapeType {
   long   x;
   long   y;
   long   shapesize;                                                       Default
                                     Topic                                  QoS
   string color;
};
#pragma keylist ShapeType color




                   dds::Topic<ShapeType> shape(“Circle”);


                                  © 2009, PrismTech. All Rights Reserved
Topic Registration Gotchas

‣ Topics registration is idempotent as far as you register the topic in the same way from various
    applications.
‣   It is an error to try to register a topic with the same name but a different type.

‣ Example:
                Application 1                                                         Application 2


dds::Topic<ShapeType> shape(“Circle”);                          dds::Topic<ShapeType> shape(“Circle”);     OK



dds::Topic<ShapeType> shape(“Circle”);                          dds::Topic<AnotherType> shape(“Circle”);   Errror



                                             © 2009, PrismTech. All Rights Reserved
OpenSplice DDS
Delivering Performance, Openness, and Freedom


Your will learn:
- What are DDS Partitions
- How to partitions work
                                        Step II
                            Defining the Scope
Domains and Partitions
                                              Domain


Domain
‣ A Domain is one instance of the DDS
  Global Data Space
‣ DDS entities always belong to a specific
  domain
Partition
‣ A partition is a scoping mechanism
  provided by DDS organize a partition                                             DDS
                                                                              Global Data Space
                                             Partition



                                              © 2009, PrismTech. All Rights Reserved
More about Partitions

‣ Each partition is identified by a
    string, such as “sensor-data”,
    “log-data” etc.
‣   Read/Write access to a
    partition is gained by means of
    DDS Publisher/Subscribers
‣   Each Publisher/Subscriber
    can be provided with a list of
    Partitions name, which might
    as well include wildcards ,or                                                   DDS
    generic regular expression,                                                Global Data Space
                                                          Partition
    such as “*-data”


                                      © 2009, PrismTech. All Rights Reserved
Partition as Namespaces

‣ Although DDS does not support explicit nesting of partitions, a powerful way of organizing your
    data is by always using a hierarchical “dotted” notation to describe them.
‣   For instance, for a building in which you are deploying the new temperature control system you
    might use a scheme such as “building.floor-level.room-number” for scoping the data that flows
    in each room.
    ‣ building.floor-2.room-10
    ‣ building.floor-3.room-15
‣ In this way, accessing the data for a specific floor can be done by using the partition
    expression “building.floor-2.*”
‣   While the data for all the building is available via “building.*”



                                             © 2009, PrismTech. All Rights Reserved
Emulating Partition Nesting
“building.floor-1.*”

                                           “building”

                            “building.floor-1”
        “building.floor-1.room-1” ...                                  “building.floor-N”
                     “building.floor-1.room-2”               “building.floor-N.room-1”
                                                                                         “building.floor-N.room-2”
                                                                            ...
                                      “building.floor-2”
                 “building.floor-2.room-1”
                                                          ...
                                          “building.floor-2.room-2”
                                     ...

                                                © 2009, PrismTech. All Rights Reserved
Connecting to Partitions in SIMD
‣ SIMD provides two ways of connecting to partitions.
‣ A simple one is to bound the full runtime to a partition expression by passing a string to the
    Runtime class at construction time
‣   The other is to configure a specific Publisher/Subscriber with the relevant list of partitions

Runtime();
Runtime(const std::string& partition);
Runtime(const std::string& partition, const std::string& domain);

Publisher(const std::string& partition);
Publisher(const std::string& partition, ::dds::DomainParticipant dp);
Publisher(const ::dds::PublisherQos& qos, ::dds::DomainParticipant dp);

Subscriber(const std::string& partition);
Subscriber(const std::string& partition, ::dds::DomainParticipant dp);
Subscriber(const ::dds::SubscriberQos& qos, ::dds::DomainParticipant dp);



                                            © 2009, PrismTech. All Rights Reserved
OpenSplice DDS
Delivering Performance, Openness, and Freedom


Your will learn:
- What is a Data Writer
- How to Create a Data Writer
- How to write Data                         Step III
                                Producing the Data
Writing Data in SIMD



‣ Writing data with SIMD takes two steps.
‣ First you have to create the DataWriter by using the proper constructor (this
  depends on the level of customization you require)
‣ Then, you’ll have to decide how you want to write the data




                                 © 2009, PrismTech. All Rights Reserved
Creating a DataWriter
‣ SIMD provides different DataWriter constructors allowing to control the
 level of customization required for the specific writer

template <typename T>
class dds::pub::DataWriter : public dds::core::Entity {
public:
   DataWriter();

   DataWriter(Topic<T> topic)

   DataWriter(Topic<T> topic, const DataWriterQos& qos)

   DataWriter(Topic<T> topic, const DataWriterQos& qos, Publisher pub);
// ...
};

                                 © 2009, PrismTech. All Rights Reserved
Writing Data with SIMD

‣ SIMD provides two generic writes as well as a method for creating a writer
  dedicated to a specific instance
‣ The DataInstanceWriter provides constant time writes as it does not
  need to look-up the key-fields

 DDS::ReturnCode_t write(const T& sample);

 DDS::ReturnCode_t write(const T& sample, const DDS::Time_t& timestamp);

 DataInstanceWriter<T> register_instance(const T& key);




                                © 2009, PrismTech. All Rights Reserved
Writing “Circling” Circle Samples




              © 2009, PrismTech. All Rights Reserved
OpenSplice DDS
Delivering Performance, Openness, and Freedom


Your will learn:
- Reading vs Taking data
- Sample State
- How to Create a Data Reader
- How to read/take data
                                       Step IV
                                Consuming Data
Reading Samples

                                                                                                  ‣ Read iterates over the
                                                                                                      available sample instances
                                                                                                  ‣
                   1   1     1   2   1   3   1     4
                                                                                                      Samples are not removed
                   2   1     2   2   2   3
DataReader                                                                                            from the local cache as




                                                                                                                                   Proprietary Information - Distribution without Expressed Written Permission is Prohibited.
                   3   1     3   2   3   3   3      4       3    5
                                                                                                      result of a read
                                                                     Topic                        ‣   Read samples can be read
                                                                                                      again, by accessing the
    Samples Read                 Samples not Read
                                                                                                      cache with the proper
                                                                                                      options (more later)
                           DataReader Cache

                                                                                      struct Counter {
                                                                                         int cID;
                                                                                         int count;
                                                                                      };
                                                                                      #pragma keylist Counter cID
                                                 © 2009, PrismTech. All Rights Reserved
Reading Samples
                                                                                               ‣ Read iterates over the
                                                                                                   available sample instances
                  1    1     1   2   1   3   1     4
                                                                                               ‣   Samples are not removed
                  2    1     2   2   2   3
                                                                                                   from the local cache as
DataReader




                                                                                                                                Proprietary Information - Distribution without Expressed Written Permission is Prohibited.
                  3    1     3   2   3   3   3      4       3    5
                                                                                                   result of a read
                                                                                               ‣   Read samples can be read
                                                                     Topic
                                                                                                   again, by accessing the
        Samples Read                 Samples not Read                                              cache with the proper
                                                                                                   options (more later)
                           DataReader Cache
                                                                                      struct Counter {
                                                                                         int cID;
                                                                                         int count;
                                                                                      };
                                                                                      #pragma keylist Counter cID
                                                 © 2009, PrismTech. All Rights Reserved
Reading Samples
                                                                                         ‣ Read iterates over the
                                                                                             available sample instances
             1   1     1   2   1   3   1     4
                                                                                         ‣   Samples are not removed
             2   1     2   2   2   3
                                                                                             from the local cache as
DataReader




                                                                                                                          Proprietary Information - Distribution without Expressed Written Permission is Prohibited.
             3   1     3   2   3   3   3      4       3    5
                                                                                             result of a read
                                                                                         ‣   Read samples can be read
                                                               Topic
                                                                                             again, by accessing the
             Samples Read              Samples not Read                                      cache with the proper
                                                                                             options (more later)
                     DataReader Cache
                                                                                struct Counter {
                                                                                   int cID;
                                                                                   int count;
                                                                                };
                                                                                #pragma keylist Counter cID
                                           © 2009, PrismTech. All Rights Reserved
Taking Samples
                                                                                         ‣ Take iterates over the
                                                                                             available sample instances
             1   1     1   2   1   3   1     4
                                                                                         ‣   Taken Samples are
             2   1     2   2   2   3
                                                                                             removed from the local
DataReader




                                                                                                                          Proprietary Information - Distribution without Expressed Written Permission is Prohibited.
                                       3      4       3    5
                                                                                             cache as result of a take
             3   1     3   2   3   3
                                                                                         ‣
                                                               Topic

                           Samples not Taken


                     DataReader Cache
                                                                                struct Counter {
                                                                                   int cID;
                                                                                   int count;
                                                                                };
                                                                                #pragma keylist Counter cID
                                           © 2009, PrismTech. All Rights Reserved
Taking Samples
                                                                                 ‣ Take iterates over the
                                                                                     available sample instances
               1   2   1   3   1     4
                                                                                 ‣   Taken Samples are
               2   2   2   3
                                                                                     removed from the local
DataReader




                                                                                                                  Proprietary Information - Distribution without Expressed Written Permission is Prohibited.
               3   2   3   3   3      4       3    5
                                                                                     cache as result of a take

                                                       Topic

                       Samples not Taken


             DataReader Cache
                                                                        struct Counter {
                                                                           int cID;
                                                                           int count;
                                                                        };
                                                                        #pragma keylist Counter cID
                                   © 2009, PrismTech. All Rights Reserved
Taking Samples
                                                                              ‣ Take iterates over the
                                                                                  available sample instances
                    1   3   1     4
                                                                              ‣   Taken Samples are
                    2   3
                                                                                  removed from the local
DataReader




                                                                                                               Proprietary Information - Distribution without Expressed Written Permission is Prohibited.
                    3   3   3      4       3    5
                                                                                  cache as result of a take

                                                    Topic

                        Samples not Taken


             DataReader Cache
                                                                     struct Counter {
                                                                        int cID;
                                                                        int count;
                                                                     };
                                                                     #pragma keylist Counter cID
                                © 2009, PrismTech. All Rights Reserved
Sample, Instance and View States
                      History Depth = 2


                                              ‣ Along with data samples, DataReaders are provided
                      1       1
                                                with state information allowing to detect relevant
                      2       2
                                                transitions in the life-cycle of data as well as data
                      3                         writers
  DataReader




                                                                                                          Proprietary Information - Distribution without Expressed Written Permission is Prohibited.
                     SampleInfo               ‣ Sample State (READ | NOT_READ): Determines
                                                wether a sample has already been read by this
                      1   1   1   2
                                                DataReader or not.
                      2   2   2   3
                                              ‣ Instance State (ALIVE, NOT_ALIVE, DISPOSED).
                      3   1
                                                Determines wether (1) writer exist for the specific
                      Samples                   instance, or (2) no matched writers are currently
                          Topic                 available, or (3) the instance has been disposed

               DataReader Cache
                                              ‣ View State (NEW, NOT_NEW). Determines wether
                                                this is the first sample of a new (or re-born) instance
                                          © 2009, PrismTech. All Rights Reserved
Application / DDS Coordination
DDS provides three main mechanism for exchanging information with the application


‣ Polling. The application polls from time to time for new data or status changes. The
  interval might depend on the kind of applications as well as data




                                                                                              Proprietary Information - Distribution without Expressed Written Permission is Prohibited.
‣ WaitSets. The application registers a WaitSet with DDS and waits (i.e. is suspended)
  until one of the specified events has happened.

‣ Listeners. The application registers a listener with a specific DDS entity to be notified
  when relevant events occur, such as state changes or




                                          © 2009, PrismTech. All Rights Reserved
Reading Data with SIMD
/**
 * Reads all new samples from any view state and alive instances. Notice
 * that this call is intended to loan the <code>samples</code> as
 * well as the <conde>infos</code> containers, thus will require a
 * return_loan.
 */
DDS::ReturnCode_t read(TSeq& samples, DDS::SampleInfoSeq& infos)

/**
 * Reads at most <code>max_samples</code> samples that have not been




                                                                                      Proprietary Information - Distribution without Expressed Written Permission is Prohibited.
 * read yet from all vies and alive instances.
 */
DDS::ReturnCode_t read(TSeq& samples, long max_samples)

/**
 * Most generic <code>read</code> exposing all the knobs provided by
 * the OMG DDS API.
 */
DDS::ReturnCode_t
read(TSeq& samples, DDS::SampleInfoSeq& infos,long max_samples,
     DDS::SampleStateMask samples_state, DDS::ViewStateMask views_state,
     DDS::InstanceStateMask instances_state)

DDS::ReturnCode_t
return_loan(TSeq& samples, DDS::SampleInfoSeq& infos);


                                             © 2009, PrismTech. All Rights Reserved
Taking Data with SIMD
/**
 * Reads all new samples from any view state and alive instances. Notice
 * that this call is intended to loan the <code>samples</code> as
 * well as the <conde>infos</code> containers, thus will require a
 * return_loan.
 */
DDS::ReturnCode_t take(TSeq& samples, DDS::SampleInfoSeq& infos)

/**




                                                                                     Proprietary Information - Distribution without Expressed Written Permission is Prohibited.
 * Reads at most <code>max_samples</code> samples that have not been
 * read yet from all vies and alive instances.
 */
DDS::ReturnCode_t take(TSeq& samples, long max_samples)

/**
 * Most generic <code>read</code> exposing all the knobs provided by
 * the OMG DDS API.
 */
DDS::ReturnCode_t
take(TSeq& samples, DDS::SampleInfoSeq& infos,long max_samples,
     DDS::SampleStateMask samples_state, DDS::ViewStateMask views_state,
     DDS::InstanceStateMask instances_state)




                                            © 2009, PrismTech. All Rights Reserved
WaitSets in SIMD

‣ SIMD provides a strongly typed WaitSet that supports automatic dispatching to functors
‣ The best way of understanding SIMD waitsets is to look at an example:




                                                                                           Proprietary Information - Distribution without Expressed Written Permission is Prohibited.
                                       © 2009, PrismTech. All Rights Reserved
Listeners
 in SIMD


‣ SIMD provides a strongly
    typed Listeners based on
    the Signals/Slots patterns




                                                                          Proprietary Information - Distribution without Expressed Written Permission is Prohibited.
‣   The best way of
    understanding SIMD
    Listeners is to look at an
    example...




                                 © 2009, PrismTech. All Rights Reserved
The DDS Tutorial - Part I
OpenSplice DDS
Delivering Performance, Openness, and Freedom




                                Step V
                     Compile and Run...
What You’ve Learned today



‣ Defining Topics and Topic Types
‣ Scoping Information with Partitions
‣ Writing Data
‣ Reading (Taking) data with Waitsets and Listeners
‣ Writing an example that demonstrate all of the above



                               © 2009, PrismTech. All Rights Reserved
What I’ll Cover Next Time



‣ Content Filtered Topics and Queries
‣ QoS and the Request vs. Offered Model
‣ Setting QoS on DDS Entities
‣ Tuning OpenSplice DDS Configuration



                               © 2009, PrismTech. All Rights Reserved
Online Resources

 http://www.opensplice.com/
                                                                                  http://www.slideshare.net/angelo.corsaro
 emailto:opensplicedds@prismtech.com




 http://bit.ly/1Sreg                                                              http://twitter.com/acorsaro/




                                                                                  http://opensplice.blogspot.com
 http://www.youtube.com/OpenSpliceTube


                                         © 2009, PrismTech. All Rights Reserved

More Related Content

PDF
The DDS Tutorial Part II
PDF
DDS Tutorial -- Part I
PDF
OpenSplice DDS Tutorial -- Part II
PDF
DDS QoS Unleashed
PDF
DDS in Action -- Part I
PDF
Getting Started in DDS with C++ and Java
PDF
The Data Distribution Service Tutorial
PDF
The Data Distribution Service Tutorial
The DDS Tutorial Part II
DDS Tutorial -- Part I
OpenSplice DDS Tutorial -- Part II
DDS QoS Unleashed
DDS in Action -- Part I
Getting Started in DDS with C++ and Java
The Data Distribution Service Tutorial
The Data Distribution Service Tutorial

What's hot (20)

PPTX
Introduction to RTI DDS
PDF
The Data Distribution Service
PDF
Advanced OpenSplice Programming - Part I
PDF
The Data Distribution Service
PDF
DDS: The IoT Data Sharing Standard
PDF
Tuning and Troubleshooting OpenSplice DDS Applications
PDF
Micro XRCE-DDS: Bringing DDS into microcontrollers
PDF
The DDS Security Standard
PDF
Distributed Simulations with DDS and HLA
PDF
OMG DDS: The Data Distribution Service for Real-Time Systems
PDF
Fast DDS Features & Tools
PDF
Getting Started with DDS in C++, Java and Scala
PDF
An overview of Neo4j Internals
PPT
Data-Centric and Message-Centric System Architecture
PDF
NoSQL Essentials: Cassandra
PDF
Cyclone DDS: Sharing Data in the IoT Age
PPTX
Best Practices Using RTI Connext DDS
PDF
PySpark in practice slides
PDF
RTI DDS Intro with DDS Secure
PPTX
Understanding Split Brain DNS
Introduction to RTI DDS
The Data Distribution Service
Advanced OpenSplice Programming - Part I
The Data Distribution Service
DDS: The IoT Data Sharing Standard
Tuning and Troubleshooting OpenSplice DDS Applications
Micro XRCE-DDS: Bringing DDS into microcontrollers
The DDS Security Standard
Distributed Simulations with DDS and HLA
OMG DDS: The Data Distribution Service for Real-Time Systems
Fast DDS Features & Tools
Getting Started with DDS in C++, Java and Scala
An overview of Neo4j Internals
Data-Centric and Message-Centric System Architecture
NoSQL Essentials: Cassandra
Cyclone DDS: Sharing Data in the IoT Age
Best Practices Using RTI Connext DDS
PySpark in practice slides
RTI DDS Intro with DDS Secure
Understanding Split Brain DNS
Ad

Viewers also liked (19)

PDF
20 Tips for OpenSplice Newbies
PDF
10 Reasons for Choosing OpenSplice DDS
PDF
DDS In Action Part II
PDF
OpenSplice DDS v6
PDF
Building the Internet of Things
PDF
Standardizing the Data Distribution Service (DDS) API for Modern C++
PPTX
Comparison of MQTT and DDS as M2M Protocols for the Internet of Things
PDF
RUSTing -- Partially Ordered Rust Programming Ruminations
PDF
Stream Processing with DDS and CEP
PDF
Vortex Tutorial -- Part I
PDF
Vortex Tutorial Part II
PDF
Desktop, Embedded and Mobile Apps with Vortex Café
PDF
Building Real-Time Web Applications with Vortex-Web
PDF
Advanced OpenSplice Programming - Part II
PDF
Connected Mobile and Web Applications with Vortex
PDF
Getting Started with OpenSplice DDS Community Ed.
PDF
Building Reactive Applications with DDS
PDF
Getting Started with Vortex
PDF
Introducing Vortex Lite
20 Tips for OpenSplice Newbies
10 Reasons for Choosing OpenSplice DDS
DDS In Action Part II
OpenSplice DDS v6
Building the Internet of Things
Standardizing the Data Distribution Service (DDS) API for Modern C++
Comparison of MQTT and DDS as M2M Protocols for the Internet of Things
RUSTing -- Partially Ordered Rust Programming Ruminations
Stream Processing with DDS and CEP
Vortex Tutorial -- Part I
Vortex Tutorial Part II
Desktop, Embedded and Mobile Apps with Vortex Café
Building Real-Time Web Applications with Vortex-Web
Advanced OpenSplice Programming - Part II
Connected Mobile and Web Applications with Vortex
Getting Started with OpenSplice DDS Community Ed.
Building Reactive Applications with DDS
Getting Started with Vortex
Introducing Vortex Lite
Ad

Similar to The DDS Tutorial - Part I (20)

PDF
Cloudand Xchange
PDF
Tweeting with OpenSplice DDS
PDF
UML Profile for DDS
PDF
OMG DDS Tutorial - Part I
PDF
DDS vs AMQP
PDF
DDS-PSM-Cxx and simd-cxx
PDF
Getting Started with OpenSplice and Esper
PDF
The Data Distribution Service: The Communication Middleware Fabric for Scala...
PDF
A Gentle Introduction to OpenSplice DDS
PPTX
CoreDX DDS Technical Information
PDF
DDS for JMS Programmers
PDF
High Performance Distributed Computing with DDS and Scala
PDF
Reactive Data Centric Architectures with DDS
PDF
DDS Interoperability Demo 2013 (Washington DC)
PDF
Couchbase Korea User Gorup 2nd Meetup #1
PPT
internet
PDF
DDS vs DDS4CCM
PDF
The Present and Future of DDS
PDF
Interoperability for Intelligence Applications using Data-Centric Middleware
Cloudand Xchange
Tweeting with OpenSplice DDS
UML Profile for DDS
OMG DDS Tutorial - Part I
DDS vs AMQP
DDS-PSM-Cxx and simd-cxx
Getting Started with OpenSplice and Esper
The Data Distribution Service: The Communication Middleware Fabric for Scala...
A Gentle Introduction to OpenSplice DDS
CoreDX DDS Technical Information
DDS for JMS Programmers
High Performance Distributed Computing with DDS and Scala
Reactive Data Centric Architectures with DDS
DDS Interoperability Demo 2013 (Washington DC)
Couchbase Korea User Gorup 2nd Meetup #1
internet
DDS vs DDS4CCM
The Present and Future of DDS
Interoperability for Intelligence Applications using Data-Centric Middleware

More from Angelo Corsaro (20)

PDF
Zenoh: The Genesis
PDF
zenoh: The Edge Data Fabric
PDF
Zenoh Tutorial
PDF
Data Decentralisation: Efficiency, Privacy and Fair Monetisation
PDF
zenoh: zero overhead pub/sub store/query compute
PDF
zenoh -- the ZEro Network OverHead protocol
PDF
zenoh -- the ZEro Network OverHead protocol
PDF
Breaking the Edge -- A Journey Through Cloud, Edge and Fog Computing
PDF
Eastern Sicily
PDF
fog05: The Fog Computing Infrastructure
PDF
fog05: The Fog Computing Platform
PDF
Programming in Scala - Lecture Four
PDF
Programming in Scala - Lecture Three
PDF
Programming in Scala - Lecture Two
PDF
Programming in Scala - Lecture One
PDF
Data Sharing in Extremely Resource Constrained Envionrments
PDF
Vortex II -- The Industrial IoT Connectivity Standard
PDF
Fog Computing Defined
PDF
DDS and OPC UA Explained
PDF
The Cloudy, Foggy and Misty Internet of Things -- Toward Fluid IoT Architect...
Zenoh: The Genesis
zenoh: The Edge Data Fabric
Zenoh Tutorial
Data Decentralisation: Efficiency, Privacy and Fair Monetisation
zenoh: zero overhead pub/sub store/query compute
zenoh -- the ZEro Network OverHead protocol
zenoh -- the ZEro Network OverHead protocol
Breaking the Edge -- A Journey Through Cloud, Edge and Fog Computing
Eastern Sicily
fog05: The Fog Computing Infrastructure
fog05: The Fog Computing Platform
Programming in Scala - Lecture Four
Programming in Scala - Lecture Three
Programming in Scala - Lecture Two
Programming in Scala - Lecture One
Data Sharing in Extremely Resource Constrained Envionrments
Vortex II -- The Industrial IoT Connectivity Standard
Fog Computing Defined
DDS and OPC UA Explained
The Cloudy, Foggy and Misty Internet of Things -- Toward Fluid IoT Architect...

Recently uploaded (20)

PDF
Empathic Computing: Creating Shared Understanding
PDF
gpt5_lecture_notes_comprehensive_20250812015547.pdf
PPTX
Programs and apps: productivity, graphics, security and other tools
PDF
Heart disease approach using modified random forest and particle swarm optimi...
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PDF
Video forgery: An extensive analysis of inter-and intra-frame manipulation al...
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PPTX
Tartificialntelligence_presentation.pptx
PPTX
cloud_computing_Infrastucture_as_cloud_p
PDF
A comparative analysis of optical character recognition models for extracting...
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PPTX
TechTalks-8-2019-Service-Management-ITIL-Refresh-ITIL-4-Framework-Supports-Ou...
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
Univ-Connecticut-ChatGPT-Presentaion.pdf
PDF
NewMind AI Weekly Chronicles - August'25-Week II
PDF
A comparative study of natural language inference in Swahili using monolingua...
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
Mushroom cultivation and it's methods.pdf
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PDF
Network Security Unit 5.pdf for BCA BBA.
Empathic Computing: Creating Shared Understanding
gpt5_lecture_notes_comprehensive_20250812015547.pdf
Programs and apps: productivity, graphics, security and other tools
Heart disease approach using modified random forest and particle swarm optimi...
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
Video forgery: An extensive analysis of inter-and intra-frame manipulation al...
Building Integrated photovoltaic BIPV_UPV.pdf
Tartificialntelligence_presentation.pptx
cloud_computing_Infrastucture_as_cloud_p
A comparative analysis of optical character recognition models for extracting...
Agricultural_Statistics_at_a_Glance_2022_0.pdf
TechTalks-8-2019-Service-Management-ITIL-Refresh-ITIL-4-Framework-Supports-Ou...
Per capita expenditure prediction using model stacking based on satellite ima...
Univ-Connecticut-ChatGPT-Presentaion.pdf
NewMind AI Weekly Chronicles - August'25-Week II
A comparative study of natural language inference in Swahili using monolingua...
Advanced methodologies resolving dimensionality complications for autism neur...
Mushroom cultivation and it's methods.pdf
Reach Out and Touch Someone: Haptics and Empathic Computing
Network Security Unit 5.pdf for BCA BBA.

The DDS Tutorial - Part I

  • 1. OpenSplice DDS Delivering Performance, Openness, and Freedom The DDS Tutorial Angelo Corsaro, Ph.D. Chief Technology Officer OMG DDS SIG Co-Chair [email protected] ::Part I
  • 2. Addressing Data Distribution Challenges DDS is standard designed to address the data-distribution challenges across a wide class of Defense and Aerospace Applications The OMG DDS Standard ‣ Introduced in 2004, DDS is a standard for Real-Time, Dependable and High- Performance Publish/Subscribe ‣ DDS behaviour and semantics can be controlled via a rich set of QoS Policies ‣ DDS is today recommended by key administration worldwide and widely adopted across several different application domains, such as, Automated Trading, Simulations, SCADA, Telemetry, etc. © 2009, PrismTech. All Rights Reserved
  • 3. The OMG Data Distribution Service (DDS) DDS v1.2 API Standard ‣ Language Independent, OS and HW architecture Application independent Object/Relational Mapping ‣ DCPS. Standard API for Data-Centric, Topic- Data Local Reconstruction Layer (DLRL) Based, Real-Time Publish/Subscribe Content ‣ DLRL. Standard API for creating Object Views out Ownership Durability Subscription of collection of Topics Minimum Profile Data Centric Publish/Subscribe (DCPS) DDSI/RTPS v2.1 Wire Protocol Standard ‣ Standard wire protocol allowing interoperability Real-Time Publish/Subscribe Protocol between different implementations of the DDS DDS Interoperability Wire Protocol standard UDP/IP ‣ Interoperability demonstrated among key DDS vendors in March 2009 © 2009, PrismTech. All Rights Reserved
  • 4. Tutorial Scope Scope & Goals ‣ The Tutorial will cover the DCPS layer of DDS Application ‣ It will give you enough details and examples Object/Relational Mapping to make sure that you can get started Data Local Reconstruction Layer (DLRL) writing DDS applications Content Ownership Durability Subscription Software ‣ OpenSplice DDS Minimum Profile Data Centric Publish/Subscribe (DCPS) ‣ http://www.opensplice.org Real-Time Publish/Subscribe Protocol ‣ SIMple Dds (SIMD) DDS Interoperability Wire Protocol ‣http://code.google.com/p/simd-cxx UDP/IP Prerequisite ‣ Basic C++ understanding © 2009, PrismTech. All Rights Reserved
  • 5. OpenSplice DDS Delivering Performance, Openness, and Freedom Your will learn: - What is a Topic - How to define Topic Types - How to register a Topic Step I Defining the Data
  • 6. Topics Topic ‣ Unit of information atomically exchanged between Publisher and Subscribers. ‣ An association between a unique name, a type and a QoS setting © 2009, PrismTech. All Rights Reserved
  • 7. Topic Types A DDS Topic Type is described by an IDL Structure containing an arbitrary number for fields whose types might be: ‣ IDL primitive types, e.g., octet, short, long, float, string (bound/unbound), etc. ‣ Enumeration ‣ Union ‣ Sequence (bounded or unbounded) ‣ Array ‣ Structure (nested) © 2009, PrismTech. All Rights Reserved
  • 8. Examples struct HelloTopicType { enum TemperatureScale { string message; CELSIUS, }; FAHRENHEIT, struct ShapeType { KELVIN long x; }; long y; long shapesize; struct TempSensorType { struct PingType string color; short id; { }; float temp; long counter; float hum; string<32> vendor; TemperatureScale scale; }; }; struct Counter { long cID; long count; }; © 2009, PrismTech. All Rights Reserved
  • 9. Topic Types & Keys ‣ Each Topic Type has to define its key-set (which might be the empty set) ‣ There are no limitations on the number of attributes used to represent a key ‣ Keys can be top-level attributes as well as nested-attributes (i.e. attributes in nested structures) © 2009, PrismTech. All Rights Reserved
  • 10. Key Examples -- Empty Key-Set struct PingType struct HelloTopicType { { string message; long counter; }; string<32> vendor; #pragma keylist HelloTopicType }; #pragma keylist PingType © 2009, PrismTech. All Rights Reserved
  • 11. Key Examples -- User-Defined Keys enum TemperatureScale { CELSIUS, FAHRENHEIT, struct ShapeType { KELVIN long x; }; long y; long shapesize; struct TempSensorType { string color; short id; }; short roomid; #pragma keylist ShapeType color float temp; float hum; TemperatureScale scale; struct Counter { }; long cID; #pragma keylist TempSensorType id roomid long count; }; #pragma keylist Counter cID © 2009, PrismTech. All Rights Reserved
  • 12. Topic Keys Gotchas ‣ Keys are used to identify specific data “instances” ‣ It we want to make a parallel with OO then we could say that: ‣ Keyless Topic as singletons, e.g. there is only one instance! ‣ Keyed Topics identify a class of instances. Each instance is identified by a key value ‣ Think at each different key value as really instantiating a new “object” in your system. That will avoid making mistakes in your keys assignment ‣ Never do something like this: struct Counter { long cID; long count; }; #pragma keylist Counter count ... As it will create a new topic instance for each ping you send thus consuming an unbounded amount of resources! © 2009, PrismTech. All Rights Reserved
  • 13. Compiling Topic Types ‣ Topic types have to be compiled with the DDS-provided IDL compiler ‣ The compilation process will take care of generating code for ‣ Strongly typed Reader and Writers ‣ Type Serialization ‣ When compiling a target language should be chosen, such as C/C++/Java/C# ‣ Example: $ idlpp -S -l cpp -d gencxx ShapeType.idl $ idlpp -S -l java -d genjava ShapeType.idl Standalone mode Target Language Target Directory Target File © 2009, PrismTech. All Rights Reserved
  • 14. IDL Compilation in SIMD ‣ SIMD provides a template makefile that you can use to compile your IDL files. ‣ The default language is C++ (as SIMD currently supports only C++) Makefile.idl #-*-Makefile-*- include $(SIMD_HOME)/config/apps/Macros-idl.GNU TARGET_IDL=ShapeType.idl include $(SIMD_HOME)/config/apps/Rules-idl.GNU © 2009, PrismTech. All Rights Reserved
  • 15. Putting it all Together Circle struct ShapeType { long x; long y; long shapesize; Topic QoS string color; }; #pragma keylist ShapeType color © 2009, PrismTech. All Rights Reserved
  • 16. Registering Topics with SIMD ‣ SIMD provides several constructors that allow to register a topic: Topic(const std::string& name); Topic(const std::string& name, const TopicQos& qos); Topic(const std::string& name, const std::string& type_name); Topic(const std::string& name, const std::string& type_name, const TopicQos& qos); © 2009, PrismTech. All Rights Reserved
  • 17. Registering the Circle Topic Circle struct ShapeType { long x; long y; long shapesize; Default Topic QoS string color; }; #pragma keylist ShapeType color dds::Topic<ShapeType> shape(“Circle”); © 2009, PrismTech. All Rights Reserved
  • 18. Topic Registration Gotchas ‣ Topics registration is idempotent as far as you register the topic in the same way from various applications. ‣ It is an error to try to register a topic with the same name but a different type. ‣ Example: Application 1 Application 2 dds::Topic<ShapeType> shape(“Circle”); dds::Topic<ShapeType> shape(“Circle”); OK dds::Topic<ShapeType> shape(“Circle”); dds::Topic<AnotherType> shape(“Circle”); Errror © 2009, PrismTech. All Rights Reserved
  • 19. OpenSplice DDS Delivering Performance, Openness, and Freedom Your will learn: - What are DDS Partitions - How to partitions work Step II Defining the Scope
  • 20. Domains and Partitions Domain Domain ‣ A Domain is one instance of the DDS Global Data Space ‣ DDS entities always belong to a specific domain Partition ‣ A partition is a scoping mechanism provided by DDS organize a partition DDS Global Data Space Partition © 2009, PrismTech. All Rights Reserved
  • 21. More about Partitions ‣ Each partition is identified by a string, such as “sensor-data”, “log-data” etc. ‣ Read/Write access to a partition is gained by means of DDS Publisher/Subscribers ‣ Each Publisher/Subscriber can be provided with a list of Partitions name, which might as well include wildcards ,or DDS generic regular expression, Global Data Space Partition such as “*-data” © 2009, PrismTech. All Rights Reserved
  • 22. Partition as Namespaces ‣ Although DDS does not support explicit nesting of partitions, a powerful way of organizing your data is by always using a hierarchical “dotted” notation to describe them. ‣ For instance, for a building in which you are deploying the new temperature control system you might use a scheme such as “building.floor-level.room-number” for scoping the data that flows in each room. ‣ building.floor-2.room-10 ‣ building.floor-3.room-15 ‣ In this way, accessing the data for a specific floor can be done by using the partition expression “building.floor-2.*” ‣ While the data for all the building is available via “building.*” © 2009, PrismTech. All Rights Reserved
  • 23. Emulating Partition Nesting “building.floor-1.*” “building” “building.floor-1” “building.floor-1.room-1” ... “building.floor-N” “building.floor-1.room-2” “building.floor-N.room-1” “building.floor-N.room-2” ... “building.floor-2” “building.floor-2.room-1” ... “building.floor-2.room-2” ... © 2009, PrismTech. All Rights Reserved
  • 24. Connecting to Partitions in SIMD ‣ SIMD provides two ways of connecting to partitions. ‣ A simple one is to bound the full runtime to a partition expression by passing a string to the Runtime class at construction time ‣ The other is to configure a specific Publisher/Subscriber with the relevant list of partitions Runtime(); Runtime(const std::string& partition); Runtime(const std::string& partition, const std::string& domain); Publisher(const std::string& partition); Publisher(const std::string& partition, ::dds::DomainParticipant dp); Publisher(const ::dds::PublisherQos& qos, ::dds::DomainParticipant dp); Subscriber(const std::string& partition); Subscriber(const std::string& partition, ::dds::DomainParticipant dp); Subscriber(const ::dds::SubscriberQos& qos, ::dds::DomainParticipant dp); © 2009, PrismTech. All Rights Reserved
  • 25. OpenSplice DDS Delivering Performance, Openness, and Freedom Your will learn: - What is a Data Writer - How to Create a Data Writer - How to write Data Step III Producing the Data
  • 26. Writing Data in SIMD ‣ Writing data with SIMD takes two steps. ‣ First you have to create the DataWriter by using the proper constructor (this depends on the level of customization you require) ‣ Then, you’ll have to decide how you want to write the data © 2009, PrismTech. All Rights Reserved
  • 27. Creating a DataWriter ‣ SIMD provides different DataWriter constructors allowing to control the level of customization required for the specific writer template <typename T> class dds::pub::DataWriter : public dds::core::Entity { public: DataWriter(); DataWriter(Topic<T> topic) DataWriter(Topic<T> topic, const DataWriterQos& qos) DataWriter(Topic<T> topic, const DataWriterQos& qos, Publisher pub); // ... }; © 2009, PrismTech. All Rights Reserved
  • 28. Writing Data with SIMD ‣ SIMD provides two generic writes as well as a method for creating a writer dedicated to a specific instance ‣ The DataInstanceWriter provides constant time writes as it does not need to look-up the key-fields DDS::ReturnCode_t write(const T& sample); DDS::ReturnCode_t write(const T& sample, const DDS::Time_t& timestamp); DataInstanceWriter<T> register_instance(const T& key); © 2009, PrismTech. All Rights Reserved
  • 29. Writing “Circling” Circle Samples © 2009, PrismTech. All Rights Reserved
  • 30. OpenSplice DDS Delivering Performance, Openness, and Freedom Your will learn: - Reading vs Taking data - Sample State - How to Create a Data Reader - How to read/take data Step IV Consuming Data
  • 31. Reading Samples ‣ Read iterates over the available sample instances ‣ 1 1 1 2 1 3 1 4 Samples are not removed 2 1 2 2 2 3 DataReader from the local cache as Proprietary Information - Distribution without Expressed Written Permission is Prohibited. 3 1 3 2 3 3 3 4 3 5 result of a read Topic ‣ Read samples can be read again, by accessing the Samples Read Samples not Read cache with the proper options (more later) DataReader Cache struct Counter { int cID; int count; }; #pragma keylist Counter cID © 2009, PrismTech. All Rights Reserved
  • 32. Reading Samples ‣ Read iterates over the available sample instances 1 1 1 2 1 3 1 4 ‣ Samples are not removed 2 1 2 2 2 3 from the local cache as DataReader Proprietary Information - Distribution without Expressed Written Permission is Prohibited. 3 1 3 2 3 3 3 4 3 5 result of a read ‣ Read samples can be read Topic again, by accessing the Samples Read Samples not Read cache with the proper options (more later) DataReader Cache struct Counter { int cID; int count; }; #pragma keylist Counter cID © 2009, PrismTech. All Rights Reserved
  • 33. Reading Samples ‣ Read iterates over the available sample instances 1 1 1 2 1 3 1 4 ‣ Samples are not removed 2 1 2 2 2 3 from the local cache as DataReader Proprietary Information - Distribution without Expressed Written Permission is Prohibited. 3 1 3 2 3 3 3 4 3 5 result of a read ‣ Read samples can be read Topic again, by accessing the Samples Read Samples not Read cache with the proper options (more later) DataReader Cache struct Counter { int cID; int count; }; #pragma keylist Counter cID © 2009, PrismTech. All Rights Reserved
  • 34. Taking Samples ‣ Take iterates over the available sample instances 1 1 1 2 1 3 1 4 ‣ Taken Samples are 2 1 2 2 2 3 removed from the local DataReader Proprietary Information - Distribution without Expressed Written Permission is Prohibited. 3 4 3 5 cache as result of a take 3 1 3 2 3 3 ‣ Topic Samples not Taken DataReader Cache struct Counter { int cID; int count; }; #pragma keylist Counter cID © 2009, PrismTech. All Rights Reserved
  • 35. Taking Samples ‣ Take iterates over the available sample instances 1 2 1 3 1 4 ‣ Taken Samples are 2 2 2 3 removed from the local DataReader Proprietary Information - Distribution without Expressed Written Permission is Prohibited. 3 2 3 3 3 4 3 5 cache as result of a take Topic Samples not Taken DataReader Cache struct Counter { int cID; int count; }; #pragma keylist Counter cID © 2009, PrismTech. All Rights Reserved
  • 36. Taking Samples ‣ Take iterates over the available sample instances 1 3 1 4 ‣ Taken Samples are 2 3 removed from the local DataReader Proprietary Information - Distribution without Expressed Written Permission is Prohibited. 3 3 3 4 3 5 cache as result of a take Topic Samples not Taken DataReader Cache struct Counter { int cID; int count; }; #pragma keylist Counter cID © 2009, PrismTech. All Rights Reserved
  • 37. Sample, Instance and View States History Depth = 2 ‣ Along with data samples, DataReaders are provided 1 1 with state information allowing to detect relevant 2 2 transitions in the life-cycle of data as well as data 3 writers DataReader Proprietary Information - Distribution without Expressed Written Permission is Prohibited. SampleInfo ‣ Sample State (READ | NOT_READ): Determines wether a sample has already been read by this 1 1 1 2 DataReader or not. 2 2 2 3 ‣ Instance State (ALIVE, NOT_ALIVE, DISPOSED). 3 1 Determines wether (1) writer exist for the specific Samples instance, or (2) no matched writers are currently Topic available, or (3) the instance has been disposed DataReader Cache ‣ View State (NEW, NOT_NEW). Determines wether this is the first sample of a new (or re-born) instance © 2009, PrismTech. All Rights Reserved
  • 38. Application / DDS Coordination DDS provides three main mechanism for exchanging information with the application ‣ Polling. The application polls from time to time for new data or status changes. The interval might depend on the kind of applications as well as data Proprietary Information - Distribution without Expressed Written Permission is Prohibited. ‣ WaitSets. The application registers a WaitSet with DDS and waits (i.e. is suspended) until one of the specified events has happened. ‣ Listeners. The application registers a listener with a specific DDS entity to be notified when relevant events occur, such as state changes or © 2009, PrismTech. All Rights Reserved
  • 39. Reading Data with SIMD /** * Reads all new samples from any view state and alive instances. Notice * that this call is intended to loan the <code>samples</code> as * well as the <conde>infos</code> containers, thus will require a * return_loan. */ DDS::ReturnCode_t read(TSeq& samples, DDS::SampleInfoSeq& infos) /** * Reads at most <code>max_samples</code> samples that have not been Proprietary Information - Distribution without Expressed Written Permission is Prohibited. * read yet from all vies and alive instances. */ DDS::ReturnCode_t read(TSeq& samples, long max_samples) /** * Most generic <code>read</code> exposing all the knobs provided by * the OMG DDS API. */ DDS::ReturnCode_t read(TSeq& samples, DDS::SampleInfoSeq& infos,long max_samples, DDS::SampleStateMask samples_state, DDS::ViewStateMask views_state, DDS::InstanceStateMask instances_state) DDS::ReturnCode_t return_loan(TSeq& samples, DDS::SampleInfoSeq& infos); © 2009, PrismTech. All Rights Reserved
  • 40. Taking Data with SIMD /** * Reads all new samples from any view state and alive instances. Notice * that this call is intended to loan the <code>samples</code> as * well as the <conde>infos</code> containers, thus will require a * return_loan. */ DDS::ReturnCode_t take(TSeq& samples, DDS::SampleInfoSeq& infos) /** Proprietary Information - Distribution without Expressed Written Permission is Prohibited. * Reads at most <code>max_samples</code> samples that have not been * read yet from all vies and alive instances. */ DDS::ReturnCode_t take(TSeq& samples, long max_samples) /** * Most generic <code>read</code> exposing all the knobs provided by * the OMG DDS API. */ DDS::ReturnCode_t take(TSeq& samples, DDS::SampleInfoSeq& infos,long max_samples, DDS::SampleStateMask samples_state, DDS::ViewStateMask views_state, DDS::InstanceStateMask instances_state) © 2009, PrismTech. All Rights Reserved
  • 41. WaitSets in SIMD ‣ SIMD provides a strongly typed WaitSet that supports automatic dispatching to functors ‣ The best way of understanding SIMD waitsets is to look at an example: Proprietary Information - Distribution without Expressed Written Permission is Prohibited. © 2009, PrismTech. All Rights Reserved
  • 42. Listeners in SIMD ‣ SIMD provides a strongly typed Listeners based on the Signals/Slots patterns Proprietary Information - Distribution without Expressed Written Permission is Prohibited. ‣ The best way of understanding SIMD Listeners is to look at an example... © 2009, PrismTech. All Rights Reserved
  • 44. OpenSplice DDS Delivering Performance, Openness, and Freedom Step V Compile and Run...
  • 45. What You’ve Learned today ‣ Defining Topics and Topic Types ‣ Scoping Information with Partitions ‣ Writing Data ‣ Reading (Taking) data with Waitsets and Listeners ‣ Writing an example that demonstrate all of the above © 2009, PrismTech. All Rights Reserved
  • 46. What I’ll Cover Next Time ‣ Content Filtered Topics and Queries ‣ QoS and the Request vs. Offered Model ‣ Setting QoS on DDS Entities ‣ Tuning OpenSplice DDS Configuration © 2009, PrismTech. All Rights Reserved
  • 47. Online Resources http://www.opensplice.com/ http://www.slideshare.net/angelo.corsaro emailto:[email protected] http://bit.ly/1Sreg http://twitter.com/acorsaro/ http://opensplice.blogspot.com http://www.youtube.com/OpenSpliceTube © 2009, PrismTech. All Rights Reserved