SlideShare a Scribd company logo
ISO C++ DDS PSM


   Angelo Corsaro                  Rick Warren
  OMG DDS Co-Chair                       RTI
        PrismTech                 rick.warren@rti.com

angelo.corsaro@prismtech.com




   POC: Angelo Corsaro <angelo.corsaro@prismtech.com>1
Agenda
- Status Update
- Submission Scope
- API Overview
- Resource Management
- Code Example
- Type Mapping Example
- Next Steps
                  Copyright 2010, PrismTech / RTI
Status Update


- Tuesday 20th Sept. 2010, after a “conclave”
 of 4+ hours PrismTech and RTI have
 resolved all open issues and points of
 divergence!
- This presentation provides a unified view of
 what the joint final submission will be.



                  Copyright 2010, PrismTech / RTI
Agenda

- Status Update
- Submission Scope
- API Overview
- Resource Management
- Code Example
- Type Mapping Example
- Next Steps
                  Copyright 2010, PrismTech / RTI
Submission Scope


The ISO C++ DDS PSM has the following
scope:
- Full API for DCPS v1.2 PIM
- Full API for Extensible Topics
- ISO C++ mapping of DDS Type System (as
 defined in xtypes)


                   Copyright 2010, PrismTech / RTI
Agenda

- Status Update
- Submission Scope
- API Overview
- Resource Management
- Code Example
- Type Mapping Example
- Next Steps
                  Copyright 2010, PrismTech / RTI
Key Highlights
- Simple, safe, efficient, extensible and
 portable C++ API
- Well defined and safe resource management
- Use of C++ templates to ensure type safety
 and improve compile time error detection
- Consistent use of Standard C++ types and
 idioms, such as, std::string, std::vector,
 iterators, RAII Pattern, etc., throughout the
 API
                   Copyright 2010, PrismTech / RTI
API Organization
    DDS type constructors.
                                             Vendor Implementation for
                                             the DELEGATE layer


                   DELEGATE

               tdds                                     idds




                                             Standard API instantiated
                                             from the parametrized API
               dds                           and the vendor
                                             implementation of the
                                             DELEGATE layer.
        ANSI/ISO C++ PSM



                      Copyright 2010, PrismTech / RTI
Agenda

- Status Update
- Submission Scope
- API Overview
- Resource Management
- Code Example
- Type Mapping Example
- Next Steps
                  Copyright 2010, PrismTech / RTI
Resource Management
- Principles
   Safety: Never access uninitialized, freed, or
    undefined state
   Determinism: Applications control when local and
    remote resources are allocated and released
   Expressiveness: Maintain capabilities from PIM




                     Copyright 2010, PrismTech / RTI
Resource Management

- Expression of principles differ for
 different kinds of types
   Reference types: Identity based on reference
     • DDS Entities
     • Wait sets and conditions
   Value types: Identity based on state
     • Entity QoS and QoS policies
     • Status
     • Time and duration


                      Copyright 2010, PrismTech / RTI
Reference Type Usage
- Access is through smart pointers, allocated by
 factory methods. These:
   Provide null initialization
   Throw exception on access to “closed” object
   May automatically manage resources
- Examples:
   Null pointer:
      • Publisher pub;
      • if (pub == dds::core::null) { … }
   Initialization:
      • pub = dp.create_publisher();
   Copying reference:
      • Publisher pub2 = pub1; —or— Publisher pub2(pub1);
        // 2 references to same object
   Polymorphism & Down-Casting:
      • Entity e = pub; // Publisher pub
      • Publisher pub =
        dds::core::polymorphic_cast<Publisher>(e);

                         Copyright 2010, PrismTech / RTI
Reference Type Mgmt

- Reference types have close() method
   Disposes object and its contained objects

- Service may automatically close objects no longer
 in use
   “May” gives vendors flexibility to balance determinism,
    convenience for their users
   Similar to resource management practice in JMS
   Common-sense rules:
      • If I keep a reference to it, I intend to call it: still in use
      • If I set a listener, I want it to call me: still in use
      • If I call retain(): still in use

- Summary:
   Deterministic way to halt communication, reclaim resources
   Deterministic way to continue communication, maintain resources
   Flexibility for vendors

                                Copyright 2010, PrismTech / RTI
Agenda

- Status Update
- Submission Scope
- API Overview
- Resource Management
- Type Mapping Example
- Code Example
- Next Steps
                  Copyright 2010, PrismTech / RTI
DDS Types Mapping

- The ISO C++ API is independent from the
 specific mapping used for DDS Topic Types,
 as far as generated types have value
 semantics
      The ISO C++ API can be used with the existing
      IDL2C++ type mapping, or
     It can be used with the ISO C++ mapping for
      DDS Types as defined in the DDS-XTypes
      specification

                      Copyright 2010, PrismTech / RTI
ISO C++ Mapping


- Main Characteristics
     Use of ISO C++ / StdLib types
     Full Attribute Encapsulation via accessors
     Container Safe

- Example... see next slide


                       Copyright 2010, PrismTech / RTI
DDS Type Mapping
   DDS Topic Type                                    ISO C++ Mapping
                                  class TelephoneNumber {

                                  public:
                                    TelephoneNumber();

struct TelephoneNumber {               explicit TelephoneNumber(
   string prefix;                        const std::string& prefix,
   string number;                         const std::string& number);
};
                                    virtual ~TelephoneNumber()
                                  public:
                                    const std::string& prefix() const;
                                    void prefix(const std::string& s);

                                       const std::string& number() const;
                                       void number(const std::string& s);

                                  // State representation
                                  // is implementation dependent
                                  };
                           Copyright 2010, PrismTech / RTI
DDS Type Mapping
       DDS Topic Type

enum MarrialStatus {
  SINGLE, MARRIED, DIVORCED };

struct Person {
   long age; //@id(1)
   wstring name;
   MarrialStatus married;
   sequence<TelephoneNumber> tel;
   sequence<TelefoneNumber, 2> fax;
   double height; //@optional
   double weight; //@optional
   sequence<byte> photo; //@shared
};




                           Copyright 2010, PrismTech / RTI
DDS Type Mapping
       DDS Topic Type                                ISO C++ Mapping

enum MarrialStatus {
  SINGLE, MARRIED, DIVORCED };
                                                      class Person {
struct Person {                                       public:
   long age; //@id(1)                                  int32_t age() const;
   wstring name;                                       void age(int32_t i);
   MarrialStatus married;                             };
   sequence<TelephoneNumber> tel;
   sequence<TelefoneNumber, 2> fax;
   double height; //@optional
   double weight; //@optional
   sequence<byte> photo; //@shared
};




                           Copyright 2010, PrismTech / RTI
DDS Type Mapping
       DDS Topic Type                                ISO C++ Mapping

enum MarrialStatus {
  SINGLE, MARRIED, DIVORCED };
                                                class Person {
struct Person {                                 public:
   long age; //@id(1)                            std::wstring name() const;
   wstring name;                                 void name(const std::wstring s);
   MarrialStatus married;                       };
   sequence<TelephoneNumber> tel;
   sequence<TelefoneNumber, 2> fax;
   double height; //@optional
   double weight; //@optional
   sequence<byte> photo; //@shared
};




                           Copyright 2010, PrismTech / RTI
DDS Type Mapping
       DDS Topic Type                                 ISO C++ Mapping

enum MarrialStatus {
  SINGLE, MARRIED, DIVORCED };

struct Person {
   long age; //@id(1)
   wstring name;
   MarrialStatus married;
   sequence<TelephoneNumber> tel;
   sequence<TelefoneNumber, 2> fax;
   double height; //@optional
   double weight; //@optional
   sequence<byte> photo; //@shared
};
                    class Person {
                    public:
                     const std::vector<TelephoneNumber>& tel() const;
                     void tel(const std::vector<TelephoneNumber>& s);
                    };
                            Copyright 2010, PrismTech / RTI
DDS Type Mapping
       DDS Topic Type                  ISO C++ Mapping

enum MarrialStatus {
  SINGLE, MARRIED, DIVORCED };

struct Person {
   long age; //@id(1)
   wstring name;
   MarrialStatus married;
   sequence<TelephoneNumber> tel;
   sequence<TelefoneNumber, 2> fax;
   double height; //@optional
   double weight; //@optional
   sequence<byte> photo; //@shared
};
                 class Person {
                 public:
                  const dds::core::optional<double>& height() const;
                  void height(double d);
                  void height(const dds::core::optional<double>& o);
                 };         Copyright 2010, PrismTech / RTI
DDS Type Mapping
       DDS Topic Type                                 ISO C++ Mapping

enum MarrialStatus {
  SINGLE, MARRIED, DIVORCED };

struct Person {
   long age; //@id(1)
   wstring name;
   MarrialStatus married;
   sequence<TelephoneNumber> tel;
   sequence<TelefoneNumber, 2> fax;
   double height; //@optional
   double weight; //@optional
   sequence<byte> photo; //@shared
};
                    class Person {
                    public:
                     std::vector<uint8_t>* photo() const;
                     void photo(std::vector<uint8_t>* v);
                    };
                            Copyright 2010, PrismTech / RTI
Agenda

- Status Update
- Submission Scope
- API Overview
- Resource Management
- Type Mapping Example
- Code Example
- Next Steps
                  Copyright 2010, PrismTech / RTI
Code Example

 DDS Topic Type
 struct RadarTrack {
    string id;
    long x;
    long y;
 };




                       Copyright 2010, PrismTech / RTI
Data Writer

- Create DataWriter
 using dds::core; using dds::domain;
 using dds::pub; using dds::topic;

 DomainId id = 0;

 DomainParticipant dp =
    theParticipantFactory().create_participant(id);

 Publisher pub = dp.create_publisher();

 Topic<RadarTrack> topic = dp.create_topic("RadarTrackTopic");
 DataWriter<RadarTrack> dw = pub.create_datawriter();
 RadarTrack t("T101", 100, 200);
 dw.write(t);



                          Copyright 2010, PrismTech / RTI
Data Reader


 using dds::core; using dds::domain;
 using dds::pub; using dds::topic;

 DomainId id = 0;
 DomainParticipant dp(id);

 DomainParticipant dp =
    theParticipantFactory().create_participant();

 Publisher sub = dp.create_publisher();

 Topic<RadarTrack> topic = dp.create_topic("RadarTrackTopic");
 DataReader<RadarTrack> reader = sub.create_datareader();




                        Copyright 2010, PrismTech / RTI
Data Reader
                                                          std::vector<RadarTrack> t;
                                                          std::vector<SampleInfo> i;

                                                          RadarTrack at[MSIZE];
                                                          SampleInfo ai[MSIZE];

- User Provided Container
   dr.take(t.begin(), i.begin(), maxsize);



   dr.take(at, ai, MSIZE);




                        Copyright 2010, PrismTech / RTI
Data Reader


- Loaned Data
   LoanedSamples<RadarTrack> dt = dr.take();
    for (LoanedSamples<RadarTrack>::Iterator it = dt.begin();
          it != dt.end();
          ++it) {
      const Sample<RadarTrack>& sample = *it;
      if (sample.is_valid_data()) {
        const RadarTrack& data = sample.data();
        // …
      }
    }

                        Copyright 2010, PrismTech / RTI
Agenda

- Status Update
- Submission Scope
- API Overview
- Resource Management
- Type Mapping Example
- Code Example
- Next Steps
                  Copyright 2010, PrismTech / RTI
Next Steps


- XTopics API
     Add support for the XTopics API
     Complete the Type Mapping to include the full
      DDS-XTypes Type System

- Vote for Adoption
     December Meeting



                      Copyright 2010, PrismTech / RTI
THANKS

  `

More Related Content

PPT
Extensible and Dynamic Topic Types For DDS (out of date)
PDF
CSMR10c.ppt
PPTX
How To Code in C#
PDF
What's the Right Messaging Standard for the IoT?
PDF
Vortex II -- The Industrial IoT Connectivity Standard
PDF
RUSTing -- Partially Ordered Rust Programming Ruminations
PPT
Facebook
PPT
The Reality of Innovation and its Implications for Projects
Extensible and Dynamic Topic Types For DDS (out of date)
CSMR10c.ppt
How To Code in C#
What's the Right Messaging Standard for the IoT?
Vortex II -- The Industrial IoT Connectivity Standard
RUSTing -- Partially Ordered Rust Programming Ruminations
Facebook
The Reality of Innovation and its Implications for Projects

Viewers also liked (20)

PPT
Presentation 12.19
PDF
ikd312-08-fd
PDF
ikd312-03-design
PPSX
Microsoft
PPTX
CBI Presentation March 2011
PPT
BONES FESTES
PDF
Real-Time Marketing With Twitter
PDF
Electric energy scientific development, main source and consumers
PDF
Designing the Mobile Experience
PPT
How to Play Well with Others (A Program on Dealing with Difficult People)
PDF
Crosscurrents, 2011. It's All about Thinking
KEY
Lxb Attest
PDF
ikh331-05-transaction
PDF
Visita parque ciencias 2º ciclo
PDF
Building Distributed Systems in Scala with OpenSplice DDS
PPT
Varney Family Photos
PPT
Sph 107 Ch 15
PDF
Ralph Who
PPTX
The big pig
PDF
My Portfolio
Presentation 12.19
ikd312-08-fd
ikd312-03-design
Microsoft
CBI Presentation March 2011
BONES FESTES
Real-Time Marketing With Twitter
Electric energy scientific development, main source and consumers
Designing the Mobile Experience
How to Play Well with Others (A Program on Dealing with Difficult People)
Crosscurrents, 2011. It's All about Thinking
Lxb Attest
ikh331-05-transaction
Visita parque ciencias 2º ciclo
Building Distributed Systems in Scala with OpenSplice DDS
Varney Family Photos
Sph 107 Ch 15
Ralph Who
The big pig
My Portfolio
Ad

Similar to DDS ISO C++ PSM (20)

PDF
ISO C++ DDS PSM
PDF
Overloading in Overdrive: A Generic Data-Centric Messaging Library for DDS
PDF
Standardizing the Data Distribution Service (DDS) API for Modern C++
PDF
Comparing IDL to C++ with IDL to C++11
PDF
Comparing IDL to C++ with IDL to C++11
PDF
IDL to C++11 OMG RTWS presentations
PPTX
Extensible and Dynamic Topic Types for DDS
PPT
02 Symbian Os Basics Tipos De Dados
PDF
DDS Programming with IDL to C++11 tutorial
PDF
A simple and powerful property system for C++ (talk at GCDC 2008, Leipzig)
PPTX
Symbian OS - Types And Declarations
PDF
The DDS Tutorial - Part I
PPTX
Silicon Valley Code Camp - Do you C what I C
PPTX
Extensible and Dynamic Topic Types for DDS
PDF
Dynamic C++ Silicon Valley Code Camp 2012
PDF
EEE 3rd year oops cat 3 ans
PDF
AMI4CCM_IDL2CPP
TXT
Advance C++notes
PDF
IDL to C++11 revised submission presentation
PPT
C++ polymorphism
ISO C++ DDS PSM
Overloading in Overdrive: A Generic Data-Centric Messaging Library for DDS
Standardizing the Data Distribution Service (DDS) API for Modern C++
Comparing IDL to C++ with IDL to C++11
Comparing IDL to C++ with IDL to C++11
IDL to C++11 OMG RTWS presentations
Extensible and Dynamic Topic Types for DDS
02 Symbian Os Basics Tipos De Dados
DDS Programming with IDL to C++11 tutorial
A simple and powerful property system for C++ (talk at GCDC 2008, Leipzig)
Symbian OS - Types And Declarations
The DDS Tutorial - Part I
Silicon Valley Code Camp - Do you C what I C
Extensible and Dynamic Topic Types for DDS
Dynamic C++ Silicon Valley Code Camp 2012
EEE 3rd year oops cat 3 ans
AMI4CCM_IDL2CPP
Advance C++notes
IDL to C++11 revised submission presentation
C++ polymorphism
Ad

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
Cyclone DDS: Sharing Data in the IoT Age
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
The DDS Security Standard
PDF
The Data Distribution Service
PDF
Fog Computing Defined
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
Cyclone DDS: Sharing Data in the IoT Age
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
The DDS Security Standard
The Data Distribution Service
Fog Computing Defined

Recently uploaded (20)

PDF
A comparative analysis of optical character recognition models for extracting...
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PDF
project resource management chapter-09.pdf
PPTX
TLE Review Electricity (Electricity).pptx
PDF
MIND Revenue Release Quarter 2 2025 Press Release
PDF
Hybrid model detection and classification of lung cancer
PPTX
Tartificialntelligence_presentation.pptx
PPTX
Group 1 Presentation -Planning and Decision Making .pptx
PPTX
TechTalks-8-2019-Service-Management-ITIL-Refresh-ITIL-4-Framework-Supports-Ou...
PDF
Assigned Numbers - 2025 - Bluetooth® Document
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
August Patch Tuesday
PDF
Accuracy of neural networks in brain wave diagnosis of schizophrenia
PPTX
A Presentation on Artificial Intelligence
PDF
Mushroom cultivation and it's methods.pdf
PDF
gpt5_lecture_notes_comprehensive_20250812015547.pdf
PDF
Heart disease approach using modified random forest and particle swarm optimi...
PPTX
OMC Textile Division Presentation 2021.pptx
PPTX
Programs and apps: productivity, graphics, security and other tools
A comparative analysis of optical character recognition models for extracting...
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
project resource management chapter-09.pdf
TLE Review Electricity (Electricity).pptx
MIND Revenue Release Quarter 2 2025 Press Release
Hybrid model detection and classification of lung cancer
Tartificialntelligence_presentation.pptx
Group 1 Presentation -Planning and Decision Making .pptx
TechTalks-8-2019-Service-Management-ITIL-Refresh-ITIL-4-Framework-Supports-Ou...
Assigned Numbers - 2025 - Bluetooth® Document
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Agricultural_Statistics_at_a_Glance_2022_0.pdf
August Patch Tuesday
Accuracy of neural networks in brain wave diagnosis of schizophrenia
A Presentation on Artificial Intelligence
Mushroom cultivation and it's methods.pdf
gpt5_lecture_notes_comprehensive_20250812015547.pdf
Heart disease approach using modified random forest and particle swarm optimi...
OMC Textile Division Presentation 2021.pptx
Programs and apps: productivity, graphics, security and other tools

DDS ISO C++ PSM

  • 1. ISO C++ DDS PSM Angelo Corsaro Rick Warren OMG DDS Co-Chair RTI PrismTech rick.warren@rti.com angelo.corsaro@prismtech.com POC: Angelo Corsaro <angelo.corsaro@prismtech.com>1
  • 2. Agenda - Status Update - Submission Scope - API Overview - Resource Management - Code Example - Type Mapping Example - Next Steps Copyright 2010, PrismTech / RTI
  • 3. Status Update - Tuesday 20th Sept. 2010, after a “conclave” of 4+ hours PrismTech and RTI have resolved all open issues and points of divergence! - This presentation provides a unified view of what the joint final submission will be. Copyright 2010, PrismTech / RTI
  • 4. Agenda - Status Update - Submission Scope - API Overview - Resource Management - Code Example - Type Mapping Example - Next Steps Copyright 2010, PrismTech / RTI
  • 5. Submission Scope The ISO C++ DDS PSM has the following scope: - Full API for DCPS v1.2 PIM - Full API for Extensible Topics - ISO C++ mapping of DDS Type System (as defined in xtypes) Copyright 2010, PrismTech / RTI
  • 6. Agenda - Status Update - Submission Scope - API Overview - Resource Management - Code Example - Type Mapping Example - Next Steps Copyright 2010, PrismTech / RTI
  • 7. Key Highlights - Simple, safe, efficient, extensible and portable C++ API - Well defined and safe resource management - Use of C++ templates to ensure type safety and improve compile time error detection - Consistent use of Standard C++ types and idioms, such as, std::string, std::vector, iterators, RAII Pattern, etc., throughout the API Copyright 2010, PrismTech / RTI
  • 8. API Organization DDS type constructors. Vendor Implementation for the DELEGATE layer DELEGATE tdds idds Standard API instantiated from the parametrized API dds and the vendor implementation of the DELEGATE layer. ANSI/ISO C++ PSM Copyright 2010, PrismTech / RTI
  • 9. Agenda - Status Update - Submission Scope - API Overview - Resource Management - Code Example - Type Mapping Example - Next Steps Copyright 2010, PrismTech / RTI
  • 10. Resource Management - Principles  Safety: Never access uninitialized, freed, or undefined state  Determinism: Applications control when local and remote resources are allocated and released  Expressiveness: Maintain capabilities from PIM Copyright 2010, PrismTech / RTI
  • 11. Resource Management - Expression of principles differ for different kinds of types  Reference types: Identity based on reference • DDS Entities • Wait sets and conditions  Value types: Identity based on state • Entity QoS and QoS policies • Status • Time and duration Copyright 2010, PrismTech / RTI
  • 12. Reference Type Usage - Access is through smart pointers, allocated by factory methods. These:  Provide null initialization  Throw exception on access to “closed” object  May automatically manage resources - Examples:  Null pointer: • Publisher pub; • if (pub == dds::core::null) { … }  Initialization: • pub = dp.create_publisher();  Copying reference: • Publisher pub2 = pub1; —or— Publisher pub2(pub1); // 2 references to same object  Polymorphism & Down-Casting: • Entity e = pub; // Publisher pub • Publisher pub = dds::core::polymorphic_cast<Publisher>(e); Copyright 2010, PrismTech / RTI
  • 13. Reference Type Mgmt - Reference types have close() method  Disposes object and its contained objects - Service may automatically close objects no longer in use  “May” gives vendors flexibility to balance determinism, convenience for their users  Similar to resource management practice in JMS  Common-sense rules: • If I keep a reference to it, I intend to call it: still in use • If I set a listener, I want it to call me: still in use • If I call retain(): still in use - Summary:  Deterministic way to halt communication, reclaim resources  Deterministic way to continue communication, maintain resources  Flexibility for vendors Copyright 2010, PrismTech / RTI
  • 14. Agenda - Status Update - Submission Scope - API Overview - Resource Management - Type Mapping Example - Code Example - Next Steps Copyright 2010, PrismTech / RTI
  • 15. DDS Types Mapping - The ISO C++ API is independent from the specific mapping used for DDS Topic Types, as far as generated types have value semantics  The ISO C++ API can be used with the existing IDL2C++ type mapping, or  It can be used with the ISO C++ mapping for DDS Types as defined in the DDS-XTypes specification Copyright 2010, PrismTech / RTI
  • 16. ISO C++ Mapping - Main Characteristics  Use of ISO C++ / StdLib types  Full Attribute Encapsulation via accessors  Container Safe - Example... see next slide Copyright 2010, PrismTech / RTI
  • 17. DDS Type Mapping DDS Topic Type ISO C++ Mapping class TelephoneNumber { public: TelephoneNumber(); struct TelephoneNumber { explicit TelephoneNumber( string prefix; const std::string& prefix, string number; const std::string& number); }; virtual ~TelephoneNumber() public: const std::string& prefix() const; void prefix(const std::string& s); const std::string& number() const; void number(const std::string& s); // State representation // is implementation dependent }; Copyright 2010, PrismTech / RTI
  • 18. DDS Type Mapping DDS Topic Type enum MarrialStatus { SINGLE, MARRIED, DIVORCED }; struct Person { long age; //@id(1) wstring name; MarrialStatus married; sequence<TelephoneNumber> tel; sequence<TelefoneNumber, 2> fax; double height; //@optional double weight; //@optional sequence<byte> photo; //@shared }; Copyright 2010, PrismTech / RTI
  • 19. DDS Type Mapping DDS Topic Type ISO C++ Mapping enum MarrialStatus { SINGLE, MARRIED, DIVORCED }; class Person { struct Person { public: long age; //@id(1) int32_t age() const; wstring name; void age(int32_t i); MarrialStatus married; }; sequence<TelephoneNumber> tel; sequence<TelefoneNumber, 2> fax; double height; //@optional double weight; //@optional sequence<byte> photo; //@shared }; Copyright 2010, PrismTech / RTI
  • 20. DDS Type Mapping DDS Topic Type ISO C++ Mapping enum MarrialStatus { SINGLE, MARRIED, DIVORCED }; class Person { struct Person { public: long age; //@id(1) std::wstring name() const; wstring name; void name(const std::wstring s); MarrialStatus married; }; sequence<TelephoneNumber> tel; sequence<TelefoneNumber, 2> fax; double height; //@optional double weight; //@optional sequence<byte> photo; //@shared }; Copyright 2010, PrismTech / RTI
  • 21. DDS Type Mapping DDS Topic Type ISO C++ Mapping enum MarrialStatus { SINGLE, MARRIED, DIVORCED }; struct Person { long age; //@id(1) wstring name; MarrialStatus married; sequence<TelephoneNumber> tel; sequence<TelefoneNumber, 2> fax; double height; //@optional double weight; //@optional sequence<byte> photo; //@shared }; class Person { public: const std::vector<TelephoneNumber>& tel() const; void tel(const std::vector<TelephoneNumber>& s); }; Copyright 2010, PrismTech / RTI
  • 22. DDS Type Mapping DDS Topic Type ISO C++ Mapping enum MarrialStatus { SINGLE, MARRIED, DIVORCED }; struct Person { long age; //@id(1) wstring name; MarrialStatus married; sequence<TelephoneNumber> tel; sequence<TelefoneNumber, 2> fax; double height; //@optional double weight; //@optional sequence<byte> photo; //@shared }; class Person { public: const dds::core::optional<double>& height() const; void height(double d); void height(const dds::core::optional<double>& o); }; Copyright 2010, PrismTech / RTI
  • 23. DDS Type Mapping DDS Topic Type ISO C++ Mapping enum MarrialStatus { SINGLE, MARRIED, DIVORCED }; struct Person { long age; //@id(1) wstring name; MarrialStatus married; sequence<TelephoneNumber> tel; sequence<TelefoneNumber, 2> fax; double height; //@optional double weight; //@optional sequence<byte> photo; //@shared }; class Person { public: std::vector<uint8_t>* photo() const; void photo(std::vector<uint8_t>* v); }; Copyright 2010, PrismTech / RTI
  • 24. Agenda - Status Update - Submission Scope - API Overview - Resource Management - Type Mapping Example - Code Example - Next Steps Copyright 2010, PrismTech / RTI
  • 25. Code Example DDS Topic Type struct RadarTrack { string id; long x; long y; }; Copyright 2010, PrismTech / RTI
  • 26. Data Writer - Create DataWriter using dds::core; using dds::domain; using dds::pub; using dds::topic; DomainId id = 0; DomainParticipant dp = theParticipantFactory().create_participant(id); Publisher pub = dp.create_publisher(); Topic<RadarTrack> topic = dp.create_topic("RadarTrackTopic"); DataWriter<RadarTrack> dw = pub.create_datawriter(); RadarTrack t("T101", 100, 200); dw.write(t); Copyright 2010, PrismTech / RTI
  • 27. Data Reader using dds::core; using dds::domain; using dds::pub; using dds::topic; DomainId id = 0; DomainParticipant dp(id); DomainParticipant dp = theParticipantFactory().create_participant(); Publisher sub = dp.create_publisher(); Topic<RadarTrack> topic = dp.create_topic("RadarTrackTopic"); DataReader<RadarTrack> reader = sub.create_datareader(); Copyright 2010, PrismTech / RTI
  • 28. Data Reader std::vector<RadarTrack> t; std::vector<SampleInfo> i; RadarTrack at[MSIZE]; SampleInfo ai[MSIZE]; - User Provided Container dr.take(t.begin(), i.begin(), maxsize); dr.take(at, ai, MSIZE); Copyright 2010, PrismTech / RTI
  • 29. Data Reader - Loaned Data LoanedSamples<RadarTrack> dt = dr.take(); for (LoanedSamples<RadarTrack>::Iterator it = dt.begin(); it != dt.end(); ++it) { const Sample<RadarTrack>& sample = *it; if (sample.is_valid_data()) { const RadarTrack& data = sample.data(); // … } } Copyright 2010, PrismTech / RTI
  • 30. Agenda - Status Update - Submission Scope - API Overview - Resource Management - Type Mapping Example - Code Example - Next Steps Copyright 2010, PrismTech / RTI
  • 31. Next Steps - XTopics API  Add support for the XTopics API  Complete the Type Mapping to include the full DDS-XTypes Type System - Vote for Adoption  December Meeting Copyright 2010, PrismTech / RTI