![Abstract composition of orange triangles and scattered particles against white background (no text or symbols)](.vortex-opensplice-c-reference-guide/d74b01d2387884e0ec5fff75b2b4667136f0191c4e10d5afe61fc5ab5bd3269e.jpg)

# VORTEX

# OPENSPLICE

# C Reference Guide

Release 6.x

# Vortex OpenSplice

# C REFERENCE GUIDE

# Copyright Notice

© 2006 to 2018 ADLINK Technology Limited. All rights reserved.

This document may be reproduced in whole but not in part.

The information contained in this document is subject to change without notice and is made available in good faith without liability on the part of ADLINK Technology Limited.

All trademarks acknowledged.

# CONTENTS

# Table of Contents

List of Figures xxi

# Preface

About the C Reference Guide. . . . . . . . xxiii

Contacts . . . xxv

# Introduction

About the C Reference Guide 3

Document Structure . . . .

Operations . . . .

# API Reference

Chapter 1 DCPS API General Description 7

1.1 Thread Safety . . . .

1.2 Signal Handling. . . . . . . 8

1.2.1 Synchronous Signals . . .

1.2.2 Asynchronous Signals . . .

1.3 Memory Management . . . .

1.3.1 IDL Mapping Rules for Sequences . . .

1.3.1.1 Standard Defined Type . . . . . . 10

1.3.1.2 User-Defined Type . . . . . 10

1.3.1.3 Data Distribution Service Defined Type . .

1.3.2 Plain Sequences . . .

1.3.3 Sequences Embedded in QosPolicy Objects . . . . . 12

1.3.4 Sequences Embedded in Status Objects . . . . 12

1.3.5 Resources and operations . 12

1.3.5.1 Sequences DDS\_&lt;sequence-name&gt; . . . 13

1.3.5.2 DDS\_sequence\_set\_release . . . . 16

1.4 Listeners Interfaces . . . 22
1.4.1 Struct DDS\_&lt;Entity&gt;Listener . . . 24
1.4.2 DDS\_DomainParticipantListener . . 27
1.4.3 DDS\_ExtDomainParticipantListener . 29
1.4.4 DDS\_TopicListener. . . 32
1.4.5 DDS\_ExtTopicListener . . . 33
1.4.6 DDS\_PublisherListener . . . 34
1.4.7 DDS\_DataWriterListener . . 35
1.4.8 DDS\_SubscriberListener . . . 36
1.4.9 DDS\_DataReaderListener . . . 38
1.5 Inheritance of Abstract Operations . . . . . . . . . 40

# Chapter 2 DCPS Modules 41

2.1 Functionality . . . . . . 41
2.2 Infrastructure Module . . . . . . . . 42
2.3 Domain Module. . . . . . . . 43
2.4 Topic-Definition Module . . . . . . . . 44
2.5 Publication Module. . . . . . . . 46
2.6 Subscription Module . . . . . . . . 48

# Chapter 3 DCPS Classes and Operations 51

3.1 Infrastructure Module . . . . . . . . . 52
3.1.1 Class DDS\_Entity (abstract) . . . 52
3.1.1.1 DDS\_Entity\_enable . . . . 54
3.1.1.2 DDS\_Entity\_get\_instance\_handle . . . . 55
3.1.1.3 DDS\_Entity\_get\_listener (abstract) . . . . 56
3.1.1.4 DDS\_Entity\_get\_qos (abstract) . . 56
3.1.1.5 DDS\_Entity\_get\_status\_changes . . . . 57
3.1.1.6 DDS\_Entity\_get\_statuscondition . . . . . 58
3.1.1.7 DDS\_Entity\_set\_listener (abstract) . 59
3.1.1.8 DDS\_Entity\_set\_qos (abstract) . 59
3.1.2 Class DDS\_DomainEntity (abstract). . . 59
3.1.3 Struct QosPolicy . . . . 59
3.1.3.1 DDS\_DeadlineQosPolicy . . . . 69
3.1.3.2 DDS\_DestinationOrderQosPolicy . . . . 71
3.1.3.3 DDS\_DurabilityQosPolicy . . . . 73
3.1.3.4 DDS\_DurabilityServiceQosPolicy . . . . 76
3.1.3.5 DDS\_EntityFactoryQosPolicy . . . . 79
3.1.3.6 DDS\_GroupDataQosPolicy . . . . . 80
3.1.3.7 DDS\_HistoryQosPolicy . . . . . 80
3.1.3.8 DDS\_LatencyBudgetQosPolicy . . . . 83
3.1.3.9 DDS\_LifespanQosPolicy . . . . . 84

3.1.3.10 DDS\_LivelinessQosPolicy . . . . . 85

3.1.3.11 DDS\_OwnershipQosPolicy . . . . 87

3.1.3.12 DDS\_OwnershipStrengthQosPolicy. . . . . . 90

3.1.3.13 DDS\_PartitionQosPolicy . . 91

3.1.3.14 DDS\_PresentationQosPolicy . . . . 92

3.1.3.15 DDS\_ReaderDataLifecycleQosPolicy . . 99

3.1.3.16 DDS\_ReliabilityQosPolicy. . . .102

3.1.3.17 DDS\_ResourceLimitsQosPolicy . . . .104

3.1.3.18 DDS\_SchedulingQosPolicy . . . .106

3.1.3.19 DDS\_TimeBasedFilterQosPolicy. . . .107

3.1.3.20 DDS\_TopicDataQosPolicy. . . .108

3.1.3.21 DDS\_TransportPriorityQosPolicy . . . .109

3.1.3.22 DDS\_UserDataQosPolicy. . . . .110

3.1.3.23 DDS\_WriterDataLifecycleQosPolicy. . . . .110

3.1.3.24 DDS\_SubscriptionKeyQosPolicy. . . . .112

3.1.3.25 DDS\_ReaderLifespanQosPolicy . . . .113

3.1.3.26 DDS\_ShareQosPolicy. . . .114

3.1.3.27 DDS\_ViewKeyQosPolicy . . . .115

3.1.4 DDS\_Listener interface . . .116

3.1.5 Struct DDS\_Status . . . .117

3.1.5.1 DDS\_InconsistentTopicStatus . . . . 122

3.1.5.2 DDS\_LivelinessChangedStatus . . . . 122

3.1.5.3 DDS\_LivelinessLostStatus . . . 124

3.1.5.4 DDS\_OfferedDeadlineMissedStatus . 125

3.1.5.5 DDS\_OfferedIncompatibleQosStatus. . . . .126

3.1.5.6 DDS\_PublicationMatchedStatus .128

3.1.5.7 DDS\_RequestedDeadlineMissedStatus . .129

3.1.5.8 DDS\_RequestedIncompatibleQosStatus . . . . 130

3.1.5.9 DDS\_SampleLostStatus . . . . 132

3.1.5.10 DDS\_SampleRejectedStatus. . . . . 133

3.1.5.11 DDS\_SubscriptionMatchedStatus . 134

3.1.5.12 DDS\_AllDataDisposedTopicStatus . . . . 135

3.1.6 Class DDS\_WaitSet. . . . . 136

3.1.6.1 DDS\_WaitSet\_\_alloc . . . .137

3.1.6.2 DDS\_WaitSet\_attach\_condition. . . .137

3.1.6.3 DDS\_WaitSet\_detach\_condition . . 139

3.1.6.4 DDS\_WaitSet\_get\_conditions . . . 140

3.1.6.5 DDS\_WaitSet\_wait. . . . 141

3.1.7 Class DDS\_Condition . . . 143

3.1.7.1 DDS\_Condition\_get\_trigger\_value . .144

3.1.8 Class DDS\_GuardCondition .145

3.1.8.1 DDS\_GuardCondition\_\_alloc. . . . .146

3.1.8.2 DDS\_GuardCondition\_get\_trigger\_value (inherited) . . . 147

3.1.8.3 DDS\_GuardCondition\_set\_trigger\_value . . . 147

3.1.9 Class DDS\_StatusCondition . . 148

3.1.9.1 DDS\_StatusCondition\_get\_enabled\_statuses. . . . 149

3.1.9.2 DDS\_StatusCondition\_get\_entity . . . 151

3.1.9.3 DDS\_StatusCondition\_get\_trigger\_value (inherited) . 151

3.1.9.4 DDS\_StatusCondition\_set\_enabled\_statuses . . . 152

3.1.10 Class DDS\_ErrorInfo . 153

3.1.10.1 DDS\_ErrorInfo\_\_alloc . . . . 155

3.1.10.2 DDS\_ErrorInfo\_update . . . 155

3.1.10.3 DDS\_ErrorInfo\_get\_code. . . . 156

3.1.10.4 DDS\_ErrorInfo\_get\_message. . . . . 158

3.1.10.5 DDS\_ErrorInfo\_get\_location . . . . 159

3.1.10.6 DDS\_ErrorInfo\_get\_source\_line . . . . . 160

3.1.10.7 DDS\_ErrorInfo\_get\_stack\_trace . . . . 160

3.2 Domain Module. . . . . . . . 161

3.2.1 Class DDS\_DomainParticipant . . . 161

3.2.1.1 DDS\_DomainParticipant\_assert\_liveliness . . . 166

3.2.1.2 DDS\_DomainParticipant\_contains\_entity . . . . . . 167

3.2.1.3 DDS\_DomainParticipant\_create\_contentfilteredtopic . . . . 168

3.2.1.4 DDS\_DomainParticipant\_create\_multitopic . . 169

3.2.1.5 DDS\_DomainParticipant\_create\_publisher . . . . 171

3.2.1.6 DDS\_DomainParticipant\_create\_subscriber . . . 174

3.2.1.7 DDS\_DomainParticipant\_create\_topic . . 177

3.2.1.8 DDS\_DomainParticipant\_delete\_contained\_entities . . . . 179

3.2.1.9 DDS\_DomainParticipant\_delete\_contentfilteredtopic . . . . 181

3.2.1.10 DDS\_DomainParticipant\_delete\_multitopic . . . 183

3.2.1.11 DDS\_DomainParticipant\_delete\_publisher . . . . 184

3.2.1.12 DDS\_DomainParticipant\_delete\_subscriber . . . . 185

3.2.1.13 DDS\_DomainParticipant\_delete\_topic . 186

3.2.1.14 DDS\_DomainParticipant\_enable (inherited) . . . 188

3.2.1.15 DDS\_DomainParticipant\_find\_topic . . . . 188

3.2.1.16 DDS\_DomainParticipant\_get\_builtin\_subscriber . . . . . 190

3.2.1.17 DDS\_DomainParticipant\_get\_current\_time. . . . 190

3.2.1.18 DDS\_DomainParticipant\_get\_default\_publisher\_qos . . . . 192

3.2.1.19 DDS\_DomainParticipant\_get\_default\_subscriber\_qos . . . . . . 193

3.2.1.20 DDS\_DomainParticipant\_get\_default\_topic\_qos . . . . . 195

3.2.1.21 DDS\_DomainParticipant\_get\_discovered\_participants . . . . . . . 196

3.2.1.22 DDS\_DomainParticipant\_get\_discovered\_participant\_data . . . . . . . . 198

3.2.1.23 DDS\_DomainParticipant\_get\_discovered\_topics . 199

3.2.1.24 DDS\_DomainParticipant\_get\_discovered\_topic\_data . . . . . . 201

3.2.1.25 DDS\_DomainParticipant\_get\_domain\_id . . . 202

3.2.1.26 DDS\_DomainParticipant\_get\_listener . . . . 203

3.2.1.27 DDS\_DomainParticipant\_get\_qos . . . . 204

3.2.1.28 DDS\_DomainParticipant\_get\_status\_changes (inherited) . . . . . . 205

3.2.1.29 DDS\_DomainParticipant\_get\_statuscondition (inherited) . . . . . . 205

3.2.1.30 DDS\_DomainParticipant\_ignore\_participant. . . .205

3.2.1.31 DDS\_DomainParticipant\_ignore\_publication . . . .206

3.2.1.32 DDS\_DomainParticipant\_ignore\_subscription .206

3.2.1.33 DDS\_DomainParticipant\_ignore\_topic . . . .206

3.2.1.34 DDS\_DomainParticipant\_lookup\_topicdescription . . . . .206

3.2.1.35 DDS\_DomainParticipant\_set\_default\_publisher\_qos . . .207

3.2.1.36 DDS\_DomainParticipant\_set\_default\_subscriber\_qos. . . . .209

3.2.1.37 DDS\_DomainParticipant\_set\_default\_topic\_qos . . . .210

3.2.1.38 DDS\_DomainParticipant\_set\_listener . . .212

3.2.1.39 DDS\_DomainParticipant\_set\_qos . . .215

3.2.1.40 DDS\_DomainParticipant\_delete\_historical\_data . . . . .216

3.2.1.41 DDS\_DomainParticipant\_get\_property . . . .217

3.2.1.42 DDS\_DomainParticipant\_set\_property . . . .218

3.2.2 Class DDS\_DomainParticipantFactory . . . .220

3.2.2.1 DDS\_DomainParticipantFactory\_create\_participant . . . .221

3.2.2.2 DDS\_DomainParticipantFactory\_delete\_participant . . . .225

3.2.2.3 DDS\_DomainParticipantFactory\_get\_default\_participant\_qos . . . . . . . . 226

3.2.2.4 DDS\_DomainParticipantFactory\_get\_instance . . .227

3.2.2.5 DDS\_DomainParticipantFactory\_get\_qos . . . . 228

3.2.2.6 DDS\_DomainParticipantFactory\_lookup\_participant . . . .229

3.2.2.7 DDS\_DomainParticipantFactory\_set\_default\_participant\_qos . . . . . . . . 230

3.2.2.8 DDS\_DomainParticipantFactory\_set\_qos . . . . 231

3.2.2.9 DDS\_DomainParticipantFactory\_delete\_domain . 232

3.2.2.10 DDS\_DomainParticipantFactory\_lookup\_domain. . . . 233

3.2.2.11 DDS\_DomainParticipantFactory\_delete\_contained\_entities . . . . . . . . . 234

3.2.2.12 DDS\_DomainParticipantFactory\_detach\_all\_domains . . . . 235

3.2.3 Class DDS\_Domain. . . 237

3.2.3.1 DDS\_Domain\_create\_persistent\_snapshot. . . 238

3.2.4 DDS\_DomainParticipantListener interface . . . . 239

3.2.4.1 DDS\_DomainParticipantListener\_\_alloc . . . . 242

3.2.4.2 DDS\_DomainParticipantListener\_on\_data\_available (inherited, abstract) . 243

3.2.4.3 DDS\_DomainParticipantListener\_on\_data\_on\_readers (inherited, abstract) .243

3.2.4.4 DDS\_DomainParticipantListener\_on\_inconsistent\_topic (inherited, abstract) .243

3.2.4.5 DDS\_DomainParticipantListener\_on\_liveliness\_changed (inherited, abstract) .243

3.2.4.6 DDS\_DomainParticipantListener\_on\_liveliness\_lost (inherited, abstract) . 244
3.2.4.7 DDS\_DomainParticipantListener\_on\_offered\_deadline\_missed (inherited, abstract) . 244
3.2.4.8 DDS\_DomainParticipantListener\_on\_offered\_incompatible\_qos (inherited, abstract) . 244
3.2.4.9 DDS\_DomainParticipantListener\_on\_publication\_matched (inherited, abstract) . 245
3.2.4.10 DDS\_DomainParticipantListener\_on\_requested\_deadline\_missed (inherited, abstract) . . 245
3.2.4.11 DDS\_DomainParticipantListener\_on\_requested\_incompatible\_qos (inherited, abstract) . . . 245
3.2.4.12 DDS\_DomainParticipantListener\_on\_sample\_lost (inherited, abstract) 246
3.2.4.13 DDS\_DomainParticipantListener\_on\_sample\_rejected (inherited, abstract) . 246
3.2.4.14 DDS\_DomainParticipantListener\_on\_subscription\_matched (inherited, abstract) . 246
3.2.5 DDS\_ExtDomainParticipantListener interface . . . . 246
3.2.5.1 DDS\_ExtDomainParticipantListener\_\_alloc . . . . 249
3.2.5.2 DDS\_ExtDomainParticipantListener\_on\_data\_available (inherited, abstract) . 250
3.2.5.3 DDS\_ExtDomainParticipantListener\_on\_data\_on\_readers (inherited, abstract) . 250
3.2.5.4 DDS\_ExtDomainParticipantListener\_on\_inconsistent\_topic (inherited, abstract) . 250
3.2.5.5 DDS\_ExtDomainParticipantListener\_on\_liveliness\_changed (inherited, abstract) . 251
3.2.5.6 DDS\_ExtDomainParticipantListener\_on\_liveliness\_lost (inherited, abstract) . 251
3.2.5.7 DDS\_ExtDomainParticipantListener\_on\_offered\_deadline\_missed (inherited, abstract) . . . 251
3.2.5.8 DDS\_ExtDomainParticipantListener\_on\_offered\_incompatible\_qos (inherited, abstract) . . . 251
3.2.5.9 DDS\_ExtDomainParticipantListener\_on\_publication\_matched (inherited, abstract) . 252
3.2.5.10 DDS\_ExtDomainParticipantListener\_on\_requested\_deadline\_missed (inherited, abstract) . . 252
3.2.5.11 DDS\_ExtDomainParticipantListener\_on\_requested\_incompatible\_qos (inherited, abstract) . . 252
3.2.5.12 DDS\_ExtDomainParticipantListener\_on\_sample\_lost (inherited, abstract) . 253

3.2.5.13 DDS\_ExtDomainParticipantListener\_on\_sample\_rejected (inherited, abstract) .253

3.2.5.14 DDS\_ExtDomainParticipantListener\_on\_subscription\_matched (inherited, abstract) . 253

3.2.5.15 DDS\_ExtDomainParticipantListener\_on\_all\_data\_disposed (inherited, abstract) .253

3.3 Topic-Definition Module . . . . . . . . . 254

3.3.1 Class DDS\_TopicDescription (abstract) . .255

3.3.1.1 DDS\_TopicDescription\_get\_name. . .256

3.3.1.2 DDS\_TopicDescription\_get\_participant . . . .256

3.3.1.3 DDS\_TopicDescription\_get\_type\_name . . . .257

3.3.2 Class DDS\_Topic .258

3.3.2.1 DDS\_Topic\_enable (inherited). . .259

3.3.2.2 DDS\_Topic\_get\_inconsistent\_topic\_status . . . 260

3.3.2.3 DDS\_Topic\_get\_listener . .261

3.3.2.4 DDS\_Topic\_get\_name (inherited) . . .261

3.3.2.5 DDS\_Topic\_get\_participant (inherited) . . . .261

3.3.2.6 DDS\_Topic\_get\_qos. . . . .262

3.3.2.7 DDS\_Topic\_get\_status\_changes (inherited) .263

3.3.2.8 DDS\_Topic\_get\_statuscondition (inherited) .263

3.3.2.9 DDS\_Topic\_get\_type\_name (inherited). . . . . 263

3.3.2.10 DDS\_Topic\_set\_listener. . . .263

3.3.2.11 DDS\_Topic\_set\_qos . .265

3.3.2.12 DDS\_Topic\_dispose\_all\_data . . . .267

3.3.3 Class DDS\_ContentFilteredTopic . . . . . 268

3.3.3.1 DDS\_ContentFilteredTopic\_get\_expression\_parameters . . .270

3.3.3.2 DDS\_ContentFilteredTopic\_get\_filter\_expression .271

3.3.3.3 DDS\_ContentFilteredTopic\_get\_name (inherited) .271

3.3.3.4 DDS\_ContentFilteredTopic\_get\_participant (inherited) . . . . .272

3.3.3.5 DDS\_ContentFilteredTopic\_get\_related\_topic . . . . 272

3.3.3.6 DDS\_ContentFilteredTopic\_get\_type\_name (inherited) . . . .273

3.3.3.7 DDS\_ContentFilteredTopic\_set\_expression\_parameters. . . . .273

3.3.4 Class DDS\_MultiTopic . . . 273

3.3.4.1 DDS\_MultiTopic\_get\_expression\_parameters. . . . 274

3.3.4.2 DDS\_MultiTopic\_get\_name (inherited). . . . . 275

3.3.4.3 DDS\_MultiTopic\_get\_participant (inherited) . 276

3.3.4.4 DDS\_MultiTopic\_get\_subscription\_expression. . . . 276

3.3.4.5 DDS\_MultiTopic\_get\_type\_name (inherited) . . .277

3.3.4.6 DDS\_MultiTopic\_set\_expression\_parameters . . . .277

3.3.5 DDS\_TopicListener Interface . . . . 278

3.3.5.1 DDS\_TopicListener\_\_alloc . . . .279

3.3.5.2 DDS\_TopicListener\_on\_inconsistent\_topic (abstract). . .280

3.3.6 DDS\_ExtTopicListener interface . 281

3.3.6.1 DDS\_ExtTopicListener\_on\_all\_data\_disposed (abstract) . . . . . 282

3.3.7 Topic-Definition Type Specific Classes . . . 283

3.3.7.1 Class DDS\_TypeSupport (abstract) . . . . 283

3.3.7.2 DDS\_TypeSupport\_\_alloc (abstract) . . . . 284

3.3.7.3 DDS\_TypeSupport\_get\_type\_name (abstract). . . . 284

3.3.7.4 DDS\_TypeSupport\_register\_type (abstract) . 284

3.3.7.5 Class SPACE\_FooTypeSupport. . . . 285

3.3.7.6 SPACE\_FooTypeSupport\_\_alloc. . . . . 285

3.3.7.7 SPACE\_FooTypeSupport\_get\_type\_name . . . . 286

3.3.7.8 SPACE\_FooTypeSupport\_register\_type . . . . . 287

3.4 Publication Module. . . . . . . . . 289

3.4.1 Class DDS\_Publisher . 290

3.4.1.1 DDS\_Publisher\_begin\_coherent\_changes . . . . 292

3.4.1.2 DDS\_Publisher\_copy\_from\_topic\_qos . . . . 294

3.4.1.3 DDS\_Publisher\_create\_datawriter . . . . . 295

3.4.1.4 DDS\_Publisher\_delete\_contained\_entities . 299

3.4.1.5 DDS\_Publisher\_delete\_datawriter . . . 300

3.4.1.6 DDS\_Publisher\_enable (inherited). . . . 301

3.4.1.7 DDS\_Publisher\_end\_coherent\_changes. . . . . 301

3.4.1.8 DDS\_Publisher\_get\_default\_datawriter\_qos . . 302

3.4.1.9 DDS\_Publisher\_get\_listener . . 304

3.4.1.10 DDS\_Publisher\_get\_participant . . . . 304

3.4.1.11 DDS\_Publisher\_get\_qos. . . . . 305

3.4.1.12 DDS\_Publisher\_get\_status\_changes (inherited) . 306

3.4.1.13 DDS\_Publisher\_get\_statuscondition (inherited) . 306

3.4.1.14 DDS\_Publisher\_lookup\_datawriter . . . . 306

3.4.1.15 DDS\_Publisher\_resume\_publications . . . . 307

3.4.1.16 DDS\_Publisher\_set\_default\_datawriter\_qos . . . . 308

3.4.1.17 DDS\_Publisher\_set\_listener. . . . 310

3.4.1.18 DDS\_Publisher\_set\_qos . . . . 312

3.4.1.19 DDS\_Publisher\_suspend\_publications. . . . . . 314

3.4.1.20 DDS\_Publisher\_wait\_for\_acknowledgments. . . . . . 315

3.4.2 Publication Type Specific Classes. . . . 317

3.4.2.1 Class DDS\_DataWriter (abstract) . 317

3.4.2.2 DDS\_DataWriter\_assert\_liveliness . 321

3.4.2.3 DDS\_DataWriter\_dispose (abstract) . . 323

3.4.2.4 DDS\_DataWriter\_dispose\_w\_timestamp (abstract). . . . . 323

3.4.2.5 DDS\_DataWriter\_enable (inherited) . . 323

3.4.2.6 DDS\_DataWriter\_get\_key\_value (abstract). . . . . 324

3.4.2.7 DDS\_DataWriter\_get\_listener . . . . 324

3.4.2.8 DDS\_DataWriter\_get\_liveliness\_lost\_status . . . . 324

3.4.2.9 DDS\_DataWriter\_get\_matched\_subscription\_data . . . 326

3.4.2.10 DDS\_DataWriter\_get\_matched\_subscriptions. . . . 327

3.4.2.11 DDS\_DataWriter\_get\_offered\_deadline\_missed\_status . . . .329

3.4.2.12 DDS\_DataWriter\_get\_offered\_incompatible\_qos\_status . . . . . 330

3.4.2.13 DDS\_DataWriter\_get\_publication\_matched\_status. . . .332

3.4.2.14 DDS\_DataWriter\_get\_publisher. . . .333

3.4.2.15 DDS\_DataWriter\_get\_qos . . . .334

3.4.2.16 DDS\_DataWriter\_get\_status\_changes (inherited) . . . .335

3.4.2.17 DDS\_DataWriter\_get\_statuscondition (inherited) . . .335

3.4.2.18 DDS\_DataWriter\_get\_topic . . . .335

3.4.2.19 DDS\_DataWriter\_lookup\_instance (abstract) . . . .336

3.4.2.20 DDS\_DataWriter\_register\_instance (abstract) . . .336

3.4.2.21 DDS\_DataWriter\_register\_instance\_w\_timestamp (abstract) . . . . . . . . 337

3.4.2.22 DDS\_DataWriter\_set\_listener . .337

3.4.2.23 DDS\_DataWriter\_set\_qos . . .339

3.4.2.24 DDS\_DataWriter\_unregister\_instance (abstract) . . . .341

3.4.2.25 DDS\_DataWriter\_unregister\_instance\_w\_timestamp (abstract) . . . . . . 341

3.4.2.26 DDS\_DataWriter\_wait\_for\_acknowledgments . . .342

3.4.2.27 DDS\_DataWriter\_write (abstract) .344

3.4.2.28 DDS\_DataWriter\_write\_w\_timestamp (abstract) .344

3.4.2.29 DDS\_DataWriter\_writedispose (abstract) . 344

3.4.2.30 DDS\_DataWriter\_writedispose\_w\_timestamp (abstract) . . . . 345

3.4.2.31 Class SPACE\_FooDataWriter . . . 345

3.4.2.32 SPACE\_FooDataWriter\_assert\_liveliness (inherited) . . . .349

3.4.2.33 SPACE\_FooDataWriter\_dispose . . .349

3.4.2.34 SPACE\_FooDataWriter\_dispose\_w\_timestamp .353

3.4.2.35 SPACE\_FooDataWriter\_enable (inherited) . . . 355

3.4.2.36 SPACE\_FooDataWriter\_get\_key\_value . .355

3.4.2.37 SPACE\_FooDataWriter\_get\_listener (inherited) . . . . 356

3.4.2.38 SPACE\_FooDataWriter\_get\_liveliness\_lost\_status (inherited) . . . . . . . 357

3.4.2.39 SPACE\_FooDataWriter\_get\_matched\_subscription\_data (inherited) . . 357

3.4.2.40 SPACE\_FooDataWriter\_get\_matched\_subscriptions (inherited) . . . . . 357

3.4.2.41 SPACE\_FooDataWriter\_get\_offered\_deadline\_missed\_status (inherited) . 357

3.4.2.42 SPACE\_FooDataWriter\_get\_offered\_incompatible\_qos\_status (inherited) . 358

3.4.2.43 SPACE\_FooDataWriter\_get\_publication\_matched\_status (inherited) . 358

3.4.2.44 SPACE\_FooDataWriter\_get\_publisher (inherited) . . 358

3.4.2.45 SPACE\_FooDataWriter\_get\_qos (inherited) . . . 358

3.4.2.46 SPACE\_FooDataWriter\_get\_status\_changes (inherited). . . . . . . 359

3.4.2.47 SPACE\_FooDataWriter\_get\_statuscondition (inherited). . . . . . 359

3.4.2.48 SPACE\_FooDataWriter\_get\_topic (inherited). . .359

3.4.2.49 SPACE\_FooDataWriter\_lookup\_instance . . . 359

3.4.2.50 SPACE\_FooDataWriter\_register\_instance . 361

3.4.2.51 SPACE\_FooDataWriter\_register\_instance\_w\_timestamp. . . . . . 363

3.4.2.52 SPACE\_FooDataWriter\_set\_listener (inherited) . . . . 364

3.4.2.53 SPACE\_FooDataWriter\_set\_qos (inherited) . . . . 365

3.4.2.54 SPACE\_FooDataWriter\_unregister\_instance . 365

3.4.2.55 SPACE\_FooDataWriter\_unregister\_instance\_w\_timestamp. . . . . . . . . 369

3.4.2.56 SPACE\_FooDataWriter\_wait\_for\_acknowledgments (inherited) . . . . . 370

3.4.2.57 SPACE\_FooDataWriter\_write . . . . 371

3.4.2.58 SPACE\_FooDataWriter\_write\_w\_timestamp . . . 374

3.4.2.59 SPACE\_FooDataWriter\_writedispose . . . . 375

3.4.2.60 SPACE\_FooDataWriter\_writedispose\_w\_timestamp . 380

3.4.3 DDS\_PublisherListener interface . 381

3.4.3.1 DDS\_PublisherListener\_\_alloc . . . 383

3.4.3.2 DDS\_PublisherListener\_on\_liveliness\_lost (inherited, abstract) . 383

3.4.3.3 DDS\_PublisherListener\_on\_offered\_deadline\_missed (inherited, abstract) . 384

3.4.3.4 DDS\_PublisherListener\_on\_offered\_incompatible\_qos (inherited, abstract) . 384

3.4.3.5 DDS\_PublisherListener\_on\_publication\_matched (inherited, abstract) . 384

3.4.4 DDS\_DataWriterListener interface . . . 385

3.4.4.1 DDS\_DataWriterListener\_\_alloc . . . . 386

3.4.4.2 DDS\_DataWriterListener\_on\_liveliness\_lost (abstract) . . 387

3.4.4.3 DDS\_DataWriterListener\_on\_offered\_deadline\_missed (abstract). . . . . 388

3.4.4.4 DDS\_DataWriterListener\_on\_offered\_incompatible\_qos (abstract) . . . . 389

3.4.4.5 DDS\_DataWriterListener\_on\_publication\_matched (abstract) . . . . . . . . 390

3.5 Subscription Module . . . . . . . . . 391

3.5.1 Class DDS\_Subscriber . 392

3.5.1.1 DDS\_Subscriber\_begin\_access . . 395

3.5.1.2 DDS\_Subscriber\_copy\_from\_topic\_qos . . . . 396

3.5.1.3 DDS\_Subscriber\_create\_datareader. . . . . . 398

3.5.1.4 DDS\_Subscriber\_delete\_contained\_entities . . . 401

3.5.1.5 DDS\_Subscriber\_delete\_datareader. . . . . 403

3.5.1.6 DDS\_Subscriber\_enable (inherited). . . . . 404

3.5.1.7 DDS\_Subscriber\_end\_access . . . . . 405

3.5.1.8 DDS\_Subscriber\_get\_datareaders . . . . 406

3.5.1.9 DDS\_Subscriber\_get\_default\_datareader\_qos. . . . 408

3.5.1.10 DDS\_Subscriber\_get\_listener . 409

3.5.1.11 DDS\_Subscriber\_get\_participant . . . . 410

3.5.1.12 DDS\_Subscriber\_get\_qos. . . . . 411

3.5.1.13 DDS\_Subscriber\_get\_status\_changes (inherited) . 412

3.5.1.14 DDS\_Subscriber\_get\_statuscondition (inherited) . . 412

3.5.1.15 DDS\_Subscriber\_lookup\_datareader . . . . 412

3.5.1.16 DDS\_Subscriber\_notify\_datareaders . . . . 413

3.5.1.17 DDS\_Subscriber\_set\_default\_datareader\_qos . . . . 414

3.5.1.18 DDS\_Subscriber\_set\_listener . . . . . 416

3.5.1.19 DDS\_Subscriber\_set\_qos . . . 419

3.5.2 Subscription Type Specific Classes. . . . . 420

3.5.2.1 Class DDS\_DataReader (abstract) . . .421

3.5.2.2 DDS\_DataReader\_create\_querycondition . . .427

3.5.2.3 DDS\_DataReader\_create\_readcondition . . .428

3.5.2.4 DDS\_DataReader\_create\_view . . 430

3.5.2.5 DDS\_DataReader\_delete\_contained\_entities. . . . . 430

3.5.2.6 DDS\_DataReader\_delete\_readcondition . . . .432

3.5.2.7 DDS\_DataReader\_delete\_view . . . 433

3.5.2.8 DDS\_DataReader\_enable (inherited) . . . .434

3.5.2.9 DDS\_DataReader\_get\_default\_datareaderview\_qos . . . . 434

3.5.2.10 DDS\_DataReader\_get\_key\_value (abstract) . . . . . 435

3.5.2.11 DDS\_DataReader\_get\_listener. . . . . 436

3.5.2.12 DDS\_DataReader\_get\_liveliness\_changed\_status . . . . . . 436

3.5.2.13 DDS\_DataReader\_get\_matched\_publication\_data . . . .437

3.5.2.14 DDS\_DataReader\_get\_matched\_publications . . . .439

3.5.2.15 DDS\_DataReader\_get\_qos . . .441

3.5.2.16 DDS\_DataReader\_get\_requested\_deadline\_missed\_status . . . . . . 442

3.5.2.17 DDS\_DataReader\_get\_requested\_incompatible\_qos\_status . . . . . . . . . 443

3.5.2.18 DDS\_DataReader\_get\_sample\_lost\_status . . 444

3.5.2.19 DDS\_DataReader\_get\_sample\_rejected\_status . . . . 446

3.5.2.20 DDS\_DataReader\_get\_status\_changes (inherited). . . .447

3.5.2.21 DDS\_DataReader\_get\_statuscondition (inherited) . . 447

3.5.2.22 DDS\_DataReader\_get\_subscriber . . . . 447

3.5.2.23 DDS\_DataReader\_get\_subscription\_matched\_status . . . 448

3.5.2.24 DDS\_DataReader\_get\_topicdescription. . . . 449

3.5.2.25 DDS\_DataReader\_lookup\_instance (abstract) . . . . . 450

3.5.2.26 DDS\_DataReader\_read (abstract) . . 450

3.5.2.27 DDS\_DataReader\_read\_instance (abstract) . . . 451

3.5.2.28 DDS\_DataReader\_read\_next\_instance (abstract) . . 451

3.5.2.29 DDS\_DataReader\_read\_next\_instance\_w\_condition (abstract) . . . . . . 452

3.5.2.30 DDS\_DataReader\_read\_next\_sample (abstract) . 452

3.5.2.31 DDS\_DataReader\_read\_w\_condition (abstract) .452

3.5.2.32 DDS\_DataReader\_return\_loan (abstract). . . . 453

3.5.2.33 DDS\_DataReader\_set\_default\_datareaderview\_qos . . . . . 453

3.5.2.34 DDS\_DataReader\_set\_listener . . . . 454

3.5.2.35 DDS\_DataReader\_set\_qos . . . . 457

3.5.2.36 DDS\_DataReader\_take (abstract). . . 458

3.5.2.37 DDS\_DataReader\_take\_instance (abstract) . . . 459

3.5.2.38 DDS\_DataReader\_take\_next\_instance (abstract). . . . 459

3.5.2.39 DDS\_DataReader\_take\_next\_instance\_w\_condition (abstract). . . . . . . 460

3.5.2.40 DDS\_DataReader\_take\_next\_sample (abstract) . . 460

3.5.2.41 DDS\_DataReader\_take\_w\_condition (abstract). . . . . 461

3.5.2.42 DDS\_DataReader\_wait\_for\_historical\_data . . . . . 461

3.5.2.43 DDS\_DataReader\_wait\_for\_historical\_data\_w\_condition . . . . . 463

3.5.2.44 Class SPACE\_FooDataReader. . . . . 465

3.5.2.45 SPACE\_FooDataReader\_create\_querycondition (inherited) . . . . . . . . . 471

3.5.2.46 SPACE\_FooDataReader\_create\_readcondition (inherited) . . . . . . . 471

3.5.2.47 SPACE\_FooDataReader\_delete\_contained\_entities (inherited) . . . . . . 472

3.5.2.48 SPACE\_FooDataReader\_delete\_readcondition (inherited) . . . . . . . . . . 472

3.5.2.49 SPACE\_FooDataReader\_enable (inherited) . . 472

3.5.2.50 SPACE\_FooDataReader\_get\_key\_value . . . . . . 472

3.5.2.51 SPACE\_FooDataReader\_get\_listener (inherited) . . 474

3.5.2.52 SPACE\_FooDataReader\_get\_liveliness\_changed\_status (inherited) . . 474

3.5.2.53 SPACE\_FooDataReader\_get\_matched\_publication\_data (inherited) . . 474

3.5.2.54 SPACE\_FooDataReader\_get\_matched\_publications (inherited). . . . . . 474

3.5.2.55 SPACE\_FooDataReader\_get\_qos (inherited) . . 475

3.5.2.56 SPACE\_FooDataReader\_get\_requested\_deadline\_missed\_status (inherited) . 475

3.5.2.57 SPACE\_FooDataReader\_get\_requested\_incompatible\_qos\_status (inherited) . . 475

3.5.2.58 SPACE\_FooDataReader\_get\_sample\_lost\_status (inherited) . . . . . . . . 476

3.5.2.59 SPACE\_FooDataReader\_get\_sample\_rejected\_status (inherited). . . . . 476

3.5.2.60 SPACE\_FooDataReader\_get\_status\_changes (inherited) . . . . . . . . 476

3.5.2.61 SPACE\_FooDataReader\_get\_statuscondition (inherited) . . . . . . . . 476

3.5.2.62 SPACE\_FooDataReader\_get\_subscriber (inherited) . . . . . 477

3.5.2.63 SPACE\_FooDataReader\_get\_subscription\_matched\_status (inherited) 477

3.5.2.64 SPACE\_FooDataReader\_get\_topicdescription (inherited) . . . . . . . . . . 477

3.5.2.65 SPACE\_FooDataReader\_lookup\_instance . . . . 477

3.5.2.66 SPACE\_FooDataReader\_read . . . 478

3.5.2.67 SPACE\_FooDataReader\_read\_instance. . . . . . 483

3.5.2.68 SPACE\_FooDataReader\_read\_next\_instance . . . . . 485

3.5.2.69 SPACE\_FooDataReader\_read\_next\_instance\_w\_condition . . . . . . . . . 488

3.5.2.70 SPACE\_FooDataReader\_read\_next\_sample . . . . 490

3.5.2.71 SPACE\_FooDataReader\_read\_w\_condition . . . . . 490

3.5.2.72 SPACE\_FooDataReader\_return\_loan . . . . . 492

3.5.2.73 SPACE\_FooDataReader\_set\_listener (inherited). . . . . 494

3.5.2.74 SPACE\_FooDataReader\_set\_qos (inherited). . . . 495

3.5.2.75 SPACE\_FooDataReader\_take . . . . . 495

3.5.2.76 SPACE\_FooDataReader\_take\_instance . . . . 497

3.5.2.77 SPACE\_FooDataReader\_take\_next\_instance . . . 499

3.5.2.78 SPACE\_FooDataReader\_take\_next\_instance\_w\_condition . . . . . . . . . 501

3.5.2.79 SPACE\_FooDataReader\_take\_next\_sample . . 503

3.5.2.80 SPACE\_FooDataReader\_take\_w\_condition . . . .503

3.5.2.81 SPACE\_FooDataReader\_wait\_for\_historical\_data (inherited) . . . . . . . 505

3.5.2.82 SPACE\_FooDataReader\_wait\_for\_historical\_data\_w\_condition (inherited) .505

3.5.3 Class DDS\_DataSample .505

3.5.4 Struct DDS\_SampleInfo . . .506

3.5.4.1 DDS\_SampleInfo . . . .506

3.5.5 DDS\_SubscriberListener Interface . . .510

3.5.5.1 DDS\_SubscriberListener\_\_alloc .512

3.5.5.2 DDS\_SubscriberListener\_on\_data\_available (inherited, abstract). . . . . . 513

3.5.5.3 DDS\_SubscriberListener\_on\_data\_on\_readers (abstract) . . . . .513

3.5.5.4 DDS\_SubscriberListener\_on\_liveliness\_changed (inherited, abstract) . . 514

3.5.5.5 DDS\_SubscriberListener\_on\_requested\_deadline\_missed (inherited, abstract) .514

3.5.5.6 DDS\_SubscriberListener\_on\_requested\_incompatible\_qos (inherited, abstract) .515

3.5.5.7 DDS\_SubscriberListener\_on\_sample\_lost (inherited, abstract). . . . . . . . 515

3.5.5.8 DDS\_SubscriberListener\_on\_sample\_rejected (inherited, abstract) . . . . 515

3.5.5.9 DDS\_SubscriberListener\_on\_subscription\_matched (inherited, abstract) .515

3.5.6 DDS\_DataReaderListener interface .516

3.5.6.1 DDS\_DataReaderListener\_\_alloc. . . .517

3.5.6.2 DDS\_DataReaderListener\_on\_data\_available (abstract) . . . . . . . 518

3.5.6.3 DDS\_DataReaderListener\_on\_liveliness\_changed (abstract) . . . . . . . . . 519

3.5.6.4 DDS\_DataReaderListener\_on\_requested\_deadline\_missed (abstract) . . 520

3.5.6.5 DDS\_DataReaderListener\_on\_requested\_incompatible\_qos (abstract) . 521

3.5.6.6 DDS\_DataReaderListener\_on\_sample\_lost (abstract) . . . . 522

3.5.6.7 DDS\_DataReaderListener\_on\_sample\_rejected (abstract) . . . . .522

3.5.6.8 DDS\_DataReaderListener\_on\_subscription\_matched (abstract) . . . . . . . 523

3.5.7 Class DDS\_ReadCondition . . 525

3.5.7.1 DDS\_ReadCondition\_get\_datareader. . . . 526

3.5.7.2 DDS\_ReadCondition\_get\_instance\_state\_mask . 526

3.5.7.3 DDS\_ReadCondition\_get\_sample\_state\_mask . . . 527

3.5.7.4 DDS\_ReadCondition\_get\_trigger\_value (inherited) . . 528

3.5.7.5 DDS\_ReadCondition\_get\_view\_state\_mask . . .528

3.5.8 Class DDS\_QueryCondition . . .529

3.5.8.1 DDS\_QueryCondition\_get\_datareader (inherited). . . . 530

3.5.8.2 DDS\_QueryCondition\_get\_instance\_state\_mask (inherited). . . . . . . . . . 530

3.5.8.3 DDS\_QueryCondition\_get\_query\_parameters. . . . 531

3.5.8.4 DDS\_QueryCondition\_get\_query\_expression . . . . 532

3.5.8.5 DDS\_QueryCondition\_get\_sample\_state\_mask (inherited) . . . . 532

3.5.8.6 DDS\_QueryCondition\_get\_trigger\_value (inherited) . . 533

3.5.8.7 DDS\_QueryCondition\_get\_view\_state\_mask (inherited) . . . . 533

3.5.8.8 DDS\_QueryCondition\_set\_query\_parameters . . . 533

3.5.9 Class DDS\_DataReaderView (abstract) . . 534

3.5.9.1 DDS\_DataReaderView\_create\_querycondition. . . . 540

3.5.9.2 DDS\_DataReaderView\_create\_readcondition . . . 540

3.5.9.3 DDS\_DataReaderView\_delete\_contained\_entities . . 541

3.5.9.4 DDS\_DataReaderView\_delete\_readcondition . . . 541

3.5.9.5 DDS\_DataReaderView\_enable (inherited) . 541

3.5.9.6 DDS\_DataReaderView\_get\_datareader . . . . 542

3.5.9.7 DDS\_DataReaderView\_get\_key\_value (abstract) . . . . 542

3.5.9.8 DDS\_DataReaderView\_get\_qos . . . . 543

3.5.9.9 DDS\_DataReaderView\_get\_status\_changes (inherited) . . 544

3.5.9.10 DDS\_DataReaderView\_get\_statuscondition (inherited) . . . . . . 544

3.5.9.11 DDS\_DataReaderView\_lookup\_instance (abstract) . 544

3.5.9.12 DDS\_DataReaderView\_read (abstract) . . . . 545

3.5.9.13 DDS\_DataReaderView\_read\_instance (abstract). . . . 545

3.5.9.14 DDS\_DataReaderView\_read\_next\_instance (abstract) . . . 545

3.5.9.15 DDS\_DataReaderView\_read\_next\_instance\_w\_condition (abstract) . . 546

3.5.9.16 DDS\_DataReaderView\_read\_next\_sample (abstract) . . . . 546

3.5.9.17 DDS\_DataReaderView\_read\_w\_condition (abstract) . . . 547

3.5.9.18 DDS\_DataReaderView\_return\_loan (abstract) . 547

3.5.9.19 DDS\_DataReaderView\_set\_qos. . . . 548

3.5.9.20 DDS\_DataReaderView\_take (abstract) . . . . 549

3.5.9.21 DDS\_DataReaderView\_take\_instance (abstract). . . . 549

3.5.9.22 DDS\_DataReaderView\_take\_next\_instance (abstract) . . . 550

3.5.9.23 DDS\_DataReaderView\_take\_next\_instance\_w\_condition (abstract) . . 550

3.5.9.24 DDS\_DataReaderView\_take\_next\_sample (abstract) . . . 551

3.5.9.25 DDS\_DataReaderView\_take\_w\_condition (abstract) . . 551

3.5.10 Class SPACE\_FooDataReaderView . . . . 552

3.5.10.1 SPACE\_FooDataReaderView\_create\_querycondition (inherited) . . . . 556

3.5.10.2 SPACE\_FooDataReaderView\_create\_readcondition (inherited). . . . . . 556

3.5.10.3 SPACE\_FooDataReaderView\_delete\_contained\_entities . . . . . . . 557

3.5.10.4 SPACE\_FooDataReaderView\_delete\_readcondition (inherited). . . . . . 557

3.5.10.5 SPACE\_FooDataReaderView\_enable (inherited) . . 557

3.5.10.6 SPACE\_FooDataReaderView\_get\_datareader (inherited). . . . . . . 557

3.5.10.7 SPACE\_FooDataReaderView\_get\_key\_value. . . . . 558

3.5.10.8 SPACE\_FooDataReaderView\_get\_qos (inherited) . . . 558

3.5.10.9 SPACE\_FooDataReaderView\_get\_status\_changes (inherited) . . . . . . . 558

3.5.10.10 SPACE\_FooDataReaderView\_get\_statuscondition (inherited) . . . . . . 558

3.5.10.11 SPACE\_FooDataReaderView\_lookup\_instance . 559

3.5.10.12 SPACE\_FooDataReaderView\_read . .559

3.5.10.13 SPACE\_FooDataReaderView\_read\_instance . . 559

3.5.10.14 SPACE\_FooDataReaderView\_read\_next\_instance . . . .560

3.5.10.15 SPACE\_FooDataReaderView\_read\_next\_instance\_w\_condition . . . .560

3.5.10.16 SPACE\_FooDataReaderView\_read\_next\_sample . . . .561

3.5.10.17 SPACE\_FooDataReaderView\_read\_w\_condition . . . .561

3.5.10.18 SPACE\_FooDataReaderView\_return\_loan . . . .561

3.5.10.19 SPACE\_FooDataReaderView\_set\_qos (inherited) .562

3.5.10.20 SPACE\_FooDataReaderView\_take . . . .562

3.5.10.21 SPACE\_FooDataReaderView\_take\_instance .563

3.5.10.22 SPACE\_FooDataReaderView\_take\_next\_instance . . . .563

3.5.10.23 SPACE\_FooDataReaderView\_take\_next\_instance\_w\_condition . . . .564

3.5.10.24 SPACE\_FooDataReaderView\_take\_next\_sample . . . .564

3.5.10.25 SPACE\_FooDataReaderView\_take\_w\_condition . . . .564

3.6 QosProvider. . . . . . . 565

3.6.1 Class DDS\_QosProvider . . . .565

3.6.1.1 DDS\_QosProvider\_\_alloc . . . .566

3.6.1.2 DDS\_QosProvider\_get\_participant\_qos. . . . .567

3.6.1.3 DDS\_QosProvider\_get\_topic\_qos . . . . . 568

3.6.1.4 DDS\_QosProvider\_get\_subscriber\_qos . .569

3.6.1.5 DDS\_QosProvider\_get\_datareader\_qos . . .570

3.6.1.6 DDS\_QosProvider\_get\_publisher\_qos. . . .571

3.6.1.7 DDS\_QosProvider\_get\_datawriter\_qos . .572

# Appendix A Quality Of Service 577

Affected Entities . .577

Basic Usage . . . .577

DDS\_DataReaderQos .579

DDS\_DataWriterQos. . . .582

DDS\_DomainParticipantFactoryQos . . .585

DDS\_DomainParticipantQos. . . . .586

DDS\_PublisherQos . . . 588

DDS\_SubscriberQos . . .589

DDS\_TopicQos . . . . . 590

# Appendix B API Constants and Types 595

# Appendix C Platform Specific IDL Interface 599

dds\_dcps.idl . . .599

# Appendix D SampleStates, ViewStates and InstanceStates 629

SampleInfo Class . . . . . . 629

sample\_state. . . . . . 629

instance\_state. . . . . 631

view\_state . . . . . 632

State Masks . . . . . 634

Operations Concerning States . . . . . 635

# Appendix E Class Inheritance 639

# Appendix F Listeners, Conditions and Waitsets 641

Communication Status Event . . . 643

Listeners. . . . 646

Conditions and Waitsets . . . . . 647

DDS\_StatusCondition Trigger State . . . . . . 651

DDS\_ReadCondition and DDS\_QueryCondition Trigger State . . . . . . . 651

DDS\_GuardCondition Trigger State . . . . . . 652

# Appendix G DDS\_Topic Definitions 653

DDS\_Topic Definition Example . . . . 653

Complex Topics. . . . . . 654

IDL Pre-processor . . . . 654

# Appendix H DCPS Queries and Filters 659

SQL Grammar in BNF . . 659

SQL Token Expression . . . . 660

SQL Examples. . . . . 661

# Appendix I Built-in Topics 663

Bibliography 673

Glossary 677

Index 681

# List of Figures

Figure 1: C Reference Guide Document Structure . . .

Figure 2: DCPS Module Composition . . . . . . . 41

Figure 3: DCPS Infrastructure Module’s Class Model . . . . . . . 42

Figure 4: DCPS Domain Module’s Class Model . . . . . . . 44

Figure 5: DCPS Topic-Definition Module’s Class Model . . . . . . . . 45

Figure 6: Data Type “Foo” Typed Classes Pre-processor Generation . . . . . . 46

Figure 7: DCPS Publication Module’s Class Model . . . . . . . 47

Figure 8: DCPS Subscription Module’s Class Model . . . . . . . 48

Figure 9: DCPS Infrastructure Module’s Class Model . . . . . . . . 52

Figure 10: QosPolicy Settings . . . . . . . . 61

Figure 11: DCPS Listeners . . . . . . 117

Figure 12: DCPS DDS\_Status Values . . . . . . . . 120

Figure 13: DCPS DDS\_WaitSets . . . . . . . . 136

Figure 14: DCPS DDS\_Conditions . . . . . . . . 144

Figure 15: DCPS Domain Module’s Class Model . . . . . . . 161

Figure 16: DCPS Topic-Definition Module Class Model . . . . . . . . . 254

Figure 17: Pre-processor Generation of the Typed Classes for Data Type “Foo” . . 255

Figure 18: The DCPS Publication Module’s Class Model . . . . . . . . . . . . . . . 289

Figure 19: The DCPS Subscription Module’s Class Model . . . . . . . . . . . . . . 391

Figure 20: State Chart of the sample\_state for a Single Sample . . . . . . . . . . 630

Figure 21: State Chart of the instance\_state for a Single Instance . . . . . . . . 632

Figure 22: State Chart of the view\_state for a Single Instance . . . . . . . . . . . 633

Figure 23: DCPS Inheritance . . . . . . . . 639

Figure 24: Plain Communication Status State Chart . . . . . . . . 644

Figure 25: Read Communication Status DDS\_DataReader Statecraft . . . . 645

Figure 26: DDS\_Subscriber Statecraft for a Read Communication Status . 646

Figure 27: DCPS Listeners . . . . . . . . 647

Figure 28: DCPS DDS\_WaitSets . . . . . . . . . 648

Figure 29: DCPS DDS\_Conditions . . . . . . . . . 650

Figure 30: Blocking Behaviour of a Waitset State Chart . . . . . . . . . . . . 651

List of Figures

# P re f a c e

# About the C Reference Guide

The C Reference Guide provides a detailed explanation of the OpenSplice (Subscription Paradigm for the Logical Interconnection of Concurrent Engines) Application Programming Interfaces for the C language.

This reference guide is based on the OMG’s Data Distribution Service Specification and C Language Mapping Specification.

The C Reference Guide describes the Data Centric Publish Subscribe (DCPS) layer. The purpose of the DCPS is the distribution of data (publish/subscribe). The structure of the DCPS is divided into five modules. Each module consists of several classes, which in turn generally contain several operations.

# Intended Audience

The C Reference Guide is intended to be used by C programmers who are using OpenSplice to develop applications.

# Organisation

The C Reference Guide is organised into the following topics.

The Introduction describes the details of the document structure.

Chapter 1, DCPS API General Description, is a general description of the DCPS API and its error codes.

Chapter 2, DCPS Modules, provides the detailed description of the DCPS modules.

Chapter 3, DCPS Classes and Operations, provides the detailed description of the DCPS classes, structs and operations.

The following appendices are included, as well as a Bibliography containing references material and Glossary:

Appendix A, Quality Of Service

Appendix B, API Constants and Types

Appendix C, Platform Specific IDL Interface

Appendix D, SampleStates, ViewStates and InstanceStates

Appendix E, Class Inheritance

Appendix F, Listeners, Conditions and Waitsets

Appendix G, DDS\_Topic Definitions

Appendix H, DCPS Queries and Filters

Appendix I, Built-in Topics

# Conventions

The conventions listed below are used to guide and assist the reader in understanding the C Reference Guide.

![The image displays a vertical stack of two safety symbols on a white background. The upper symbol is a red triangle outline containing a black exclamation mark. Directly below it is a blue lowercase letter 'i'.](.vortex-opensplice-c-reference-guide/6a7f08e104c6663889d9abb0598c401682659e1de28ab7d1dbb8896c2f21b1d0.jpg)

Item of special significance or where caution needs to be taken.

Item contains helpful hint or special information.

![The image displays a rectangular box with a thin black border. Inside the box, centered against a white background, is the word 'WIN' written in blue, uppercase serif letters.](.vortex-opensplice-c-reference-guide/5064945c2476312a1baef49eefd518801b4f9d0588a93cc0b906231d4e7f9d23.jpg)

Information applies to Windows (e.g. XP, 2003, Windows 7) only.

![A black rectangular border encloses the word 'UNIX' in blue capital letters on a white background.](.vortex-opensplice-c-reference-guide/63131b2dadb5c7fde641d6e1ed60b00e15bba555d172ed78501e91dbe63176e5.jpg)

Information applies to Unix based systems (e.g. Solaris) only.

![The image displays a single blue capital letter 'C' against a white background.](.vortex-opensplice-c-reference-guide/81f7750ef3507045c8bb3e61d5eec56dd19296ecfb1673eb5d94d336f1a4ee41.jpg)

C language specific

![The image features the text 'C++' written in a blue serif font on a white background. The letter 'C' is significantly larger than the two plus signs following it.](.vortex-opensplice-c-reference-guide/3577035d6f2889e110bd548b2946ad9011d7b0b91d066e118536c2391105f1f2.jpg)

C++ language specific

![The image displays the text 'C#' in a blue, serif typeface on a white background.](.vortex-opensplice-c-reference-guide/4c08e225af5e34044211b7f0ef915408f76d99cc178d8c4ff50de3073177c8a4.jpg)

C# language specific.

![The image displays the word 'Java' written in a blue, italicized serif font on a white background.](.vortex-opensplice-c-reference-guide/ad4b0064eba90af42175cade0a5368fdfc9a81c94b0583ac9ab4d98dc85e1ccb.jpg)

Java language specific

Hypertext links are shown as blue italic underlined.

On-Line (PDF) versions of this document: Items shown as cross-references, e.g. Contacts on page xxv, are hypertext links: click on the reference to go to the item.

```txt
% Commands or input which the user enters on the command line of the computer terminal
```

Courier fonts indicate programming code and file names.

Extended code fragments are shown in shaded boxes:

```javascript
NameComponent newName[] = new NameComponent[1];
// set id field to "example" and kind field to an empty string scarf
newName[0] = new NameComponent("example", "");
```

Italics and Italic Bold are used to indicate new terms, or emphasise an item.

Sans-serif and Sans-serif Bold are used to indicate elements of a Graphical User Interface (GUI) or Integrated Development Environment (IDE), such as an OK button, and sequences of actions, such as selecting File > Save from a menu.

Step 1: One of several steps required to complete a task.

# Contacts

ADLINK can be reached at the following contact points for information and technical support.

# USA Corporate Headquarters

ADLINK Technology Corporation

400 TradeCenter

Suite 5900

Woburn, MA

01801

USA

Tel: +1 781 569 5819

# European Head Office

ADLINK Technology Limited

The Edge

5th Avenue, Team Valley

Gateshead

NE11 0XA

Tel: +44 (0)191 497 9900

Web: http://ist.adlinktech.com

E-mail: ist\_info@adlinktech.com

Preface

# INTRODUCTION

# A b o u t t h e C R e f e re n c e G u i d e

# Document Structure

The C Reference Guide document structure is based on the structure of the DCPS Platform Independent Model (DCPS PIM) of the Data Distribution Service Specification. The detailed description is subdivided into the PIM Modules, which are then subdivided into classes.

Some of the classes are implemented as structs in the DCPS Platform Specific Model (DCPS PSM) of the Data Distribution Service Specification, as indicated in the Interface Description Language (IDL) chapter of the PSM (see Appendix C, Platform Specific IDL Interface). These structs are described in the respective chapters.

• In the classes as described in the PIM, which are implemented as a class in the PSM, the operations are described in detail.
• In the classes as described in the PIM, which are implemented as a struct in the PSM, the struct contents are described in detail.
• The order of the modules and classes is conform the PIM part.
• The order of the operations or struct contents is alphabetical.
• Each description of a class or struct starts with the API description header file.

![Based on the provided flowchart, here is the description of the labeled blocks and their connections:\n\n**Labeled Blocks:**\n*   **DDS-DCPS detailed description** (Top)\n*   **Modules ...** (Middle)\n*   **Structs ...** (Bottom Left)\n*   **Classes ...** (Bottom Right)\n*   **Operations ...** (Bottom)\n\n**Connections:**\n*   **DDS-DCPS detailed description** connects via a vertical line descending from the center, which intersects a horizontal line. This horizontal line has a vertical drop on both its left and right ends.\n*   **Modules ...** is positioned below the intersection of the top vertical and horizontal lines. From **Modules ...**, a vertical line descends and intersects a horizontal line. This horizontal line branches downwards: the left vertical drop leads to **Structs ...** and the right vertical drop leads to **Classes ...**.\n*   From **Classes ...**, a vertical line descends and intersects a horizontal line. This horizontal line branches downwards: the left vertical drop leads to **Operations ...** and the right vertical drop is empty (no label).](.vortex-opensplice-c-reference-guide/1b8a4d9cd98ab32c24c895bcb4e214ab848bdb8505d2934fbe16cbeabf96fdc0.jpg)

Figure 1: C Reference Guide Document Structure

# Operations

Several types of operations are described in this manual. The different types of operations are: basic, inherited, abstract and abstract interface. All operations of any type can be found in their respective class. The details of their description depends on the type of operation.

Basic operations are described in detail in the class they are implemented in.

• Inherited operations only refer to the operation in the class they are inherited from. The detailed description is not repeated.
• Abstract operations only refer to the type specific implementations in their respective derived class. The detailed description is not repeated.
• Abstract operations which are implemented as an interface (Listeners), are described in detail in their class. These operations must be implemented in the application.

In the API description header file, the inherited and abstract operations are commented out since they are not implemented in this class.

Inheritance in the C API is implemented by prefixing the name of the operation with DDS\_ and the name of the class they are in. For example, the operation get\_name in the class Topic is named DDS\_Topic\_get\_name. Since this operation is actually inherited from the class TopicDescription the operation refers to the T o p i c D e s c r i p t i o n c l a s s f o r m o r e i n f o r m a t i o n . H o w e v e r, i n t h e TopicDescription c l a s s t h i s o p e r a t i o n i s n a m e d DDS\_TopicDescripton\_get\_name.

# API REFERENCE

# 1 DCPS API General Description

The structure of the DCPS is divided into modules, which are described in detail in the next chapter. Each module consists of several classes, which in turn may contain several operations.

S o m e o f t h e s e o p e r a t i o n s h a v e a n o p e r a t i o n r e t u r n c o d e o f t y p e DDS\_ReturnCode\_t, which is defined in the next table:

Table 1: Return Codes

<table><tr><td>DDS_ReturnCode_t</td><td>Return Code Description</td></tr><tr><td>DDS_RETCODE_OK</td><td>Successful return</td></tr><tr><td>DDS_RETCODE_ERROR</td><td>Generic, unspecified error</td></tr><tr><td>DDS_RETCODE_BAD_PARAMETER</td><td>Illegal parameter value</td></tr><tr><td>DDS_RETCODE_UNSUPPORTED</td><td>Unsupported operation or DDS_QosPolicy setting. Can only be returned by operations that are optional or operations that uses an optional DDS_QoS as a parameter</td></tr><tr><td>DDS_RETCODE_ALREADY_DELETED</td><td>The object target of this operation has already been deleted</td></tr><tr><td>DDS_RETCODE_OUT_OF_RESOURCES</td><td>Service ran out of the resources needed to complete the operation</td></tr><tr><td>DDS_RETCODE_NOT_ENABLED</td><td>Operation invoked on an DDS_Entity that is not yet enabled</td></tr><tr><td>DDS_RETCODE_IMMUTABLE_POLICY</td><td>Application attempted to modify an immutable DDS_QosPolicy</td></tr><tr><td>DDS_RETCODE_INCONSISTENT_POLICY</td><td>Application specified a set of policies that are not consistent with each other</td></tr><tr><td>DDS_RETCODE_PRECONDITION_NOT_MET</td><td>A pre-condition for the operation was not met</td></tr></table>

Table 1: Return Codes

<table><tr><td>DDS_ReturnCode_t</td><td>Return Code Description</td></tr><tr><td>DDS_RETCODE_TIMEOUT</td><td>The operation timed out</td></tr><tr><td>DDS_RETCODE_ILLEGAL_OPERATION</td><td>An operation was invoked on an inappropriate object or at an inappropriate time (as determined by QosPolicies that control the behaviour of the object in question). There is no precondition that could be changed to make the operation succeed.</td></tr><tr><td>DDS_RETCODE_NO_DATA</td><td>Indicates a situation where the operation did not return any data</td></tr></table>

The name scope (name space) of these return codes is DDS. The operation return codes DDS\_RETCODE\_OK, DDS\_RETCODE\_ERROR, DDS\_RETCODE ILLEGAL\_OPERATION, DDS\_RETCODE\_BAD\_PARAMETER, DDS\_RETCODE UNSUPPORTED and DDS\_RETCODE\_ALREADY\_DELETED are default for operations that return an operation return code and are therefore not explicitly mentioned in the DDS specification. However, in this manual they are mentioned along with each operation.

Some operations are not implemented. These operations are mentioned including t h e i r s y n o p s i s , b u t n o t d e s c r i b e d i n t h i s m a n u a l a n d r e t u r n DDS\_RETCODE\_UNSUPPORTED when called from the application. All constants and types are given in Appendix B, API Constants and Types.

# 1.1 Thread Safety

A l l o p e r a t i o n s a r e t h r e a d s a f e a p a r t f r o m t h e DDS\_DomainParticipantFactory\_get\_instance operation. It is the applications responsibility to call DDS\_DomainParticipantFactory\_ get\_instance only from one application thread. This restriction only applies to the first call of DDS\_DomainParticipantFactory\_get\_instance.

# 1.2 Signal Handling

![The image displays a black rectangular border containing the word 'UNIX' in blue capital letters.](.vortex-opensplice-c-reference-guide/c9b13e45518961befaa26b3ab12dabc691d12c19ffb31101b985161052905464.jpg)

Every application that participates in a domain should register signal-handlers in order to protect the data distribution service in case of an exception or termination r e q u e s t . T h i s i s d o n e a u t o m a t i c a l l y w h e n t h e a p p l i c a t i o n c a l l s t h e DDS\_DomainParticipantFactory\_get\_instance operation. The data distribution service distinguishes between two kinds of signals: synchronous (i.e. exceptions) and asynchronous signals (i.e. termination requests).

# 1.2.1 Synchronous Signals

The data distribution service registers a signal-handler for the following synchronous signals: SIGILL, SIGTRAP, SIGABRT, SIGFPE, SIGBUS, SIGSEGV and SIGSYS. If a signal-handler is already registered for any of these signals it will be chained by the handlers registered by the data distribution service. Upon receiving any of the mentioned signals, the signal-handler will synchronously detach the application from the domain and call any chained handler if available. This allows core dumps to be created when an error occurs in application-code, without sacrificing the integrity of the data distribution service. Because the signal is processed synchronously, the offending thread will not be able to continue.

Synchronous signals can also be received asynchronously from another process (i.e. $^ { 1 } \mathrm { k i 1 1 } - \mathrm { A B R T } &lt; \tt p i d &gt; ^ { \prime } )$ . This is handled by the signal-handlers registered by the data distribution service and the behaviour will mimic the behaviour of a regular synchronous signal, occurring at the point in the application when the signal is received. A log message will be recorded stating that an asynchronously received synchronous signal occurred, including the source of the signal.

# 1.2.2 Asynchronous Signals

The asynchronous signal-handlers are only registered by the data distribution service if the application did not already register a handler, nor set the ignore-flag for these signals. If the data distribution service handlers are registered, the default handlers are chained. The signels that are handled are: SIGINT, SIGQUIT, SIGTERM, SIGHUP and SIGPIPE. When receiving any of these signals, the handlers of the data distribution service will ensure a disconnection from the domain. The default handler will in turn cause the application to terminate immediately.

# 1.3 Memory Management

When objects are being created, they occupy memory space. To avoid memory leaks when they are not used any more, these objects have to be deleted in order to release the memory space. However, when using pointers, it is difficult to keep track of which object has been released and which has not. When objects are not being released, the memory leak finally uses up all the resources and the application fails. On the other hand, when an object is being released twice because there were two pointers to the same object, the application fails. This implementation is based on the OMG C Language Mapping Specification. Accordingly, the CORBA rules listed below apply.

# 1.3.1 IDL Mapping Rules for Sequences

The names of the operations and types are given by the IDL mapping rules. For sequences several rules apply. The basic IDL definition of a sequence is defined by:

```txt
module name-space {
    typedef sequence&lt;&lt;sequence-element-type&gt;>
&lt;sequence-name&gt;;
}
```

In the C language, this results in the following type definition of the sequence:

```txt
typedef
DDS_sequence_&lt;name-space-prefix&gt;&lt;sequence-element-type&gt;
&lt;name-space&gt;_&lt;sequence-name&gt;
```

In this type definition, the &lt;sequence-element-type&gt; is the type of the objects in the sequence. This &lt;sequence-element-type&gt; may be a standard type or a Data Distribution Service defined type. The &lt;name-space-prefix&gt; represents the name space in which the &lt;sequence-element-type&gt; is defined. The standard types have an empty prefix. In the Data Distribution Service all the typedefs are set within the module DDS block, therefore defined types have the prefix DDS\_. Finally, the &lt;sequence-name&gt; is name of the sequence and is always prefixed by DDS\_.

# 1.3.1.1 Standard Defined Type

The standard defined types are the types as defined in the Data Distribution Service specification. For example, for the standard defined &lt;sequence-element-type&gt; of type string with a &lt;sequence-name&gt; of StringSeq, the following IDL definition is given:

```txt
typedef sequence&lt;string&gt; StringSeq
```

In C, this results in the following type definition of the sequence:

```c
typedef DDS_sequence_string DDS_StringSeq
```

# 1.3.1.2 User-Defined Type

The user-defined types are the types as defined in the application. For example, for the user-defined &lt;sequence-element-type&gt; of type Foo with a &lt;sequence-name&gt; of name FooSeq in the module SPACE, the following IDL definition is given:

```txt
module SPACE {
    typedef sequence&lt;Foo&gt; FooSeq;
}
```

In C, this results in the following type definition of the sequence:

```txt
typedef DDS_sequence_SPACE_Foo SPACE_FooSeq
```

# 1.3.1.3 Data Distribution Service Defined Type

F o r e x a m p l e , f o r t h e D a t a D i s t r i b u t i o n S e r v i c e d e f i n e d &lt;sequence-element-type&gt; of type SampleInfo with a &lt;sequence-name&gt; of name SampleInfoSeq, the following IDL definition is given:

typedef sequence&lt;SampleInfo&gt; SampleInfoSeq

In C, this results in the following type definition of the sequence:

typedef DDS\_sequence\_DDS\_SampleInfo DDS\_SampleInfoSeq

# 1.3.2 Plain Sequences

The following table shows the sequences for which the resources have to be managed. In other words, for these sequences DDS\_&lt;sequence-name&gt;\_\_alloc and DDS\_&lt;sequence-name&gt;\_allocbuf operations are available. For sequences, which are only used as an out parameter, the application does not need to use these allocation operations, since the Data Distribution Service allocates them. In this case, the application may use these operations for its own sequences. Furthermore to free the resources allocated with DDS\_&lt;sequence-name&gt;\_\_alloc and DDS\_&lt;sequence-name&gt;\_allocbuf the application must use the DDS\_free operation. It does not make any difference whether the application or the Data Distribution Service does the allocation. When the application does not use the DDS\_free operation, the application will fail. The DDS\_free operation operates recursively, in other words all embedded structures are released.

Sequences and buffers can also be allocated on stack. However in case the application allocates a sequence or buffer on stack, the DDS\_free operation may not be used on this object, otherwise the application will fail.

Table 2: Sequences

<table><tr><td rowspan="2">Sequence Name</td><td colspan="4">Parameter Type</td></tr><tr><td>In</td><td>Out</td><td>Inout</td><td>Return</td></tr><tr><td>DDS_ConditionSeq</td><td></td><td>X</td><td></td><td></td></tr><tr><td>DDS_StringSeq</td><td>X</td><td></td><td></td><td>X</td></tr><tr><td>DDS_DataReaderSeq</td><td></td><td>X</td><td></td><td></td></tr><tr><td>DDS_InstanceHandleSeq</td><td></td><td></td><td>X</td><td></td></tr><tr><td>DDS_QosPolicyCountSeq</td><td colspan="4">Used in status struct only.</td></tr><tr><td>DDS_SampleInfoSeq</td><td></td><td></td><td>X</td><td></td></tr><tr><td>DDS_sequence_octet</td><td colspan="4">Used in QosPolicy struct only.</td></tr></table>

# 1.3.3 Sequences Embedded in QosPolicy Objects

The following table shows the QosPolicy objects for which the resources have to be managed because they contain sequences. In other words, for these QosPolicy objects DDS\_&lt;QosPolicy&gt;\_\_alloc operations are available. The buffers used in t h e s e Q o s P o l i c y o b j e c t s m u s t b e a l l o c a t e d u s i n g t h e DDS\_&lt;sequence-name&gt;\_allocbuf operations. The DDS\_free operation takes care of the embedded sequences and the buffers in a QosPolicy.

Table 3: QosPolicy Objects

<table><tr><td rowspan="2">QosPolicy Name</td><td colspan="4">Parameter Type</td><td rowspan="2">ContainsSequence</td></tr><tr><td>In</td><td>Out</td><td>Inout</td><td>Return</td></tr><tr><td>DDS_DomainParticipantQos</td><td>X</td><td></td><td>X</td><td></td><td>DDS_sequence_octet</td></tr><tr><td>DDS_TopicQos</td><td>X</td><td></td><td>X</td><td></td><td>DDS_sequence_octet</td></tr><tr><td rowspan="2">DDS_PublisherQos</td><td rowspan="2">X</td><td rowspan="2"></td><td rowspan="2">X</td><td rowspan="2"></td><td>DDS_sequence_octet</td></tr><tr><td>DDS_StringSeq</td></tr><tr><td>DDS_DataWriterQos</td><td>X</td><td></td><td>X</td><td></td><td>DDS_sequence_octet</td></tr><tr><td rowspan="2">DDS_SubscriberQos</td><td rowspan="2">X</td><td rowspan="2"></td><td rowspan="2">X</td><td rowspan="2"></td><td>DDS_sequence_octet</td></tr><tr><td>DDS_StringSeq</td></tr><tr><td>DDS_DataReaderQos</td><td>X</td><td></td><td>X</td><td></td><td>DDS_sequence_octet</td></tr></table>

# 1.3.4 Sequences Embedded in Status Objects

The following table shows the Status objects for which the resources have to be managed because they contain sequences. In other words, for these Status objects DDS\_&lt;Status&gt;\_\_alloc operations are available. The buffers used in these Status objects must be allocated using the DDS\_&lt;sequence-name&gt;\_allocbuf operations. The DDS\_free operation takes care of the embedded sequences and the buffers in a Status.

Table 4: Status Objects

<table><tr><td rowspan="2">Status Name</td><td colspan="4">Parameter Type</td><td rowspan="2">ContainsSequence</td></tr><tr><td>In</td><td>Out</td><td>Inout</td><td>Return</td></tr><tr><td>DDS_OfferedIncompatibleQosStatus</td><td>X</td><td></td><td>X</td><td></td><td>DDS_QosPolicyCountSeq</td></tr><tr><td>DDS_RequestedIncompatibleQosStatus</td><td>X</td><td></td><td>X</td><td></td><td>DDS_QosPolicyCountSeq</td></tr></table>

# 1.3.5 Resources and operations

The interface description of the memory management operations is as follows:

```c
/* interface Memory management */
typedef struct {
```

```c
DDS_unsigned_long _maximum;
DDS_unsigned_long _length;
DDS_&lt;sequence-element-type&gt; *_buffer;
DDS_boolean _release;
} DDS_sequence_&lt;name-space-prefix&gt;&lt;sequence-element-type&gt;;
typedef
DDS_sequence_&lt;name-space-prefix&gt;&lt;sequence-element-type&gt;
DDS_&lt;sequence-name&gt;

/* implemented API operations */
void
DDS_sequence_set_release
(void *sequence,
DDS_boolean release);
DDS_boolean
DDS_sequence_get_release
(void *sequence);
DDS_&lt;sequence-name&gt; *
DDS_&lt;sequence-name&gt;_alloc
(void);
DDS_&lt;sequence-element-type&gt; *
DDS_&lt;sequence-name&gt;_allocbuf
(DDS_unsigned_long len);
DDS_&lt;QosPolicy&gt;
DDS_&lt;QosPolicy&gt;_alloc
(void);
DDS_&lt;Status&gt;
DDS_&lt;Status&gt;_alloc
(void);
void
DDS_free
(void *);
```

The following paragraphs describe the usage of all memory management operations.

# 1.3.5.1 Sequences DDS\_&lt;sequence-name&gt;

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
    typedef struct {
    DDS_unsigned_long _maximum;
    DDS_unsigned_long _length;
    DDS_&lt;sequence-element-type&gt; *_buffer;
    DDS_boolean _release;
```

```cpp
} DDS_sequence_&lt;name-space-prefix&gt;
&lt;sequence-element-type&gt;;
typedef DDS_sequence_&lt;name-space-prefix&gt;
    &lt;sequence-element-type&gt; DDS_&lt;sequence-name&gt;
```

# Description

The typedef DDS\_&lt;sequence-name&gt; represents the sequence which contains the objects of &lt;sequence-element-type&gt;.

# Attributes

DDS\_unsigned\_long \_maximum - the maximum number of elements that can be contained in the sequence.

```txt
DDS_unsigned_long _length - the actual number of elements in the sequence.
DDS_&lt;sequence-element-type&gt; *_buffer - a pointer to the sequence buffer.
DDS_boolean _release - indicates whether this sequence owns the memory of _buffer.
```

# Detailed Description

The typedef DDS\_&lt;sequence-name&gt; represents the sequence struct that holds the sequence attributes associated with the sequence buffer, which contains the objects of &lt;sequence-element-type&gt;. This sequence is allocated by calling DDS\_&lt;sequence-name&gt;\_\_alloc. The sequence buffer must be allocated separately by calling DDS\_&lt;sequence-name&gt;\_allocbuf. In other words when using a sequence, the memory space must be allocated for both the sequence struct and the sequence buffer. Whether, the application must allocate the resources or the Data Distribution Service allocates the resources, depends on the type of usage.

# In or Inout Parameter

In case the sequence is passed as an in or inout parameter, both the sequence and the buffer must be allocated by the application. The application must set the attributes of the sequence according to the size and ownership of the buffer. Furthermore, for an inout parameter the application can control whether the Data Distribution Service must replace the elements in the sequence, the application can allow this by setting the \_release attribute.

• When set to TRUE the Data Distribution Service is allowed to free any pointer types. The Data Distribution Service sets the \_length attribute to the number of returned elements. The number of elements never exceeds the number set by the application in the \_maximum attribute.

• When set to FALSE the Data Distribution Service is not allowed to free the pointer types. In this case, the Data Distribution Service allocates exactly the amount of elements and set the \_length and the \_maximum attributes of the sequence to that amount.
• In either case, the sequence and the buffer must be released by the application by calling DDS\_free on the sequence. In this case also the buffer is released, since the DDS\_free operation is recursive.

# Out or Return Parameter

In case the sequence is used as an out parameter or a sequence is returned by a function, both the sequence and the buffer are allocated by the Data Distribution Service. The attributes of the sequence are set by the Data Distribution Service according to the size and ownership of the buffer. The sequence and the buffer must be released by the application by calling DDS\_free on the sequence. In this case also the buffer is released, since the DDS\_free operation is recursive.

In case the Data Distribution Service has no data to return, it returns an empty sequence with the \_length and the \_maximum attributes of the sequence set to zero, the \_buffer attribute set to DDS\_OBJECT\_NIL and the \_release attribute set to FALSE.

# Allocation on the Stack

In case the sequence is allocated by the application. The application may also allocate the sequence on stack for performance reason instead of calling DDS\_&lt;sequence-name&gt;\_\_alloc. When the buffer is allocated on the stack the application must also set the \_release attribute to FALSE as described below. In case the buffer is allocated using DDS\_&lt;sequence-name&gt;\_allocbuf then the application must release the buffer separately by calling DDS\_free on \_buffer of the sequence.

# Attributes

The attributes of the DDS\_&lt;sequence-name&gt; struct must be set after allocation. In case of an out parameter or the sequence is returned by a function, the attributes are set by the Data Distribution Service. In case of an in parameter or inout parameter, the attributes must be set by the application.

The \_length attribute of the sequence must be set to the current length of the sequence. In other words equal to the number of valid sequence elements.

The \_maximum attribute of the sequence must be set to the size of the allocated sequence buffer. In other words equal to the len parameter used in the call to DDS\_&lt;sequence-element-type&gt;\_allocbuf.

The \_buffer attribute of the sequence must be set to the pointer to the allocated sequence buffer. In other words equal to the returned pointer from the call to DDS\_&lt;sequence-element-type&gt;\_allocbuf. Or in case of allocation on stack, the pointer to the variable.

The \_release flag of the sequence may not be set directly. The \_release flag of the sequence must be set by using DDS\_sequence\_set\_release and may only be read by using DDS\_sequence\_get\_release. DDS\_sequence\_set\_release may only be used by the creator of the sequence. If it is not called for a given sequence instance, then the default value of the \_release flag for that instance is FALSE.

If the \_release flag of the sequence is set to TRUE, the sequence effectively “owns” the resource pointed to by \_buffer; if the flag is set to FALSE, the application is responsible for the resource. If, for example, a sequence is returned from an operation with its release flag set to FALSE, calling DDS\_free on the returned sequence pointer does not deallocate the memory pointed to by \_buffer.

Before calling DDS\_free on the \_buffer member of a sequence directly, the a p p l i c a t i o n s h o u l d c h e c k t h e release f l a g u s i n g DDS\_sequence\_get\_release. If it returns FALSE, the application should not invoke DDS\_free on the \_buffer member; doing so produces undefined behaviour.

# 1.3.5.2 DDS\_sequence\_set\_release

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
void
DDS_sequence_set_release
(void *sequence, DDS_boolean release);
```

# Description

This operation sets the state of the \_release flag of the sequence.

# Parameters

in void \*sequence - a pointer to the DDS\_&lt;sequence-name&gt;.

in DDS\_boolean release - the new state of the \_release flag of the sequence.

# Return Value

```txt
&lt;none&gt;
```

# Detailed Description

This operation sets the state of the \_release flag of the sequence. If the flag is set to TRUE, the sequence effectively “owns” the resource pointed to by \_buffer; if the flag is set to FALSE, the application is responsible for the resource. If, for example, a sequence is returned from an operation with its release flag set to FALSE, calling DDS\_free on the returned sequence pointer does not deallocate the memory pointed to by \_buffer. Passing a DDS\_OBJECT\_NIL pointer or a pointer to something other than a sequence type to DDS\_sequence\_set\_release produces undefined behaviour.

DDS\_sequence\_set\_release should only be used by the creator of the sequence. If it is not called for a given sequence instance, then the default value of the \_release flag for that instance is FALSE. The \_release flag of the sequence may not be set directly. It may only be changed by this operation.

# 1.3.5.2.1 DDS\_sequence\_get\_release

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
DDS_boolean
DDS_sequence_get_release
(void *sequence);
```

# Description

This operation gets the state of the \_release flag of the sequence.

# Parameters

in void \*sequence - a pointer to the DDS\_&lt;sequence-name&gt;.

# Return Value

DDS\_boolean - the present state of the \_release flag of the sequence.

# Detailed Description

This operation gets the present state of the \_release flag of the sequence. If the flag returned is TRUE, the sequence effectively “owns” the resource pointed to by \_buffer; if the flag returned is FALSE, the application is responsible for the resource. If, for example, a sequence is returned from an operation with its release flag set to FALSE, calling DDS\_free on the returned sequence pointer does not deallocate the memory pointed to by \_buffer. Before calling DDS\_free on the \_buffer member of a sequence directly, the application should check the \_release flag using DDS\_sequence\_get\_release. If it returns FALSE, the application should not invoke DDS\_free on the \_buffer member; doing so produces undefined behaviour. Passing a DDS\_OBJECT\_NIL pointer or a pointer to something other than a sequence type to DDS\_sequence\_get\_release produces undefined behaviour.

# 1.3.5.2.2 DDS\_&lt;sequence-name&gt;\_\_alloc

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
DDS_&lt;sequence-name&gt;
DDS_&lt;sequence-name&gt;_alloc
(void);
```

# Description

This operation allocates a new DDS\_&lt;sequence-name&gt;.

# Parameters

```txt
&lt;none&gt;
```

# Return Value

DDS\_&lt;sequence-name&gt; - the pointer to the newly-created empty DDS\_&lt;sequence-name&gt;. In case of an error, a DDS\_OBJECT\_NIL pointer is returned.

# Detailed Description

This operation allocates a new empty DDS\_&lt;sequence-name&gt;. This operation does not allocate the buffer and leave the sequence empty by setting the \_length and \_maximum attributes to zero and the \_buffer attribute to DDS\_OBJECT\_NIL. The application may also allocate the DDS\_&lt;sequence-name&gt; as a variable on stack. In this case the application may not use DDS\_free on the sequence. In case the DDS\_&lt;sequence-name&gt; was allocated by this operation, and the application wants to release the DDS\_&lt;sequence-name&gt; it must be released using DDS\_free on the sequence.

I n c a s e t h e r e a r e i n s u f f i c i e n t r e s o u r c e s a v a i l a b l e t o a l l o c a t e t h e DDS\_&lt;sequence-name&gt;, a DDS\_OBJECT\_NIL pointer is returned instead.

# 1.3.5.2.3 DDS\_&lt;sequence-element-type&gt;\_allocbuf

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
DDS_&lt;sequence-element-type&gt; *
DDS_&lt;sequence-name&gt;_allocbuf
(DDS_unsigned_long len);
```

# Description

This operation allocates a new DDS\_&lt;sequence-element-type&gt; buffer.

# Parameters

```txt
&lt;none&gt;
```

# Return Value

DDS\_&lt;sequence-element-type&gt; - the pointer to the newly-created buffer of DDS\_&lt;sequence-element-type&gt;. In case of an error, a DDS\_OBJECT\_NIL pointer is returned.

# Detailed Description

This operation allocates a new buffer of DDS\_&lt;sequence-element-type&gt;. The application may also allocate the buffer of DDS\_&lt;sequence-element-type&gt; as a variable on stack. In this case the application may not use DDS\_free on the buffer. Furthermore, the application may only use DDS\_free on the sequence when the release flag of the sequence is set to FALSE and/or the \_buffer pointer is set to DDS\_OBJECT\_NIL to prevent the buffer from being released. In case the buffer of DDS\_&lt;sequence-element-type&gt; was allocated by this operation, and the application wants to release the buffer of DDS\_&lt;sequence-element-type&gt; it must be released using DDS\_free.

In case there are insufficient resources available to allocate the buffer of DDS\_&lt;sequence-element-type&gt;, a DDS\_OBJECT\_NIL pointer is returned instead.

# 1.3.5.2.4 DDS\_&lt;QosPolicy&gt;\_\_alloc

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
DDS_&lt;QosPolicy&gt;
DDS_&lt;QosPolicy&gt;_alloc
(void);
```

# Description

This operation allocates a new DDS\_&lt;QosPolicy&gt;.

# Parameters

```txt
&lt;none&gt;
```

# Return Value

DDS\_&lt;QosPolicy&gt; - the handle to the newly-created DDS\_&lt;QosPolicy&gt;. In case of an error, a DDS\_OBJECT\_NIL pointer is returned.

# Detailed Description

This operation allocates a new DDS\_&lt;QosPolicy&gt;. The behaviour is identical to DDS\_&lt;sequence-name&gt;\_\_alloc except that it creates a QosPolicy structure including its embedded sequences. Further, the embedded buffers are not allocated.

# 1.3.5.2.5 DDS\_&lt;Status&gt;\_\_alloc

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
DDS_&lt;Status&gt;
DDS_&lt;Status&gt;_alloc
(void);
```

# Description

This operation allocates a new DDS\_&lt;Status&gt;.

# Parameters

```txt
&lt;none&gt;
```

# Return Value

DDS\_&lt;Status&gt; - the handle to the newly-created DDS\_&lt;Status&gt;. In case of an error, a DDS\_OBJECT\_NIL pointer is returned.

# Detailed Description

This operation allocates a new DDS\_&lt;Status&gt;. The behaviour is identical to DDS\_&lt;sequence-name&gt;\_\_alloc except that it creates a Status structure including its embedded sequences. Further, the embedded buffers are not allocated.

# 1.3.5.2.6 DDS\_string\_alloc

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
DDS_char *
DDS_string_alloc
(DDS_unsigned_long len);
```

# Description

This operation dynamically allocates a string of a specified length.

# Parameters

in DDS\_unsigned\_long len - the length of the string to allocate. The allocated string has length len+1 (1 character is allocated extra for the terminating NUL character).

# Return Value

DDS\_char \* - the pointer to the allocated string. If there are insufficient resources available, a DDS\_OBJECT\_NIL pointer is returned.

# Detailed Description

This operation dynamically allocates a string of a specified length. The allocated string has length len+1 (1 character is allocated extra for the terminating ‘0’ character). If there are insufficient resources available, a DDS\_OBJECT\_NIL pointer is returned.

A string that is allocated via DDS\_string\_alloc must be freed using the operation DDS\_free.

# 1.3.5.2.7 DDS\_free

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
void
DDS_free
(void *);
```

# Description

This operation releases the allocated resources for the object in the parameter.

# Parameters

in void \* - contains the object which resources should be released.

# Return Value

```txt
&lt;none&gt;
```

# Detailed Description

This operation releases the allocated resources for the object in the parameter. The parameter may be a sequence in which case both the sequence and the sequence buffer are released since this operation operates recursively. Or the parameter may be a sequence buffer in case only the buffer is released. In both cases, the application is responsible to call this operation on the proper object in order to release the resources.

This operation may only be used when the resource was allocated using one of the \_alloc operations. In case the object was declared as a variable on stack, the application may not use DDS\_free on this object.

This means that there are four combinations of allocation possible:

B o t h t h e s e q u e n c e a n d t h e b u ff e r i s a l l o c a t e d u s i n g t h e DDS\_&lt;sequence-name&gt;\_\_alloc and DDS\_&lt;sequence-name&gt;\_allocbuf operation. In this case the DDS\_free operation must be used on the sequence to release both.

• The sequence is allocated on stack and the buffer is allocated using the DDS\_&lt;sequence-name&gt;\_allocbuf operation. In this case the sequence may not be released using the DDS\_free operation but the buffer must be released using the DDS\_free operation (operated on the buffer).
• The sequence is allocated using the DDS\_&lt;sequence-name&gt;\_\_alloc operation and the buffer is allocated on stack. In this case the DDS\_free operation must be used on the sequence but the buffer may not be released using the DDS\_free operation. Since the DDS\_free operation works recursively, the application must put the \_release flag of the sequence to FALSE and/or the \_buffer pointer to DDS\_OBJECT\_NIL to prevent the buffer from being released.
• Both the sequence and the buffer are allocated on stack. In this case the DDS\_free operation may not be used.

# 1.4 Listeners Interfaces

The Listener provides a generic mechanism (actually a callback function) for the Data Distribution Service to notify the application of relevant asynchronous status change events, such as a missed deadline, violation of a DDS\_QosPolicy setting, etc. The Listener is related to changes in communication status.

The Listener interfaces are designed as an interface at PIM level. In other words, such an interface is part of the application which must implement the interface operations. These operations must be provided by the application. All Listener operations must be implemented, it is up to the application whether an operation is empty or contains some functionality.

Each DCPS DDS\_Entity supports its own specialized kind of Listener. Therefore, the following Listeners are available:

• DDS\_DomainParticipantListener
• DDS\_ExtDomainParticipantListener
• DDS\_TopicListener
• DDS\_ExtTopicListener
• DDS\_PublisherListener
• DDS\_DataWriterListener

• DDS\_SubscriberListener
• DDS\_DataReaderListener

For example, since a DDS\_DataReader is a kind of DDS\_Entity, it has the ability to have a Listener associated with it. In this case, the associated Listener must be of type DDS\_DataReaderListener. This interface must be implemented by the application. All DDS\_DataReaderListener operations must be implemented, it is up to the application whether an operation is empty or contains some functionality.

As an example, one of the operations in the DDS\_DataReaderListener is the DDS\_DataReaderListener\_on\_liveliness\_changed. This operation (implemented by the application) will be called by the Data Distribution Service when the liveliness of the associated DDS\_DataWriter has changed. In other words, it serves as a callback function to the event of a change in liveliness. The parameters of the operation are supplied by the Data Distribution Service. In this example, the pointer to the DDS\_DataReader and the status of the liveliness are provided.

# Implementation

The struct DDS\_&lt;Entity&gt;Listener represents the implementation of the Listener for an &lt;Entity&gt;. Since a Listener is implemented as a struct of pointers, the application must allocate this struct and initialise these pointers. The Listener is allocated using the appropriate DDS\_&lt;Entity&gt;Listener\_\_alloc operation. Each pointer must point to the appropriate callback operation defined in the application (when the status is enabled). It is up to the application whether an operation is empty or contains some functionality. An example is presented of the allocation and initialization of a DDS\_DataReaderListener which is only enabled for the on\_liveliness\_changed. The on\_liveliness\_changed operation is provided by the application:

```c
#include "dds_dcps.h"
static struct DDS_DataReaderListener *msgListener;
DDS_FooDataReader FooDR;
/* at this point, it is not important how to create the FooDR
*/
DataWriterListenerData UserDefined_ListenerData;
/* at this point, it is not important how
UserDefined_ListenerData is implemented.
This parameter can be used for Listener identification.
If not used, the parameter may be NULL. */
/* Prepare a listener for the Foo DataReader. */
msgListener = DDS_DataReaderListener_alloc();
msgListener.listener_data = UserDefined_ListenerData;
msgListener.on_requested_deadline_missed = NULL;
msgListener.on_requested_incompatible_qos = NULL;
```

```c
msgListener.on_sample_rejected = NULL;
msgListener.on_liveliness_changed =
    (void (*)(void *, DDS_DataReader)) on_liveliness_changed;
msgListener.on_data_available = NULL;
msgListener.on_subscription_matched = NULL;
msgListener.on_sample_lost = NULL;

/* Set the Listener with a mask only
    to trigger on on_liveliness_changed. */
status = DDS_DataReader_set_listener
    (FooDR,
    &msgListener,
    DDS_LIVELINESS_CHANGED_STATUS);
```

# 1.4.1 Struct DDS\_&lt;Entity&gt;Listener

The struct DDS\_&lt;Entity&gt;Listener represents the implementation of a Listener.

The interface description applies to the different types of &lt;Entity&gt;, that is the DomainParticipant, Topic, Publisher, DataWriter, Subscriber or DataReader. The actual attributes depends on the &lt;Entity&gt;. Only for the DomainParticipant all the fields are applicable. the description of these structs is as follows:

```c
struct DDS_DomainParticipantListener
{
    void *listener_data;
    DDS_DomainParticipantListener_InconsistentTopicListener on_inconsistent_topic;
    DDS_DomainParticipantListener_OfferedDeadlineMissedListener on_offered_deadline_missed;
    DDS_DomainParticipantListener_OfferedIncompatibleQosListener on_offered_incompatible_qos;
    DDS_DomainParticipantListener_LivelinessLostListener on_liveliness_lost;
    DDS_DomainParticipantListener_PublicationMatchListener on_publication_matched;
    DDS_DomainParticipantListener_RequestedDeadlineMissedListener on_requested_deadline_missed;
    DDS_DomainParticipantListener_RequestedIncompatibleQosListener on_requested_incompatible_qos;
    DDS_DomainParticipantListener_SampleRejectedListener on_sample_rejected;
    DDS_DomainParticipantListener_LivelinessChangedListener on_liveliness_changed;
    DDS_DomainParticipantListener_DataAvailableListener on_data_available;
```

```c
DDS_DomainParticipantListener_SubscriptionMatchListener
on Subscription_matched;
DDS_DomainParticipantListener_SampleLostListener
on_sample_lost;
DDS_DomainParticipantListener_DataOnReadersListener
on_data_on_readers;
};
struct DDS_ExtDomainParticipantListener
{
    void *listener_data;
    DDS_ExtDomainParticipantListener_InconsistentTopicListener
    on_inconsistent_topic;
    DDS_ExtDomainParticipantListener_AllDataDisposed
    on_all_data_disposed;
    DDS_ExtDomainParticipantListener_OfferedDeadlineMissedListener
    on_offered_deadline_missed;
    DDS_ExtDomainParticipantListener_OfferedIncompatibleQosListener
    on_offered_incompatible_qos;
    DDS_ExtDomainParticipantListener_LivelinessLostListener
    on_liveliness_lost;
    DDS_ExtDomainParticipantListener_PublicationMatchListener
    on_publication_matched;
    DDS_ExtDomainParticipantListener_RequestedDeadlineMissedListener
    on_requested_deadline_missed;
    DDS_ExtDomainParticipantListener_RequestedIncompatibleQosListener
    on_requested_incompatible_qos;
    DDS_ExtDomainParticipantListener_SampleRejectedListener
    on_sample_rejected;
    DDS_ExtDomainParticipantListener_LivelinessChangedListener
    on_liveliness_changed;
    DDS_ExtDomainParticipantListener_DataAvailableListener
    on_data_available;
    DDS_ExtDomainParticipantListener_SubscriptionMatchListener
    on Subscription_matched;
    DDS_ExtDomainParticipantListener_SampleLostListener
    on_sample_lost;
    DDS_ExtDomainParticipantListener_DataOnReadersListener
    on_data_on_readers;
}
struct DDS_TopicListener
{
    void *listener_data;
    DDS_TopicListener_InconsistentTopicListener
    on_inconsistent_topic;
};
struct DDS_ExtTopicListener
{
```

```c
void *listener_data;
DDS_ExtTopicListener_InconsistentTopicListener
on_inconsistent_topic;
DDS_ExtTopicListener_AllDataDisposed on_all_data_disposed;
};
struct DDS_PublisherListener
{
    void *listener_data;
    DDS_PublisherListener_OfferedDeadlineMissedListener
    on_offered_deadline_missed;
    DDS_PublisherListener_OfferedIncompatibleQosListener
    on_offered_incompatible_qos;
    DDS_PublisherListener_LivelinessLostListener
    on_liveliness_lost;
    DDS_PublisherListener_PublicationMatchListener
    on_publication_matched;
};
struct DDS_DataWriterListener
{
    void *listener_data;
    DDS_DataWriterListener_OfferedDeadlineMissedListener
    on_offered_deadline_missed;
    DDS_DataWriterListener_OfferedIncompatibleQosListener
    on_offered_incompatible_qos;
    DDS_DataWriterListener_LivelinessLostListener
    on_liveliness_lost;
    DDS_DataWriterListener_PublicationMatchListener
    on_publication_matched;
};
struct DDS_SubscriberListener
{
    void *listener_data;
    DDS_SubscriberListener_RequestedDeadlineMissedListener
    on_requested_deadline_missed;
    DDS_SubscriberListener_RequestedIncompatibleQosListener
    on_requested_incompatible_qos;
    DDS_SubscriberListener_SampleRejectedListener
    on_sample_rejected;
    DDS_SubscriberListener_LivelinessChangedListener
    on_liveliness_changed;
    DDS_SubscriberListener_DataAvailableListener
    on_data_available;
    DDS_SubscriberListener_SubscriptionMatchListener
    on_subscription_matched;
    DDS_SubscriberListener_SampleLostListener
    on_sample_lost;
    DDS_SubscriberListener_DataReadersListener
    on_data_on_readers;
};
```

```c
struct DDS_DataReaderListener
{
    void *listener_data;
    DDS_DataReaderListener_RequestedDeadlineMissedListener on_requested_deadline_missed;
    DDS_DataReaderListener_RequestedIncompatibleQosListener on_requested_incompatible_qos;
    DDS_DataReaderListener_SampleRejectedListener on_sample_rejected;
    DDS_DataReaderListener_LivelinessChangedListener on_liveliness_changed;
    DDS_DataReaderListener_DataAvailableListener on_data_available;
    DDS_DataReaderListener_SubscriptionMatchListener on_subscription_matched;
    DDS_DataReaderListener_SampleLostListener on_sample_lost;
};

/* implemented API operations
* &lt;no operations&gt; */
```

The next paragraphs describes the usage of the DDS\_&lt;Entity&gt;Listener structs.

# 1.4.2 DDS\_DomainParticipantListener

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
struct DDS_DomainParticipantListener
{
    void *listener_data;
    DDS_DomainParticipantListener_InconsistentTopicListener on_inconsistent_topic;
    DDS_DomainParticipantListener_OfferedDeadlineMissedListener on_offered_deadline_missed;
    DDS_DomainParticipantListener_OfferedIncompatibleQosListener on_offered_incompatible_qos;
    DDS_DomainParticipantListener_LivelinessLostListener on_liveliness_lost;
    DDS_DomainParticipantListener_PublicationMatchListener on_publication_matched;
    DDS_DomainParticipantListener_RequestedDeadlineMissedListener on_requested_deadline_missed;
    DDS_DomainParticipantListener_RequestedIncompatibleQosListener on_requested_incompatible_qos;
    DDS_DomainParticipantListener_SampleRejectedListener on_sample_rejected;
    DDS_DomainParticipantListener_LivelinessChangedListener on_liveliness_changed;
    DDS_DomainParticipantListener_DataAvailableListener on_data_available;
```

```txt
DDS_DomainParticipantListener_SubscriptionMatchListener on_subscription_matched;
DDS_DomainParticipantListener_SampleLostListener on_sample_lost;
DDS_DomainParticipantListener_DataOnReadersListener on_data_on_readers;
};
```

# Description

The struct DDS\_DomainParticipantListener represents the implementation of the DomainParticipantListener.

# Attributes

void \*listener\_data - a pointer to a user-defined object, which may be used for identification of the Listener.

DDS\_DomainParticipantListener\_InconsistentTopicListener on\_inconsistent\_topic - a pointer to the call back function implemented by the application.

DDS\_DomainParticipantListener\_OfferedDeadlineMissedListener on\_offered\_deadline\_missed - a pointer to the call back function implemented by the application.

DDS\_DomainParticipantListener\_OfferedIncompatibleQosListener on\_offered\_incompatible\_qos - a pointer to the call back function implemented by the application.

DDS\_DomainParticipantListener\_LivelinessLostListener on\_liveliness\_lost - a pointer to the call back function implemented by the application.

DDS\_DomainParticipantListener\_PublicationMatchListener on\_publication\_matched - a pointer to the call back function implemented by the application.

DDS\_DomainParticipantListener\_RequestedDeadlineMissedListener on\_requested\_deadline\_missed - a pointer to the call back function implemented by the application.

DDS\_DomainParticipantListener\_RequestedIncompatible QosListener on\_requested\_incompatible\_qos -a pointer to the call back function implemented by the application.

DDS\_DomainParticipantListener\_SampleRejectedListener on\_sample\_rejected - a pointer to the call back function implemented by the application.

```txt
DDS_DomainParticipantListener_LivelinessChangedListener on_liveliness_changed - a pointer to the call back function implemented by the application.

DDS_DomainParticipantListener_DataAvailableListener on_data_available - a pointer to the call back function implemented by the application.

DDS_DomainParticipantListener_SubscriptionMatchListener on_subscription_matched - a pointer to the call back function implemented by the application.

DDS_DomainParticipantListener_SampleLostListener on_sample_lost - a pointer to the call back function implemented by the application.

DDS_DomainParticipantListener_DataOnReadersListener on_data_on_readers - a pointer to the call back function implemented by the application.
```

# Detailed Description

The struct DDS\_DomainParticipantListener represents the implementation of the Listener for the DomainParticipant. Since a Listener is implemented as a struct of pointers, the application must allocate this struct and initialise these p o i n t e r s . T h e Listener i s a l l o c a t e d u s i n g t h e DDS\_DomainParticipantListener\_\_alloc operation. Each pointer must point to the appropriate callback operation defined in the application. It is up to the application whether an operation is empty or contains some functionality. The listener\_data attribute is a pointer to an application-defined object. This attribute can be used to supply the identity of the Listener that has been called. Descriptions of the other attributes are given in the appropriate on\_&lt;status&gt; callback operations in each Listener.

# 1.4.3 DDS\_ExtDomainParticipantListener

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
struct DDS_ExtDomainParticipantListener
{
    void *listener_data;
    DDS_ExtDomainParticipantListener_InconsistentTopicListener on_inconsistent_topic;
    DDS_ExtDomainParticipantListener_AllDataDisposed on_all_data_disposed;
    DDS_ExtDomainParticipantListener_OfferedDeadlineMissedListener on_offered_deadline_missed;
    DDS_ExtDomainParticipantListener_OfferedIncompatibleQosListener
```

```txt
on_offered_incompatible_qos;
DDS_ExtDomainParticipantListener_LivelinessLostListener
on_liveliness_lost;
DDS_ExtDomainParticipantListener_PublicationMatchListener
on_publication_matched;
DDS_ExtDomainParticipantListener_RequestedDeadlineMissedListener
on_requested_deadline_missed;
DDS_ExtDomainParticipantListener_RequestedIncompatibleQosListener
on_requested_incompatible_qos;
DDS_ExtDomainParticipantListener_SampleRejectedListener
on_sample_rejected;
DDS_ExtDomainParticipantListener_LivelinessChangedListener
on_liveliness_changed;
DDS_ExtDomainParticipantListener_DataAvailableListener
on_data_available;
DDS_ExtDomainParticipantListener_SubscriptionMatchListener
on_subscription_matched;
DDS_ExtDomainParticipantListener_SampleLostListener
on_sample_lost;
DDS_ExtDomainParticipantListener_DataOnReadersListener
on_data_on_readers;
}
```

# Description

The struct DDS\_ExtDomainParticipantListener represents the implementation of the ExtDomainParticipantListener interface, which is an OpenSplice extension to the normal DomainParticipantListener interface that adds an additional callback operation to handle the ALL\_DATA\_DISPOSED\_STATUS event.

# Attributes

void \*listener\_data - a pointer to a user-defined object, which may be used for identification of the Listener.

DDS\_ExtDomainParticipantListener\_InconsistentTopicListener on\_inconsistent\_topic - a pointer to the callback function implemented by the application.

DDS\_ExtDomainParticipantListener\_AllDataDisposed on\_all\_data\_disposed - a pointer to the callback function implemented by the application.

DDS\_ExtDomainParticipantListener\_OfferedDeadlineMissedListene r on\_offered\_deadline\_missed - a pointer to the callback function implemented by the application.

DDS\_ExtDomainParticipantListener\_OfferedIncompatibleQosListen er on\_offered\_incompatible\_qos - a pointer to the callback function implemented by the application.
DDS\_ExtDomainParticipantListener\_LivelinessLostListener on\_liveliness\_lost - a pointer to the callback function implemented by the application.
DDS\_ExtDomainParticipantListener\_PublicationMatchListener on\_publication\_matched - a pointer to the callback function implemented by the application.
DDS\_ExtDomainParticipantListener\_RequestedDeadlineMissedListe ner on\_requested\_deadline\_missed - a pointer to the callback function implemented by the application.
DDS\_ExtDomainParticipantListener\_RequestedIncompatible QosListener on\_requested\_incompatible\_qos - a pointer to the callback function implemented by the application.
DDS\_ExtDomainParticipantListener\_SampleRejectedListener on\_sample\_rejected - a pointer to the callback function implemented by the application.
DDS\_ExtDomainParticipantListener\_LivelinessChangedListener on\_liveliness\_changed - a pointer to the callback function implemented by the application.
DDS\_ExtDomainParticipantListener\_DataAvailableListener on\_data\_available - a pointer to the callback function implemented by the application.
DDS\_ExtDomainParticipantListener\_SubscriptionMatchListener on\_subscription\_matched - a pointer to the callback function implemented by the application.
DDS\_ExtDomainParticipantListener\_SampleLostListener on\_sample\_lost - a pointer to the callback function implemented by the application.
DDS\_ExtDomainParticipantListener\_DataOnReadersListener on\_data\_on\_readers - a pointer to the callback function implemented by the application.

# Detailed Description

The struct DDS\_ExtDomainParticipantListener represents an extended implementation of the Listener for the DomainParticipant. This extension is an OpenSplice addition to the normal DomainParticipantListener interface a n d a d d s a n a d d i t i o n a l c a l l b a c k o p e r a t i o n t o h a n d l e t h e ALL\_DATA\_DISPOSED\_STATUS event.

Since a Listener is implemented as a struct of pointers, the application must allocate this struct and initialise these pointers. This extended Listener is allocated using the DDS\_ExtDomainParticipntListener\_\_alloc operation, and may replace the normal DDS\_DomainParticipantListener when the ALL\_DATA\_DISPOSED\_STATUS needs to be handled. (If this event does not need to be handled, you can still use the normal DDS\_DomainParticipantListener instead). Each pointer must point to the appropriate callback operation defined in the application. It is up to the application whether an operation is empty or contains some functionality. The listener\_data attribute is a pointer to an application-defined object. This attribute can be used to supply the identity of the Listener that has been called.

Descriptions of the other attributes are given in the appropriate on\_&lt;status&gt; callback operations in each Listener.

# 1.4.4 DDS\_TopicListener

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
struct DDS_TopicListener
{
    void *listener_data;
    DDS_TopicListener_InconsistentTopicListener on_inconsistent_topic;
};
```

# Description

The struct DDS\_TopicListener represents the implementation of the TopicListener.

# Attributes

void \*listener\_data - a pointer to a user-defined object, which may be used for identification of the Listener.

DDS\_TopicListener\_InconsistentTopicListener on\_inconsistent\_topic - a pointer to the callback function implemented by the application.

# Detailed Description

The struct DDS\_TopicListener represents the implementation of the Listener for the Topic. Since a Listener is implemented as a struct of pointers, the application must allocate this struct and initialise these pointers. The Listener is allocated using the DDS\_TopicListener\_\_alloc operation. Each pointer must point to the appropriate callback operation defined in the application. It is up to the application whether an operation is empty or contains some functionality. The listener\_data attribute is a pointer to an application-defined object. This attribute can be used to supply the identity of the Listener that has been called. Descriptions of the other attributes are given in the appropriate on\_&lt;status&gt; callback operations in each Listener.

# 1.4.5 DDS\_ExtTopicListener

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
struct ExtTopicListener
{
    void *listener_data;
    DDS_ExtTopicListener_InconsistentTopicListener on_inconsistent_topic;
    DDS_ExtTopicListener_AllDataDisposed on_all_data_disposed;
}
```

# Description

The struct DDS\_ExtTopicListener represents the implementation of the ExtTopicListener interface, which is an OpenSplice extension to the normal TopicListener interface that adds an additional callback operation to handle the ALL\_DATA\_DISPOSED\_STATUS event.

# Attributes

void \*listener\_data - a pointer to a user-defined object, which may be used for identification of the Listener.

DDS\_ExtTopicListener\_InconsistentTopicListener on\_inconsistent\_topic - a pointer to the callback function implemented by the application.

DDS\_ExtTopicListener\_AllDataDisposed on\_all\_data\_disposed - a pointer to the callback function implemented by the application.

# Detailed Description

The struct DDS\_ExtTopicListener represents an extended implementation of the Listener for the Topic. This extension is an OpenSplice addition to the normal TopicListener interface and adds an additional callback operation to handle the ALL\_DATA\_DISPOSED\_STATUS event. Since a Listener is implemented as a struct of pointers, the application must allocate this struct and initialise these p o i n t e r s . T h i s e x t e n d e d L i s t e n e r i s a l l o c a t e d u s i n g t h e DDS\_ExtTopicListener\_\_alloc operation, and may replace the normal DDS\_TopicListener when the ALL\_DATA\_DISPOSED\_STATUS needs to be handled. (If this event does not need to be handled, you can still use the normal DDS\_TopicListener instead). Each pointer must point to the appropriate callback operation defined in the application. It is up to the application whether an operation is empty or contains some functionality. The listener\_data attribute is a pointer to an application-defined object. This attribute can be used to supply the identity of the Listener that has been called.

Descriptions of the other attributes are given in the appropriate on\_&lt;status&gt; callback operations in each Listener.

# 1.4.6 DDS\_PublisherListener

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
struct DDS_publisherListener
{
    void *listener_data;
    DDS_publisherListener_OfferedDeadlineMissedListener on_offered_deadline_missed;
    DDS_publisherListener_OfferedIncompatibleQosListener on_offered_incompatible_qos;
    DDS_publisherListener_LivelinessLostListener on_liveliness_lost;
    DDS_publisherListener_PublicationMatchListener on_publication_matched;
};
```

# Description

The struct DDS\_publisherListener represents the implementation of the publisherListener.

# Attributes

void \*listener\_data - a pointer to a user-defined object, which may be used for identification of the Listener.

DDS\_publisherListener\_OfferedDeadlineMissedListener on\_offered\_deadline\_missed - a pointer to the call back function implemented by the application.

DDS\_publisherListener\_OfferedIncompatibleQosListener on\_offered\_incompatible\_qos - a pointer to the call back function implemented by the application.

DDS\_publisherListener\_LivelinessLostListener on\_liveliness\_lost - a pointer to the call back function implemented by the application.

DDS\_publisherListener\_PublicationMatchListener on\_publication\_matched - a pointer to the call back function implemented by the application.

# Detailed Description

The struct DDS\_publisherListener represents the implementation of the Listener for the publisher. Since a Listener is implemented as a struct of pointers, the application must allocate this struct and initialise these pointers. The Listener is allocated using the DDS\_publisherListener\_\_alloc operation. Each pointer must point to the appropriate callback operation defined in the application. It is up to the application whether an operation is empty or contains some functionality. The listener\_data attribute is a pointer to an application-defined object. This attribute can be used to supply the identity of the Listener that has been called. Descriptions of the other attributes are given in the appropriate on\_&lt;status&gt; callback operations in each Listener.

# 1.4.7 DDS\_DataWriterListener

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
struct DDS_DataWriterListener
{
    DDS_DataWriterListener_OfferedDeadlineMissedListener on_offered_deadline_missed;
    DDS_DataWriterListener_OfferedIncompatibleQosListener on_offered_incompatible_qos;
    DDS_DataWriterListener_LivelinessLostListener on_liveliness_lost;
    DDS_DataWriterListener_PublicationMatchListener on_publication_matched;
};
```

# Description

The struct DDS\_DataWriterListener represents the implementation of the DataWriterListener.

# Attributes

void \*listener\_data - a pointer to a user-defined object, which may be used for identification of the Listener.

DDS\_DataWriterListener\_OfferedDeadlineMissedListener on\_offered\_deadline\_missed - a pointer to the call back function implemented by the application.

DDS\_DataWriterListener\_OfferedIncompatibleQosListener on\_offered\_incompatible\_qos - a pointer to the call back function implemented by the application.

DDS\_DataWriterListener\_LivelinessLostListener on\_liveliness\_lost - a pointer to the call back function implemented by the application.

DDS\_DataWriterListener\_PublicationMatchListener on\_publication\_matched - a pointer to the call back function implemented by the application.

# Detailed Description

The struct DDS\_DataWriterListener represents the implementation of the Listener for the DataWriter. Since a Listener is implemented as a struct of pointers, the application must allocate this struct and initialise these pointers. The Listener is allocated using the DDS\_DataWriterListener\_\_alloc operation. Each pointer must point to the appropriate callback operation defined in the application. It is up to the application whether an operation is empty or contains some functionality. The listener\_data attribute is a pointer to an application-defined object. This attribute can be used to supply the identity of the Listener that has been called. Descriptions of the other attributes are given in the appropriate on\_&lt;status&gt; callback operations in each Listener.

# 1.4.8 DDS\_SubscriberListener

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
struct DDS_SubscriberListener
{
    void *listener_data;
    DDS_SubscriberListener_RequestedDeadlineMissedListener
    on_requested_deadline_missed;
```

```txt
DDS_SubscriberListener_RequestedIncompatibleQosListener on_requested_incompatible_qos;
DDS_SubscriberListener_SampleRejectedListener on_sample_rejected;
DDS_SubscriberListener_LivelinessChangedListener on_liveliness_changed;
DDS_SubscriberListener_DataAvailableListener on_data_available;
DDS_SubscriberListener_SubscriptionMatchListener on_subscription_matched;
DDS_SubscriberListener_SampleLostListener on_sample_lost;
DDS_SubscriberListener_DataOnReadersListener on_data_on_readers;
};
```

# Description

The struct DDS\_SubscriberListener represents the implementation of the SubscriberListener.

# Attributes

void \*listener\_data - a pointer to a user-defined object, which may be used for identification of the Listener.

DDS\_SubscriberListener\_RequestedDeadlineMissedListener on\_requested\_deadline\_missed - a pointer to the call back function implemented by the application.

DDS\_SubscriberListener\_RequestedIncompatibleQosListener on\_requested\_incompatible\_qos - a pointer to the call back function implemented by the application.

DDS\_SubscriberListener\_SampleRejectedListener on\_sample\_rejected - a pointer to the call back function implemented by the application.

DDS\_SubscriberListener\_LivelinessChangedListener on\_liveliness\_changed - a pointer to the call back function implemented by the application.

DDS\_SubscriberListener\_DataAvailableListener on\_data\_available - a pointer to the call back function implemented by the application.

DDS\_SubscriberListener\_SubscriptionMatchListener on\_subscription\_matched - a pointer to the call back function implemented by the application.

DDS\_SubscriberListener\_SampleLostListener on\_sample\_lost - a pointer to the call back function implemented by the application.

DDS\_SubscriberListener\_DataOnReadersListener

on\_data\_on\_readers - a pointer to the call back function implemented by the application.

# Detailed Description

The struct DDS\_SubscriberListener represents the implementation of the Listener for the Subscriber. Since a Listener is implemented as a struct of pointers, the application must allocate this struct and initialise these pointers. The Listener is allocated using the DDS\_SubscriberListener\_\_alloc operation. Each pointer must point to the appropriate callback operation defined in the application. It is up to the application whether an operation is empty or contains some functionality. The listener\_data attribute is a pointer to an application-defined object. This attribute can be used to supply the identity of the Listener that has been called. Descriptions of the other attributes are given in the appropriate on\_&lt;status&gt; callback operations in each Listener.

# 1.4.9 DDS\_DataReaderListener

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
struct DDS_DataReaderListener
{
    void *listener_data;
    DDS_DataReaderListener_RequestedDeadlineMissedListener on_requested_deadline_missed;
    DDS_DataReaderListener_RequestedIncompatibleQosListener on_requested_incompatible_qos;
    DDS_DataReaderListener_SampleRejectedListener on_sample_rejected;
    DDS_DataReaderListener_LivelinessChangedListener on_liveliness_changed;
    DDS_DataReaderListener_DataAvailableListener on_data_available;
    DDS_DataReaderListener_SubscriptionMatchListener on_subscription_matched;
    DDS_DataReaderListener_SampleLostListener on_sample_lost;
};
```

# Description

The struct DDS\_DataReaderListener represents the implementation of the DataReaderListener.

# Attributes

void \*listener\_data - a pointer to a user-defined object, which may be used for identification of the Listener.

DDS\_DataReaderListener\_RequestedDeadlineMissedListener on\_requested\_deadline\_missed - a pointer to the call back function implemented by the application.

DDS\_DataReaderListener\_RequestedIncompatibleQosListener on\_requested\_incompatible\_qos - a pointer to the call back function implemented by the application.

DDS\_DataReaderListener\_SampleRejectedListener on\_sample\_rejected - a pointer to the call back function implemented by the application.

DDS\_DataReaderListener\_LivelinessChangedListener on\_liveliness\_changed - a pointer to the call back function implemented by the application.

DDS\_DataReaderListener\_DataAvailableListener on\_data\_available - a pointer to the call back function implemented by the application.

DDS\_DataReaderListener\_SubscriptionMatchListener on\_subscription\_matched - a pointer to the call back function implemented by the application.

DDS\_DataReaderListener\_SampleLostListener on\_sample\_lost - a pointer to the call back function implemented by the application.

# Detailed Description

The struct DDS\_DataReaderListener represents the implementation of the Listener for the DataReader. Since a Listener is implemented as a struct of pointers, the application must allocate this struct and initialise these pointers. The Listener is allocated using the DDS\_DataReaderListener\_\_alloc operation. Each pointer must point to the appropriate callback operation defined in the application. It is up to the application whether an operation is empty or contains some functionality. The listener\_data attribute is a pointer to an application-defined object. This attribute can be used to supply the identity of the Listener that has been called. Descriptions of the other attributes are given in the appropriate on\_&lt;status&gt; callback operations in each Listener.

# 1.5 Inheritance of Abstract Operations

The information provided here conforms to the

• PIM part of the DDS-DCPS specification (for module descriptions)
• PSM part of the DDS-DCPS specification (for class and operation descriptions).

For detailed information refer to the OMG C Language Mapping Specification.

At PIM level, inheritance is used to define abstract classes and operations. The OMG IDL PSM defines the interface for an application to interact with the Data Distribution Service. The DCPS API for the C programming language conforms to the IDL to C mapping as specified in the OMG C Language Mapping Specification.

Inheritance of operations is not implemented when different type parameters for the same operation are used. In this case operations are implemented in their respective derived class (e.g. DDS\_&lt;Entity&gt;\_get\_qos and DDS\_&lt;Entity&gt;\_set\_qos).

These operations are commented out in the IDL PSM.

# 2 DCPS Modules

DCPS is divided into five modules, which are described briefly in this chapter. Each module consists of several classes as defined at PIM level in the DDS-DCPS specification. Some of the classes as described in the PIM are implemented as a struct in the PSM; these classes are treated as a class in this chapter according to the PIM with a remark about their implementation (struct). In the next chapter their actual implementations are described.

Each class contains several operations, which may be abstract. Those classes, which are implemented as a struct do not have any operations. The modules and the classes are ordered conform the DDS-DCPS specification. The classes, interfaces, structs and operations are described in the next chapter.

![The flowchart displays five labeled blocks connected by dashed arrows:\n\n**Blocks:**\n*   Domain Module\n*   Publication Module\n*   Subscription Module\n*   Topic-Definition Module\n*   Infrastructure Module\n\n**Connections:**\n*   A dashed arrow points from **Domain Module** to **Publication Module**.\n*   A dashed arrow points from **Domain Module** to **Subscription Module**.\n*   A dashed arrow points from **Domain Module** to **Topic-Definition Module**.\n*   A dashed arrow points from **Publication Module** to **Topic-Definition Module**.\n*   A dashed arrow points from **Subscription Module** to **Topic-Definition Module**.\n*   A dashed arrow points from **Topic-Definition Module** to **Infrastructure Module**.](.vortex-opensplice-c-reference-guide/fc27de5c7e1f3622f19ecc1a9134528c53c693bb4448b62bfe81b7157248445f.jpg)

Figure 2: DCPS Module Composition

# 2.1 Functionality

The modules have the following function in the Data Distribution Service:

• Infrastructure Module: This module defines the abstract classes and interfaces, which are refined by the other modules. It also provides the support for the interaction between the application and the Data Distribution Service (state-based and event-based)

• Domain Module - This module contains the DDS\_DomainParticipant class, which is the entry point of the application, the DDS\_DomainParticipantFactory class and DDS\_DomainParticipantListener interface
• Topic-Definition Module - This module contains the DDS\_Topic, DDS\_ContentFilteredTopic and DDS\_MultiTopic classes. It also contains the DDS\_TopicListener interface and all support to define DDS\_Topic objects and assign QosPolicy settings to them
• Publication Module - This module contains the DDS\_Publisher and DDS\_DataWriter classes. It also contains the DDS\_PublisherListener and DDS\_DataWriterListener interfaces
• Subscription Module - This module contains the DDS\_Subscriber, DDS\_DataReader, DDS\_ReadCondition and DDS\_QueryCondition classes. It also contains the DDS\_SubscriberListener and DDS\_DataReaderListener interfaces

# 2.2 Infrastructure Module

This module defines the abstract classes and interfaces, which, in the PIM definition, are refined by the other modules. It also provides the support for the interaction between the application and the Data Distribution Service (event-based and state-based). The event-based interaction is supported by DDS\_Listeners, the state-based interaction is supported by DDS\_WaitSets and DDS\_Conditions.

![**Labeled Blocks:**\n\n*   **QosPolicy** (contains `name : string`)\n*   **Entity** (contains `enable()`, `((abstract)) get_listener()`, `((abstract)) get_qos()`, `get_status_changes()`, `get_statuscondition()`, `((abstract)) set_listener`, `((abstract)) set_qos()`)\n*   **((Interface)) Listener**\n*   **Status**\n*   **WaitSet** (contains `attach_condition()`, `detach_condition()`, `get_conditions()`, `wait()`)\n*   **Condition** (contains `get_trigger_value()`)\n*   **DomainParticipant** (from Domain Module)\n*   **DomainEntity**\n*   **StatusCondition** (contains `get_enabled_statuses()`, `get_entity()`, `set_enabled_statuses()`)\n*   **GuardCondition** (contains `set_trigger_value()`)\n*   **ReadCondition** (from Subscription Module)\n*   **QueryCondition** (from Subscription Module)\n\n**Connections:**\n\n*   **Entity** connects to **QosPolicy** via a line labeled `qos`, with multiplicity `*` at the QosPolicy end.\n*   **Entity** connects to **Status** via a line labeled `status` with an open diamond at the Entity end (aggregation), multiplicity `1` at the Entity end, and `*` at the Status end.\n*   **Entity** connects to **((Interface)) Listener** via a line labeled `listener`, with multiplicity `*` at the Entity end and `0..1` at the Listener end.\n*   **DomainParticipant** connects to **DomainEntity** via a line labeled `entity` with a filled diamond at the DomainParticipant end (composition), multiplicity `1` at the DomainParticipant end, and `*` at the DomainEntity end.\n*   **WaitSet** connects to **Condition** via a double-headed arrow with multiplicity `*` at both ends.\n*   **StatusCondition** connects to **Entity** via a line labeled `statuscondition`, with multiplicity `0..1` at the Entity end.\n*   **DomainEntity** inherits from **Entity**.\n*   **StatusCondition** inherits from **Condition**.\n*   **GuardCondition** inherits from **Condition**.\n*   **ReadCondition** inherits from **Condition**.\n*   **QueryCondition** inherits from **ReadCondition**.](.vortex-opensplice-c-reference-guide/ddf85ad0ff8a627428e74669599ee466af4c6de44837f1f96f2b271976887505.jpg)

Figure 3: DCPS Infrastructure Module’s Class Model

This module contains the following classes:

• DDS\_Entity (abstract)
• DDS\_DomainEntity (abstract)
• DDS\_QosPolicy (abstract, struct)
• DDS\_Listener (interface)
• DDS\_Status (abstract, struct)
• DDS\_WaitSet
• DDS\_Condition
• DDS\_GuardCondition
• DDS\_StatusCondition

# 2.3 Domain Module

This module contains the class DDS\_DomainParticipant, which acts as an entry point of the Data Distribution Service and acts as a factory for many of the classes. The DDS\_DomainParticipant also acts as a container for the other objects that make up the Data Distribution Service. It isolates applications within the same Domain from other applications in a different Domain on the same set of computers. A Domain is a “virtual network” and applications with the same domainId are isolated from applications with a different domainId. In this way, several independent distributed applications can coexist in the same physical network without interfering, or even being aware of each other.

![The flowchart is a UML class diagram illustrating the structure and relationships of a Domain Participant system.\n\n**Labeled Blocks:**\n\n*   **Interfaces:**\n    *   `((Interface))` SubscriberListener (from Subscription Module)\n    *   `((Interface))` PublisherListener (from Publication Module)\n    *   `((Interface))` TopicListener (contains `on_inconsistent_topic()`)\n*   **Classes/Entities:**\n    *   `DomainParticipantListener`\n    *   `QosPolicy` (from Infrastructure Module)\n    *   `DomainParticipantFactory` (contains methods: `create_participant()`, `delete_contained_entities()`, `delete_participant()`, `get_default_participant_qos()`, `get_instance()`, `lookup_participant()`, `set_default_participant_qos()`)\n    *   `DomainParticipant` (contains methods: `assert_liveness()`, `contains_entity()`, `create_contentfilterededtopic()`, `create_multitopic()`, `create_publisher()`, `create_subscriber()`, `create_topic()`, `delete_contained_entities()`, `delete_contentfilterededtopic()`, `delete_multitopic()`, `delete_publisher()`, `delete_subscriber()`, `delete_topic()`, `find_topic()`, `get_builtin_subscriber()`, `get_current_time()`, `get_default_publisher_qos()`, `get_default_subscriber_qos()`, `get_default_topic_qos()`, `get_domain_id()`, `get_listener()`, `get_qos()`, `ignore_participant()`, `ignore_publication()`, `ignore_subscription()`, `ignore_topic()`, `lookup_topic_description()`, `set_default_publisher_qos()`, `set_default_subscriber_qos()`, `set_default_topic_qos()`, `set_listener()`, `set_qos()`)\n    *   `Entity` (from Infrastructure Module)\n    *   `Publisher` (from Publication Module)\n    *   `Subscriber` (from Subscription Module)\n    *   `DomainEntity` (from Infrastructure Module)\n    *   `Topic` (from Topic-Definition Module)\n    *   `TopicDescription` (from Topic-Definition Module)\n    *   `ContentFilteredTopic` (from Topic-Definition Module)\n    *   `MultiTopic` (from Topic-Definition Module)\n\n**Connections:**\n\n*   **Inheritance (Hollow Arrows):**\n    *   `SubscriberListener`, `PublisherListener`, `TopicListener` inherit from `DomainParticipantListener`.\n    *   `Publisher`, `Subscriber` inherit from `DomainEntity`.\n    *   `DomainEntity` inherits from `Topic`.\n    *   `Topic` inherits from `TopicDescription`.\n    *   `ContentFilteredTopic`, `MultiTopic` inherit from `TopicDescription`.\n    *   `DomainParticipant` inherits from `Entity`.\n\n*   **Creation (Open Arrows with `((create))`):**\n    *   `DomainParticipantFactory` creates `DomainParticipant`.\n    *   `DomainParticipant` creates `Publisher`.\n    *   `DomainParticipant` creates `Subscriber`.\n    *   `DomainParticipant` creates `Topic`.\n    *   `DomainParticipant` creates `ContentFilteredTopic`.\n    *   `DomainParticipant` creates `MultiTopic`.\n\n*   **Composition (Black Diamonds at `DomainParticipant`):**\n    *   `DomainParticipant` composes 1 `DomainEntity` (labeled `1`).\n    *   `DomainParticipant` composes `*` `Topic` (labeled `*`).\n\n*   **Implicit/Association Relationships:**\n    *   `DomainParticipant` has an implicit `0..1` `DomainParticipantListener` (labeled `((implicit))`).\n    *   `DomainParticipant` has an implicit `*` `TopicDescription` (labeled `((implicit))`).\n    *   `DomainParticipant` has four association lines to `QosPolicy`:\n        *   One implicit line.\n        *   Three lines labeled `default_publisher_qos`, `default_topic_qos`, and `default_subscriber_qos`, all with multiplicity `*`.\n    *   `DomainParticipantFactory` has an association to `QosPolicy` labeled `default_participant_qos` with multiplicity `*`.](.vortex-opensplice-c-reference-guide/ef3730b09030c264f62e330c80202834d3a05c95a05f7ffd7a0fe76ab12225ab.jpg)

Figure 4: DCPS Domain Module’s Class Model

This module contains the following classes:

• DDS\_DomainParticipant
• DDS\_DomainParticipantFactory
• DDS\_DomainParticipantListener (interface)
• DDS\_Domain (not depicted)

# 2.4 Topic-Definition Module

This module contains the DDS\_Topic, DDS\_ContentFilteredTopic and DDS\_MultiTopic classes. It also contains the DDS\_TopicListener interface and all support to define DDS\_Topic objects and assign QosPolicy settings to them.

![Based on the provided flowchart/block diagram, here is the accurate and concise description of the labeled blocks and their connections:\n\n**Labeled Blocks:**\n\n*   **DomainEntity** (from Infrastructure Module)\n*   **DataWriter** (from Publication Module)\n*   **Topic**\n    *   `get_inconsistent_topic_status()`\n    *   `get_listener()`\n    *   `get_qos()`\n    *   `set_listener()`\n    *   `set_qos()`\n*   **DomainParticipant** (from Domain Module)\n*   **QosPolicy** (from Infrastructure Module)\n*   **((Interface)) TopicListener**\n    *   `on_inconsistent_topic()`\n*   **StatusCondition** (from Infrastructure Module)\n*   **WaitSet** (from Infrastructure Module)\n*   **ContentFilteredTopic**\n    *   `get_expression_parameters()`\n    *   `get_filter_expression()`\n    *   `get_related_topic()`\n    *   `set_expression_parameters()`\n*   **MultiTopic**\n    *   `get_expression_parameters()`\n    *   `get_subscription_expression()`\n    *   `set_expression_parameters()`\n*   **DataReader** (from Subscription Module)\n*   **TopicDescription**\n    *   `get_name()`\n    *   `get_participant()`\n    *   `get_type_name()`\n*   **((Interface)) TypeSupport**\n    *   `get_type_name()`\n    *   `regisiter_type()`\n\n**Connections:**\n\n*   **Topic** inherits from **DomainEntity**.\n*   **DataWriter** (multiplicity *) is associated with **Topic** (multiplicity 1).\n*   **DomainParticipant** creates **Topic** (`((create))`).\n*   **DomainParticipant** creates **ContentFilteredTopic** (`((create))`).\n*   **DomainParticipant** creates **MultiTopic** (`((create))`).\n*   **Topic** is associated with **DomainParticipant** (multiplicity 1).\n*   **Topic** is associated with **QosPolicy** (multiplicity *).\n*   **Topic** is associated with **TopicListener** (multiplicity 0..1).\n*   **Topic** is associated with **StatusCondition** (multiplicity 1).\n*   **StatusCondition** is associated with **WaitSet** (multiplicity *).\n*   **ContentFilteredTopic** inherits from **TopicDescription**.\n*   **MultiTopic** inherits from **TopicDescription**.\n*   **Topic** inherits from **TopicDescription**.\n*   **TopicDescription** realizes **TypeSupport**.\n*   **DataReader** (multiplicity *) is associated with **TopicDescription** (multiplicity 1).](.vortex-opensplice-c-reference-guide/658498da48497b50280cef9db812ade1e18abe58551ea75f121f8835a5d090b2.jpg)

Figure 5: DCPS Topic-Definition Module’s Class Model

This module contains the following classes:

• DDS\_TopicDescription (abstract)
• DDS\_Topic
• DDS\_ContentFilteredTopic
• DDS\_MultiTopic
• DDS\_TopicListener (interface)
• Topic-Definition type specific classes

Topic-Definition type specific classes contain the generic class and the generated data type specific classes. In case of the user-defined data type Foo (this also applies to other types), defined in the module SPACE; “Topic-Definition type specific classes” contains the following classes:

• DDS\_TypeSupport (abstract)
• SPACE\_FooTypeSupport

![Based on the provided image, here is the accurate description of the flowchart/block diagram:\n\n**Labeled Blocks:**\n\n1.  **`((Interface)) TypeSupport`**\n    *   `get_type_name()`\n    *   `register_type()`\n2.  **`DataWriter (from Publication Module)`**\n3.  **`DataReader (from Subscription Module)`**\n4.  **`FooTypeSupport`**\n    *   `get_type_name()`\n    *   `register_type()`\n5.  **`FooDataWriter`**\n    *   `dispose()`\n    *   `dispose_w_timestamp()`\n    *   `get_key_value()`\n    *   `register()`\n    *   `register_w_timestamp()`\n    *   `unregister()`\n    *   `unregister_w_timestamp()`\n    *   `write()`\n    *   `write_w_timestamp()`\n6.  **`FooDataReader`**\n    *   `get_key_value()`\n    *   `read()`\n    *   `read_instance()`\n    *   `read_next_instance()`\n    *   `read_next_instance_w_condition()`\n    *   `read_next_sample()`\n    *   `read_w_condition()`\n    *   `return_loan()`\n    *   `take()`\n    *   `take_instance()`\n    *   `take_next_instance()`\n    *   `take_next_instance_w_condition()`\n    *   `take_next_sample()`\n    *   `take_w_condition()`\n7.  **`Foo`**\n\n**Connections:**\n\n*   An arrow points from **`FooTypeSupport`** to **`((Interface)) TypeSupport`**.\n*   An arrow points from **`FooDataWriter`** to **`DataWriter (from Publication Module)`**.\n*   An arrow points from **`FooDataReader`** to **`DataReader (from Subscription Module)`**.\n*   A line connects **`FooTypeSupport`** to **`Foo`**.\n*   A line connects **`FooDataWriter`** to **`Foo`**.\n*   A line connects **`FooDataReader`** to **`Foo`**.](.vortex-opensplice-c-reference-guide/fd6e8ffa06344cf5e926ddc80185bf03607e2e8311f76bea11cac046bdd2bdb1.jpg)

Figure 6: Data Type “Foo” Typed Classes Pre-processor Generation

# 2.5 Publication Module

This module supports writing of the data, it contains the DDS\_Publisher and DDS\_DataWriter classes. It also contains the DDS\_PublisherListener and DDS\_DataWriterListener interfaces. Furthermore, it contains all support needed for publication.

![**Blocks:**\n\n*   **DataWriter**\n    *   `assert_liveness()`\n    *   `((abstract)) dispose()`\n    *   `((abstract)) dispose_w_timestamp()`\n    *   `((abstract)) get_key_value()`\n    *   `get_listener()`\n    *   `get_liveness_lost_status()`\n    *   `get_matched_subscription_data()`\n    *   `get_matched_subscriptions()`\n    *   `get_offered_deadline_missed_status()`\n    *   `get_offered_incompatible_qos_status()`\n    *   `get_publication_match_status()`\n    *   `get_publisher()`\n    *   `get_qos()`\n    *   `get_topic()`\n    *   `((abstract)) register()`\n    *   `((abstract)) register_w_timestamp()`\n    *   `set_listener()`\n    *   `set_qos()`\n    *   `((abstract)) unregister()`\n    *   `((abstract)) unregister_w_timestamp()`\n    *   `((abstract)) write()`\n    *   `((abstract)) write_w_timestamp()`\n*   **Publisher**\n    *   `begin_coherent_changes()`\n    *   `copy_from_topic_qos()`\n    *   `create_datawriter()`\n    *   `delete_contained_entities()`\n    *   `delete_datawriter()`\n    *   `end_coherent_changes()`\n    *   `get_default_datawriter_qos()`\n    *   `get_listener()`\n    *   `get_participant()`\n    *   `get_qos()`\n    *   `lookup_datawriter()`\n    *   `resume_publications()`\n    *   `set_default_datawriter_qos()`\n    *   `set_listener()`\n    *   `set_qos()`\n    *   `suspend_publications()`\n*   **QosPolicy (from Infrastructure Module)**\n*   **Topic (from Topic-Definition Module)**\n*   **StatusCondition (from Infrastructure Module)**\n*   **WaitSet (from Infrastructure Module)**\n*   **DomainParticipant (from Domain Module)**\n*   **((Interface)) DataWriterListener**\n    *   `on_liveness_lost()`\n    *   `on_offered_deadline_missed()`\n    *   `on_offered_incompatible_qos()`\n    *   `on_publication_match()`\n*   **((Interface)) PublisherListener**\n\n**Connections:**\n\n*   **DataWriter** connects to **Topic** with multiplicity `*` at DataWriter end and `1` at Topic end.\n*   **DataWriter** connects to **QosPolicy** with label `((implicit))` and multiplicity `*` at DataWriter end.\n*   **DataWriter** connects to **StatusCondition** with label `((implicit))`, multiplicity `1` at DataWriter end and `0..1` at StatusCondition end.\n*   **DataWriter** connects to **DataWriterListener** with label `((implicit))`, multiplicity `*` at DataWriter end and `0..1` at DataWriterListener end.\n*   **Publisher** connects to **DataWriter** with multiplicity `1` at Publisher end and `*` at DataWriter end.\n*   **Publisher** connects to **DataWriter** with a `((create))` dependency (dashed arrow).\n*   **Publisher** connects to **QosPolicy** with labels `((implicit))` and `qos`, and multiplicity `*` at Publisher end.\n*   **Publisher** connects to **StatusCondition** with label `((implicit))`, multiplicity `1` at Publisher end and `0..1` at StatusCondition end.\n*   **Publisher** connects to **PublisherListener** with label `((implicit))`, multiplicity `*` at Publisher end and `1` at PublisherListener end.\n*   **Publisher** connects to **DomainParticipant** with a `((create))` dependency (dashed arrow).\n*   **QosPolicy** connects to **Topic** with label `default_datawriter_qos`, and multiplicity `*` at both ends.\n*   **StatusCondition** connects to **WaitSet** with multiplicity `*` at both ends.\n*   **DataWriterListener** inherits from **PublisherListener** (generalization).](.vortex-opensplice-c-reference-guide/6cad8da2c1fe673cc355789dd2a4d3b8b803fb93ca70259e2874a2a526b4a829.jpg)

Figure 7: DCPS Publication Module’s Class Model

This module contains the following classes:

• DDS\_Publisher
• DDS\_PublisherListener (interface)
• DDS\_DataWriterListener (interface)
• Publication type specific classes

Publication type specific classes contain the generic class and the generated data type specific classes. In case of the user-defined data type Foo (this also applies to other types), defined in the module SPACE; “Publication type specific classes” contains the following classes:

• DDS\_DataWriter (abstract)
• SPACE\_FooDataWriter

# 2.6 Subscription Module

This module supports access to the data, it contains the DDS\_Subscriber, DDS\_DataReader, DDS\_ReadCondition and DDS\_QueryCondition classes. I t a l s o c o n t a i n s t h e DDS\_SubscriberListener a n d DDS\_DataReaderListener interfaces. Furthermore, it contains all support needed for subscription.

![**Labeled Blocks:**\n*   DataSample\n*   SampleInfo\n*   DataReader\n*   QosPolicy\n*   TopicDescription (from Topic-Definition Module)\n*   Topic (from Topic-Definition Module)\n*   Subscriber\n*   DomainParticipant (from Domain Module)\n*   WaitSet (from Infrastructure Module)\n*   StatusCondition (from Infrastructure Module)\n*   ReadCondition\n*   QueryCondition\n*   ((Interface)) SubscriberListener\n*   ((Interface)) DataReaderListener\n\n**Connections:**\n*   **DataSample** and **DataReader**: Solid line with a hollow triangle pointing to **DataSample** (Generalization). Label `*` near **DataSample**.\n*   **DataReader** and **SampleInfo**: Solid line. Label `1` near **SampleInfo**.\n*   **DataReader** and **TopicDescription**: Solid line. Label `1` near **TopicDescription**. Label `((implicit))`.\n*   **DataReader** and **Topic**: Solid line. Label `*` near **Topic**. Label `((implicit))`.\n*   **DataReader** and **WaitSet**: Solid line. Label `*` near **WaitSet**. Label `((implicit))`.\n*   **DataReader** and **StatusCondition**: Solid line. Label `*` near **StatusCondition**. Label `((implicit))`.\n*   **DataReader** and **ReadCondition**: Dashed line with an arrow pointing to **ReadCondition** (Creation). Label `1` near **ReadCondition**. Label `((create))`.\n*   **DataReader** and **QueryCondition**: Dashed line with an arrow pointing to **QueryCondition** (Creation). Label `*` near **QueryCondition**. Label `((create))`.\n*   **DataReader** and **DataReaderListener**: Solid line with a hollow triangle pointing to **DataReaderListener** (Realization). Label `0..1` near **DataReaderListener**.\n*   **TopicDescription** and **QosPolicy**: Solid line with a hollow triangle pointing to **QosPolicy** (Generalization).\n*   **Topic** and **QosPolicy**: Solid line with a hollow triangle pointing to **QosPolicy** (Generalization).\n*   **Subscriber** and **Topic**: Solid line. Label `1` near **Topic**. Label `((implicit))`.\n*   **Subscriber** and **QosPolicy**: Solid line. Label `*` near **QosPolicy**. Label `((implicit))`.\n*   **Subscriber** and **StatusCondition**: Solid line. Label `0..1` near **StatusCondition**. Label `((implicit))`.\n*   **Subscriber** and **WaitSet**: Solid line. Label `0..1` near **WaitSet**. Label `((implicit))`.\n*   **Subscriber** and **SubscriberListener**: Solid line with a hollow triangle pointing to **SubscriberListener** (Realization). Label `0..1` near **SubscriberListener**.\n*   **DomainParticipant** and **Subscriber**: Dashed line with an arrow pointing to **Subscriber** (Creation). Label `((create))`.\n*   **QosPolicy** and **Subscriber**: Solid line. Label `*` near **QosPolicy**. Label `((implicit))`.\n*   **QosPolicy** and **DataReader**: Solid line. Label `*` near **QosPolicy**. Label `((implicit))`. Label `default_datareader_qos`.\n*   **WaitSet** and **StatusCondition**: Dashed line. Label `*` at both ends. Label `((implicit))`.\n*   **QueryCondition** and **ReadCondition**: Solid line with a hollow triangle pointing to **ReadCondition** (Generalization).](.vortex-opensplice-c-reference-guide/40a8e0ff147d52b8fd5126171fb6b53fa1054e6bf5fe79e9c91fc7629d1af42f.jpg)

Figure 8: DCPS Subscription Module’s Class Model

This module contains the following classes:

• DDS\_Subscriber
• DDS\_DataSample
• DDS\_SampleInfo (struct)

• DDS\_SubscriberListener (interface)
• DDS\_DataReaderListener (interface)
• DDS\_ReadCondition
• DDS\_QueryCondition
• Subscription type specific classes

Subscription type specific classes contain the generic class and the generated data type specific classes. In case of the user-defined data type Foo (this also applies to other types), defined in the module SPACE; “Subscription type specific classes” contains the following classes:

• DDS\_DataReader (abstract)

• SPACE\_FooDataReader

# 3 DCPS Classes and Operations

This chapter describes, for each module, its classes and operations in detail. Each module consists of several classes as defined at PIM level in the DDS-DCPS specification. Some of the classes are implemented as a struct in the PSM. Some of the other classes are abstract, which means they contain some abstract operations.

The Listener interfaces are designed as an interface at PIM level. In other words, the application must implement the interface operations. Therefore, all Listener classes are abstract. A user-defined class for these operations must be provided by the application which must extend from the specific Listener class. All Listener operations must be implemented in the user-defined class. It is up to the application whether an operation is empty or contains some functionality.

The Listener interfaces in the C API are implemented as structs containing function pointers. All the function pointer attributes within the struct must be assigned to a function. It is up to the application whether a function is empty or contains some functionality.

Each class contains several operations, which may be abstract (base class). Abstract operations are not implemented in their base class, but in a type specific class or an application-defined class (in case of a Listener). Classes that are implemented as a struct do not have any operations. Some operations are inherited, which means they are implemented in their base class.

The abstract operations in a class are listed (including their synopsis), but not implemented in that class. These operations are implemented in their respective derived classes. The interfaces are fully described, since they must be implemented by the application.

i General note for type Space: The name Space.h is derived from the IDL file Space.idl, that defines Foo.

# 3.1 Infrastructure Module

![The diagram is a UML class diagram describing the core entity structure of a system (likely DDS - Data Distribution Service).\n\n**Labeled Blocks:**\n*   **QosPolicy**: Contains `name : string`.\n*   **Entity**: Contains methods `enable()`, `((abstract)) get_listener()`, `((abstract)) get_qos()`, `get_status_changes()`, `get_statuscondition()`, `((abstract)) set_listener()`, `((abstract)) set_qos()`.\n*   **((Interface)) Listener**: Empty block.\n*   **Status**: Empty block.\n*   **WaitSet**: Contains methods `attach_condition()`, `detach_condition()`, `get_conditions()`, `wait()`.\n*   **Condition**: Contains method `get_trigger_value()`.\n*   **ReadCondition**: Label `(from Subscription Module)`.\n*   **DomainParticipant**: Label `(from Domain Module)`.\n*   **DomainEntity**: Empty block.\n*   **StatusCondition**: Contains methods `get_enabled_statuses()`, `get_entity()`, `set_enabled_statuses()`.\n*   **GuardCondition**: Contains method `set_trigger_value()`.\n*   **QueryCondition**: Label `(from Subscription Module)`.\n\n**Connections:**\n*   **QosPolicy** to **Entity**: An association labeled `qos` with multiplicity `*` at the Entity end.\n*   **Status** to **Entity**: An aggregation (diamond at Entity) labeled `status` with multiplicity `1` at the Entity end and `*` at the Status end.\n*   **Entity** to **((Interface)) Listener**: An association labeled `listener` with multiplicity `*` at the Entity end and `0..1` at the Listener end.\n*   **DomainParticipant** to **DomainEntity**: An aggregation (diamond at DomainParticipant) with multiplicity `1` at the DomainParticipant end and `*` at the DomainEntity end.\n*   **DomainParticipant** to **Entity**: Inheritance (arrow pointing to Entity).\n*   **DomainEntity** to **Entity**: Inheritance (arrow pointing to Entity).\n*   **WaitSet** to **Condition**: A bidirectional association with multiplicity `*` at both ends.\n*   **StatusCondition** to **Entity**: An association labeled `entity` and `statuscondition` with multiplicity `1` at the Entity end and `0..1` at the StatusCondition end.\n*   **StatusCondition** to **Condition**: Inheritance (arrow pointing to Condition).\n*   **GuardCondition** to **Condition**: Inheritance (arrow pointing to Condition).\n*   **ReadCondition** to **Condition**: Inheritance (arrow pointing to Condition).\n*   **QueryCondition** to **ReadCondition**: Inheritance (arrow pointing to ReadCondition).](.vortex-opensplice-c-reference-guide/d8b90d2675364d19c144c1840a8b36bd410a02324efd0245d2ec1146ad487f68.jpg)

Figure 9: DCPS Infrastructure Module’s Class Model

This module contains the following classes:

• DDS\_Entity (abstract)
• DDS\_DomainEntity (abstract)
• DDS\_QosPolicy (abstract, struct)
• DDS\_Listener (interface)
• DDS\_Status (abstract, struct)
• DDS\_WaitSet
• DDS\_Condition
• DDS\_GuardCondition
• DDS\_StatusCondition
• DDS\_ErrorInfo

# 3.1.1 Class DDS\_Entity (abstract)

This class is the abstract base class for all the DCPS objects. It acts as a generic class for DDS\_Entity objects.

The interface description of this class is as follows:

```c
/* interface DDS_Entity */
/* abstract operations (implemented in class DDS_DomainParticipant,
* DDS_Topic, DDS_Publisher, DDS_DataWriter, DDS_Subscriber and
```

```c
* DDS_DataReader)
*/
/*
 * DDS_ReturnCode_t
 * DDS_Entity_set_qos
 * (DDS_Entity _this,
 * const DDS_EntityQos *qos);
 */
/*
 * DDS_ReturnCode_t
 * DDS_Entity_get_qos
 * (DDS_Entity _this,
 * DDS_EntityQos *qos);
 */
/*
 * DDS_ReturnCode_t
 * DDS_Entity_set_listener
 * (DDS_Entity _this,
 * const struct DDS_EntityListener *a_listener,
 * const DDS_StatusMask mask);
 */
/*
 * struct DDS_EntityListener
 * DDS_Entity_get_listener
 * (DDS_Entity _this);
 */
/*
 * implemented API operations
 */
DDS_ReturnCode_t
DDS_Entity_enable
(DDS_Entity _this);
DDS_StatusCondition
DDS_Entity_get_statuscondition
(DDS_Entity _this);
DDS_StatusMask
DDS_Entity_get_status_changes
(DDS_Entity _this);
DDS_InstanceHandle_t
DDS_Entity_get_instance_handle
(DDS_Entity _this);
```

The abstract operations are listed but not fully described because they are not implemented in this specific class. The full description of these operations is given in the subclasses, which contain the type specific implementation of these operations.

# 3.1.1.1 DDS\_Entity\_enable

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
DDS_ReturnCode_t
DDS_Entity_enable
(DDS_Entity _this);
```

# Description

This operation enables the DDS\_Entity on which it is being called when the DDS\_Entity was created with the DDS\_EntityFactoryQosPolicy set to FALSE.

# Parameters

in DDS\_Entity \_this - the DDS\_Entity object on which the operation is operated.

# Return Value

```txt
DDS_ReturnCode_t - Possible return codes of the operation are: DDS_RETCODE_OK, DDS_RETCODE_ERROR, DDS_RETCODE_ILLEGAL_OPERATION, DDS_RETCODE_ALREADY_DELETED, DDS_RETCODE_OUT_OF_RESOURCES or DDS_RETCODE_PRECONDITION_NOT_MET.
```

# Detailed Description

This operation enables the DDS\_Entity. Created DDS\_Entity objects can start in either an enabled or disabled state. This is controlled by the value of the DDS\_EntityFactoryQosPolicy on the corresponding factory for the DDS\_Entity. Enabled entities are immediately activated at creation time meaning all their immutable QoS settings can no longer be changed. Disabled Entities are not yet activated, so it is still possible to change their immutable QoS settings. However, once activated the immutable QoS settings can no longer be changed.

Creating disabled entities can make sense when the creator of the DDS\_Entity does not yet know which QoS settings to apply, thus allowing another piece of code to set the QoS later on.

The default setting of DDS\_EntityFactoryQosPolicy is such that, by default, entities are created in an enabled state so that it is not necessary to explicitly call DDS\_&lt;Entity&gt;\_enable on newly-created entities.

The DDS\_&lt;Entity&gt;\_enable operation produces the same results no matter how many times it is performed. Calling DDS\_&lt;Entity&gt;\_enable on an already enabled DDS\_Entity returns DDS\_RETCODE\_OK and has no effect.

If a DDS\_Entity has not yet been enabled, the only operations that can be invoked on it are: the ones to set, get or copy the QosPolicy settings (including the default QosPolicy settings on factories), the ones that set (or get) the listener, the ones that get the DDS\_StatusCondition, the DDS\_Entity\_get\_status\_changes operation (although the status of a disabled entity never changes), and the ‘factory’ operations that create, delete or lookup1 other DDS\_Entities. Other operations will return the error DDS\_RETCODE\_NOT\_ENABLED.

Entities created from a factory that is disabled, are created disabled regardless of the setting of the DDS\_EntityFactoryQosPolicy.

Calling DDS\_&lt;Entity&gt;\_enable on an DDS\_Entity whose factory is not enabled will fail and return DDS\_RETCODE\_PRECONDITION\_NOT\_MET.

If the DDS\_EntityFactoryQosPolicy has autoenable\_created\_entities set to TRUE, the DDS\_&lt;Entity&gt;\_enable operation on the factory will automatically enable all Entities created from the factory.

The Listeners associated with an DDS\_Entity are not called until the DDS\_Entity is enabled. DDS\_Conditions associated with an DDS\_Entity that is not enabled are "inactive", that is, have a trigger\_value which is FALSE.

# Return Code

When the operation returns:

• DDS\_RETCODE\_OK - the application enabled the DDS\_Entity (or it was already enabled)
• DDS\_RETCODE\_ERROR - an internal error has occurred
• DDS\_RETCODE\_ILLEGAL\_OPERATION - the operation is invoked on an inappropriate object
• DDS\_RETCODE\_OUT\_OF\_RESOURCES - the Data Distribution Service ran out of resources to complete this operation
• DDS\_RETCODE\_PRECONDITION\_NOT\_MET - the factory of the DDS\_Entity is not enabled

# 3.1.1.2 DDS\_Entity\_get\_instance\_handle

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
DDS_InstanceHandle_t
DDS_Entity_get_instance_handle
(DDS_Entity _this);
```

# Description

This operation returns the instance\_handle of the built-in topic sample that represents the specified DDS\_Entity.

# Parameters

in DDS\_Entity \_this - object on which the operation is operated.

# Return Value

DDS\_InstanceHandle\_t - Result value is the instance\_handle of the built-in topic sample that represents the state of this DDS\_Entity.

# Detailed Description

The relevant state of some DDS\_Entity objects are distributed using built-in topics. Each built-in topic sample represents the state of a specific DDS\_Entity and has a unique instance\_handle. This operation returns the instance\_handle of the built-in topic sample that represents the specified DDS\_Entity.

Some DDS\_Entities (DDS\_Publisher and DDS\_Subscriber) do not have a corresponding built-in topic sample, but they still have an instance\_handle that uniquely identifies the DDS\_Entity.

The instance\_handles obtained this way can also be used to check whether a specific DDS\_Entity is located in a specific DDS\_DomainParticipant. (See Section 3.2.1.2, DDS\_DomainParticipant\_contains\_entity, on page 167.)

# 3.1.1.3 DDS\_Entity\_get\_listener (abstract)

This abstract operation is defined as a generic operation to access a Listener. Each subclass derived from this class, DDS\_DomainParticipant, DDS\_Topic, DDS\_Publisher, DDS\_Subscriber, DDS\_DataWriter and DDS\_DataReader will provide a class specific implementation of this abstract operation.

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
struct DDS_EntityListener
DDS_Entity_get_listener
(DDS_Entity _this);
```

# 3.1.1.4 DDS\_Entity\_get\_qos (abstract)

This abstract operation is defined as a generic operation to access a struct with the Q o s P o l i c y s e t t i n g s . E a c h s u b c l a s s d e r i v e d f r o m t h i s c l a s s , DDS\_DomainParticipant, DDS\_Topic, DDS\_Publisher, DDS\_Subscriber, DDS\_DataWriter and DDS\_DataReader will provide a class specific implementation of this abstract operation.

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
DDS_ReturnCode_t
DDS_Entity_get_qos
(DDS_Entity _this,
DDS_EntityQos *qos);
```

# 3.1.1.5 DDS\_Entity\_get\_status\_changes

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
DDS_StatusMask
DDS_Entity_get_status_changes
(DDS_Entity _this);
```

# Description

This operation returns a mask with the communication statuses in the DDS\_Entity that are “triggered”.

# Parameters

in DDS\_Entity \_this - object on which the operation is operated.

# Return Value

DDS\_StatusMask - Result is a bit-mask in which each bit shows which value has changed.

# Detailed Description

This operation returns a mask with the communication statuses in the DDS\_Entity that are “triggered”. That is the set of communication statuses whose value have changed since the last time the application called this operation. This operation shows whether a change has occurred even when the status seems unchanged because the status changed back to the original status.

When the DDS\_Entity is first created or if the DDS\_Entity is not enabled, all communication statuses are in the “un-triggered” state so the mask returned by the operation is empty.

The result value is a bit-mask in which each bit shows which value has changed. The relevant bits represent one of the following statuses:

• DDS\_INCONSISTENT\_TOPIC\_STATUS
• DDS\_OFFERED\_DEADLINE\_MISSED\_STATUS
• DDS\_REQUESTED\_DEADLINE\_MISSED\_STATUS
• DDS\_OFFERED\_INCOMPATIBLE\_QOS\_STATUS

```c
- DDS_REQUESTED_INCOMPATIBLE_QOS_STATUS
- DDS_SAMPLE_LOST_STATUS
- DDS_SAMPLE_REJECTED_STATUS
- DDS_DATA_ON_READERS_STATUS
- DDS_DATA_AVAILABLE_STATUS
- DDS_LIVELINESS_LOST_STATUS
- DDS_LIVELINESS_CHANGED_STATUS
- DDS_PUBLICATION_MATCHED_STATUS
- DDS_SUBSCRIPTION_MATCHED_STATUS
```

Each status bit is declared as a constant and can be used in an AND operation to check the status bit against the result of type DDS\_StatusMask. Not all statuses are relevant to all DDS\_Entity objects. See the respective Listener interfaces for each DDS\_Entity for more information.

# 3.1.1.6 DDS\_Entity\_get\_statuscondition

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
DDS_StatusCondition
DDS_Entity_get_statuscondition
(DDS_Entity _this);
```

# Description

This operation allows access to the DDS\_StatusCondition associated with the DDS\_Entity.

# Parameters

in DDS\_Entity \_this - object on which the operation is operated.

# Return Value

DDS\_StatusCondition - Result value is the DDS\_StatusCondition of the DDS\_Entity.

# Detailed Description

Each DDS\_Entity has a DDS\_StatusCondition associated with it. This operation allows access to the DDS\_StatusCondition associated with the DDS\_Entity. The returned condition can then be added to a DDS\_WaitSet so that the application can wait for specific status changes that affect the DDS\_Entity.

# 3.1.1.7 DDS\_Entity\_set\_listener (abstract)

This abstract operation is defined as a generic operation to access a Listener. Each subclass derived from this class, DDS\_DomainParticipant, DDS\_Topic, DDS\_Publisher, DDS\_Subscriber, DDS\_DataWriter and DDS\_DataReader will provide a class specific implementation of this abstract operation.

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
DDS_ReturnCode_t
DDS_Entity_set_listener
(DDS_Entity _this,
const struct DDS_Listener *a_listener,
const DDS_StatusMask mask);
```

# 3.1.1.8 DDS\_Entity\_set\_qos (abstract)

This abstract operation is defined as a generic operation to modify a struct with the Q o s P o l i c y s e t t i n g s . E a c h s u b c l a s s d e r i v e d f r o m t h i s c l a s s , DDS\_DomainParticipant, DDS\_Topic, DDS\_Publisher, DDS\_Subscriber, DDS\_DataWriter and DDS\_DataReader will provide a class specific implementation of this abstract operation.

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
DDS_ReturnCode_t
DDS_Entity_set_qos
(DDS_Entity_this,
const DDS_EntityQos *qos);
```

# 3.1.2 Class DDS\_DomainEntity (abstract)

T h i s c l a s s i s t h e a b s t r a c t b a s e c l a s s f o r t h e a l l e n t i t i e s e x c e p t D D S\_ D o m a i n Pa r t i c i pa n t . T h e m a i n p u r p o s e i s t o e x p r e s s t h a t DDS\_DomainParticipant is a special kind of DDS\_Entity, which acts as a container of all other DDS\_Entity objects, but cannot contain another DDS\_DomainParticipant within itself. Therefore, this class is not part of the IDL interface in the DCPS PSM description.

The class DDS\_DomainEntity does not contain any operations.

# 3.1.3 Struct QosPolicy

Each DDS\_Entity provides a &lt;DDS\_Entity&gt;Qos structure that implements the basic mechanism for an application to specify Quality of Service attributes. This structure consists of DDS\_Entity specific QosPolicy attributes. QosPolicy attributes are structured types where each type specifies the information that controls an DDS\_Entity related (configurable) property of the Data Distribution Service.

All QosPolicies applicable to a DDS\_Entity are aggregated in a corresponding &lt;DDS\_Entity&gt;Qos, which is a compound structure that is set atomically so that it represents a coherent set of QosPolicy attributes.

Compound types are used whenever multiple attributes must be set coherently to define a consistent attribute for a QosPolicy.

See Appendix A, Quality Of Service for details of the &lt;DDS\_Entity&gt;Qos, along with a complete list of individual QosPolicy settings and their meanings.

![**Labeled Blocks and Attributes:**\n\n*   **QosPolicy**: name : string\n*   **HistoryQosPolicy**: kind : HistoryQosPolicyKind, depth : long\n*   **LifespanQosPolicy**: duration : Duration_t\n*   **OwnershipQosPolicy**: kind : OwnershipQosPolicyKind\n*   **OwnershipStrengthQosPolicy**: value : long\n*   **WriterDataLifecycleQosPolicy**: autodispose_unregistered_instances : boolean\n*   **ReaderDataLifecycleQosPolicy**: autopurge_nowriter_samples_delay : Duration_t, autopurge_disposed_samples_delay : Duration_t, autopurge_dispose_all : boolean, enable_invalid_samples : boolean, invalid_sample_visibility : InvalidSampleVisibilityQosPolicy\n*   **PresentationQosPolicy**: access_scope : PresentationQosPolicyAccessScopeKind, coherent_access : boolean, ordered_access : boolean\n*   **UserDataQosPolicy**: value (*) : octet\n*   **TopicDataQosPolicy**: value (*) : octet\n*   **GroupDataQosPolicy**: value (*) : octet\n*   **LatencyBudgetQosPolicy**: duration : Duration_t\n*   **DeadlineQosPolicy**: duration : Duration_t\n*   **TimeBasedFilterQosPolicy**: minimum_separation : Duration_t\n*   **EntityFactoryQosPolicy**: autoenable_created_entities : boolean\n*   **PartitionQosPolicy**: name(*) : string\n*   **ReliabilityQosPolicy**: kind : ReliabilityQosPolicyKind, max_blocking_time : Duration_t, synchronous : boolean\n*   **LivelinessQosPolicy**: kind : LivelinessQosPolicyKind, lease_duration : Duration_t\n*   **DurabilityQosPolicy**: kind : DurabilityQosPolicyKind\n*   **ResourceLimitsQosPolicy**: max_samples : long, max_instances : long, max_samples_per_instance : long\n*   **DestinationOrderQosPolicy**: kind : DestinationOrderQosPolicyKind\n*   **TransportPriorityQosPolicy**: value : long\n*   **DurabilityServiceQosPolicy**: service_cleanup_delay : Duration_t, history_kind : HistoryQosPolicyKind, history_depth : long, max_samples : long, max_instances : long, max_samples_per_instance : long\n\n**Connections:**\n\n*   **QosPolicy** has arrows pointing left and right, initiating the diagram's branches.\n*   **Left Column**: Arrows point left from a main horizontal line to HistoryQosPolicy, LifespanQosPolicy, OwnershipQosPolicy, WriterDataLifecycleQosPolicy, ReaderDataLifecycleQosPolicy, and PresentationQosPolicy.\n*   **Ownership Inheritance (Left Column)**: An upward arrow connects OwnershipStrengthQosPolicy to OwnershipQosPolicy.\n*   **Latency/Deadline Relationship**: A downward arrow connects LatencyBudgetQosPolicy to DeadlineQosPolicy.\n*   **Time Based Filter Relationship**: An upward arrow connects TimeBasedFilterQosPolicy to DeadlineQosPolicy.\n*   **Right-Side Connections**: Horizontal lines connect UserDataQosPolicy, TopicDataQosPolicy, GroupDataQosPolicy, and EntityFactoryQosPolicy to a vertical line on the far right.\n*   **Right Column Connections**: Horizontal lines connect PartitionQosPolicy, ReliabilityQosPolicy, LivelinessQosPolicy, DurabilityQosPolicy, ResourceLimitsQosPolicy, DestinationOrderQosPolicy, TransportPriorityQosPolicy, and DurabilityServiceQosPolicy to the same vertical line on the far right.](.vortex-opensplice-c-reference-guide/70f95dbd7ea48fdb6667e3ad90c41f7ff605b232a9de160c1fb29c52a83f4856.jpg)

Figure 10: QosPolicy Settings

# Requested/Offered

In several cases, for communications to occur properly (or efficiently), a QosPolicy on the requesting side must be compatible with a corresponding QosPolicy on the offering side. For example, if a DDS\_DataReader requests to receive data reliably while the corresponding DDS\_DataWriter defines a best-effort QosPolicy, communication will not happen as requested. This means that the specification for QosPolicy follows the requested/offered (RxO) pattern while trying to maintain the desirable decoupling of publication and subscription as much as possible. In this pattern:

• the requesting side can specify a “requested” attribute for a particular QosPolicy
• the offering side specifies an “offered” attribute for that QosPolicy.

The Data Distribution Service will then determine whether the attribute requested by the requesting side is compatible with what is offered by the offering side. Only when the two QosPolicy settings are compatible, communication is established. If the two QosPolicy settings are not compatible, the Data Distribution Service will not establish communication between the two DDS\_Entity objects and notify this fact by means of the DDS\_OFFERED\_INCOMPATIBLE\_QOS status on the offering side and the DDS\_REQUESTED\_INCOMPATIBLE\_QOS status on the requesting side. The application can detect this fact by means of a Listener or DDS\_Condition.

The interface description of these QosPolicys are as follows:

```c
/*
 * struct DDS_&lt;DDS_Entity&gt;Qos
 *    see appendix
 */
/*
 * struct DDS_&lt;name&gt;QosPolicy
 */
struct DDS_UserDataQosPolicy
    { DDS_sequence_octet value; };
struct DDS_TopicDataQosPolicy
    { DDS_sequence_octet value; };
struct DDS_GroupDataQosPolicy
    { DDS_sequence_octet value; };
struct DDS_TransportPriorityQosPolicy
    { DDS_long value; };
struct DDS_LifespanQosPolicy
    { DDS_Duration_t duration; };
enum DDS_DurabilityQosPolicyKind
    { DDS_VOLATILE_DURABILITY_QOS,
    DDS_TRANSIENT_LOCAL_DURABILITY_QOS,
    DDS_TRANSIENT_DURABILITY_QOS,
    DDS_PERSISTENT_DURABILITY_QOS };
struct DDS_DurabilityQosPolicy
    { DDS_DurabilityQosPolicyKind kind; };
enum DDS_PresentationQosPolicyAccessScopeKind
    { DDS_INSTANCE_PRESENTATION_QOS,
    DDS_TOPIC_PRESENTATION_QOS,
    DDS_GROUP_PRESENTATION_QOS };
struct DDS_PresentationQosPolicy
    { DDS_PresentationQosPolicyAccessScopeKind access_scope;
```

```c
DDS_boolean coherent_access;
DDS_boolean ordered_access; };
struct DDS_DeadlineQosPolicy
{ DDS_Duration_t period; };
struct DDS_LatencyBudgetQosPolicy
{ DDS_Duration_t duration; };
enum DDS_OwnershipQosPolicyKind
{ DDS_SHARED_OWNERSHIP_QOS,
DDS_EXCLUSIVE_OWNERSHIP_QOS };
struct DDS_OwnershipQosPolicy
{ DDS_OwnershipQosPolicyKind kind; };
struct DDS_OwnershipStrengthQosPolicy
{ DDS_long value; };
enum DDS_LivelinessQosPolicyKind
{ DDS_AUTOMATIC_LIVELINESS_QOS,
DDS_MANUAL_BY_PARTICIPANT_LIVELINESS_QOS,
DDS_MANUAL_BY_TOPIC_LIVELINESS_QOS };
struct DDS_LivelinessQosPolicy
{ DDS_LivelinessQosPolicyKind kind;
DDS_Duration_t lease_duration; };
struct DDS_TimeBasedFilterQosPolicy
{ DDS_Duration_t minimum_separation; };
struct DDS_PartitionQosPolicy
{ DDS_StringSeq name; };
enum DDS_ReliabilityQosPolicyKind
{ DDS_BEST_EFFORT_RELIABILITY_QOS,
DDS_RELIABLE_RELIABILITY_QOS };
struct DDS_ReliabilityQosPolicy
{ DDS_ReliabilityQosPolicyKind kind;
DDS_Duration_t max_blocking_time;
DDS_boolean synchronous; };
enum DDS_DestinationOrderQosPolicyKind
{ DDS_BY_RECEPTION_TIMESTAMP_DESTINATIONORDER_QOS,
DDS_BY_SOURCE_TIMESTAMP_DESTINATIONORDER_QOS };
struct DDS_DestinationOrderQosPolicy
{ DDS_DestinationOrderQosPolicyKind kind; };
enum DDS_HistoryQosPolicyKind
{ DDS_KEEP_LAST_HISTORY_QOS,
DDS_KEEP_ALL_HISTORY_QOS };
struct DDS_HistoryQosPolicy
{ DDS_HistoryQosPolicyKind kind;
DDS_long depth; };
struct DDS_ResourceLimitsQosPolicy
{ DDS_long max_samples;
DDS_long max_instances;
DDS_long max_samples_per_instance; };
struct DDS_EntityFactoryQosPolicy
{ DDS_boolean autoenable_created_entities; };
struct DDS_WriteDataLifecycleQosPolicy
{ DDS_boolean autodispose_unregistered_instances; };
```

```c
enum DDS_InvalidSampleVisibilityQosPolicyKind
{ DDS_NO_INVALID_SAMPLES,
DDS_MINIMUM_INVALID_SAMPLES,
DDS_ALL_INVALID_SAMPLES };
struct DDS_InvalidSampleVisibilityQosPolicy
{ DDS_InvalidSampleVisibilityQosPolicyKind kind; };
struct DDS_ReaderDataLifecycleQosPolicy
{ DDS_Duration_t autopurge_nowriter_samples_delay;
DDS_Duration_t autopurge_disposed_samples_delay;
DDS_boolean autopurge_dispose_all;
DDS_boolean enable_invalid_samples; /* deprecated */
DDS_InvalidSampleVisibilityQosPolicy
invalid_sample_visibility; };
struct DurabilityServiceQosPolicy
{ DDS_Duration_t service_cleanup_delay;
DDS_HistoryQosPolicyKind history_kind;
DDS_long history_depth;
DDS_long max_samples;
DDS_long max_instances;
DDS_long max_samples_per_instance; };
enum DDS_SchedulingClassQosPolicyKind
{ DDS_SCHEDULE_DEFAULT,
DDS_SCHEDULE_TIMESHARING,
DDS_SCHEDULE_REALTIME };
struct DDS_SchedulingClassQosPolicy
{ DDS_SchedulingClassQosPolicyKind kind; };
enum DDS_SchedulingPriorityQosPolicyKind
{ DDS_PRIORITY_RELATIVE,
DDS_PRIORITY_ABSOLUTE };
struct DDS_SchedulingPriorityQosPolicy
{ DDS_SchedulingPriorityQosPolicyKind kind; };
struct DDS_SchedulingQosPolicy
{ DDS_SchedulingClassQosPolicy scheduling_class;
DDS_SchedulingPriorityQosPolicy scheduling_priority_kind;
DDS_long scheduling_priority; };
struct DDS_SubscriptionKeyQosPolicy
{ DDS_boolean use_key_list,
DDS_StringSeq key_list };
struct DDS_ReaderLifespanQosPolicy
{ DDS_boolean use_lifespan,
DDS_Duration_t duration };
struct DDS_ShareQosPolicy
{ DDS_string name,
DDS_boolean enable };
struct DDS_ViewKeyQosPolicy
{ DDS_boolean use_key_list;
DDS_StringSeq key_list };
/*
* implemented API operations
* &lt;no operations&gt;
```

\*/

# Default attributes

The default attributes of each QosPolicy are listed in Table 5: below.

Table 5: QosPolicy Default Attributes

<table><tr><td>QosPolicy</td><td>Attribute</td><td>Value</td></tr><tr><td>user_data</td><td>value.length</td><td>0</td></tr><tr><td>topic_data</td><td>value.length</td><td>0</td></tr><tr><td>group_data</td><td>value.length</td><td>0</td></tr><tr><td>transport_priority</td><td>value</td><td>0</td></tr><tr><td>lifespan</td><td>duration</td><td>DDS_DURATION_INFINITE</td></tr><tr><td>durability</td><td>kind</td><td>DDS_VOLATILE_DURABILITY_QOS</td></tr><tr><td rowspan="3">presentation</td><td>access_scope</td><td>DDS_INSTANCE_PRESENTATION_QOS</td></tr><tr><td>coherent_access</td><td>FALSE</td></tr><tr><td>ordered_access</td><td>FALSE</td></tr><tr><td>deadline</td><td>period</td><td>DDS_DURATION_INFINITE</td></tr><tr><td>latency_budget</td><td>duration</td><td>0</td></tr><tr><td>ownership_strength</td><td>value</td><td>0</td></tr><tr><td>ownership</td><td>kind</td><td>DDS_SHARED_OWNERSHIP_QOS</td></tr><tr><td rowspan="2">liveliness</td><td>kind</td><td>DDS_AUTOMATIC_LIVELINESS_QOS</td></tr><tr><td>lease_duration</td><td>DDS_DURATION_INFINITE</td></tr><tr><td>time_based_filter</td><td>minimum_separation</td><td>0</td></tr><tr><td>partition</td><td>name.length</td><td>0</td></tr><tr><td rowspan="3">reliability</td><td>kind</td><td>DDS_BEST_EFFORT_RELIABILITY_QOS</td></tr><tr><td>max_blocking_time</td><td>100 ms</td></tr><tr><td>synchronous</td><td>FALSE</td></tr><tr><td>destination_order</td><td>kind</td><td>DDS_BY_RECEPTION_TIMESTAMP_DESTINATIONORDER_QOS</td></tr><tr><td rowspan="2">history</td><td>kind</td><td>DDS_KEEP_LAST_HISTORY_QOS</td></tr><tr><td>depth</td><td>1</td></tr><tr><td rowspan="3">resource_limits</td><td>max_samples</td><td>DDS_LENGTH_UNLIMITED</td></tr><tr><td>max_instances</td><td>DDS_LENGTH_UNLIMITED</td></tr><tr><td>max_samples_per_instance</td><td>DDS_LENGTH_UNLIMITED</td></tr><tr><td>entity_factory</td><td>autoenable_created_entities</td><td>TRUE</td></tr><tr><td>writer_data_lifecycle</td><td>autodispose_unregistered_instances</td><td>TRUE</td></tr><tr><td rowspan="5">reader_data_lifecycle</td><td>autopurge_nowriter_samples_delay</td><td>DDS_DURATION_INFINITE</td></tr><tr><td>autopurge_disposed_samples_delay</td><td>DDS_DURATION_INFINITE</td></tr><tr><td>autopurge_dispose_all</td><td>FALSE</td></tr><tr><td>enable_invalid_samples</td><td>TRUE</td></tr><tr><td>invalid_sample_visibilityy.kind</td><td>DDS_MINIMUM_INVALID_SAMPLES</td></tr><tr><td rowspan="6">durability_service</td><td>history_kind</td><td>KEEP_LAST</td></tr><tr><td>history_depth</td><td>1</td></tr><tr><td>max_samples</td><td>LENGTH_UNLIMITED</td></tr><tr><td>max_instances</td><td>LENGTH_UNLIMITED</td></tr><tr><td>max_samples_per_instance</td><td>LENGTH_UNLIMITED</td></tr><tr><td>service_cleanup_delay</td><td>0</td></tr><tr><td rowspan="3">watchdog_scheduling, listener_scheduling</td><td>scheduling_class.kind</td><td>DDS_SCHEDULE_DEFAULT</td></tr><tr><td>scheduling_priority_kind.kind</td><td>DDS_PRIORITY_RELATIVE</td></tr><tr><td>scheduling_priority</td><td>0</td></tr><tr><td rowspan="2">subscription_keys</td><td>use_key_list</td><td>FALSE</td></tr><tr><td>key_list.length</td><td>0</td></tr><tr><td rowspan="2">reader_lifespan</td><td>use_lifespan</td><td>FALSE</td></tr><tr><td>duration</td><td>DDS_DURATION_INFINITE</td></tr><tr><td rowspan="2">share</td><td>name</td><td>""</td></tr><tr><td>enable</td><td>FALSE</td></tr><tr><td rowspan="2">view_keys</td><td>use_key_list</td><td>FALSE</td></tr><tr><td>key_list.length</td><td>0</td></tr></table>

# RxO

The QosPolicy settings that need to be set in a compatible manner between the publisher and subscriber ends are indicated by the setting of the “RxO” (Requested/Offered) property. The “RxO” property of each QosPolicy is listed in Table 6: on page 67

• A $\mathrm { { ^ { \circ } R x O ^ { \circ } } }$ setting of “Yes” indicates that the QosPolicy can be set at both ends (publishing and subscribing) and the attributes must be set in a compatible manner. In this case the compatible attributes are explicitly defined

• A “RxO” setting of “No” indicates that the QosPolicy can be set at both ends (publishing and subscribing) but the two settings are independent. That is, all combinations of attributes are compatible
• A “RxO” setting of “Not applicable” indicates that the QosPolicy can only be specified at either the publishing or the subscribing end, but not at both ends. So compatibility does not apply.

# Changeable

The “changeable” property determines whether the QosPolicy can be changed after the DDS\_Entity is enabled. In other words, a QosPolicy with “changeable” setting of “No” is considered “immutable” and can only be specified either at DDS\_Entity creation time or prior to calling the DDS\_Entity\_enable operation on the DDS\_Entity.

When the application tries to change a QosPolicy with “changeable” setting of “ N o ” , t h e D a t a D i s t r i b u t i o n S e r v i c e w i l l n o t i f y t h i s b y r e t u r n i n g a DDS\_RETCODE\_IMMUTABLE\_POLICY.

The basic way to modify or set the &lt;DDS\_Entity&gt;Qos is by using a DDS\_&lt;Entity&gt;\_get\_qos and DDS\_&lt;Entity&gt;\_set\_qos operation to get all QosPolicy settings from this DDS\_Entity (that is the &lt;DDS\_Entity&gt;Qos), modify several specific QosPolicy settings and put them back using an user operation to set all QosPolicy settings on this DDS\_Entity (that is the &lt;DDS\_Entity&gt;Qos). An example of these operations for the DDS\_DataWriter are DDS\_DataWriter\_get\_qos and DDS\_DataWriter\_set\_qos, which take the DataWriterQos as a parameter.

The “RxO” setting and the “changeable” setting of each QosPolicy are listed in Table 6: below:

Table 6: QosPolicy Basics

<table><tr><td>QosPolicy</td><td>Concerns DDS_Entity</td><td>RxO</td><td>Changeable After Enabling</td></tr><tr><td>user_data</td><td>DDS_DomainParticipantDDS_DataReaderDDS_DataWriter</td><td>No</td><td>Yes</td></tr><tr><td>topic_data</td><td>DDS_Topic</td><td>No</td><td>Yes</td></tr><tr><td>group_data</td><td>DDS_PublisherDDS_Subscriber</td><td>No</td><td>Yes</td></tr><tr><td>transport_priority</td><td>DDS_TopicDDS_DataWriter</td><td>Not applicable</td><td>Yes</td></tr><tr><td>lifespan</td><td>DDS_TopicDDS_DataWriter</td><td>Not applicable</td><td>Yes</td></tr><tr><td>durability</td><td>DDS_TopicDDS_DataReaderDDS_DataWriter</td><td>Yes</td><td>No</td></tr><tr><td>presentation</td><td>DDS_PublisherDDS_Subscriber</td><td>Yes</td><td>No</td></tr><tr><td>deadline</td><td>DDS_TopicDDS_DataReaderDDS_DataWriter</td><td>Yes</td><td>Yes</td></tr><tr><td>latency_budget</td><td>DDS_TopicDDS_DataReaderDDS_DataWriter</td><td>Yes</td><td>Yes</td></tr><tr><td>ownership</td><td>DDS_TopicDDS_DataReaderDDS_DataWriter</td><td>Yes</td><td>No</td></tr><tr><td>ownership_strength</td><td>DDS_DataWriter</td><td>Not applicable</td><td>Yes</td></tr><tr><td>liveliness</td><td>DDS_TopicDDS_DataReaderDDS_DataWriter</td><td>Yes</td><td>No</td></tr><tr><td>time_based_filter</td><td>DDS_DataReader</td><td>Not applicable</td><td>Yes</td></tr><tr><td>partition</td><td>DDS_PublisherDDS_Subscriber</td><td>No</td><td>Yes</td></tr><tr><td>reliability</td><td>DDS_TopicDDS_DataReaderDDS_DataWriter</td><td>Yes</td><td>No</td></tr><tr><td>destination_order</td><td>DDS_TopicDDS_DataReaderDDS_DataWriter</td><td>Yes</td><td>No</td></tr><tr><td>history</td><td>DDS_TopicDDS_DataReaderDDS_DataWriter</td><td>No</td><td>No</td></tr><tr><td>resource_limits</td><td>DDS_TopicDDS_DataReaderDDS_DataWriter</td><td>No</td><td>No</td></tr><tr><td>entity_factory</td><td>DDS_DomainParticipantFactoryDDS_DomainParticipantDDS_PublisherDDS_Subscriber</td><td>No</td><td>Yes</td></tr><tr><td>writer_data_lifecycle</td><td>DDS_DataWriter</td><td>Not applicable</td><td>Yes</td></tr><tr><td>reader_data_lifecycle</td><td>DDS_DataReader</td><td>Not applicable</td><td>Yes</td></tr><tr><td>durability_service</td><td>DDS_Topic</td><td>No</td><td>No</td></tr><tr><td>scheduling</td><td>DDS_DomainParticipant</td><td>Not applicable</td><td>No</td></tr><tr><td>subscription_keys</td><td>DDS_DataReader</td><td>Not applicable</td><td>No</td></tr><tr><td>reader_lifespan</td><td>DDS_DataReader</td><td>Not applicable</td><td>Yes</td></tr><tr><td>share</td><td>DDS_DataReaderDDS_Subscriber</td><td>Not applicable</td><td>NoNo</td></tr><tr><td>view_keys</td><td>DDS_DataReaderView</td><td>Not applicable</td><td>No</td></tr></table>

The next paragraphs describe the usage of each QosPolicy struct.

# 3.1.3.1 DDS\_DeadlineQosPolicy

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
struct DDS_DeadlineQosPolicy
{ DDS_Duration_t period; };
```

# Description

This QosPolicy defines the period within which a new sample is expected by the DataReader or to be written by the DataWriter.

# Attributes

DDS\_Duration\_t period - specifies the period within which a new sample is expected or to be written.

# Detailed Description

This QosPolicy will set the period within which a DDS\_DataReader expects a new sample or, in case of a DDS\_DataWriter, the period in which it expects applications to write the sample. The default value of the period is DDS\_DURATION\_INFINITE, indicating that there is no deadline. The QosPolicy may be used to monitor the real-time behaviour, a DDS\_Listener or a DDS\_StatusCondition may be used to catch the event that is generated when a deadline is missed.

DDS\_DeadlineQosPolicy is instance oriented (i.e. the period is monitored for each individual instance).

The exact consequences of a missed deadline depend on the DDS\_Entity in which it occured, and the DDS\_OwnershipQosPolicy value of that DDS\_Entity:

• In case a DDS\_DataWriter misses an instance deadline (regardless of its DDS\_OwnershipQosPolicy setting), an offered\_deadline\_missed\_status is raised, which can be detected by either a DDS\_Listener or a DDS\_StatusCondition. There are no further consequences.
• In case a DDS\_DataReader misses an instance deadline, a requested\_deadline\_missed\_status is raised, which can be detected by either a DDS\_Listener or a DDS\_StatusCondition. In case the DDS\_OwnershipQosPolicy is set to SHARED, there are no further consequences. In case the DDS\_OwnershipQosPolicy is set to EXCLUSIVE, the ownership of that instance on that particular DDS\_DataReader is transferred to the next available highest strength DDS\_DataWriter, but this will have no impact on the instance\_state whatsoever. So even when a deadline is missed for an instance that has no other (lower-strength) DDS\_DataWriters to transfer ownership to, the instance\_state remains unchanged. See also Section 3.1.3.11, DDS\_OwnershipQosPolicy.

This QosPolicy is applicable to a DDS\_DataReader, a DDS\_DataWriter and a DDS\_Topic. After enabling of the concerning DDS\_Entity, this QosPolicy may be changed by using the DDS\_&lt;DDS\_Entity&gt;\_set\_qos operation.

# Requested/Offered

In case the Requested/Offered QosPolicy are incompatible, the notification DDS\_OFFERED\_INCOMPATIBLE\_QOS status on the offering side and DDS\_REQUESTED\_INCOMPATIBLE\_QOS status on the requesting side is raised.

Table 7: DDS\_DeadlineQosPolicy

<table><tr><td>Period</td><td>Compatibility</td></tr><tr><td>offered period &lt; requested period</td><td>compatible</td></tr><tr><td>offered period = requested period</td><td>compatible</td></tr><tr><td>offered period &gt; requested period</td><td>INcompatible</td></tr></table>

Whether communication is established, is controlled by the Data Distribution Service, depending on the Requested/Offered QosPolicy of the DDS\_DataWriter and DDS\_DataReader. In other words, the communication between any DDS\_DataWriter and DDS\_DataReader depends on what is expected by the DDS\_DataReader. As a consequence, a DDS\_DataWriter that has an incompatible QoS with respect to what a DDS\_DataReader specifies is not allowed to send its data to that specific DDS\_DataReader. A DDS\_DataReader that has an incompatible QoS with respect to what a DDS\_DataWriter specifies does not get any data from that particular DDS\_DataWriter.

Changing an existing deadline period using the set\_qos operation on either the DDS\_DataWriter or DDS\_DataReader may have consequences for the connectivity between readers and writers, depending on their RxO values. (See also in Section 3.1.3, Struct QosPolicy, the paragraph entitled Requested/Offered.) Consider a writer with deadline period Pw and a reader with deadline period Pr, where Pw &lt;= Pr. In this case a connection between that reader and that writer is established. Now suppose Pw is changed so that Pw &gt; Pr, then the existing connection between reader and writer will be lost, and the reader will behave as if the writer unregistered all its instances, transferring the ownership of these instances when appropriate. See also Section 3.1.3.11, DDS\_OwnershipQosPolicy.

# DDS\_TopicQos

This QosPolicy can be set on a DDS\_Topic. The DDS\_DataWriter and/or D D S\_ D a t a R e ad e r ca n c opy t hi s qo s by u s i n g t h e o p e r a t i o n s DDS\_&lt;DDS\_Entity&gt;\_copy\_from\_topic\_qos a n d t h e n DDS\_&lt;DDS\_Entity&gt;\_set\_qos. That way the application can relatively easily ensure the QosPolicy for the DDS\_Topic, DDS\_DataReader and DDS\_DataWriter are consistent.

# 3.1.3.2 DDS\_DestinationOrderQosPolicy

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
enum DDS_DestinationOrderQosPolicyKind
{ DDS_BY_RECEPTION_TIMESTAMP_DESTINATIONORDER_QOS,
DDS_BY_SOURCE_TIMESTAMP_DESTINATIONORDER_QOS };
struct DDS_DestinationOrderQosPolicy
{ DDS_DestinationOrderQosPolicyKind kind; };
```

# Description

This QosPolicy controls the order in which the DDS\_DataReader stores the data.

# Attributes

DDS\_DestinationOrderQosPolicyKind kind - controls the order in which the DDS\_DataReader stores the data.

# Detailed Description

This QosPolicy controls the order in which the DDS\_DataReader stores the data. The order of storage is controlled by the timestamp. However a choice can be made to use the timestamp of the DDS\_DataReader (time of reception) or the timestamp of the DDS\_DataWriter (source timestamp).

This QosPolicy is applicable to a DDS\_DataWriter, DDS\_DataReader and a DDS\_Topic. After enabling of the concerning DDS\_Entity, this QosPolicy cannot be changed any more.

# Attribute

The QosPolicy is controlled by the attribute kind which may be:

• DDS\_BY\_RECEPTION\_TIMESTAMP\_DESTINATIONORDER\_QOS
• DDS\_BY\_SOURCE\_TIMESTAMP\_DESTINATIONORDER\_QOS

When set to DDS\_BY\_RECEPTION\_TIMESTAMP\_DESTINATIONORDER\_QOS, the order is based on the timestamp, at the moment the sample was received by the DDS\_DataReader.

When set to DDS\_BY\_SOURCE\_TIMESTAMP\_DESTINATIONORDER\_QOS, the order is based on the timestamp, which was set by the DDS\_DataWriter. This means that the system needs some time synchronisation.

# Requested/Offered

In case the Requested/Offered QosPolicy are incompatible, the notification DDS\_OFFERED\_INCOMPATIBLE\_QOS status on the offering side and DDS\_REQUESTED\_INCOMPATIBLE\_QOS status on the requesting side is raised.

Table 8: Requested/Offered DDS\_DestinationOrderQosPolicy

<table><tr><td>Requested Offered</td><td>BY_RECEPTION_TIMESTAMP</td><td>BY_SOURCE_TIMESTAMP</td></tr><tr><td>BY_RECEPTION_TIMESTAMP</td><td>compatible</td><td>INcompatible</td></tr><tr><td>BY_SOURCE_TIMESTAMP</td><td>compatible</td><td>compatible</td></tr></table>

Whether communication is established, is controlled by the Data Distribution Service, depending on the Requested/Offered QosPolicy of the DDS\_DataWriter and DDS\_DataReader. In other words, the communication between any DDS\_DataWriter and DDS\_DataReader depends on what is expected by the

DDS\_DataReader. As a consequence, a DDS\_DataWriter that has an incompatible QoS with respect to what a DDS\_DataReader specified, is not allowed to send its data to that specific DDS\_DataReader. A DDS\_DataReader that has an incompatible QoS with respect to what a DDS\_DataWriter specified, does not get any data from that particular DDS\_DataWriter.

# DDS\_TopicQos

This QosPolicy can be set on a DDS\_Topic. The DDS\_DataWriter and/or D D S\_ D a t a R e ad e r ca n c opy t hi s qo s by u s i n g t h e o p e r a t i o n s DDS\_&lt;DDS\_Entity&gt;\_copy\_from\_topic\_qos a n d t h e n DDS\_&lt;DDS\_Entity&gt;\_set\_qos. That way the application can relatively easily ensure the QosPolicy for the DDS\_Topic, DDS\_DataReader and DDS\_DataWriter are consistent.

# 3.1.3.3 DDS\_DurabilityQosPolicy

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
enum DDS_DurabilityQosPolicyKind
{ DDS_VOLATILE_DURABILITY_QOS,
DDS_TRANSIENT_LOCAL_DURABILITY_QOS,
DDS_TRANSIENT_DURABILITY_QOS,
DDS_PERSISTENT_DURABILITY_QOS };
struct DDS_DurabilityQosPolicy
{ DDS_DurabilityQosPolicyKind kind; };
```

# Description

This QosPolicy controls whether the data should be stored for late joining readers.

# Attributes

DDS\_DurabilityQosPolicyKind kind - specifies the type of durability from DDS\_VOLATILE\_DURABILITY\_QOS (short life) to DDS\_PERSISTENT\_DURABILITY\_QOS (long life).

# Detailed Description

The decoupling between DDS\_DataReader and DDS\_DataWriter offered by the Data Distribution Service allows an application to write data even if there are no current readers on the network. Moreover, a DDS\_DataReader that joins the network after some data has been written could potentially be interested in accessing the most current values of the data as well as some history. This QosPolicy controls whether the Data Distribution Service will actually make data available to late-joining DDS\_DataReaders.

This QosPolicy is applicable to a DDS\_DataReader, DDS\_DataWriter and DDS\_Topic. After enabling of the concerning DDS\_Entity, this QosPolicy cannot be changed any more.

# Attributes

The QosPolicy is controlled by the attribute kind which may be:

• DDS\_VOLATILE\_DURABILITY\_QOS - the samples are not available to late-joining DDS\_DataReaders. In other words, only DDS\_DataReaders, which were present at the time of the writing and have subscribed to this DDS\_Topic, will receive the sample. When a DDS\_DataReader subscribes afterwards (late-joining), it will only be able to read the next written sample. This setting is typically used for data, which is updated quickly;
• DDS\_TRANSIENT\_LOCAL\_DURABILITY\_QOS - currently behaves identically to the TRANSIENT\_DURABILITY\_QOS, except for its RxO properties. The desired behaviour of TRANSIENT\_LOCAL\_DURABILITY\_QOS can be achieved from the TRANSIENT\_DURABILITY\_QOS with the default (TRUE) setting of the autodispose\_unregistered\_instances flag on the DataWriter and the service\_cleanup\_delay set to 0 on the durability service. This is because for TRANSIENT\_LOCAL, the data should only remain available for late-joining readers during the lifetime of its source writer, so it is not required to survive after its source writer has been deleted. Since the deletion of a writer implicitly unregisters all its instances, an autodispose\_unregistered\_instances value of TRUE will also dispose the affected data from the durability store, and thus prevent it from remaining available to late-joining readers.

• DDS\_TRANSIENT\_DURABILITY\_QOS - some samples are available to late-joining DDS\_DataReaders (stored in memory). This means that the late-joining DDS\_DataReaders are able to read these previously written samples. The DDS\_DataReader does not necessarily have to exist at the time of writing. Not all samples are stored (depending on QosPolicy History and QosPolicy resource\_limits). The storage does not depend on the DDS\_DataWriter and will outlive the DDS\_DataWriter. This may be used to implement reallocation of applications because the data is saved in the Data Distribution Service (not in the DDS\_DataWriter). This setting is typically used for state related information of an application. In this case also the DurabilityServiceQosPolicy settings are relevant for the behaviour of the Data Distribution Service;

• DDS\_PERSISTENT\_DURABILITY\_QOS - the data is stored in permanent storage (e.g. hard disk). This means that the samples are also available after a system restart. The samples not only outlives the DDS\_DataWriters, but even the Data Distribution Service and the system. This setting is typically used for attributes and settings for an application or the system. In this case also the DurabilityServiceQosPolicy settings are relevant for the behaviour of the Data Distribution Service.

# Requested/Offered

In case the Requested/Offered QosPolicy are incompatible, the notification DDS\_OFFERED\_INCOMPATIBLE\_QOS status on the offering side and DDS\_REQUESTED\_INCOMPATIBLE\_QOS status on the requesting side is raised.

Table 9: Requested/Offered DDS\_DurabilityQosPolicy

<table><tr><td>Offered\Requested</td><td>VOLATILE</td><td>TRANSIENT_LOCAL</td><td>TRANSIENT</td><td>PERSISTENT</td></tr><tr><td>VOLATILE</td><td>compatible</td><td>INcompatible</td><td>INcompatible</td><td>INcompatible</td></tr><tr><td>TRANSIENT_LOCAL</td><td>compatible</td><td>compatible</td><td>INcompatible</td><td>INcompatible</td></tr><tr><td>TRANSIENT</td><td>compatible</td><td>compatible</td><td>compatible</td><td>INcompatible</td></tr><tr><td>PERSISTENT</td><td>compatible</td><td>compatible</td><td>compatible</td><td>compatible</td></tr></table>

This means that the Request/Offering mechanism is applicable between:

• the DDS\_DataWriter and the DDS\_DataReader: if the QosPolicy settings between DDS\_DataWriter and DDS\_DataReader are inconsistent, no communication between them is established. In addition the DDS\_DataWriter will be informed via a DDS\_REQUESTED\_INCOMPATIBLE\_QOS status change and the DDS\_DataReader will be informed via an DDS\_OFFERED\_INCOMPATIBLE\_QOS status change

• the DDS\_DataWriter and the Data Distribution Service (as a built-in DDS\_DataReader): if the QosPolicy settings between DDS\_DataWriter and the Data Distribution Service are inconsistent, no communication between them is established. In that case data published by the DDS\_DataWriter will not be maintained by the service and as a consequence will not be available for late joining DDS\_DataReaders. The QosPolicy of the Data Distribution Service in the role of DDS\_DataReader is specified by the DDS\_Topic QosPolicy

• the Data Distribution Service (as a built-in DDS\_DataWriter) and the DDS\_DataReader: if the QosPolicy settings between the Data Distribution Service and the DDS\_DataReader are inconsistent, no communication between them is established. In that case the Data Distribution Service will not publish historical data to late joining DDS\_DataReaders. The QosPolicy of the Data Distribution Service in the role of DDS\_DataWriter is specified by the DDS\_Topic QosPolicy.

# Cleanup

The DDS\_DurabilityQosPolicy kind setting DDS\_TRANSIENT LOCAL\_DURABILITY\_QOS, DDS\_TRANSIENT\_DURABILITY\_QOS and DDS\_PERSISTENT\_DURABILITY\_QOS d e t e r m i n e t h a t t h e DDS\_DurabilityServiceQosPolicy applies for the DDS\_Topic. It controls amongst others at which time the durability service is allowed to remove all information regarding a data-instance. Information on a data-instance is maintained until the following conditions are met:

• the instance has been explicitly disposed of (instance\_state = DDS\_NOT\_ALIVE\_DISPOSED\_INSTANCE\_STATE),
• and the system detects that there are no more “live” DDS\_DataWriter objects writing the instance, that is, all DDS\_DataWriter either unregister\_instance the instance (call DDS\_DataWriter\_unregister\_instance operation) or lose their liveliness,
• and a time interval longer than service\_cleanup\_delay has elapsed since the moment the Data Distribution Service detected that the previous two conditions were met.

The use of the DDS\_DurabilityServiceQosPolicy attribute service\_cleanup\_delay is apparent in the situation where an application disposes of an instance and it crashes before having a chance to complete additional tasks related to the disposition. Upon re-start the application may ask for i n i t i a l d a t a t o r e g a i n i t s s t a t e a n d t h e d e l a y i n t r o d u c e d b y t h e service\_cleanup\_delay allows the re-started application to receive the information on the disposed of instance and complete the interrupted tasks.

# DDS\_TopicQos

This QosPolicy can be set on a DDS\_Topic. The DDS\_DataWriter and/or D D S\_ D a t a R ea d e r c a n c op y t h is qo s b y u s i ng t he op e r a t i on s DDS\_&lt;DDS\_Entity&gt;\_copy\_from\_topic\_qos a n d t h e n DDS\_&lt;DDS\_Entity&gt;\_set\_qos. That way the application can relatively easily ensure the QosPolicy for the DDS\_Topic, DDS\_DataReader and DDS\_DataWriter are consistent.

# 3.1.3.4 DDS\_DurabilityServiceQosPolicy

# Scope

DDS

# Synopsis

#include &lt;dds\_dcps.h&gt;

```c
struct DDS_DurabilityServiceQosPolicy
{ DDS_Duration_t service_cleanup_delay;
DDS_HistoryQosPolicyKind history_kind;
DDS_long history_depth;
DDS_long max_samples;
DDS_long max_instances;
DDS_long max_samples_per_instance; };
```

# Description

This QosPolicy controls the behaviour of the durability service regarding transient and persistent data.

# Attributes

DDS\_Duration\_t service\_cleanup\_delay - specifies how long the durability service must wait before it is allowed to remove the information on the transient or persistent topic data-instances as a result of incoming dispose messages.

DDS\_HistoryQosPolicyKind history\_kind - specifies the type of history, w h i c h m a y b e DDS\_KEEP\_LAST\_HISTORY\_QOS, o r DDS\_KEEP\_ALL\_HISTORY\_QOS the durability service must apply for the transient or persistent topic data-instances.

DDS\_long history\_depth - specifies the number of samples of each instance of data (identified by its key) that is managed by the durability service for the tran sien t or persisten t to pic data-in sta nces. If h i s to r y\_ k i nd i s KEEP\_LAST\_HISTORY\_QOS, history\_depth must be smaller than or equal to max\_samples\_per\_instance for this QosPolicy to be consistent.

DDS\_long max\_samples - specifies the maximum number of data samples for all instances the durability service will manage for the transient or persistent topic data-instances.

DDS\_long max\_instances - specifies the maximum number of instances the durability service will manage for the transient or persistent topic data-instances.

DDS\_long max\_samples\_per\_instance - specifies the maximum number of samples of any single instance the durability service will manage for the transient or persistent topic data-instances. If history\_kind is DDS\_KEEP\_LAST\_ HISTORY\_QOS, max\_samples\_per\_instance must be greater than or equal to history\_depth for this QosPolicy to be consistent.

# Detailed Description

This QosPolicy controls the behaviour of the durability service regarding transient and persistent data. It controls for the transient or persistent topic; the time at which information regarding the topic may be discarded, the history policy it must set and the resource limits it must apply.

# Cleanup

The setting of the DDS\_DurabilityServiceQosPolicy only applies when kind of the DDS\_DurabilityQosPolicy is either DDS\_TRANSIENT DURABILITY\_QOS or DDS\_PERSISTENT\_DURABILITY\_QOS. The service\_cleanup\_delay setting controls at which time the durability service is allowed to remove all information regarding a data-instance. Information on a data-instance is maintained until the following conditions are met:

• the instance has been explicitly disposed of (instance\_state = DDS\_NOT\_ALIVE\_DISPOSED\_INSTANCE\_STATE)
• and the system detects that there are no more “live” DataWriter objects writing the instance, that is, all DataWriter either unregister\_instance the instance (call unregister\_instance operation) or lose their liveliness
• and a time interval longer than service\_cleanup\_delay has elapsed since the moment the Data Distribution Service detected that the previous two conditions were met

The use of the attribute service\_cleanup\_delay is apparent in the situation where an application disposes an instance and it crashes before having a chance to complete additional tasks related to the disposal of the instance. Upon re-start the application may ask for initial data to regain its state and the delay introduced by the service\_cleanup\_delay allows the re-started application to receive the information of the disposed instance and complete the interrupted tasks.

# History

The attributes history\_kind and history\_depth apply to the history settings of the durability service’s internal DDS\_DataWriter and DDS\_DataReader managing the topic. The DDS\_HistoryQosPolicy behaviour, as described in Section 3.1.3.7, DDS\_HistoryQosPolicy, applies to these attributes.

# Resource Limits

The attributes max\_samples, max\_instances and max\_samples per\_instance apply to the resource limits of the durability service’s internal DDS\_DataWriter and DDS\_DataReader managing the topic. The DDS\_ResourceLimitsQosPolicy behaviour, as described in paragraph 3.1.3.17 (DDS\_ResourceLimitsQosPolicy) applies to these attributes.

# TopicQos

This QosPolicy can be set on a DDS\_Topic only. After enabling of the concerning DDS\_Topic, this QosPolicy can not be changed any more.

# 3.1.3.5 DDS\_EntityFactoryQosPolicy

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
struct DDS_EntityFactoryQosPolicy
{ DDS_boolean autoenable_created_entities; };
```

# Description

This QosPolicy controls the behaviour of the Entity as a factory for other entities.

# Attributes

DDS\_boolean autoenable\_created\_entities - specifies whether the entity acting as a factory automatically enables the instances it creates. If autoenable\_created\_entities is TRUE the factory will automatically enable each created Entity, otherwise it will not.

# Detailed Description

This QosPolicy controls the behaviour of the Entity as a factory for other entities. It concerns only DDS\_DomainParticipantFactory (as factory for DDS\_DomainParticipant), DDS\_DomainParticipant (as factory for DDS\_Publisher, DDS\_Subscriber, and DDS\_Topic), DDS\_Publisher (as factory for DDS\_DataWriter), and DDS\_Subscriber (as factory for DDS\_DataReader).

This policy is mutable. A change in the policy affects only the entities created after the change; not the previously created entities.

The setting of autoenable\_created\_entities to TRUE indicates that the factory create\_&lt;entity&gt; operation will automatically invoke the enable operation each time a new DDS\_Entity is created. Therefore, the DDS\_Entity returned by create\_&lt;entity&gt; will already be enabled. A setting of FALSE indicates that the DDS\_Entity will not be automatically enabled: the application will need to enable it explicitly by means of the enable operation. See Section 3.1.1.1, DDS\_Entity\_enable for a detailed description about the differences between enabled and disabled entities.

The default setting of autoenable\_created\_entities is TRUE meaning that by default it is not necessary to explicitly call enable on newly-created entities.

# 3.1.3.6 DDS\_GroupDataQosPolicy

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
struct DDS_GroupDataQosPolicy
{ DDS_sequence_octet value; };
```

# Description

This QosPolicy allows the application to attach additional information to a DDS\_Publisher or DDS\_Subscriber DDS\_Entity. This information is distributed with the DDS\_BuiltinTopics.

# Attributes

DDS\_sequence\_octet value - a sequence of octets that holds the application group data. By default, the sequence has length 0.

# Detailed Description

This QosPolicy allows the application to attach additional information to a DDS\_Publisher or DDS\_Subscriber DDS\_Entity. This information is distributed with the DDS\_BuiltinTopic. An application that discovers a new DDS\_Entity of the listed kind, can use this information to add additional functionality. The DDS\_GroupDataQosPolicy is changeable and updates of the DDS\_BuiltinTopic instance must be expected. Note that the Data Distribution Service is not aware of the real structure of the group data (the Data Distribution System handles it as an opaque type) and that the application is responsible for correct mapping on structural types for the specific platform.

# 3.1.3.7 DDS\_HistoryQosPolicy

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
enum DDS_HistoryQosPolicyKind
{ DDS_KEEP_LAST_HISTORY_QOS,
DDS_KEEP_ALL_HISTORY_QOS };
struct DDS_HistoryQosPolicy
{ DDS_HistoryQosPolicyKind kind;
DDS_long depth; };
```

# Description

This QosPolicy controls which samples will be stored when the value of an instance changes (one or more times) before it is finally communicated.

# Attributes

DDS\_HistoryQosPolicyKind kind - specifies the type of history, which may be DDS\_KEEP\_LAST\_HISTORY\_QOS or DDS\_KEEP\_ALL\_HISTORY\_QOS.

DDS\_long depth - specifies the number of samples of each instance of data (identified by its key) managed by this DDS\_Entity.

# Detailed Description

This QosPolicy controls whether the Data Distribution Service should deliver only the most recent sample, attempt to deliver all samples, or do something in between. In other words, how the DDS\_DataWriter or DDS\_DataReader should store samples. Normally, only the most recent sample is available but some history can be stored.

# DDS\_DataWriter

On the publishing side this QosPolicy controls the samples that should be maintained by the DDS\_DataWriter on behalf of existing DDS\_DataReader objects. The behaviour with respect to a DDS\_DataReader objects discovered after a sample is written is controlled by the DDS\_DurabilityQosPolicy.

# DDS\_DataReader

On the subscribing side it controls the samples that should be maintained until the application “takes” them from the Data Distribution Service.

This QosPolicy is applicable to a DDS\_DataReader, DDS\_DataWriter and DDS\_Topic. After enabling of the concerning DDS\_Entity, this QosPolicy cannot be changed any more.

# Attributes

The QosPolicy is controlled by the attribute kind which can be:

• DDS\_KEEP\_LAST\_HISTORY\_QOS - the Data Distribution Service will only attempt to keep the latest values of the instance and discard the older ones. The attribute “depth” determines how many samples in history will be stored. In other words, only the most recent samples in history are stored. On the publishing side, the Data Distribution Service will only keep the most recent “depth” samples of each instance of data (identified by its key) managed by the DDS\_DataWriter. On the subscribing side, the DDS\_DataReader will only keep the most recent “depth” samples received for each instance (identified by its key) until the application “takes” them via the DDS\_DataReader\_take operation. DDS\_KEEP\_LAST\_HISTORY\_QOS is the default kind. The default value of depth is 1, indicating that only the most recent value should be delivered. If a depth other than 1 is specified, it should be compatible with the settings of the DDS\_ResourceLimitsQosPolicy max\_samples\_ per\_instance. For these two QosPolicy settings to be compatible, they must verify that depth &lt;= max\_samples\_per\_instance, otherwise a DDS\_RETCODE\_INCONSISTENT\_POLICY is generated on relevant operations;

• DDS\_KEEP\_ALL\_HISTORY\_QOS - all samples are stored, provided, the resources are available. On the publishing side, the Data Distribution Service will attempt to keep all samples (representing each value written) of each instance of data (identified by its key) managed by the DDS\_DataWriter until they can be delivered to all subscribers. On the subscribing side, the Data Distribution Service will attempt to keep all samples of each instance of data (identified by its key) managed by the DDS\_DataReader. These samples are kept until the application “takes” them from the Data Distribution Service via the DDS\_DataReader\_take operation. The setting of depth has no effect. Its implied value is DDS\_LENGTH\_UNLIMITED. The resources that the Data Distribution Service can use to keep this history are limited by the settings of the DDS\_ResourceLimitsQosPolicy. If the limit is reached, the behaviour of the Data Distribution Service will depend on the DDS\_ReliabilityQosPolicy. If the DDS\_ReliabilityQosPolicy is DDS\_BEST\_EFFORT\_RELIABILITY\_ QOS, the old values are discarded. If DDS\_ReliabilityQosPolicy is DDS\_RELIABLE\_RELIABILITY\_QOS, the Data Distribution Service will block the DDS\_DataWriter until it can deliver the necessary old values to all subscribers.

On the subscribing side it controls the samples that should be maintained until the application “takes” them from the Data Distribution Service. On the publishing side this QosPolicy controls the samples that should be maintained by the DDS\_DataWriter on behalf of DDS\_DataReader objects. The behaviour with respect to a DDS\_DataReader objects discovered after a sample is written is controlled by the DDS\_DurabilityQosPolicy. In more detail, this QosPolicy specifies the behaviour of the Data Distribution Service in case the value of a sample changes (one or more times) before it can be successfully communicated to one or more DDS\_Subscribers.

# Requested/Offered

The setting of the QosPolicy offered is independent of the one requested, in other words they are never considered incompatible. The communication will not be r e j e c t e d o n a c c o u n t o f t h i s Q o s P o l i c y. T h e n o t i f i c a t i o n DDS\_OFFERED\_INCOMPATIBLE\_QOS status on the offering side or DDS\_REQUESTED\_INCOMPATIBLE\_QOS status on the requesting side will not be raised.

# DDS\_TopicQos

This QosPolicy can be set on a DDS\_Topic. The DDS\_DataWriter and/or D D S\_ D a t a R e ad e r ca n c opy t hi s qo s by u s i n g t h e o p e r a t i o n s DDS\_&lt;DDS\_Entity&gt;\_copy\_from\_topic\_qos a n d t h e n DDS\_&lt;DDS\_Entity&gt;\_set\_qos. That way the application can relatively easily ensure the QosPolicy for the DDS\_Topic, DDS\_DataReader and DDS\_DataWriter are consistent.

# 3.1.3.8 DDS\_LatencyBudgetQosPolicy

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
struct DDS_LatencyBudgetQosPolicy
{ DDS_Duration_t duration; };
```

# Description

Specifies the maximum acceptable additional delay to the typical transport delay from the time the data is written until the data is delivered at the DDS\_DataReader and the application is notified of this fact.

# Attributes

DDS\_Duration\_t duration - specifies the maximum acceptable additional delay from the time the data is written until the data is delivered.

# Detailed Description

This QosPolicy specifies the maximum acceptable additional delay to the typical transport delay from the time the data is written until the data is delivered at the DDS\_DataReader and the application is notified of this fact. This QosPolicy provides a means for the application to indicate to the Data Distribution Service the “urgency” of the data-communication. By having a non-zero duration the Data Distribution Service can optimise its internal operation. The default value of the duration is zero, indicating that the delay should be minimized.

This QosPolicy is applicable to a DDS\_DataReader, DDS\_DataWriter and DDS\_Topic. After enabling of the concerning DDS\_Entity, this QosPolicy may be changed by using the DDS\_&lt;DDS\_Entity&gt;\_set\_qos operation.

# Requested/Offered

This QosPolicy is considered a hint to the Data Distribution Service, which will automatically adapt its behaviour to meet the requirements of the shortest delay if possible. In case the Requested/Offered QosPolicy are incompatible, the notification DDS\_OFFERED\_INCOMPATIBLE\_QOS status on the offering side and DDS\_REQUESTED\_INCOMPATIBLE\_QOS status on the requesting side is raised.

Table 10: DDS\_LatencyBudgetQosPolicy

<table><tr><td>Duration</td><td>Compatibility</td></tr><tr><td>offered duration &lt; requested duration</td><td>compatible</td></tr><tr><td>offered duration = requested duration</td><td>compatible</td></tr><tr><td>offered duration &gt; requested duration</td><td>INcompatible</td></tr></table>

Note that even when the offered duration is considered compatible to the requested duration, this duration is not enforced in any way: there will be no notification on any violations of the requested duration.

Changing an existing latency budget using the set\_qos operation on either the DDS\_DataWriter or DDS\_DataReader may have consequences for the connectivity between readers and writers, depending on their RxO values. (See also in Section 3.1.3, Struct QosPolicy the paragraph entitled Requested/Offered.) Consider a writer with budget Bw and a reader with budget Br, where Bw &lt;= Br. In this case a connection between that reader and that writer is established. Now suppose Bw is changed so that Bw &gt; Br, then the existing connection between reader and writer will be lost, and the reader will behave as if the writer unregistered all its instances, transferring the ownership of these instances when appropriate. See also Section 3.1.3.11, DDS\_OwnershipQosPolicy.

# DDS\_TopicQos

This QosPolicy can be set on a DDS\_Topic. The DDS\_DataWriter and/or D D S\_ D a t a R ea d e r c a n c op y t h is qo s b y u s i ng t he op e r a t i on s DDS\_&lt;DDS\_Entity&gt;\_copy\_from\_topic\_qos a n d t h e n DDS\_&lt;DDS\_Entity&gt;\_set\_qos. That way the application can relatively easily ensure the QosPolicy for the DDS\_Topic, DDS\_DataReader and DDS\_DataWriter are consistent.

# 3.1.3.9 DDS\_LifespanQosPolicy

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
struct DDS_LifespanQosPolicy
{ DDS_Duration_t duration; };
```

# Description

This QosPolicy specifies the duration of the validity of the data written by the DDS\_DataWriter.

# Attributes

DDS\_Duration\_t duration - specifies the length in time of the validity of the data.

# Detailed Description

This QosPolicy specifies the duration of the validity of the data written by the DDS\_DataWriter. When this time has expired, the data will be removed or if it has not been delivered yet, it will not be delivered at all. In other words, the duration is the time in which the data is still valid. This means that during this period a DDS\_DataReader can access the data or if the data has not been delivered yet, it s t i l l w i l l b e d e l i v e r e d . T h e d e f a u l t v a l u e o f t h e d u r a t i o n i s DDS\_DURATION\_INFINITE, indicating that the data does not expire.

This QosPolicy is applicable to a DDS\_DataWriter and a DDS\_Topic. After enabling of the concerning DDS\_Entity, this QosPolicy may be changed by using the DDS\_&lt;DDS\_Entity&gt;\_set\_qos operation.

# Requested/Offered

The setting of this QosPolicy is only applicable to the publishing side, in other words the Requested/Offered constraints are not applicable. The communication will not be rejected on account of this QosPolicy. The notification DDS\_OFFERED\_INCOMPATIBLE\_QOS status on the offering side will not be raised.

# DDS\_TopicQos

This QosPolicy can be set on a DDS\_Topic. The DDS\_DataWriter and/or D D S\_ D a t a R e ad e r ca n c opy t hi s qo s by u s i n g t h e o p e r a t i o n s DDS\_&lt;DDS\_Entity&gt;\_copy\_from\_topic\_qos a n d t h e n DDS\_&lt;DDS\_Entity&gt;\_set\_qos. That way the application can relatively easily ensure the QosPolicy for the DDS\_Topic, DDS\_DataReader and DDS\_DataWriter are consistent.

# 3.1.3.10 DDS\_LivelinessQosPolicy

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
enum DDS_LivelinessQosPolicyKind
{ DDS_AUTOMATIC_LIVELINESS_QOS,
DDS_MANUAL_BY_PARTICIPANT_LIVELINESS_QOS,
DDS_MANUAL_BY_TOPIC_LIVELINESS_QOS };
```

```c
struct DDS_LivelinessQosPolicy
{ DDS_LivelinessQosPolicyKind kind;
DDS_Duration_t lease_duration; };
```

# Description

This QosPolicy controls the way the liveliness of an DDS\_Entity is being reported.

# Attributes

DDS\_LivelinessQosPolicyKind kind - controls the way the liveliness of an DDS\_Entity is reported.

DDS\_Duration\_t lease\_duration - specifies the duration of the interval within which the liveliness must be reported.

# Detailed Description

This QosPolicy controls the way the liveliness of an DDS\_Entity is being determined. The liveliness must be reported periodically before the lease\_duration expires.

This QosPolicy is applicable to a DDS\_DataReader, a DDS\_DataWriter and a DDS\_Topic. After enabling of the concerning DDS\_Entity, this QosPolicy cannot be changed any more.

# Attributes

The QosPolicy is controlled by the attribute kind which can be:

• DDS\_AUTOMATIC\_LIVELINESS\_QOS - the Data Distribution Service will take care of reporting the Liveliness automatically with a rate determined by the lease\_duration
• DDS\_MANUAL\_BY\_PARTICIPANT\_LIVELINESS\_QOS - the application must take care of reporting the liveliness before the lease\_duration expires. If a DDS\_Entity reports its liveliness, all DDS\_Entities within the same DDS\_DomainParticipant that have their liveliness kind set to DDS\_MANUAL\_BY\_PARTICIPANT\_LIVELINESS\_QOS, can be considered alive by the Data Distribution Service. Liveliness can reported explicitly by calling the operation DDS\_DomainParticipant\_assert\_liveliness or implicitly by writing some data
• DDS\_MANUAL\_BY\_TOPIC\_LIVELINESS\_QOS - the application must take care of reporting the liveliness before the lease\_duration expires. This can explicitly be done by calling the operation DDS\_DataWriter\_assert\_liveliness or implicitly by writing some data

The lease\_duration specifies the duration of the interval within which the liveliness should be reported.

# Requested/Offered

In case the Requested/Offered QosPolicy are incompatible, the notification DDS\_OFFERED\_INCOMPATIBLE\_QOS status on the offering side and DDS\_REQUESTED\_INCOMPATIBLE\_QOS status on the requesting side is raised.

Table 11: DDS\_LivelinessQosPolicy

<table><tr><td>Offered\Requested</td><td>AUTOMATIC</td><td>MANUAL_BY_PARTICIPANT</td><td>MANUAL_BY_TOPIC</td></tr><tr><td>AUTOMATIC</td><td>compatible</td><td>INcompatible</td><td>INcompatible</td></tr><tr><td>MANUAL_BY_PARTICIPANT</td><td>compatible</td><td>compatible</td><td>INcompatible</td></tr><tr><td>MANUAL_BY_TOPIC</td><td>compatible</td><td>compatible</td><td>compatible</td></tr></table>

Whether communication is established, is controlled by the Data Distribution Service, depending on the Requested/Offered QosPolicy of the DDS\_DataWriter and DDS\_DataReader. In other words, the communication between any DDS\_DataWriter and DDS\_DataReader depends on what is expected by the DDS\_DataReader. As a consequence, a DDS\_DataWriter that has an incompatible QoS with respect to what a DDS\_DataReader specified is not allowed to send its data to that specific DDS\_DataReader. A DDS\_DataReader that has an incompatible QoS with respect to what a DDS\_DataWriter specified does not get any data from that particular DDS\_DataWriter.

# DDS\_TopicQos

This QosPolicy can be set on a DDS\_Topic. The DDS\_DataWriter and/or D D S\_ D a t a R e ad e r ca n c opy t hi s qo s by u s i n g t h e o p e r a t i o n s DDS\_&lt;DDS\_Entity&gt;\_copy\_from\_topic\_qos a n d t h e n DDS\_&lt;DDS\_Entity&gt;\_set\_qos. That way the application can relatively easily ensure the QosPolicy for the DDS\_Topic, DDS\_DataReader and DDS\_DataWriter are consistent.

# 3.1.3.11 DDS\_OwnershipQosPolicy

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
enum DDS_OwnershipQosPolicyKind
{ DDS_SHARED_OWNERSHIP_QOS,
DDS_EXCLUSIVE_OWNERSHIP_QOS };
struct DDS_OwnershipQosPolicy
{ DDS_OwnershipQosPolicyKind kind; };
```

# Description

This QosPolicy specifies whether a DDS\_DataWriter exclusively owns an instance.

# Attributes

DDS\_OwnershipQosPolicyKind kind - specifies whether a DDS\_DataWriter exclusively owns an instance.

# Detailed Description

This QosPolicy specifies whether a DDS\_DataWriter exclusively may own an instance. In other words, whether multiple DDS\_DataWriter objects can write the same instance at the same time. The DDS\_DataReader objects will only read the modifications on an instance from the DDS\_DataWriter owning the instance.

E x c l u s i v e o w n e r s h i p i s o n a n i n s t a n c e - b y - i n s t a n c e b a s i s . T h a t i s , a D D S \_ S u b s c r i b e r c a n r e c e i v e v a l u e s w r i t t e n b y a l o w e r s t r e n g t h DDS\_DataWriter as long as they affect instances whose values have not been written or registered by a higher-strength DDS\_DataWriter.

This QosPolicy is applicable to a DDS\_DataReader, a DDS\_DataWriter and a DDS\_Topic. After enabling of the concerning DDS\_Entity, this QosPolicy cannot be changed any more.

# Attribute

The QosPolicy is controlled by the attribute kind which can be:

• DDS\_SHARED\_OWNERSHIP\_QOS (default) - the same instance can be written by multiple DDS\_DataWriter objects. All updates will be made available to the DDS\_DataReader objects. In other words it does not have a specific owner
• DDS\_EXCLUSIVE\_OWNERSHIP\_QOS - the instance will only be accepted from one DDS\_DataWriter which is the only one whose modifications will be visible to the DDS\_DataReader objects

# Requested/Offered

In case the Requested/Offered QosPolicy are incompatible, the notification O F FE R E D \_ I NC O M P A T I BL E \_ Q O S s t a t u s o n t h e o ff e r i n g s i d e a n d REQUESTED\_INCOMPATIBLE\_QOS status on the requesting side is raised.

Table 12: Requested/Offered DDS\_OwnershipQosPolicy

<table><tr><td>Requested Offered</td><td>SHARED</td><td>EXCLUSIVE</td></tr><tr><td>SHARED</td><td>compatible</td><td>INcompatible</td></tr><tr><td>EXCLUSIVE</td><td>INcompatible</td><td>compatible</td></tr></table>

Whether communication is established, is controlled by the Data Distribution Service, depending on the Requested/Offered QosPolicy of the DDS\_DataWriter and DDS\_DataReader. The value of the OWNERSHIP kind offered must exactly match the one requested or else they are considered incompatible. As a consequence, a DDS\_DataWriter that has an incompatible QoS with respect to what a DDS\_DataReader specified is not allowed to send its data to that specific DDS\_DataReader. A DDS\_DataReader that has an incompatible QoS with respect to what a DDS\_DataWriter specified does not get any data from that particular DDS\_DataWriter.

# Exclusive Ownership

The DDS\_DataWriter with the highest DDS\_OwnershipStrengthQosPolicy value and being alive (depending on the DDS\_LivelinessQosPolicy) and which has not violated its DDS\_DeadlineQosPolicy contract with respect to the instance, will be considered the owner of the instance. Consequently, the ownership can change as a result of:

• a DDS\_DataWriter in the system with a higher value of the DDS\_OwnershipStrengthQosPolicy modifies the instance
• a change in the DDS\_OwnershipStrengthQosPolicy value (becomes less) of the DDS\_DataWriter owning the instance
• a change in the liveliness (becomes not alive) of the DDS\_DataWriter owning the instance
• a deadline with respect to the instance that is missed by the DDS\_DataWriter that owns the instance.

# Time-line

Each DDS\_DataReader may detect the change of ownership at a different time. In other words, at a particular point in time, the DDS\_DataReader objects do not have a consistent picture of who owns each instance for that DDS\_Topic. Outside this grey area in time all DDS\_DataReader objects will consider the same DDS\_DataWriter to be the owner.

If multiple DDS\_DataWriter o b j e c t s w i t h t h e s a m e DDS\_OwnershipStrengthQosPolicy modify the same instance, all DDS\_DataReader objects will make the same choice of the particular DDS\_DataWriter that is the owner. The DDS\_DataReader is also notified of this via a status change that is accessible by means of the Listener or DDS\_Condition mechanisms.

# Ownership of an Instance

DDS\_DataWriter objects are not aware whether they own a particular instance. There is no error or notification given to a DDS\_DataWriter that modifies an instance it does not currently own.

# TopicQos

This QosPolicy can be set on a DDS\_Topic. The DDS\_DataWriter and/or D D S\_ D a t a R ea d e r can copy this q o s b y u s i n g t h e o p e r a t i o n s DDS\_Publisher/Subscriber\_copy\_from\_topic\_qos and then DDS\_DataWriter/DataReader\_set\_qos. That way the application can relatively easily ensure the QosPolicy for the DDS\_Topic, DDS\_DataReader and DDS\_DataWriter are consistent

# 3.1.3.12 DDS\_OwnershipStrengthQosPolicy

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
struct DDS_OwnershipStrengthQosPolicy
{ DDS_long value; };
```

# Description

This QosPolicy specifies the value of the ownership strength of a DDS\_DataWriter used to determine the ownership of an instance.

# Attributes

DDS\_long value - specifies the ownership strength of the DDS\_DataWriter.

# Detailed Description

This QosPolicy specifies the value of the ownership strength of a DDS\_DataWriter used to determine the ownership of an instance. This ownership is used to arbitrate among multiple DDS\_DataWriter objects that attempt to m o d i f y t h e s a m e i n s t a n c e . T h i s Q o s P o l i c y o n l y a p p l i e s i f t h e DDS\_OwnershipQosPolicy is of kind DDS\_EXCLUSIVE\_OWNERSHIP\_QOS. For more information, see DDS\_OwnershipQosPolicy.

This QosPolicy is applicable to a DDS\_DataWriter only. After enabling of the concerning DDS\_Entity, this QosPolicy may be changed by using the DDS\_DataWriter\_set\_qos operation. When changed, the ownership of the instances may change with it.

# 3.1.3.13 DDS\_PartitionQosPolicy

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
struct DDS_PartitionQosPolicy
{ DDS_StringSeq name; };
```

# Description

T h i s Q o s P o l i c y s p e c i f i e s t h e l o g i c a l p a r t i t i o n s i n w h i c h t h e DDS\_Subscribers and DDS\_Publishers are active.

# Attributes

DDS\_StringSeq name - holds the sequence of strings, which specifies the partitions

# Detailed Description

This QosPolicy specifies the logical partitions inside the domain in which the DDS\_Subscribers and DDS\_Publishers are active. This QosPolicy is particularly used to create a separate subspace, like a real domain versus a simulation domain. A DDS\_Publisher and/or DDS\_Subscriber can participate in more than one partition. Each string in the sequence of strings name defines a partition name. A partition name may contain wildcards. Sharing a partition means that at least one of the partition names in the sequence matches. When none of the partition names match, it is not considered an “incompatible” QoS and does not trigger any listeners or conditions. It only means that no communication is established. The default value of the attribute is an empty (zero-sized) sequence. This is treated as a special value that matches the partition.

This QosPolicy is applicable to a DDS\_Publisher and DDS\_Subscriber. After enabling of the concerning DDS\_Entity, this QosPolicy may be changed by using the DDS\_&lt;DDS\_Entity&gt;\_set\_qos operation. When changed, it modifies the association of DDS\_DataReader and DDS\_DataWriter objects. It may establish new associations or break existing associations. By default, DDS\_DataWriter and DDS\_DataReader objects belonging to a DDS\_Publisher or DDS\_Subscriber that do not specify a DDS\_PartitionQosPolicy, will participate in the default partition. In this case the partition name is “”

# Requested/Offered

The offered setting of this QosPolicy is independent of the one requested, in other words they are never considered incompatible. The communication will not be r e j e c t e d o n a c c o u n t o f t h i s Q o s P o l i c y. T h e n o t i f i c a t i o n DDS\_OFFERED\_INCOMPATIBLE\_QOS status on the offering side or DDS\_REQUESTED\_INCOMPATIBLE\_QOS status on the requesting side will not be raised.

# 3.1.3.14 DDS\_PresentationQosPolicy

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
enum DDS_PresentationQosPolicyAccessScopeKind
{ DDS_INSTANCE_PRESENTATION_QOS,
DDS_TOPIC_PRESENTATION_QOS,
DDS_GROUP_PRESENTATION_QOS };
struct DDS_PresentationQosPolicy
{ DDS_PresentationQosPolicyAccessScopeKind access_scope;
DDS_boolean coherent_access;
DDS_boolean ordered_access; };
```

# Description

This QosPolicy controls the extent to which changes to data-instances can be made dependent on each other, the order in which they need to be presented to the user and also the kind of dependencies that can be propagated and maintained by the Data Distribution Service.

# Attributes

PresentationQosPolicyAccessScopeKind access\_scope - specifies the granularity of the changes that needs to be preserved when communicating a set of samples and the granularity of the ordering in which these changes need to be presented to the user.

boolean coherent\_access - controls whether the Data Distribution Service will preserve the groupings of changes, as indicated by the access\_scope, made b y a p u b l i s h i n g a p p l i c a t i o n b y m e a n s o f t h e o p e r a t i o n s begin\_coherent\_change and end\_coherent\_change.

boolean ordered\_access - controls whether the Data Distribution Service will preserve the order of the changes, as indicated by the access\_scope.

# Detailed Description

The support for ‘coherent changes’ enables a publishing application to change the value of several data-instances that could belong to the same or different topics and have those changes be seen ‘atomically’ by the readers. This is useful in cases where the values are inter-related. For example, if there are two data-instances representing the ‘altitude’ and ‘velocity vector’ of the same aircraft and both are changed, it may be useful to communicate those values in a way the reader can see both together; otherwise it may erroneously interpret that the aircraft is on a collision course.

Basically this QosPolicy allows a Publisher to group a number of samples by enclosing them within calls to DDS\_Publisher\_begin\_coherent\_change and DDS\_Publisher\_end\_coherent\_change and treat them as if they are to be communicated as a single message. That is, the receiver will only be able to access the data after all the modifications in the set are available at the receiver end.

Samples that belong to a (yet) unfinished coherent update consume resource limits from the receiving DataReader, but are not (yet) accessible through its history, and cannot (yet) push samples out of its history. In order for the DataReader to store samples outside its history administration, its ResourceLimitsQosPolicy should have a value for max\_samples\_per\_instance that is bigger than the depth value of its HistoryQosPolicy.

If not enough resources are available to hold an incoming sample that belongs to an unfinished transaction, one of the following things may happen.

• When some of the resources are in use by the history of the DataReader, the incoming sample will be rejected, and the DataReader will be notified of a SAMPLE\_REJECTED event. This will cause the delivery mechanism to retry delivery of the rejected sample at a later moment in time, in the expectation that the application will free resources by actively taking samples out of the reader history.

• When all the available resources are in use by samples belonging to unfinished coherent updates, the application has no way to free up resources and the transaction is either ‘deadlocked’ by itself (i.e. it is too big for the amount of available resources) or by one or more other incomplete transactions. To break out of this deadlock, all samples belonging to the same transaction as the currently incoming sample will be dropped, and the DataReader will be notified of a SAMPLE\_LOST event. No attempt will be made to retransmit the dropped transaction. To avoid this scenario, it is important to make sure the DataReader has set its ResourceLimits to accommodate for the worst case history size PLUS the worst case transaction size. In other words, if $\mathrm { S _ { h } }$ represents the worst case size of the required history, $\mathrm { S } _ { \mathrm { t } }$ represents the worst case size of single transaction and $\mathrm { N _ { t } }$ represents the worst case number of concurrent transactions, then the ResourceLimits should accommodate for $\mathrm { S _ { h } } + \mathrm { ( S _ { t } } ^ { \ast } \mathrm { N _ { t } } )$ .

A connectivity change may occur in the middle of a set of coherent changes; for example, the set of partitions used by the Publisher or one of its Subscribers may change, a late-joining DataReader may appear on the network, or a communication failure may occur. In the event that such a change prevents an entity from receiving the entire set of coherent changes, that entity must behave as if it had received none of the set.

The support for ‘ordered\_access’ enables a subscribing application to view changes in the order in which they occurred. Ordering is always determined according to the applicable DestinationOrderQosPolicy setting. Depending on the selected access\_scope, ordering is either on a per instance basis (this is the default behaviour, even when ordered\_access is set to FALSE), on a per DataReader basis or across all DataReaders that span the Subscriber. In case of ordered\_access with an access\_scope of GROUP, the Subscriber will enforce that all its DataReaders share the same DestinationOrderQosPolicy setting. The DestinationOrderQosPolicy setting of the first DataReader created for that Subscriber will then determine the DestinationOrderQosPolicy setting that is allowed for all subsequent DataReaders. Conflicting settings will result in an INCONSISTENT\_POLICY error.

The PresentationQosPolicy is applicable to a Publisher and Subscriber. After enabling of the concerning Entity, this QosPolicy cannot be changed any more.

# Attributes

The PresentationQosPolicy is applicable to both Publisher and Subscriber, but behaves differently on the publishing side and the subscribing side. The setting of coherent\_access on a DDS\_Publisher controls whether that Publisher will preserve the coherency of changes (enclosed by calls to DDS\_Publisher\_begin\_coherent\_change and end\_coherent\_change), as indicated by its access\_scope and as made available by its embedded DataWriters. However, the Subscriber settings determine whether a coherent set of samples will actually be delivered to the subscribing application in a coherent way.

• If a Publisher or Subscriber sets coherent\_access to FALSE, it indicates that it does not want to maintain coherency between the different samples in a set: a Subscriber that receives only a part of this set may still deliver this partial set of samples to its embedded DataReaders.
• If both Publisher and Subscriber set coherent\_access to TRUE, they indicate that they want to maintain coherency between the different samples in a set: a Subscriber that receives only a part of this set may not deliver this partial set of samples to its embedded DataReaders; it needs to wait for the set to become complete, and it will flush this partial set when it concludes that it will never be able to complete it.

Coherency is implemented on top of a transaction mechanism between individual DataWriters and DataReaders; completeness of a coherent set is determined by the successful completion of each of its participating transactions. The value of the access\_scope attribute determines which combination of transactions constitute the contents of a coherent set.

The setting of ordered\_access has no impact on the way in which a Publisher transmits its samples (although it does influence the RxO properties of this Publisher), but basically it determines whether a Subscriber will preserve the ordering of samples when the subscribing application uses its embedded DataReaders to read or take samples:

• If a Subscriber sets ordered\_access to FALSE, it indicates that it does not want to maintain ordering between the different samples it receives: a subscribing application that reads or takes samples will receive these samples ordered by their key-values, which does probably not resemble the order they were written in.
• If a Subscriber sets ordered\_access to TRUE, it indicates that it does want to maintain ordering within the specified access\_scope between the different samples it receives: a subscribing application that reads or takes samples will receives these samples sorted by the order in which they were written.

The access\_scope determines the maximum extent of coherent and/or ordered changes:

• If access\_scope is set to DDS\_INSTANCE\_PRESENTATION\_QOS and coherent\_access is set to TRUE, then the Subscriber will behave, with respect to maintaining coherency, in a way similar to an access\_scope that is set to DDS\_TOPIC\_PRESENTATION\_QOS. This is caused by the fact that coherency is defined as the successful completion of all participating transactions. If a DataWriter writes a transaction containing samples from different instances, and a connected DataReader misses one of these samples, then the transaction failed and the coherent set is considered incomplete by the receiving DataReader. It doesn’t matter that all the other instances have received their samples successfully; an unsuccessful transaction by definition results in an incomplete coherent set. In that respect the DDS can offer no granularity that is more fine-grained with respect to coherency than that described by the DDS\_TOPIC\_PRESENTATION\_QOS.

If access\_scope is set to DDS\_INSTANCE\_PRESENTATION\_QOS and ordered\_access is set to TRUE, then the subscriber will maintain ordering between samples belonging to the same instance. Samples belonging to different instances will still be grouped by their key-values instead of by the order in which they were received.

• If access\_scope is set to DDS\_TOPIC\_PRESENTATION\_QOS and coherent\_access is set to TRUE, then the DDS will define the scope of a coherent set on individual transactions. So a coherent set that spans samples coming from multiple DataWriters (indicated by its enclosure within calls to DDS\_Publisher\_begin\_coherent\_change and DDS\_Publisher\_end\_coherent\_change on their shared Publisher), is chopped up into separate and disjunct transactions (one for each participating DataWriter), where each transaction is processed separately. On the subscribing side this may result in the successful completion of some of these transactions, and the unsuccessful completion of some others. In such cases all DataReaders that received successful transactions will deliver the embedded content to their applications, without waiting for the completion of other transactions in other DataReaders connected to the same Subscriber.

If access\_scope is set to DDS\_TOPIC\_PRESENTATION\_QOS and ordered\_access is set to TRUE, then the subscriber will maintain ordering between samples belonging to the same DataReader. This means that samples belonging to the same instance in the same DataReader may no longer be received consecutively if samples belonging to different instances were written in between. It is possible to read/take a limited batch of ordered samples (where max\_samples != LENGTH\_UNLIMITED). In that case the DataReader will keep a bookmark, so that in subsequent read/take operations your application can start where the previous read/take call left off. There are two ways for the middleware to indicate that you completed a full iteration:

- The amount of samples returned is smaller than the amount of samples requested. In that case the bookmark is automatically reset and the next read/take will begin a new iteration right from the start of the ordered list.
- Your read/take call returns RETCODE\_NO\_DATA, indicating that there are no more samples matching your criteria after the current bookmark. In that case the bookmark is reset as well.

The bookmark is also reset in the following cases:

- A read/take call uses different masks than the previous invocation of read/take.
- A read/take call uses a different query than the previous invocation of read/take.

• If access\_scope is set to DDS\_GROUP\_PRESENTATION\_QOS and coherent\_access is set to TRUE, then the DDS will define the scope of a coherent set on the sum of all participating transactions. So a coherent set that spans samples coming from multiple DataWriters (indicated by its enclosure within calls to DDS\_Publisher\_begin\_coherent\_change and DDS\_Publisher\_end\_coherent\_change on their shared Publisher), is chopped up into separate and disjunct transactions (one for each participating DataWriter), where each transactions is processed separately. On the subscribing side this may result in the successful completion of some of these transactions, and the unsuccessful completion of some others. However, each DataReader is only allowed to deliver the embedded content when all participating transactions completed successfully. This means that DataReaders that received successful transactions will need to wait for all other DataReaders attached to the same Subscriber to also complete their transactions successfully. If one or more DataReaders conclude that they will not be able to complete their transactions successfully, then all DataReaders that participate in the original coherent set will flush the content of their transactions. In order for the application to access the state of all DataReaders that span the coherent update, a separate read/take operation will need to be performed on each of the concerned DataReaders. To keep the history state of the DataReaders consistent in between the successive invocations of the read/take operations on the various readers, the DataReaders should be locked for incoming updates by invoking the DDS\_Subscriber\_begin\_access on the Subscriber prior to accessing the first DataReader. If all concerned DataReaders have been accessed properly, they can be unlocked for incoming updates by invoking the DDS\_Subscriber\_end\_access on the Subscriber. Note that in this case a Subscriber is created in a disabled state. This allows the application to create all concerned DataReaders, preventing any transactions from completing prematurely before all DataReaders have been created. The application must explicitly enable the subscriber after it has finished creating DataReaders. See Section 3.5.1.6, DDS\_Subscriber\_enable (inherited), for additional information.

If access\_scope is set to DDS\_GROUP\_PRESENTATION\_QOS and ordered\_access is set to TRUE, then ordering is maintained between samples that are written by DataWriters attached to a common Publisher and received by DataReaders attached to a common Subscriber. This way the subscribing application can access the changes as a unit and/or in the proper order. However, this does not necessarily imply that the subscribing application will indeed access the changes as a unit and/or in the correct order. For that to occur, the subscribing application must use the proper logic in accessing its datareaders:

\- Upon notification by the callback operation on\_data\_on\_readers of the SubscriberListener or when triggered by the similar DDS\_DATA\_ON\_READERS status of the Subscriber’s DDS\_StatusCondition, the application uses DDS\_Subscriber\_begin\_access on the Subscriber to indicate it will be accessing data through the Subscriber. This will lock the embedded datareaders for any incoming messages during the coherent data access.

- Then it calls DDS\_Subscriber\_get\_datareaders on the Subscriber to get the list of DataReader objects where data samples are available. Note that when ordered\_access is TRUE, then the list of DataReaders may contain the same reader several times. In this manner the correct sample order can be maintained among samples in different DataReader objects.
- Following this it calls DDS\_DataReader\_read or DDS\_DataReader\_take on each DataReader in the same order returned to access all the relevant changes in the DataReader. Note that when ordered\_access is TRUE, you should only read or take one sample at a time.
- Once it has called read or take on all the readers, it calls DDS\_Subscriber\_end\_access on the Subscriber. This will unlock the embedded datareaders again.

# Requested/Offered

In case the Requested/Offered QosPolicy are incompatible, the notification DDS\_OFFERED\_INCOMPATIBLE\_QOS status on the offering side and DDS\_REQUESTED\_INCOMPATIBLE\_QOS status on the requesting side is raised.

Table 13: Requested/Offered PresentationQosPolicy

<table><tr><td>Requested Offered</td><td>INSTANCE</td><td>Topic</td><td>Group</td></tr><tr><td>instance</td><td>compatible</td><td>INcompatible</td><td>INcompatible</td></tr><tr><td>topic</td><td>compatible</td><td>compatible</td><td>INcompatible</td></tr><tr><td>group</td><td>compatible</td><td>compatible</td><td>compatible</td></tr></table>

The value offered is considered compatible with the value requested if and only if the following conditions are met:

1. The inequality “offered access\_scope >= requested access\_scope” evaluates to ‘TRUE’. For the purposes of this inequality, the values of PRESENTATION access\_scope are considered ordered such that INSTANCE &lt; TOPIC &lt; GROUP.
2. Requested coherent\_access is FALSE, or else both offered and requested coherent\_access are TRUE.
3. Requested ordered\_access is FALSE, or else both offered and requested ordered\_access are TRUE.

In case the quality offered by the Publisher is better than the value requested by the Subscriber, the subscriber’s values determine the resulting behaviour for the subscribing application. In other words, the quality specified at the Subscriber site overrules the corresponding value at the Publisher site.

Consider the following scenario:

1. A Publisher publishes coherent sets with access\_scope is GROUP and coherent\_access is TRUE.
2. A Subscriber subscribes to these coherent sets with access\_scope is TOPIC and coherent\_access is TRUE.
3. The Publisher writes a coherent set consisting of 2 samples of Topic A, and 2 samples of Topic B.
4. During transmission, the first sample of Topic B gets lost.

According to the access\_scope of the Publisher, the coherent set is incomplete and can therefore not be delivered. However, according to the access\_scope of the Subscriber, coherency needs to be maintained on a per Reader/Writer pair basis so the samples for Topic A will be delivered upon arrival, but the samples for Topic B will not.

Basically, when both coherent\_access and ordered\_access are set to FALSE, then the access\_scope serves no other purpose than to determine connectivity between Publishers and Subscribers.

# 3.1.3.15 DDS\_ReaderDataLifecycleQosPolicy

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
enum DDS_InvalidSampleVisibilityQosPolicyKind
{ DDS_NO_INVALID_SAMPLES,
DDS_MINIMUM_INVALID_SAMPLES,
DDS_ALL_INVALID_SAMPLES };
struct DDS_InvalidSampleVisibilityQosPolicy
{ DDS_InvalidSampleVisibilityQosPolicyKind kind; };
struct DDS_ReaderDataLifecycleQosPolicy
{ DDS_Duration_t autopurge_nowriter_samples_delay;
DDS_Duration_t autopurge_disposed_samples_delay;
DDS_boolean autopurge_dispose_all;
DDS_boolean enable_invalid_samples;
DDS_InvalidSampleVisibilityQosPolicy invalid_sample_visibility;
};
```

# Description

This QosPolicy specifies the maximum duration for which the DDS\_DataReader will maintain information regarding a data instance for which the instance\_state becomes either DDS\_NOT\_ALIVE\_NO\_WRITERS\_INSTANCE\_STATE or DDS\_NOT\_ALIVE\_DISPOSED\_INSTANCE\_STATE. The policy also controls whether state changes will potentially be communicated using so-called ‘invalid’ samples.

# Attributes

DDS\_Duration\_t autopurge\_nowriter\_samples\_delay - specifies the duration for which the DDS\_DataReader will maintain information regarding a d a t a i n s t a n c e f o r w h i c h t h e i n s t a n c e \_ s t a t e b e c o m e s DDS\_NOT\_ALIVE\_NO\_WRITERS\_INSTANCE\_STATE. By default the duration value is DDS\_DURATION\_INFINITE. When the delay time has expired, the data instance is marked so that it can be purged in the next garbage collection sweep.

DDS\_Duration\_t autopurge\_disposed\_samples\_delay - specifies the duration for which the DDS\_DataReader will maintain information regarding a d a t a i n s t a n c e f o r w h i c h t h e i n s t a n c e \_ s t a t e b e c o m e s DDS\_NOT\_ALIVE\_DISPOSED\_INSTANCE\_STATE. By default the duration value is DDS\_DURATION\_INFINITE. When the delay time has expired, the data instance is marked so that it can be purged in the next garbage collection sweep.

DDS\_Boolean autopurge\_dispose\_all - Determines whether all samples in t h e D D S \_ D a t a R e a d e r w i l l b e p u rg e d a u t o m a t i c a l l y w h e n a dispose\_all\_data() call is performed on the DDS\_Topic that is associated with the DDS\_DataReader. If this attribute set to TRUE, no more samples will exist in the DDS\_DataReader after the dispose\_all\_data has been processed. Because all samples are purged, no data available events will be n o t i f i e d t o p o t e n t i a l L i s t e n e r s o r C o n d i t i o n s t h a t a r e s e t f o r t h e DDS\_DataReader. If this attribute is set to FALSE, the dispose\_all\_data() behaves as if each individual instance was disposed separately.

DDS\_boolean enable\_invalid\_samples - Insert dummy samples if no data sample is available to notify readers of an instance\_state change. By default the value is true.

![The image displays a red triangular warning sign with a thick red border and a white interior. Centered inside is a black exclamation point. Directly beneath the exclamation point is a small black arrow pointing downward.](.vortex-opensplice-c-reference-guide/b97dcb36cb59ca5e5b460f241a5672b36e29c6eb1fb5b67f9af719ec625fb396.jpg)

NOTE: This feature is deprecated. It is recommended that you use invalid\_sample\_visibility instead.

DDS\_InvalidSampleVisibilityQosPolicy invalid\_sample\_visibility - Insert dummy samples if no data sample is available, to notify readers of an instance\_state change. By default the value is DDS\_MINIMUM\_INVALID\_SAMPLES.

# Detailed Description

This QosPolicy specifies the maximum duration for which the DDS\_DataReader will maintain information regarding a data instance for which the instance\_state becomes either DDS\_NOT\_ALIVE\_NO\_WRITERS\_INSTANCE\_STATE or DDS\_NOT\_ALIVE\_DISPOSED\_INSTANCE\_STATE. The DDS\_DataReader manages resources for instances and samples of those instances. The amount of r e s o u r c e s m a n a g e d d e p e n d s o n o t h e r Q o s P o l i c i e s l i k e t h e DDS\_HistoryQosPolicy and the DDS\_ResourceLimitsQosPolicy. The

DDS\_DataReader can only release resources for data instances for which all s a m p l e s h a v e b e e n t a k e n a n d t h e i n s t a n c e \_ s t a t e h a s b e c o m e DDS\_NOT\_ALIVE\_NO\_WRITERS\_INSTANCE\_STATE or DDS\_NOT\_ALIVE DISPOSED\_INSTANCE\_STATE. If an application does not take the samples b e l o n g i n g t o a d a t a i n s t a n c e w i t h s u c h a n i n s t a n c e \_ s t a t e , t h e DDS\_DataReader will never be able to release the maintained resources. By means of this QosPolicy the application can instruct the DDS\_DataReader to release all resources related to the relevant data instance after a specified duration.

![The image displays a standard triangular warning sign with a thick red border and a white interior. Inside the triangle, there is a black exclamation mark (!) centered near the top, with a black downward-pointing arrow (↓) positioned directly below it.](.vortex-opensplice-c-reference-guide/61933bc080f71726ca2c9efd8ce49152f9e072eeba6baf3d6540c8c897a109cf.jpg)

There is one exception to this rule. If the autopurge\_dispose\_all attribute is TRUE, the maintained resources in the DDS\_DataReader are cleaned up immediately in case dispose\_all\_data() is called on the DDS\_Topic that is associated with the DDS\_DataReader.

Instance state changes are communicated to a DDS\_DataReader by means of the SampleInfo accompanying a data sample. If no samples are available in the DDS\_DataReader, a so-called ‘invalid sample’ can be injected with the sole purpose of notifying applications of the instance state. This behaviour is configured by the DDS\_InvalidSampleVisibilityQosPolicy.

• If invalid\_sample\_visibility is set to DDS\_NO\_INVALID\_SAMPLES, applications will be notified of instance\_state changes only if there is a sample available in the DDS\_DataReader. The SampleInfo belonging to this sample will contain the updated instance state.
• If invalid\_sample\_visibility is set to DDS\_MINIMUM\_INVALID\_SAMPLES, the middleware will try to update the instance\_state on available samples in the DataReader. If no sample is available, an invalid sample will be injected. These samples contain only the key values of the instance. The SampleInfo for invalid samples will have the ‘valid\_data’ flag disabled, and contain the updated instance state.
• If invalid\_sample\_visibility is set to DDS\_ALL\_INVALID\_SAMPLES, every change in the instance\_state will be communicated by a separate invalid sample.

NOTE: This value (DDS\_ALL\_INVALID\_SAMPLES) is not yet implemented. It is scheduled for a future release.

![The image displays a standard warning symbol featuring a red triangle outline with a black exclamation point centered inside on a white background.](.vortex-opensplice-c-reference-guide/45111145d6a3d979ec92d01ac56ab102b28a3ed03a66179f81639a14fb0b75fa.jpg)

An alternative but deprecated way to determine the visibility of state changes is to set a boolean value for the enable\_invalid\_samples field.

• When TRUE, the behavior is similar to the DDS\_MINIMUM\_INVALID\_SAMPLES value of the DDS\_InvalidSampleVisibilityQosPolicy field.
• When FALSE, the behavior is similar to the DDS\_NO\_INVALID\_SAMPLES value of the DDS\_InvalidSampleVisibilityQosPolicy field.

![The image displays a red triangular warning sign with a thick border. Inside the triangle is a black exclamation point with a short horizontal line beneath the dot.](.vortex-opensplice-c-reference-guide/09a0eb67293c1fe5c7d6fb321b3a96538a517efe9b61c806b15865de86a6cfb8.jpg)

You cannot set both the the enable\_invalid\_samples field AND the invalid\_sample\_visibility field. If both deviate from their factory default, this is considered a DDS\_RETCODE\_INCONSISTENT\_POLICY. If only one of the fields deviates from its factory default, then that setting will be leading. However, modifying the default value of the enable\_invalid\_samples field will automatically result in a warning message stating that you are using deprecated functionality.

This QosPolicy is applicable to a DDS\_DataReader only. After the relevant DDS\_DataReader is enabled, this QosPolicy can be changed using the set\_qos operation.

# 3.1.3.16 DDS\_ReliabilityQosPolicy

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
enum DDS_ReliabilityQosPolicyKind
{ DDS_BEST_EFFORT_RELIABILITY_QOS,
DDS_RELIABLE_RELIABILITY_QOS };
struct DDS_ReliabilityQosPolicy
{ DDS_ReliabilityQosPolicyKind kind;
DDS_Duration_t max_blocking_time;
DDS_boolean synchronous; };
```

# Description

This QosPolicy controls the level of reliability of the data distribution offered or requested by the DDS\_DataWriters and DDS\_DataReaders.

# Attributes

```txt
DDS_ReliabilityQosPolicyKind kind - specifies the type of reliability which may be DDS_BEST_EFFORT_RELIABILITY_QOS or DDS_RELIABLE_RELIABILITY_QOS.
```

```txt
DDS_Duration_t max_blocking_time - specifies the maximum time the DDS_DataWriter_write operation may block when the DDS_DataWriter does not have space to store the value written or when synchronous communication is specified and all expected acknowledgements are not yet received.
```

```txt
DDS_boolean synchronous - specifies whether a DataWriter should wait for acknowledgements by all connected DataReaders that also have set a synchronous ReliabilityQosPolicy.
```

I t i s a d v i s a b l e o n l y t o u s e t h i s p o l i c y i n c o m b i n a t i o n w i t h RELIABLE\_RELIABILITY; if used in combination with BEST\_EFFORT data may not arrive at the DataReader, resulting in a timeout at the DataWriter indicating that the data has not been received.

Acknowledgments are always sent RELIABLE so that when the DataWriter encounters a timeout it is guaranteed that the DataReader hasn’t received the data.

![The image displays a triangular warning sign with a thick red border and a white background. Inside the triangle, there is a black exclamation mark (!) positioned above a black downward-pointing arrow.](.vortex-opensplice-c-reference-guide/fa40e1d45471a7a6d1fac8e576334c3aa8ebebf28d3a64492693bbecdab9c163.jpg)

NOTE: This is an OpenSplice-specific parameter, it is not part of the DDS Specification.

# Detailed Description

This QosPolicy controls the level of reliability of the data distribution requested by a DDS\_DataReader or offered by a DDS\_DataWriter. In other words, it controls whether data is allowed to get lost in transmission or not.

This QosPolicy is applicable to a DDS\_DataReader, DDS\_DataWriter and DDS\_Topic. After enabling of the concerning DDS\_Entity, this QosPolicy cannot be changed any more.

# Attributes

The QosPolicy is controlled by the attribute kind which can be:

• DDS\_RELIABLE\_RELIABILITY\_QOS - the Data Distribution Service will attempt to deliver all samples in the DDS\_DataWriters history; arrival-checks are performed and data may get re-transmitted in case of lost data. In the steady-state (no modifications communicated via the DDS\_DataWriter) the Data Distribution Service guarantees that all samples in the DDS\_DataWriter history will eventually be delivered to the all DDS\_DataReader objects. Outside the steady-state the DDS\_HistoryQosPolicy and DDS\_ResourceLimitsQosPolicy determine how samples become part of the history and whether samples can be discarded from it. In this case also the max\_blocking\_time must be set
• DDS\_BEST\_EFFORT\_RELIABILITY\_QOS - the Data Distribution Service will only attempt to deliver the data; no arrival-checks are being performed and any lost data is not re-transmitted (non-reliable). Presumably new values for the samples are generated often enough by the application so that it is not necessary to resent or acknowledge any samples.

The effect of the attribute max\_blocking\_time depends on the setting of the DDS\_HistoryQosPolicy and DDS\_ResourcesLimitsQosPolicy and the synchronous setting of the DDS\_ReliabilityQosPolicy. In case the DDS\_HistoryQosPolicy kind is set to DDS\_KEEP\_ALL\_HISTORY\_QOS, the DDS\_DataWriter\_write operation on the DDS\_DataWriter may block if the m o d i f i c a t i o n w o u l d c a u s e o n e o f t h e l i m i t s s p e c i f i e d i n t h e DDS\_ResourceLimitsQosPolicy to be exceeded. Also in case the synchronous attribute value of the ReliabilityQosPolicy is set to TRUE on both sides of a pair of connected DataWriters and DataReaders, then the DataWriter will wait until all its connected synchronous DataReaders have acknowledged the data.

Under these circumstances, the max\_blocking\_time attribute of the DDS\_ReliabilityQosPolicy configures the maximum duration the DDS\_DataWriter\_write operation may block.

# Requested/Offered

In case the Requested/Offered QosPolicy are incompatible, the notification DDS\_OFFERED\_INCOMPATIBLE\_QOS status on the offering side and DDS\_REQUESTED\_INCOMPATIBLE\_QOS status on the requesting side is raised.

Table 14: Requested/Offered DDS\_ReliabilityQosPolicy

<table><tr><td>Requested Offered</td><td>BEST_EFFORT</td><td>RELIABLE</td></tr><tr><td>BEST_EFFORT</td><td>compatible</td><td>INcompatible</td></tr><tr><td>RELIABLE</td><td>compatible</td><td>compatible</td></tr></table>

# DDS\_TopicQos

This QosPolicy can be set on a DDS\_Topic. The DDS\_DataWriter and/or D D S\_ D a t a R ea d e r c a n c op y t h is qo s b y u s i ng t he op e r a t i on s DDS\_&lt;DDS\_Entity&gt;\_copy\_from\_topic\_qos a n d t h e n DDS\_&lt;DDS\_Entity&gt;\_set\_qos. That way the application can relatively easily ensure the QosPolicy for the DDS\_Topic, DDS\_DataReader and DDS\_DataWriter are consistent.

# 3.1.3.17 DDS\_ResourceLimitsQosPolicy

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
struct DDS_ResourceLimitsQosPolicy
{ DDS_long max_samples;
DDS_long max_instances;
DDS_long max_samples_per_instance; };
```

# Description

This QosPolicy will specify the maximum amount of resources, which can be used by a DDS\_DataWriter or DDS\_DataReader.

# Attributes

DDS\_long max\_samples - specifies the maximum number of data samples for all instances for any single DDS\_DataWriter (or DDS\_DataReader). By default, DDS\_LENGTH\_UNLIMITED.

DDS\_long max\_instances - specifies the maximum number of instances for any single DDS\_DataWriter (or DDS\_DataReader). By default, DDS\_LENGTH\_UNLIMITED.

DDS\_long max\_samples\_per\_instance - specifies the maximum number of samples of any single instance for any single DDS\_DataWriter (or DDS\_DataReader). By default, DDS\_LENGTH\_UNLIMITED.

# Detailed Description

This QosPolicy controls the maximum amount of resources that the Data Distribution Service can use in order to meet the requirements imposed by the application and other QosPolicy settings.

This QosPolicy is applicable to a DDS\_DataReader, a DDS\_DataWriter and a DDS\_Topic. After enabling of the concerning DDS\_Entity, this QosPolicy cannot be changed any more.

# Requested/Offered

The value of the QosPolicy offered is independent of the one requested, in other words they are never considered incompatible. The communication will not be r e j e c t e d o n a c c o u n t o f t h i s Q o s P o l i c y. T h e n o t i f i c a t i o n DDS\_OFFERED\_INCOMPATIBLE\_QOS status on the offering side or DDS\_REQUESTED\_INCOMPATIBLE\_QOS status on the requesting side will not be raised.

# Resource limits

If the DDS\_DataWriter objects are publishing samples faster than they are taken by the DDS\_DataReader objects, the Data Distribution Service will eventually hit against some of the QosPolicy-imposed resource limits. Note that this may occur when just a single DDS\_DataReader cannot keep up with its corresponding DDS\_DataWriter.

In case the DDS\_HistoryQosPolicy is DDS\_KEEP\_LAST\_HISTORY\_QOS, the setting of DDS\_ResourceLimitsQosPolicy max\_samples\_per\_instance must be compatible with the DDS\_HistoryQosPolicy depth. For these two QosPolicy settings to be compatible, they must verify that depth &lt;= max\_samples\_per\_instance.

# DDS\_TopicQos

This QosPolicy can be set on a DDS\_Topic. The DDS\_DataWriter and/or D D S\_ D a t a R ea d e r c a n c op y t h is qo s b y u s i ng t he op e r a t i on s DDS\_&lt;DDS\_Entity&gt;\_copy\_from\_topic\_qos a n d t h e n DDS\_&lt;DDS\_Entity&gt;\_set\_qos. That way the application can relatively easily ensure the QosPolicy for the DDS\_Topic, DDS\_DataReader and DDS\_DataWriter are consistent.

# 3.1.3.18 DDS\_SchedulingQosPolicy

![The image displays a standard warning sign featuring a red triangle with a white background. Inside the triangle, there is a black exclamation point centered vertically. A black border surrounds the entire graphic.](.vortex-opensplice-c-reference-guide/d626300b6e3f3f9e916076568aec584f715a3de25a6a0f2bd0802aff6faf1a0f.jpg)

NOTE: This is an OpenSplice-specific QosPolicy, it is not part of the DDS Specification.

# Scope

DDS

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
enum DDS_SchedulingClassQosPolicyKind
{ DDS_SCHEDULE_DEFAULT,
DDS_SCHEDULE_TIMESHARING,
DDS_SCHEDULE_REALTIME };
struct DDS_SchedulingClassQosPolicy
{ DDS_SchedulingClassQosPolicyKind kind; };
enum DDS_SchedulingPriorityQosPolicyKind
{ DDS_PRIORITY_RELATIVE,
DDS_PRIORITY_ABSOLUTE };
struct DDS_SchedulingPriorityQosPolicy
{ DDS_SchedulingPriorityQosPolicyKind kind; };
struct DDS_SchedulingQosPolicy
{ DDS_SchedulingClassQosPolicy scheduling_class;
DDS_SchedulingPriorityQosPolicy scheduling_priority_kind;
DDS_long scheduling_priority; };
```

# Description

This QosPolicy specifies the scheduling parameters that will be used for a thread that is spawned by the DDS\_DomainParticipant.

![The image displays a standard warning symbol featuring a red triangle outline containing a black exclamation mark.](.vortex-opensplice-c-reference-guide/a458932d9848b15708636ecd18c27609f83aeea6a1b16f352d82da961d9e7167.jpg)

Note that some scheduling parameters may not be supported by the underlying Operating System or that you may need special privileges to select particular settings.

# Attributes

DDS\_SchedulingClassQosPolicyKind scheduling\_class.kind - specifies the scheduling class used by the Operating System, which may be DDS\_SCHEDULE\_DEFAULT, DDS\_SCHEDULE\_TIMESHARING or DDS\_SCHEDULE\_REALTIME. Threads can only be spawned within the scheduling classes that are supported by the underlying Operating System.

DDS\_SchedulingPriorityQosPolicyKind scheduling\_priority\_kind.kind - specifies the priority type, which may be either DDS\_PRIORITY\_RELATIVE or DDS\_PRIORITY\_ABSOLUTE.

DDS\_long scheduling\_priority - specifies the priority that will be assigned to threads spawned by the DDS\_DomainParticipant. Threads can only be spawned with priorities that are supported by the underlying Operating System.

# Detailed Description

![A red triangular warning sign with a white background. Inside the triangle is a black exclamation point (!) and a black diamond shape (♦) directly below it.](.vortex-opensplice-c-reference-guide/97bdc9263a599b979ee75276fcdcf693c894373563923af1a4cbf1c59253b928.jpg)

This QosPolicy specifies the scheduling parameters that will be used for threads spawned by the DDS\_DomainParticipant. Note that some scheduling parameters may not be supported by the underlying Operating System or that you may need special privileges to select particular settings. Refer to the documentation of your OS for more details on this subject.

Although the behaviour of the scheduling\_class is highly dependent on the underlying OS, in general when running in a Timesharing class your thread will need to regularly yield execution to other threads of equal priority. In a Realtime class, your thread normally runs until completion and can only be pre-empted by higher priority threads. Often, the highest range of priorities is not accessible through a Timesharing Class.

The scheduling\_priority\_kind determines whether the specified scheduling\_priority should be interpreted as an absolute priority or whether it should be interpreted relative to the priority of its creator, in this case the priority of the thread that created the DDS\_DomainParticipant.

# 3.1.3.19 DDS\_TimeBasedFilterQosPolicy

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
struct DDS_TimeBasedFilterQosPolicy
{ DDS_Duration_t minimum_separation; };
```

# Description

This QosPolicy specifies a period after receiving a sample for a particular instance during which a DataReader will filter out new samples for the same instance.

At the end of the period the latest state of the instance will be notified and a new filter period will start. If there are no new samples in a period the filter will not notify the same latest already-notified state and it will wait for a new sample on this particular instance to start a new period.

In the case where the reliability QoS kind is RELIABLE the system guarantees that the latest state is notified.

Effectively the DataReader will receive at most one sample with the latest state per period for each instance.

# Attributes

DDS\_Duration\_t minimum\_separation - specifies the minimum period between received samples to be passed through the filter. The default value is 0, meaning that all samples are accepted.

# Detailed Description

This QosPolicy allows a DataReader to indicate that it is not interested in processing all samples for each instance. Instead it requests at most one change per minimum\_separation period.

The filter is applied to each data-instance separately. This means that new instances will not be filtered, no matter what the minimum\_separation period or their publication time is. The filter is only applied to samples belonging to the same instance, limiting the rate at which the DataReader is notified of the most current value of each instance. This can be helpful in situations where some nodes are capable of generating data much faster than others can consume it. Instance state changes are not affected by the filter, so a DataReader always contains the latest state of an instance.

The minimum\_separation period must be consistent with the DeadlineQos. If the minimum\_separation period is greater than the deadline period, the deadline cannot be met; therefore the two QoS policies are inconsistent. An attempt to set these policies with inconsistent values will result in a failure to create the DataReader or an INCONSISTENT\_POLICY return value.

This QosPolicy is applicable to a DDS\_DataReader only. After enabling the relevant DDS\_DataReader, this QosPolicy can be changed using the set\_qos operation.

# 3.1.3.20 DDS\_TopicDataQosPolicy

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
struct DDS_TopicDataQosPolicy
{ DDS_sequence_octet value; };
```

# Description

This QosPolicy allows the application to attach additional information to a DDS\_Topic DDS\_Entity. This information is distributed with the DDS\_BuiltinTopics.

# Attributes

DDS\_sequence\_octet value – a sequence of octets that holds the application topic data. By default, the sequence has length 0.

# Detailed Description

This QosPolicy allows the application to attach additional information to a DDS\_Topic Entity. This information is distributed with the BuiltinTopic. An application that discovers a new DDS\_Topic entity, can use this information to add additional functionality. The DDS\_TopicDataQosPolicy is changeable and updates of the BuiltinTopic instance must be expected. Note that the Data Distribution Service is not aware of the real structure of the topic data (the Data Distribution System handles it as an opaque type) and that the application is responsible for correct mapping on structural types for the specific platform.

# 3.1.3.21 DDS\_TransportPriorityQosPolicy

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
struct DDS_TransportPriorityQosPolicy
{ DDS_long value; };
```

# Description

This QosPolicy specifies the priority with which the Data Distribution System can handle the data produced by the DDS\_DataWriter.

# Attributes

DDS\_long value – specifies the priority with which the Data Distribution System can handle the data produced by the DDS\_DataWriter.

# Detailed Description

This QosPolicy specifies the priority with which the Data Distribution System can handle the data produced by a DDS\_DataWriter. This QosPolicy is considered to be a hint to the Data Distribution Service to control the priorities of the underlying transport means. A higher value represents a higher priority and the full range of the type is supported. By default the transport priority is set to 0.

The DDS\_TransportPriorityQosPolicy is applicable to both DDS\_Topic and DDS\_DataWriter entities. After enabling of the concerning DDS\_Entities, this QosPolicy may be changed by using the set\_qos operation.

# TopicQos

Note that changing this QosPolicy for the DDS\_Topic does not influence the behaviour of the Data Distribution System for existing DDS\_DataWriter entities because this QosPolicy is only used by the operation copy\_from\_topic\_qos and when specifying DDS\_DATAWRITER\_QOS\_USE\_TOPIC\_QOS when creating the DataWriter.

# 3.1.3.22 DDS\_UserDataQosPolicy

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
struct DDS_UserDataQosPolicy
{ DDS_sequence_octet value; };
```

# Description

This QosPolicy allows the application to attach additional information to a DDS\_DomainParticipant, DDS\_DataReader or DDS\_DataWriter DDS\_Entity. This information is distributed with the Builtin Topics.

# Attributes

DDS\_sequence\_octet value – is a sequence of octets that holds the application user data. By default, the sequence has length 0.

# Detailed Description

This QosPolicy allows the application to attach additional information to a DDS\_DomainParticipant, DDS\_DataReader or DDS\_DataWriter entity. This information is distributed with the Builtin Topics. An application that discovers a new DDS\_Entity of the listed kind, can use this information to add additional functionality. The DDS\_UserDataQosPolicy is changeable and updates of the Builtin Topic instance must be expected. Note that the Data Distribution Service is not aware of the real structure of the user data (the Data Distribution System handles it as an opaque type) and that the application is responsible for correct mapping on structural types for the specific platform.

# 3.1.3.23 DDS\_WriterDataLifecycleQosPolicy

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
struct DDS_WriterDataLifecycleQosPolicy
```

```txt
{ DDS_boolean autodispose_unregistered_instances; DDS_Duration_t autopurge_suspended_samples_delay; DDS_Duration_t autounregister_instance_delay; };
```

# Description

This QosPolicy drives the behaviour of a DataWriter concerning the life-cycle of the instances and samples that have been written by it.

# Attributes

DDS\_boolean autodispose\_unregistered\_instances - specifies whether the Data Distribution Service should automatically dispose instances that are unregistered by this DDS\_DataWriter. By default this value is TRUE.

DDS\_Duration\_t autopurge\_suspended\_samples\_delay – specifies the duration after which the DDS\_DataWriter will automatically remove a sample from its history during periods in which its Publisher is suspended. This duration is calculated based on the source timestamp of the written sample. By default the duration value is set to DDS\_DURATION\_INFINITE and therefore no a u t o m a t i c p u rg i n g o f s a m p l e s o c c u r s . S e e S e c t i o n 3 . 4 . 1 . 1 9 , DDS\_Publisher\_suspend\_publications, on page 314 for more information about suspended publication.

DDS\_Duration\_t autounregister\_instance\_delay – specifies the duration after which the DDS\_DataWriter will automatically unregister an instance after the application wrote a sample for it and no further action is performed on the same instance by this DDS\_DataWriter afterwards. This means that when the application writes a new sample for this instance, the duration is recalculated f r o m t h a t a c t i o n o n w a r d s . B y d e f a u l t t h e d u r a t i o n v a l u e i s DDS\_DURATION\_INFINITE and therefore no automatic unregistration occurs.

# Detailed Description

This QosPolicy controls the behaviour of the DDS\_DataWriter with regard to the lifecycle of the data-instances it manages, that is, the data-instances that have been registered either explicitly using one of the register operations or implicitly by directly writing the data using the special DDS\_HANDLE\_NIL parameter. (See also Section 3.4.2.50, SPACE\_FooDataWriter\_register\_instance, on page 361).

The autodispose\_unregistered\_instances flag controls what happens when an instance gets unregistered by the DDS\_DataWriter:

• If the DDS\_DataWriter unregisters the instance explicitly using either SPACE\_FooDataWriter\_unregister\_instance or SPACE\_FooDataWriter\_unregister\_instance\_w\_timestamp, then the autodispose\_unregistered\_instances flag is currently ignored and the instance is never disposed automatically.

• If the DDS\_DataWriter unregisters its instances implicitly because it is deleted, or if a DDS\_DataReader detects a loss of liveliness of a connected DDS\_DataWriter, or if autounregister\_instance\_delay expires, then the auto\_dispose\_unregistered\_instances flag determines whether the concerned instances are automatically disposed (TRUE) or not (FALSE).

For DDS\_DataWriters associated with TRANSIENT and PERSISTENT topics setting the autodispose\_unregister\_instances attribute to TRUE would mean that all instances that are not explicitly unregistered by the application will by default be removed from the Transient and Persistent stores when the DataWriter is d e l e t e d , w h e n a l o s s o f l i v e l i n e s s i s d e t e c t e d , o r w h e n t h e autounregister\_instance\_delay expires.

# 3.1.3.24 DDS\_SubscriptionKeyQosPolicy

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
struct DDS_SubscriptionKeyQosPolicy
{ DDS_boolean use_key_list,
DDS_StringSeq key_list };
```

# Description

This QosPolicy allows the DataReader to define its own set of keys on the data, potentially different from the keys defined on the topic.

![The image displays a standard warning sign featuring an equilateral triangle with a thick red border and a white interior. In the center is a black exclamation mark. Below the exclamation mark, near the bottom edge of the triangle, is a small black diamond shape.](.vortex-opensplice-c-reference-guide/ac24ec120fce92066b91edc237b2bfc61688adf526dcf45f2ba8ac8aea94fbe1.jpg)

NOTE: This is an OpenSplice-specific QosPolicy, it is not part of the DDS Specification.

# Attributes

DDS\_boolean use\_key\_list – Controls whether the alternative key list is applied on the DataReader.

DDS\_StringSeq key\_list – A sequence of strings with one or more names of topic fields acting as alternative keys.

# Detailed Description

By using the SubscriptionKeyQosPolicy, a DataReader can force its own key-list definition on data samples. The consequences are that the DataReader will internally keep track of instances based on its own key list, instead of the key list dictated by the Topic.

O p e r a t i o n s t h a t o p e r a t e o n i n s ta n c e s o r i n s t a n c e h a n d l e s , s u c h a s lookup\_instance or get\_key\_value, respect the alternative key-list and work as expected. However, since the mapping of writer instances to reader instances is no longer trivial (one writer instance may now map to more than one matching reader instance and vice versa), a writer instance will no longer be able to fully determine the lifecycle of its matching reader instance, nor the value its view\_state and instance\_state.

In fact, by diverting from the conceptual 1 – 1 mapping between writer instance and reader instance, the writer can no longer keep an (empty) reader instance ALIVE by just refusing to unregister its matching writer instance. That means that when a reader takes all samples from a particular reader instance, that reader instance will immediately be removed from the reader’s administration. Any subsequent reception of a message with the same keys will re-introduce the instance into the reader administration, setting its view\_state back to NEW. Compare this to the default behaviour, where the reader instance will be kept alive as long as the writer does not unregister it. That causes the view\_state in the reader instance to remain NOT\_NEW, even if the reader has consumed all of its samples prior to receiving an update.

Another consequence of allowing an alternative keylist is that events that are communicated by invalid samples (i.e. samples that have only initialized their keyfields) may no longer be interpreted by the reader to avoid situations in which uninitialized non-keyfields are treated as keys in the alternative keylist. This effectively means that all invalid samples (e.g. unregister messages and both implicit and explicit dispose messages) will be skipped and can no longer affect the instance\_state, which will therefore remain ALIVE. The only exceptions to this are the messages that are transmitted explicitly using the writedispose() call (see Section 3.4.2.29, DDS\_DataWriter\_writedispose (abstract), on page 344), which always includes a full and valid sample and can therefore modify the instance\_state to NOT\_ALIVE\_DISPOSED.

By default, the SubscriptionKeyQosPolicy is not used because use\_key\_list is set to FALSE.

This QosPolicy is applicable to a DataReader only, and cannot be changed after the DataReader is enabled.

# 3.1.3.25 DDS\_ReaderLifespanQosPolicy

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
struct DDS_ReaderLifespanQosPolicy
{ DDS_boolean use_lifespan,
DDS_Duration_t duration };
```

# Description

Automatically remove samples from the DataReader after a specified timeout.

![The image shows a triangular warning sign with a red outline and a white interior. Inside the triangle, there is a large black exclamation mark. Directly below the exclamation mark is a black plus sign.](.vortex-opensplice-c-reference-guide/5354d1c756f863debd5ce0bb0ced364ecdad3d4bc9370f24b1bfd6d86c68f48c.jpg)

NOTE: This is an OpenSplice-specific QosPolicy, it is not part of the DDS Specification.

# Attributes

DDS\_boolean use\_lifespan – Controls whether the lifespan is applied to the samples in the DataReader.

DDS\_Duration\_t duration – The duration after which data loses validity and is removed.

# Detailed Description

This QosPolicy is similar to the LifespanQosPolicy (applicable to Topic and DataWriter), but limited to the DataReader on which the QosPolicy is applied. The data is automatically removed from the DataReader if it has not been taken yet after the lifespan duration expires. The duration of the ReaderLifespan is added to the insertion time of the data in the DataReader to determine the expiry time.

W h e n b o t h t h e R e a de r L i f e s pa n Q o s P ol i c y a n d a D a t a Wri t e r ’s LifespanQosPolicy are applied to the same data, only the earliest expiry time is taken into account.

By default, the ReaderLifespanQosPolicy is not used and use\_lifespan is FALSE. The duration is set to DURATION\_INFINITE.

This QosPolicy is applicable to a DataReader only, and is mutable even when the DataReader is already enabled. If modified, the new setting will only be applied to samples that are received after the modification took place.

# 3.1.3.26 DDS\_ShareQosPolicy

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
struct DDS_ShareQosPolicy
{ DDS_string name,
DDS_boolean enable };
```

# Description

Used to share a DataReader between multiple processes.

![A red triangular warning sign with a white background containing a black exclamation mark.](.vortex-opensplice-c-reference-guide/f623330ea183ebde0f76b4b2f1874ceaa61d435dfd8f47030f1f626dd5cef5f2.jpg)

NOTE: This is an OpenSplice-specific QosPolicy, it is not part of the DDS Specification.

# Attributes

DDS\_string name - The label used to identify the shared Entity.

DDS\_boolean enable - Controls whether the entity is shared.

# Detailed Description

This QosPolicy allows sharing of entities by multiple processes or threads. When the policy is enabled, the data distribution service will try to look up an existing entity that matches the name supplied in the ShareQosPolicy. A new entity will only be created if a shared entity registered under the specified name doesn’t exist yet.

Shared Readers can be useful for implementing algorithms like the worker pattern, where a single shared reader can contain samples representing different tasks that may be processed in parallel by separate processes. In this algorithm each processes consumes the task it is going to perform (i.e. it takes the sample represening that task), thus preventing other processes from consuming and therefore performing the same task.

![The image displays a triangular warning sign with a red border and white interior. Centered within is a black exclamation mark with a small black arrow pointing downward beneath it.](.vortex-opensplice-c-reference-guide/2092da9a41832ddaf69b63341ff179fa98fd912e2c28ab6d58840a4a23cf4a35.jpg)

NOTE: Entities can only be shared between processes if OpenSplice is running in federated mode, because it requires shared memory to communicate between the different processes.

By default, the ShareQosPolicy is not used and enable is FALSE. Name must be set to a valid string for the ShareQosPolicy to be valid when enable is set to TRUE.

This QosPolicy is applicable to DataReader and Subscriber entities, and cannot be modified after the DataReader or Subscriber is enabled. Note that a DataReader can only be shared if its Subscriber is also shared.

# 3.1.3.27 DDS\_ViewKeyQosPolicy

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
struct DDS_ViewKeyQosPolicy
{ DDS_boolean use_key_list;
DDS_StringSeq key_list };
```

# Description

Used to define a set of keys on a DataReaderView.

![The image shows a red triangular warning sign with rounded corners. Inside the triangle, there is a black exclamation mark '!' centered horizontally. Directly below the exclamation mark is a black diamond shape '♦'.](.vortex-opensplice-c-reference-guide/90d7b19d38655b8c2cf407e6873ac496433753f3498fe5a98485b5b1eabb5177.jpg)

NOTE: This is an OpenSplice-specific QosPolicy, it is not part of the DDS Specification.

# Detailed Description

This QosPolicy is used to set the key list of a DataReaderView. A DataReaderView allows a different view, defined by this key list, on the data set of the DataReader from which it is created.

O p e r a t i o n s t h a t o p e r a t e o n i n s ta n c e s o r i n s t a n c e h a n d l e s , s u c h a s lookup\_instance or get\_key\_value, respect the alternative key-list and work as expected. However, since the mapping of writer instances to reader instances is no longer trivial (one writer instance may now map to more than one matching reader instance and vice versa), a writer instance will no longer be able to fully determine the lifecycle of its matching reader instance, nor the value its view\_state and instance\_state.

In fact, the view sample will always copy the view\_state and instance\_state values from the reader sample to which it is slaved. If both samples preserve a 1 – 1 correspondence with respect to their originating instances (this may sometimes be the case even when an alternative keylist is provided, i.e. when one reader instance never maps to more than one view instance and vice versa) then the resulting instance\_state and view\_state still have a valid semantical meaning. If this 1 – 1 correspondence cannot be guaranteed, the resulting instance\_state and view\_state are semantically meaningless and should not be used to derive any conclusion regading the lifecycle of a view instance.

By default, the DDS\_ViewKeyQosPolicy is disabled because use\_key\_list is set to FALSE.

This QosPolicy is applicable to a DataReaderView only, and cannot be changed after the DataReaderView is created.

# 3.1.4 DDS\_Listener interface

This interface is the abstract base interface for all Listener interfaces. Listeners provide a generic mechanism for the Data Distribution Service to notify the application of relevant asynchronous status change events, such as a missed deadline, violation of a QosPolicy setting, etc. Each DCPS DDS\_Entity supports its own specialized kind of Listener. Listeners are related to changes in communication status. For each DDS\_Entity type, one specific Listener is derived from this interface. In the following modules, the following Listeners are derived from this interface:

• DDS\_DomainParticipantListener
• DDS\_TopicListener
• DDS\_PublisherListener
• DDS\_DataWriterListener
• DDS\_SubscriberListener
• DDS\_DataReaderListener.

The DDS\_Entity type specific Listener interfaces are part of the application which must implement the interface operations. A user-defined class for these operations must be provided by the application which must extend from the specific

Listener class. All Listener operations must be implemented in the user-defined class, it is up to the application whether an operation is empty or contains some functionality.

![Based on the provided flowchart, here are the labeled blocks and their connections:\n\n**Labeled Blocks:**\n\n*   **`((Interface)) Listener`** (from Infrastructure Module)\n    *   *(No methods listed)*\n*   **`((Interface)) DataWriterListener`**\n    *   `on_liveliness_lost()`\n    *   `on_offered_deadline_missed()`\n    *   `on_offered_incompatible_qos()`\n    *   `on_publication_match()`\n*   **`((Interface)) DataReaderListener`**\n    *   `on_data_available()`\n    *   `on_liveliness_changed()`\n    *   `on_requested_deadline_missed()`\n    *   `on_requested_incompatible_qos()`\n    *   `on_sample_lost()`\n    *   `on_sample_rejected()`\n    *   `on_subscription_match()`\n*   **`((Interface)) TopicListener`**\n    *   `on_inconsistent_topic()`\n*   **`((Interface)) PublisherListener`**\n    *   *(No methods listed)*\n*   **`((Interface)) SubscriberListener`**\n    *   `on_data_on_readers()`\n*   **`DomainParticipantListener`**\n    *   *(No methods listed)*\n\n**Connections:**\nThe diagram uses arrows with hollow triangular heads pointing upwards to indicate inheritance or realization relationships.\n\n*   **`DataWriterListener`** connects to **`Listener`**\n*   **`DataReaderListener`** connects to **`Listener`**\n*   **`TopicListener`** connects to **`Listener`**\n*   **`PublisherListener`** connects to **`DataWriterListener`**\n*   **`SubscriberListener`** connects to **`DataReaderListener`**\n*   **`DomainParticipantListener`** connects to **`PublisherListener`**\n*   **`DomainParticipantListener`** connects to **`TopicListener`**\n*   **`DomainParticipantListener`** connects to **`SubscriberListener`**](.vortex-opensplice-c-reference-guide/33cb5205af4b6f82a842717d71940bd0c78e72f103b77f81f843fff962707b44.jpg)

Figure 11: DCPS Listeners

The base class DDS\_Listener does not contain any operations.

# 3.1.5 Struct DDS\_Status

Each concrete DDS\_Entity class has a set of DDS\_Status attributes and for each attribute the DDS\_Entity class provides an operation to read the value. Changes to DDS\_Status attributes will affect associated DDS\_StatusCondition and (invoked and associated) Listener objects.

The communication statuses whose changes can be communicated to the application depend on the DDS\_Entity. The following table shows the relevant statuses for each DDS\_Entity.

Table 15: Status Description Per DDS\_Entity

<table><tr><td>DDS_Entity</td><td>Status Name</td><td>Meaning</td></tr><tr><td rowspan="2">DDS_Topic</td><td>DDS_INCONSISTENT_TOPIC_STATUS</td><td>Another DDS_Topic exists with the same name but with different characteristics.</td></tr><tr><td>DDS_ALL_DATA_DISPOSED_TOPIC_STATUS</td><td>All instances of the Topic have been disposed by the dispose_all_data operation on that topic.</td></tr><tr><td>DDS_Subscriber</td><td>DDS_DATA_ON_READERS_STATUS</td><td>New information is available.</td></tr><tr><td rowspan="7">DDS_DataReader</td><td>DDS_SAMPLE_REJECTED_STATUS</td><td>A (received) sample has been rejected.</td></tr><tr><td>DDS_LIVELINESS_CHANGED_STATUS</td><td>The liveliness of one or more DDS_DataWriter objects that were writing instances read through the DDS_DataReader has changed. Some DDS_DataWriter have become “alive” or “not alive”.</td></tr><tr><td>DDS_REQUESTED_DEADLINE_MISSED_STATUS</td><td>The deadline that the DDS_DataReader was expecting through its DDS_DeadlineQosPolicy was not respected for a specific instance.</td></tr><tr><td>DDS_REQUESTED_INCOMPATIBLE_QOS_STATUS</td><td>A QosPolicy setting was incompatible with what is offered.</td></tr><tr><td>DDS_DATA_AVAILABLE_STATUS</td><td>New information is available.</td></tr><tr><td>DDS_SAMPLE_LOST_STATUS</td><td>A sample has been lost (never received).</td></tr><tr><td>DDS_SUBSCRIPTION_MATCHED_STATUS</td><td>The DDS_DataReader has found a DDS_DataWriter that matches the DDS_Topic and has compatible QoS.</td></tr><tr><td rowspan="4">DDS_DataWriter</td><td>DDS_LIVELINESS_LOST_STATUS</td><td>The liveliness that the DDS_DataWriter has committed through itsDDS_LivelinessQosPolicy was not respected; thus DDS_DataReader objects will consider the DDS_DataWriter as no longer “alive”.</td></tr><tr><td>DDS_OFFERED_DEADLINE_MISSED_STATUS</td><td>The deadline that the DDS_DataWriter has committed through itsDDS_DeadlineQosPolicy was not respected for a specific instance.</td></tr><tr><td>DDS_OFFERED_INCOMPATIBLE_QOS_STATUS</td><td>A QosPolicy setting was incompatible with what was requested.</td></tr><tr><td>DDS_PUBLICATION_MATCHED_STATUS</td><td>The DDS_DataWriter has found a DDS_DataReader that matches the DDS_Topic and has compatible QoS.</td></tr></table>

A D D S \_ S t a t u s a t t r i b u t e c a n b e r e t r i e v e d w i t h t h e o p e r a t i o n get\_&lt;status\_name&gt;\_status. For example, to get the DDS\_InconsistentTopicStatus value, the application must call the operation DDS\_Topic\_get\_inconsistent\_topic\_status.

Conceptually associated with each DDS\_Entity communication status is a logical StatusChangedFlag. This flag indicates whether that particular communication status has changed. The StatusChangedFlag is only conceptual, therefore, it is not important whether this flag actually exists.

For the plain communication DDS\_Status, the StatusChangedFlag is initially set to FALSE. It becomes TRUE whenever the plain communication DDS\_Status changes and it is reset to FALSE each time the application accesses the plain communication DDS\_Status via the proper get\_&lt;status\_name&gt;\_status operation on the DDS\_Entity.

A flag set means that a change has occurred since the last time the application has read its value.

![The diagram is a UML class diagram showing inheritance relationships and dependencies.\n\n**Labeled Blocks and Attributes:**\n\n*   **Status** (Top Center)\n*   **SampleLostStatus** (Left): `total_count : long`, `total_count_change : long`\n*   **InconsistentTopicStatus** (Left): `total_count : long`, `total_count_change : long`\n*   **SampleRejectedStatus** (Left): `total_count : long`, `total_count_change : long`, `last_reason : SampleRejectedStatusKind`, `last_instance_handle : InstanceHandle_t`\n*   **PublicationMatchStatus** (Left): `total_count : long`, `total_count_change : long`, `last_subscription_handle : InstanceHandle_t`\n*   **LivelinessChangedStatus** (Middle): `active_count : long`, `inactive_count : long`, `active_count_change : long`, `inactive_count_change : long`\n*   **OfferedDeadlineMissedStatus** (Middle): `total_count : long`, `total_count_change : long`, `last_instance_handle : InstanceHandle_t`\n*   **RequestedDeadlineMissedStatus** (Middle): `total_count : long`, `total_count_change : long`, `last_instance_handle : InstanceHandle_t`\n*   **SubscriptionMatchStatus** (Middle): `total_count : long`, `total_count_change : long`, `last_publication_handle : InstanceHandle_t`\n*   **LivelinessLostStatus** (Right): `total_count`, `total_count_change`\n*   **RequestedIncompatebeQosStatus** (Right): `total_count`, `total_count_change`, `last_policy_id`, `policies (')`\n*   **OfferedIncompatibleQosStatus** (Right): `total_count`, `total_count_change`, `last_policy_id`, `policies (')`\n*   **QosPolicyCount** (Bottom Right): `policy_id`, `count`\n\n**Connections:**\n\n*   **Inheritance:** An open arrowhead points towards the **Status** block. Lines connect this arrow to the following blocks, indicating they inherit from **Status**: **SampleLostStatus**, **InconsistentTopicStatus**, **SampleRejectedStatus**, **PublicationMatchStatus**, **LivelinessChangedStatus**, **OfferedDeadlineMissedStatus**, **RequestedDeadlineMissedStatus**, **SubscriptionMatchStatus**, **LivelinessLostStatus**, **RequestedIncompatebeQosStatus**, and **OfferedIncompatibleQosStatus**.\n*   **Dependency/Association:** Lines extend from the right side of **RequestedIncompatebeQosStatus** and **OfferedIncompatibleQosStatus**, running downwards and pointing with an arrowhead towards **QosPolicyCount**.](.vortex-opensplice-c-reference-guide/b1201eba45e8876c4ec835b772e989c18c114c695e8061ed36ad887f6d2315cf.jpg)

Figure 12: DCPS DDS\_Status Values

Each DDS\_Status attribute is implemented as a struct and therefore does not provide any operations. The interface description of these structs is as follows:

```c
/*
 * struct DDS_&lt;name&gt;Status
 */
struct DDS_InconsistentTopicStatus
    { DDS_long total_count;
    DDS_long total_count_change; };
struct DDS_AllDataDisposedTopicStatus
    { DDS_long total_count;
    DDS_long total_count_change; }
struct DDS_SampleLostStatus
    { DDS_long total_count;
    DDS_long total_count_change; };
enum DDS_SampleRejectedStatusKind
    { DDS_NOT_REJECTED,
    DDS_REJECTED_BY_INSTANCES_LIMIT,
    DDS_REJECTED_BY_SAMPLES_LIMIT,
    DDS_REJECTED_BY_SAMPLES_PER_INSTANCE_LIMIT };
struct DDS_SampleRejectedStatus
    { DDS_long total_count;
    DDS_long total_count_change;
    DDS_SampleRejectedStatusKind last_reason;
```

```c
DDS_InstanceHandle_t last_instance_handle; };
struct DDS_LivelinessLostStatus
{ DDS_long total_count;
DDS_long total_count_change; };
struct DDS_LivelinessChangedStatus
{ DDS_long alive_count;
DDS_long not_alive_count;
DDS_long alive_count_change;
DDS_long not_alive_count_change;
DDS_InstanceHandle_t last_publication_handle; };
struct DDS_OfferedDeadlineMissedStatus
{ DDS_long total_count;
DDS_long total_count_change;
DDS_InstanceHandle_t last_instance_handle; };
struct DDS_RequestedDeadlineMissedStatus
{ DDS_long total_count;
DDS_long total_count_change;
DDS_InstanceHandle_t last_instance_handle; };
struct DDS_OfferedIncompatibleQosStatus
{ DDS_long total_count;
DDS_long total_count_change;
DDS_QosPolicyId_t last_policy_id;
DDS_QosPolicyCountSeq policies; };
struct DDS_RequestedIncompatibleQosStatus
{ DDS_long total_count;
DDS_long total_count_change;
DDS_QosPolicyId_t last_policy_id;
DDS_QosPolicyCountSeq policies; };
struct DDS_PublicationMatchedStatus
{ DDS_long total_count;
DDS_long total_count_change;
DDS_long current_count;
DDS_long current_count_change;
DDS_InstanceHandle_t last Subscription_handle; };
struct DDS_SubscriptionMatchedStatus
{ DDS_long total_count;
DDS_long total_count_change;
DDS_long current_count;
DDS_long current_count_change;
DDS_InstanceHandle_t last Publication_handle; };
/*
* implemented API operations
* &lt;no operations&gt;
*/
```

The sections describe the usage of each DDS\_&lt;name&gt;Status struct.

# 3.1.5.1 DDS\_InconsistentTopicStatus

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
struct DDS_InconsistentTopicStatus
{ DDS_long total_count;
DDS_long total_count_change; };
```

# Description

This struct contains the statistics about attempts to create other DDS\_Topics with the same name but with different characteristics.

# Attributes

DDS\_long total\_count - the total detected cumulative count of DDS\_Topic creations, whose name matches the DDS\_Topic to which this DDS\_Status is attached and whose characteristics are inconsistent.

DDS\_long total\_count\_change - the change in total\_count since the last time the Listener was called or the DDS\_Status was read.

# Detailed Description

This struct contains the statistics about attempts to create other DDS\_Topics with the same name but with different characteristics.

The attribute total\_count holds the total cumulative count of DDS\_Topic creations, whose name matches the DDS\_Topic to which this DDS\_Status is attached and whose characteristics are inconsistent.

The attribute total\_count\_change holds the incremental number of inconsistent DDS\_Topics, since the last time the Listener was called or the DDS\_Status was read.

# 3.1.5.2 DDS\_LivelinessChangedStatus

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
struct DDS_LivelinessChangedStatus
{ DDS_long alive_count;
DDS_long not_alive_count;
DDS_long alive_count_change;
DDS_long not_alive_count_change;
DDS_InstanceHandle_t last_publication_handle; };
```

# Description

This struct contains the statistics about whether the liveliness of one or more connected DDS\_DataWriter objects has changed.

# Attributes

DDS\_long alive\_count - the total count of currently alive DDS\_DataWriter objects that write the topic read by the DDS\_DataReader to which this DDS\_Status is attached.

DDS\_long not\_alive\_count - the total count of currently not alive DDS\_DataWriter objects that wrote the topic read by the DDS\_DataReader to which this DDS\_Status is attached.

DDS\_long alive\_count\_change - the change in alive\_count since the last time the Listener was called or the DDS\_Status was read.

DDS\_long not\_alive\_count\_change - the change in not\_alive\_count since the last time the Listener was called or the DDS\_Status was read.

DDS\_InstanceHandle\_t last\_publication\_handle - handle to the last DDS\_DataWriter whose change in liveliness caused this status to change.

# Detailed Description

This struct contains the statistics about whether the liveliness of one or more connected DDS\_DataWriter objects that were writing instances read through the DDS\_DataReader has changed. In other words, some DDS\_DataWriters have become “alive” or “not alive”.

The attribute alive\_count holds the total number of currently alive DDS\_DataWriter objects that write the topic read by the DDS\_DataReader to which this DDS\_Status is attached. This count increases when a newly matched D D S \_ D a t a W r i t e r a ss e r t s i t s l i v e l i n e s s f o r t h e f i r st t i m e o r w h e n a DDS\_DataWriter previously considered to be not alive reasserts its liveliness. The count decreases when a DDS\_DataWriter considered alive fails to assert its liveliness and becomes not alive, whether because it was deleted normally or for some other reason.

The attribute not\_alive\_count holds the total count of currently not alive DDS\_DataWriters that wrote the topic read by the DDS\_DataReader to which this DDS\_Status is attached, and that are no longer asserting their liveliness. This count increases when a DDS\_DataWriter considered alive fails to assert its liveliness and becomes not alive for some reason other than the normal deletion of that DDS\_DataWriter. It decreases when a previously not alive DDS\_DataWriter either reasserts its liveliness or is deleted normally.

The attribute alive\_count\_change holds the change in alive\_count since the last time the Listener was called or the DDS\_Status was read.

T h e a t t r i b u t e n o t \_ al i v e \_ c o un t \_ c h a ng e h o l d s t h e c h a n g e i n not\_alive\_count since the last time the Listener was called or the DDS\_Status was read.

![The image displays a red triangular warning sign with a white interior. Inside the triangle is a black exclamation mark. Below the exclamation mark is a vertical black line extending downwards that connects to a small black diamond shape at the bottom. There is no text present in the image.](.vortex-opensplice-c-reference-guide/109dcecf2200a17c41a5abe9b5b6bc2c6675f0d0bbc19cbda2e1b0785c6b9782.jpg)

The attribute last\_publication\_handle contains the instance handle to the DDS\_PublicationBuiltinTopicData instance that represents the last datawriter whose change in liveliness caused this status to change. Be aware that t h i s h a n d l e b e l o n g s t o a n o t h e r d a t a r e a d e r, t h e DDS\_PublicationBuiltinTopicDataDataReader in the builtin-subscriber, and has no meaning in the context of the datareader from which the DDS\_LivelinessChangedStatus was obtained. If the builtin-subscriber has not e x p l i c i t l y b e e n o b t a i n e d u s i n g DDS\_DomainParticipant\_get\_builtin\_subscriber, then there is no DDS\_PublicationBuiltinTopicDataDataReader as well, in which case the last\_publication\_handle will be set to DDS\_HANDLE\_NIL.

# 3.1.5.3 DDS\_LivelinessLostStatus

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
struct DDS_LivelinessLostStatus
{ DDS_long total_count;
DDS_long total_count_change; };
```

# Description

This struct contains the statistics about whether the liveliness of the DDS\_DataWriter to which this DDS\_Status is attached has been committed through its DDS\_LivelinessQosPolicy.

# Attributes

DDS\_long total\_count - the total cumulative count of times the DDS\_DataWriter to which this DDS\_Status is attached failed to actively signal its liveliness within the offered liveliness period.

DDS\_long total\_count\_change - the change in total\_count since the last time the Listener was called or the DDS\_Status was read.

# Detailed Description

This struct contains the statistics about whether the liveliness of the DDS\_DataWriter to which this DDS\_Status is attached has been committed through its DDS\_LivelinessQosPolicy. In other words, whether the DDS\_DataWriter failed to actively signal its liveliness within the offered liveliness period. In such a case, the connected DDS\_DataReader objects will consider the DDS\_DataWriter as no longer “alive”.

The attribute total\_count holds the total cumulative number of times that the previously-alive DDS\_DataWriter became not alive due to a failure to actively signal its liveliness within its offered liveliness period. This count does not change when an already not alive DDS\_DataWriter simply remains not alive for another liveliness period.

The attribute total\_count\_change holds the change in total\_count since the last time the Listener was called or the DDS\_Status was read.

# 3.1.5.4 DDS\_OfferedDeadlineMissedStatus

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
struct DDS_OfferedDeadlineMissedStatus
{ DDS_long total_count;
DDS_long total_count_change;
DDS_InstanceHandle_t last_instance_handle; };
```

# Description

This struct contains the statistics about whether the deadline that the DDS\_DataWriter to which this DDS\_Status is attached has committed through its DDS\_DeadlineQosPolicy, was not respected for a specific instance.

# Attributes

DDS\_long total\_count - the total cumulative count of times the DDS\_DataWriter to which this DDS\_Status is attached failed to write within its offered deadline.

DDS\_long total\_count\_change - the change in total\_count since the last time the Listener was called or the DDS\_Status was read.

DDS\_InstanceHandle\_t last\_instance\_handle - the handle to the last instance in the DDS\_DataWriter to which this DDS\_Status is attached, for which an offered deadline was missed.

# Detailed Description

This struct contains the statistics about whether the deadline that the DDS\_DataWriter to which this DDS\_Status is attached has committed through its DDS\_DeadlineQosPolicy, was not respected for a specific instance.

The attribute total\_count holds the total cumulative number of offered deadline periods elapsed during which the DDS\_DataWriter to which this DDS\_Status is attached failed to provide data. Missed deadlines accumulate; that is, each deadline period the total\_count will be incremented by one.

The attribute total\_count\_change holds the change in total\_count since the last time the Listener was called or the DDS\_Status was read.

The attribute last\_instance\_handle holds the handle to the last instance in the DDS\_DataWriter to which this DDS\_Status is attached, for which an offered deadline was missed.

# 3.1.5.5 DDS\_OfferedIncompatibleQosStatus

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
struct DDS_OfferedIncompatibleQosStatus
{ DDS_long total_count;
DDS_long total_count_change;
QosPolicyId_t last_policy_id;
QosPolicyCountSeq policies; };
```

# Description

This struct contains the statistics about whether an offered QosPolicy setting was incompatible with the requested QosPolicy setting.

# Attributes

DDS\_long total\_count - the total cumulative count of DDS\_DataReader objects discovered by the DDS\_DataWriter with the same DDS\_Topic and Partition and with a requested DDS\_DataReaderQos that was incompatible with the one offered by the DDS\_DataWriter.

DDS\_long total\_count\_change - the change in total\_count since the last time the Listener was called or the DDS\_Status was read.

QosPolicyId\_t last\_policy\_id - the id of one of the QosPolicy settings that was found to be incompatible with what was offered, the last time an incompatibility was detected.

QosPolicyCountSeq policies - a list containing for each QosPolicy the total number of times that the concerned DDS\_DataWriter discovered a D D S\_ D a t a R e ad e r for the sa me D D S \_ T o pi c a nd a requeste d DDS\_DataReaderQos that is incompatible with the one offered by the DDS\_DataWriter.

# Detailed Description

This struct contains the statistics about whether an offered QosPolicy setting was incompatible with the requested QosPolicy setting.

The Request/Offering mechanism is applicable between:

• the DDS\_DataWriter and the DDS\_DataReader. If the QosPolicy settings between DDS\_DataWriter and DDS\_DataReader are incompatible, no communication between them is established. In addition the DDS\_DataWriter will be informed via a DDS\_REQUESTED\_INCOMPATIBLE\_QOS status change and the DDS\_DataReader will be informed via an DDS\_OFFERED\_INCOMPATIBLE\_QOS status change.

• the DDS\_DataWriter and the Durability Service (as a built-in DDS\_DataReader). If the QosPolicy settings between DDS\_DataWriter and the Durability Service are inconsistent, no communication between them is established. In that case data published by the DDS\_DataWriter will not be maintained by the service and as a consequence will not be available for late joining DDS\_DataReaders. The QosPolicy of the Durability Service in the role of DDS\_DataReader is specified by the DDS\_DurabilityServiceQosPolicy in the DDS\_Topic.

• the Durability Service (as a built-in DDS\_DataWriter) and the DDS\_DataReader. If the QosPolicy settings between the Durability Service and the DDS\_DataReader are inconsistent, no communication between them is established. In that case the Durability Service will not publish historical data to late joining DDS\_DataReaders. The QosPolicy of the Durability Service in the role of DDS\_DataWriter is specified by the DDS\_DurabilityServiceQosPolicy in the DDS\_Topic.

The attribute total\_count holds the total cumulative count of DDS\_DataReader objects discovered by the DDS\_DataWriter with the same DDS\_Topic and a requested DDS\_DataReaderQos that was incompatible with the one offered by the DDS\_DataWriter.

The attribute total\_count\_change holds the change in total\_count since the last time the Listener was called or the DDS\_Status was read.

The attribute last\_policy\_id holds the id of one of the QosPolicy settings that was found to be incompatible with what was offered, the last time an incompatibility was detected.

The attribute policies holds a list containing for each QosPolicy the total number of times that the concerned DDS\_DataWriter discovered an incompatible DDS\_DataReader for the same DDS\_Topic. Each element in the list represents a counter for a different QosPolicy, identified by a corresponding unique index number. A named list of all index numbers is expressed as a set of constants in the API. See Table 16: below for an overview of all these constants.

Table 16: Overview of All Named QosPolicy Indexes

<table><tr><td>Index Name</td><td>Index Value</td></tr><tr><td>DDS_INVALID_QOS_POLICY_ID</td><td>0</td></tr><tr><td>DDS_USERDATA_QOS_POLICY_ID</td><td>1</td></tr><tr><td>DDS_DURABILITY_QOS_POLICY_ID</td><td>2</td></tr><tr><td>DDS_PRESENTATION_QOS_POLICY_ID</td><td>3</td></tr><tr><td>DDS_DEADLINE_QOS_POLICY_ID</td><td>4</td></tr><tr><td>DDS_LATENCYBUDGET_QOS_POLICY_ID</td><td>5</td></tr><tr><td>DDS_OWNERSHIP_QOS_POLICY_ID</td><td>6</td></tr><tr><td>DDS_OWNERSHIPSTRENGTH_QOS_POLICY_ID</td><td>7</td></tr><tr><td>DDS_LIVELINESS_QOS_POLICY_ID</td><td>8</td></tr><tr><td>DDS_TIMEBASEDFILTER_QOS_POLICY_ID</td><td>9</td></tr><tr><td>DDS_PARTITION_QOS_POLICY_ID</td><td>10</td></tr><tr><td>DDS_RELIABILITY_QOS_POLICY_ID</td><td>11</td></tr><tr><td>DDS_DESTINATIONORDER_QOS_POLICY_ID</td><td>12</td></tr><tr><td>DDS_HISTORY_QOS_POLICY_ID</td><td>13</td></tr><tr><td>DDS_RESOURCELIMITS_QOS_POLICY_ID</td><td>14</td></tr><tr><td>DDS_ENTITYFACTORY_QOS_POLICY_ID</td><td>15</td></tr><tr><td>DDS_WRITERDATALIFECYCLE_QOS_POLICY_ID</td><td>16</td></tr><tr><td>DDS_READERDATALIFECYCLE_QOS_POLICY_ID</td><td>17</td></tr><tr><td>DDS_TOPICDATA_QOS_POLICY_ID</td><td>18</td></tr><tr><td>DDS_GROUPDATA_QOS_POLICY_ID</td><td>19</td></tr><tr><td>DDS_TRANSPORTPRIORITY_QOS_POLICY_ID</td><td>20</td></tr><tr><td>DDS_LIFESPAN_QOS_POLICY_ID</td><td>21</td></tr><tr><td>DDS_DURABILITIESERVICE_QOS_POLICY_ID</td><td>22</td></tr></table>

# 3.1.5.6 DDS\_PublicationMatchedStatus

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
struct DDS_PublicationMatchedStatus
{ DDS_long total_count;
DDS_long total_count_change;
DDS_long current_count;
DDS_long current_count_change;
```

DDS\_InstanceHandle\_t last\_subscription\_handle; };

# Description

This struct contains the statistics about the discovered number of matching DataReaders currently connected to the owner of this status, and of the cumulative number of DataReaders that has connected to the owner of this status over time.

# Attributes

DDS\_long total\_count - Total cumulative count of DataReaders compatible with the concerned DataWriter.

DDS\_long total\_count\_change - The change in total\_count since the last time the Status was read.

DDS\_long current\_count - Total count of DataReaders that are currently available and compatible with the DataWriter.

DDS\_long current\_count\_change - The change in current\_count since the last time the Status was read.

DDS\_InstanceHandle\_t last\_subscription\_handle - Handle to the last DataReader that matched the DataWriter causing the status to change.

# Detailed Description

This struct contains the statistics about the discovered number of DataReaders that are compatible with the DataWriter to which the Status is attached. DataReader and DataWriter are compatible if they use the same Topic and if the QoS requested by the DataReader is compatible with that offered by the DataWriter. A DataReader will automatically connect to a matching DataWriter, but will disconnect when that DataReader is deleted, when either changes its QoS into an incompatible value, or when either puts its matching counterpart on its ignore-list using the ignore\_subscription or ignore\_publication operations on the DomainParticipant.

The total\_count includes DataReaders that have already been disconnected, while in the current\_count only the currently connected DataReaders are considered.

# 3.1.5.7 DDS\_RequestedDeadlineMissedStatus

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
struct DDS_RequestedDeadlineMissedStatus
{ DDS_long total_count;
DDS_long total_count_change;
DDS_InstanceHandle_t last_instance_handle; };
```

# Description

This struct contains the statistics about whether the deadline that the DDS\_DataReader to which this DDS\_Status is attached was expecting through its DDS\_DeadlineQosPolicy, was not respected for a specific instance.

# Attributes

DDS\_long total\_count - the total cumulative count of the missed deadlines detected for any instance read by the DDS\_DataReader to which this DDS\_Status is attached.

DDS\_long total\_count\_change - the change in total\_count since the last time the Listener was called or the DDS\_Status was read.

DDS\_InstanceHandle\_t last\_instance\_handle - the handle to the last instance in the DDS\_DataReader to which this DDS\_Status is attached for which a missed deadline was detected.

# Detailed Description

This struct contains the statistics about whether the deadline that the DDS\_DataReader to which this DDS\_Status is attached was expecting through its DDS\_DeadlineQosPolicy, was not respected for a specific instance. Missed deadlines accumulate, that is, each deadline period the total\_count will be incremented by one for each instance for which data was not received.

The attribute total\_count holds the total cumulative count of the missed deadlines detected for any instance read by the DDS\_DataReader.

The attribute total\_count\_change holds the change in total\_count since the last time the Listener was called or the DDS\_Status was read.

The attribute last\_instance\_handle holds the handle to the last instance in the DDS\_DataReader for which a missed deadline was detected.

# 3.1.5.8 DDS\_RequestedIncompatibleQosStatus

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
struct DDS_RequestedIncompatibleQosStatus
{ DDS_long total_count;
DDS_long total_count_change;
QosPolicyId_t last_policy_id;
QosPolicyCountSeq policies; };
```

# Description

This struct contains the statistics about whether a requested QosPolicy setting was incompatible with the offered QosPolicy setting.

# Attributes

DDS\_long total\_count - holds the total cumulative count of DDS\_DataWriter objects, discovered by the DDS\_DataReader to which this DDS\_Status is attached, with the same DDS\_Topic and an offered DDS\_DataWriterQos that was incompatible with the one requested by the DDS\_DataReader.

DDS\_long total\_count\_change - holds the change in total\_count since the last time the Listener was called or the DDS\_Status was read.

QosPolicyId\_t last\_policy\_id - holds the DDS\_&lt;name&gt;\_QOS\_POLICY\_ID of one of the QosPolicies that was found to be incompatible with what was requested, the last time an incompatibility was detected.

QosPolicyCountSeq policies - a list containing (for each QosPolicy) the total number of times that the concerned DDS\_DataReader discovered a D D S\_ D a t a W r it e r w i t h t h e s a m e D D S\_ T o p i c a n d a n o ff e r e d DDS\_DataWriterQos that is incompatible with the one requested by the DDS\_DataReader.

# Detailed Description

This struct contains the statistics about whether a requested QosPolicy setting was incompatible with the offered QosPolicy setting.

The Request/Offering mechanism is applicable between:

• the DDS\_DataWriter and the DDS\_DataReader. If the QosPolicy settings between DDS\_DataWriter and DDS\_DataReader are incompatible, no communication between them is established. In addition the DDS\_DataWriter will be informed via a DDS\_REQUESTED\_INCOMPATIBLE\_QOS status change and the DDS\_DataReader will be informed via an DDS\_OFFERED\_INCOMPATIBLE\_QOS status change.

• the DDS\_DataWriter and the Durability Service (as a built-in DDS\_DataReader). If the QosPolicy settings between DDS\_DataWriter and the Durability Service are inconsistent, no communication between them is established. In that case data published by the DDS\_DataWriter will not be maintained by the service and as a consequence will not be available for late joining DDS\_DataReaders. The QosPolicy of the Durability Service in the role of DDS\_DataReader is specified by the DDS\_DurabilityServiceQosPolicy in the DDS\_Topic.

• the Durability Service (as a built-in DDS\_DataWriter) and the DDS\_DataReader. If the QosPolicy settings between the Durability Service and the DDS\_DataReader are inconsistent, no communication between them is established. In that case the Durability Service will not publish historical data to late joining DDS\_DataReaders. The QosPolicy of the Durability Service in the role of DDS\_DataWriter is specified by the DDS\_DurabilityServiceQosPolicy in the DDS\_Topic.

The attribute total\_count holds the total cumulative count of DDS\_DataWriter objects discovered by the DDS\_DataReader with the same DDS\_Topic and an offered DDS\_DataWriterQos that was incompatible with the one requested by the DDS\_DataReader.

The attribute total\_count\_change holds the change in total\_count since the last time the Listener was called or the DDS\_Status was read.

The attribute last\_policy\_id holds the DDS\_&lt;name&gt;\_QOS\_POLICY\_ID of one of the QosPolicies that was found to be incompatible with what was requested, the last time an incompatibility was detected.

The attribute policies holds a list containing for each QosPolicy: the total number of times that the concerned DDS\_DataReader discovered an incompatible DDS\_DataWriter for the same DDS\_Topic. Each element in the list represents a counter for a different QosPolicy, identified by a corresponding unique index number. A named list of all index numbers is expressed as a set of constants in the API. See Table 16, Overview of All Named QosPolicy Indexes, on page 128 for an overview of all these constants.

# 3.1.5.9 DDS\_SampleLostStatus

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
struct DDS_SampleLostStatus
{ DDS_long total_count;
DDS_long total_count_change; };
```

# Description

This struct contains the statistics about whether a sample has been lost (never received).

# Attributes

DDS\_long total\_count - holds the total cumulative count of all samples lost across all instances of data published under the DDS\_Topic.

DDS\_long total\_count\_change - holds the change in total\_count since the last time the Listener was called or the DDS\_Status was read.

# Detailed Description

This struct contains the statistics about whether a sample has been lost (never received). The status is independent of the differences in instances, in other words, it includes all samples lost across all instances of data published under the DDS\_Topic.

total\_count holds the total cumulative count of all samples lost across all instances of data published under the DDS\_Topic.

total\_count\_change holds the change in total\_count since the last time the Listener was called or the DDS\_Status was read.

# 3.1.5.10 DDS\_SampleRejectedStatus

# Synopsis

```c
#include &lt;dds_dcps.h&gt;

enum DDS_SampleRejectedStatusKind
{ DDS_NOT_REJECTED,
DDS_REJECTED_BY_INSTANCES_LIMIT,
DDS_REJECTED_BY_SAMPLES_LIMIT,
DDS_REJECTED_BY_SAMPLES_PER_INSTANCE_LIMIT };

struct DDS_SampleRejectedStatus
{ DDS_long total_count;
DDS_long total_count_change;
DDS_SampleRejectedStatusKind last_reason;
DDS_InstanceHandle_t last_instance_handle; };
```

# Description

This struct contains the statistics about samples that have been rejected.

# Attributes

DDS\_long total\_count - holds the total cumulative count of samples rejected by the DDS\_DataReader to which this DDS\_Status is attached.

DDS\_long total\_count\_change - holds the change in total\_count since the last time the Listener was called or the DDS\_Status was read.

DDS\_SampleRejectedStatusKind last\_reason - holds the reason for rejecting the last sample.

DDS\_InstanceHandle\_t last\_instance\_handle - holds the handle to the instance which would have updated by the last sample that was rejected.

# Detailed Description

This struct contains the statistics about whether a received sample has been rejected.

The attribute total\_count holds the total cumulative count of samples rejected by the DDS\_DataReader to which this DDS\_Status is attached.

The attribute total\_count\_change holds the change in total\_count since the last time the Listener was called or the DDS\_Status was read.

The attribute last\_reason holds the reason for rejecting the last sample. The attribute can have the following values:

• DDS\_NOT\_REJECTED - no sample has been rejected yet.
• DDS\_REJECTED\_BY\_INSTANCES\_LIMIT - the sample was rejected because it would exceed the maximum number of instances set by the DDS\_ResourceLimitsQosPolicy.
• DDS\_REJECTED\_BY\_SAMPLES\_LIMIT - the sample was rejected because it would exceed the maximum number of samples set by the DDS\_ResourceLimitsQosPolicy.
• DDS\_REJECTED\_BY\_SAMPLES\_PER\_INSTANCE\_LIMIT - the sample was rejected because it would exceed the maximum number of samples per instance set by the DDS\_ResourceLimitsQosPolicy.

The attribute last\_instance\_handle holds the handle to the instance which would have updated by the last sample that was rejected.

# 3.1.5.11 DDS\_SubscriptionMatchedStatus

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
struct DDS_SubscriptionMatchedStatus
{ DDS_long total_count;
DDS_long total_count_change;
DDS_long current_count;
DDS_long current_count_change;
DDS_InstanceHandle_t last_publication_handle; };
```

# Description

This struct contains the statistics about the discovered number of matching DataWriters currently connected to the owner of this status, and of the cumulative number of DataWriters that has connected to the owner of this status over time.

# Attributes

DDS\_long total\_count - Total cumulative count of DataWriters compatible with the concerned DataReader.

DDS\_long total\_count\_change - The change in total\_count since the last time the Status was read.

DDS\_long current\_count - Total count of DataWriters that are currently available and compatible with the DataWriter.

DDS\_long current\_count\_change - The change in current\_count since the last time the Status was read.

DDS\_InstanceHandle\_t last\_publication\_handle - Handle to the last DataWriter that matched the DataReader causing the status to change.

# Detailed Description

This struct contains the statistics about the discovered number of DataWriters that are compatible with the DataReader to which the Status is attached. DataWriter and DataReader are compatible if they use the same Topic and if the QoS requested by the DataReader is compatible with that offered by the DataWriter. A DataWriter will automatically connect to a matching DataReader, but will disconnect when that DataWriter is deleted, when either changes its QoS into an incompatible value, or when either puts its matching counterpart on its ignore-list using the ignore\_subscription or ignore\_publication operations on the DomainParticipant.

The total\_count includes DataWriters that have already been disconnected, while in the current\_count only the currently connected DataWriters are considered.

# 3.1.5.12 DDS\_AllDataDisposedTopicStatus

# Synopsis

```txt
#include &lt;dds_dcps.h&gt;
struct DDS_AllDataDisposedTopicStatus
{ DDS_long total_count
DDS_long total_count_change }
```

# Description

T h i s s t r u c t c o n t a i n s t h e s t a t i s t i c s a b o u t t h e o c c u r e n c e o f t h e DDS\_ALL\_DATA\_DISPOSED\_TOPIC\_STATUS event on the Topic to which this Status is attached.

# Attributes

DDS\_long total\_count - the total detected cumulative count of ALL\_DATA\_DISPOSED\_TOPIC\_STATUS events.

DDS\_long total\_count\_change - the change in total\_count since the last time the Status was read.

# Detailed Description

T h i s s t r u c t c o n t a i n s t h e s t a t i s t i c s a b o u t t h e o c c u r e n c e o f t h e DDS\_ALL\_DATA\_DISPOSED\_TOPIC\_STATUS event on the Topic to which this Status is attached. The Status is directly related to the invocation of the DDS\_Topic\_dispose\_all\_data() operation. Statistics are only kept when all instances are disposed using this operation, not when instances are disposed seperately by individual dispose calls.

# 3.1.6 Class DDS\_WaitSet

A DDS\_WaitSet object allows an application to wait until one or more of the attached DDS\_Condition objects evaluates to TRUE or until the timeout expires.

The DDS\_WaitSet has no factory and must be created by the application. It is directly created as an object by using DDS\_WaitSet constructors.

![The image displays a UML class diagram with two blocks and a connecting association:\n\n**Blocks:**\n*   **Condition**: Contains the method `get_trigger_value()`.\n*   **WaitSet**: Contains the methods `attach_condition()`, `detach_condition()`, `get_conditions()`, and `wait()`.\n\n**Connections:**\n*   A horizontal line connects the right side of the **Condition** block to the left side of the **WaitSet** block.\n*   The line has an arrowhead pointing towards the **Condition** block.\n*   An asterisk `*` is located next to the arrowhead on the **Condition** side.\n*   A dot `.` is located next to the **WaitSet** block on the line.](.vortex-opensplice-c-reference-guide/16fb7b588757e540004fa81f46127b03ba3732c34cbc9942cccaa1912519fe4b.jpg)

Figure 13: DCPS DDS\_WaitSets

The interface description of this class is as follows:

```c
/*
 * interface DDS_WaitSet
 */
/*
 * implemented API operations
 */
DDS_WaitSet
    DDS_WaitSet__alloc
    (void);
DDS_ReturnCode_t
    DDS_WaitSet_wait
    (DDS_WaitSet _this,
    DDS_ConditionSeq *active_conditions,
    const DDS_Duration_t *timeout);
DDS_ReturnCode_t
    DDS_WaitSet_attach_condition
    (DDS_WaitSet _this,
    const DDS_Condition cond);
DDS_ReturnCode_t
    DDS_WaitSet_detach_condition
    (DDS_WaitSet _this,
    const DDS_Condition cond);
DDS_ReturnCode_t
```

```c
DDS_WaitSet_get_conditions
(DDS_WaitSet _this,
DDS_ConditionSeq *attached_conditions);
```

The following sections describe the usage of all DDS\_WaitSet operations.

# 3.1.6.1 DDS\_WaitSet\_\_alloc

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
DDS_WaitSet
DDS_WaitSet__alloc
(void);
```

# Description

This operation creates a new DDS\_WaitSet.

# Parameters

```txt
&lt;none&gt;
```

# Return Value

DDS\_WaitSet - handle to the newly-created DDS\_WaitSet. In case of an error, a DDS\_OBJECT\_NIL pointer is returned.

# Detailed Description

This operation creates a new DDS\_WaitSet. The DDS\_WaitSet must be created using this operation. In other words, the application is not allowed to declare an object of type DDS\_WaitSet. When the application wants to release the DDS\_WaitSet it must be released using DDS\_free.

In case there are insufficient resources available to allocate the DDS\_WaitSet, a DDS\_OBJECT\_NIL pointer is returned instead.

# 3.1.6.2 DDS\_WaitSet\_attach\_condition

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
DDS_ReturnCode_t
DDS_WaitSet_attach_condition
(DDS_WaitSet _this,
const DDS_Condition cond);
```

# Description

This operation attaches a DDS\_Condition to the DDS\_WaitSet.

# Parameters

in DDS\_WaitSet \_this - the DDS\_WaitSet object on which the operation is operated.

in const DDS\_Condition cond - a pointer to a DDS\_Condition.

# Return Value

DDS\_ReturnCode\_t - Possible return codes of the operation are: DDS\_RETCODE\_OK, DDS\_RETCODE\_ERROR, DDS\_RETCODE\_ILLEGAL\_ OPERATION, DDS\_RETCODE\_BAD\_PARAMETER or DDS\_RETCODE\_OUT\_OF\_ RESOURCES.

# Detailed Description

This operation attaches a DDS\_Condition to the DDS\_WaitSet. The parameter cond must be either a DDS\_ReadCondition, DDS\_QueryCondition, DDS\_StatusCondition or DDS\_GuardCondition. To get this parameter see:

• DDS\_ReadCondition created by DDS\_DataReader\_create\_readcondition
• DDS\_QueryCondition created by DDS\_DataReader\_create\_querycondition
• DDS\_StatusCondition retrieved by DDS\_&lt;Entity&gt;\_get\_statuscondition on an DDS\_&lt;Entity&gt;
• DDS\_GuardCondition created by the C operation DDS\_GuardCondition\_\_alloc.

When a DDS\_GuardCondition is initially created, the trigger\_value is FALSE.

When a DDS\_Condition, whose trigger\_value evaluates to TRUE, is attached t o a D D S \_ W a i t S e t t h a t i s c u r r e n t l y b e i n g w a i t e d o n ( u s i n g t h e DDS\_WaitSet\_wait operation), the DDS\_WaitSet will unblock immediately.

# Return Code

When the operation returns:

• DDS\_RETCODE\_OK - the DDS\_Condition is attached to the DDS\_WaitSet.
• DDS\_RETCODE\_ERROR - an internal error has occurred.
• DDS\_RETCODE\_ILLEGAL\_OPERATION - the operation is invoked on an inappropriate object.
• DDS\_RETCODE\_BAD\_PARAMETER - the parameter cond is not a valid DDS\_Condition.
• DDS\_RETCODE\_OUT\_OF\_RESOURCES - the Data Distribution Service ran out of resources to complete this operation.

# 3.1.6.3 DDS\_WaitSet\_detach\_condition

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
DDS_ReturnCode_t
DDS_WaitSet_detach_condition
(DDS_WaitSet _this,
const DDS_Condition cond)
```

# Description

This operation detaches a DDS\_Condition from the DDS\_WaitSet.

# Parameters

in DDS\_WaitSet \_this - the DDS\_WaitSet object on which the operation is operated.

in const DDS\_Condition cond - a pointer to a DDS\_Condition in the DDS\_WaitSet.

# Return Value

DDS\_ReturnCode\_t - Possible return codes of the operation are: DDS\_RETCODE\_OK, DDS\_RETCODE\_ERROR, DDS\_RETCODE\_ILLEGAL\_ OPERATION, DDS\_RETCODE\_BAD\_PARAMETER, DDS\_RETCODE\_ OUT\_OF\_RESOURCES or DDS\_RETCODE\_PRECONDITION\_NOT\_MET.

# Detailed Description

This operation detaches a DDS\_Condition from the DDS\_WaitSet. If the DDS\_Condition was not attached to this DDS\_WaitSet, the operation returns DDS\_RETCODE\_PRECONDITION\_NOT\_MET.

# Return Code

When the operation returns:

• DDS\_RETCODE\_OK - the DDS\_Condition is detached from the DDS\_WaitSet.
• DDS\_RETCODE\_ERROR - an internal error has occurred.
• DDS\_RETCODE\_ILLEGAL\_OPERATION - the operation is invoked on an inappropriate object.
• DDS\_RETCODE\_BAD\_PARAMETER - the parameter cond is not a valid DDS\_Condition.
• DDS\_RETCODE\_OUT\_OF\_RESOURCES - the Data Distribution Service ran out of resources to complete this operation.

• DDS\_RETCODE\_PRECONDITION\_NOT\_MET - the DDS\_Condition was not attached to this DDS\_WaitSet.

# 3.1.6.4 DDS\_WaitSet\_get\_conditions

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
DDS_ReturnCode_t
DDS_WaitSet_get_conditions
(DDS_WaitSet _this,
DDS_ConditionSeq *attached_conditions);
```

# Description

This operation retrieves the list of attached conditions.

# Parameters

in DDS\_WaitSet \_this - the DDS\_WaitSet object on which the operation is operated.

inout DDS\_ConditionSeq \*attached\_conditions - the inout parameter attached\_conditions is a sequence, which is used to pass the list of attached conditions.

# Return Value

DDS\_ReturnCode\_t - Possible return codes of the operation are: DDS\_RETCODE\_OK, DDS\_RETCODE\_ERROR, DDS\_RETCODE\_ILLEGAL\_ OPERATION or DDS\_RETCODE\_OUT\_OF\_RESOURCES.

# Detailed Description

This operation retrieves the list of attached conditions in the DDS\_WaitSet. The parameter attached\_conditions is a pointer to a sequence which afterwards will point to the sequence of attached conditions. The attached\_conditions sequence and its buffer may be pre-allocated by the application and therefore must e i t h e r b e r e - u s e d i n a s u b s e q u e n t i n v o c a t i o n o f t h e DDS\_WaitSet\_get\_conditions operation or be released by calling DDS\_free on the returned attached\_conditions. If the pre-allocated sequence is not big enough to hold the number of attached DDS\_Conditions, the sequence will automatically be (re-)allocated to fit the required size. The resulting sequence will either be an empty sequence, meaning there were no conditions attached, or will contain a list of DDS\_ReadCondition, DDS\_QueryCondition, DDS\_StatusCondition and DDS\_GuardCondition. These conditions previously have been attached by DDS\_WaitSet\_attach\_condition and were created by there respective create operation:

• DDS\_ReadCondition created by DDS\_DataReader\_create\_readcondition
• DDS\_QueryCondition created by DDS\_DataReader\_create\_querycondition
• DDS\_StatusCondition retrieved by DDS\_&lt;Entity&gt;\_get\_statuscondition on an DDS\_&lt;Entity&gt;
• DDS\_GuardCondition created by the C operation DDS\_GuardCondition\_\_alloc.

# Return Code

When the operation returns:

• DDS\_RETCODE\_OK - the list of attached conditions is returned
• DDS\_RETCODE\_ERROR - an internal error has occurred.
• DDS\_RETCODE\_ILLEGAL\_OPERATION - the operation is invoked on an inappropriate object.
• DDS\_RETCODE\_OUT\_OF\_RESOURCES - the Data Distribution Service ran out of resources to complete this operation.

# 3.1.6.5 DDS\_WaitSet\_wait

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
DDS_ReturnCode_t
DDS_WaitSet_wait
(DDS_WaitSet _this,
DDS_ConditionSeq *active_conditions,
const DDS_Duration_t *timeout)
```

# Description

This operation allows an application thread to wait for the occurrence of at least one of the conditions that is attached to the DDS\_WaitSet.

# Parameters

in DDS\_WaitSet \_this - the DDS\_WaitSet object on which the operation is operated.

inout DDS\_ConditionSeq \*active\_conditions - a sequence which is used to pass the list of all the attached conditions that have a trigger\_value of TRUE.

in const DDS\_Duration\_t \*timeout - the maximum duration to block for the DDS\_WaitSet\_wait, after which the application thread is unblocked. The special constant DDS\_DURATION\_INFINITE can be used when the maximum waiting time does not need to be bounded.

# Return Value

DDS\_ReturnCode\_t - Possible return codes of the operation are: DDS\_RETCODE\_OK, DDS\_RETCODE\_ERROR, DDS\_RETCODE\_ILLEGAL OPERATION, DDS\_RETCODE\_OUT\_OF\_RESOURCES, DDS\_RETCODE\_TIMEOUT or DDS\_RETCODE\_PRECONDITION\_NOT\_MET.

# Detailed Description

This operation allows an application thread to wait for the occurrence of at least one of the conditions to evaluate to TRUE that is attached to the DDS\_WaitSet. If all of the conditions attached to the DDS\_WaitSet have a trigger\_value of FALSE, the DDS\_WaitSet\_wait operation will block the calling thread. The result of the operation is the continuation of the application thread after which the result is left in active\_conditions. This is a sequence, which will contain the list of all the a t t a c h e d c o n d i t i o n s t h a t h a v e a t r i g g e r \_ v a l u e o f T R U E . T h e active\_conditions sequence and its buffer may be pre-allocated by the application and therefore must either be re-used in a subsequent invocation of the DDS\_WaitSet\_wait operation or be released by calling DDS\_free on the returned active\_conditions. If the pre-allocated sequence is not big enough to hold the number of triggered DDS\_Conditions, the sequence will automatically be (re-)allocated to fit the required size. The parameter timeout specifies the maximum duration for the DDS\_WaitSet\_wait to block the calling application thread (when none of the attached conditions has a trigger\_value of TRUE). In t h a t c a s e t h e r e t u r n v a l u e i s D D S \_ R E T C O D E \_ T I M E O U T a n d t h e active\_conditions sequence is left empty. Since it is not allowed for more than one application thread to be waiting on the same DDS\_WaitSet, the operation returns immediately with the value DDS\_RETCODE\_PRECONDITION\_NOT\_MET when the DDS\_WaitSet\_wait operation is invoked on a DDS\_WaitSet which already has an application thread blocking on it.

# Return Code

When the operation returns:

• DDS\_RETCODE\_OK - at least one of the attached conditions has a trigger\_value of TRUE.
• DDS\_RETCODE\_ERROR - an internal error has occurred.
• DDS\_RETCODE\_ILLEGAL\_OPERATION - the operation is invoked on an inappropriate object.

• DDS\_RETCODE\_OUT\_OF\_RESOURCES - the Data Distribution Service ran out of resources to complete this operation.
• DDS\_RETCODE\_TIMEOUT - the timeout has elapsed without any of the attached conditions becoming TRUE.
• DDS\_RETCODE\_PRECONDITION\_NOT\_MET - the DDS\_WaitSet already has an application thread blocking on it.

# 3.1.7 Class DDS\_Condition

This class is the base class for all the conditions that may be attached to a DDS\_WaitSet. This base class is specialized in three classes by the Data Distribution Service: DDS\_GuardCondition, DDS\_StatusCondition and DDS\_ReadCondition (also there is a DDS\_QueryCondition which is a specialized DDS\_ReadCondition).

Each DDS\_Condition has a trigger\_value that can be TRUE or FALSE and is set by the Data Distribution Service (except a DDS\_GuardCondition) depending on the evaluation of the DDS\_Condition.

![The image displays a UML class diagram with the following labeled blocks and connections:\n\n**Blocks (Classes/Interfaces) and Methods:**\n\n*   **Condition**\n    *   `get_trigger_value()`\n*   **ReadCondition**\n    *   `get_datareader()`\n    *   `get_instance_state_mask()`\n    *   `get_sample_state_mask()`\n    *   `get_view_state_mask()`\n*   **StatusCondition**\n    *   `get_enabled_statuses()`\n    *   `get_entity()`\n    *   `set_enabled_statuses()`\n*   **GuardCondition**\n    *   `set_trigger_value()`\n*   **QueryCondition**\n    *   `get_query_parameters()`\n    *   `get_query_expression()`\n    *   `set_query_parameters()`\n*   **Entity**\n    *   `enable()`\n    *   `((abstract)) get_listener()`\n    *   `((abstract)) get_qos()`\n    *   `get_status_changes()`\n    *   `get_statuscondition()`\n    *   `((abstract)) set_listener()`\n    *   `((abstract)) set_qos()`\n*   **DomainParticipant**\n*   **DataWriter**\n*   **DataReader**\n*   **Subscriber**\n*   **DomainEntity**\n*   **Publisher**\n*   **Topic**\n\n**Connections:**\n\n*   **Inheritance (Generalization):**\n    *   A solid line with a hollow triangle arrowhead points from **ReadCondition** to **Condition**.\n    *   A solid line with a hollow triangle arrowhead points from **StatusCondition** to **Condition**.\n    *   A solid line with a hollow triangle arrowhead points from **QueryCondition** to **ReadCondition**.\n    *   A solid line with a hollow triangle arrowhead points from **StatusCondition** to **Entity**.\n    *   A solid line with a hollow triangle arrowhead points from **DomainEntity** to **Entity**.\n    *   A solid line with a hollow triangle arrowhead points from **DomainParticipant** to **Entity**.\n    *   A solid line with a hollow triangle arrowhead points from **DataReader** to **DomainEntity**.\n    *   A solid line with a hollow triangle arrowhead points from **DataWriter** to **DomainEntity**.\n    *   A solid line with a hollow triangle arrowhead points from **Subscriber** to **DomainEntity**.\n    *   A solid line with a hollow triangle arrowhead points from **Publisher** to **DomainEntity**.\n    *   A solid line with a hollow triangle arrowhead points from **Topic** to **DomainEntity**.\n\n*   **Dependencies (Creation):**\n    *   A dashed line with an arrowhead points from **DataReader** to **ReadCondition**, labeled `((create))`.\n    *   A dashed line with an arrowhead points from **DataReader** to **QueryCondition**, labeled `((create))`.\n\n*   **Associations:**\n    *   A solid line connects **ReadCondition** and **DataReader**. It has a hollow triangle arrowhead at **DataReader**. The label `*` is near **ReadCondition**, and the label `1` is near **DataReader**.\n    *   A solid line connects **StatusCondition** and **Entity**. It has a hollow triangle arrowhead at **Entity**. The text `statuscondition` and `0..1` is near **StatusCondition**, and the text `entity` and `1` is near **Entity**.](.vortex-opensplice-c-reference-guide/cf43cf21c6ddd007af69e9b1552950c16bc92665282f3698219bb82aff147eb8.jpg)

Figure 14: DCPS DDS\_Conditions

The interface description of this class is as follows:

```c
/*
 * interface DDS_Condition
 */
/*
 * implemented API operations
 */
DDS_boolean
DDS_Condition_get_trigger_value
(DDS_Condition _this);
```

The next paragraph describes the usage of the DDS\_Condition operation.

# 3.1.7.1 DDS\_Condition\_get\_trigger\_value

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
```

```c
DDS_boolean
DDS_Condition_get_trigger_value
(DDS_Condition _this);
```

# Description

This operation returns the trigger\_value of the DDS\_Condition.

# Parameters

in DDS\_Condition \_this - the DDS\_Condition object on which the operation is operated.

# Return Value

DDS\_boolean - the trigger\_value.

# Detailed Description

A DDS\_Condition has a trigger\_value that can be TRUE or FALSE and is set by the Data Distribution Service (except a DDS\_GuardCondition). This operation returns the trigger\_value of the DDS\_Condition.

# 3.1.8 Class DDS\_GuardCondition

A DDS\_GuardCondition object is a specific DDS\_Condition whose trigger\_value is completely under the control of the application. The DDS\_GuardCondition has no factory and must be created by the application. The DDS\_GuardCondition is directly created as an object by using the DDS\_GuardCondition constructor. When a DDS\_GuardCondition is initially c r e a t e d , t h e t r i g g e r \_ v a l u e i s F A L S E . T h e p u r p o s e o f t h e DDS\_GuardCondition is to provide the means for an application to manually w a k e u p a D D S \_ W a i t S e t . T h i s i s a c c o m p l i s h e d b y a t t a c h i n g t h e DDS\_GuardCondition to the Waitset and setting the trigger\_value by means of the DDS\_GuardCondition\_set\_trigger\_value operation.

The interface description of this class is as follows:

```c
/*
 * interface DDS_GuardCondition
 */
/*
 * inherited from DDS_Condition
 */
/* DDS_boolean
 * DDS_GuardCondition_get_trigger_value
 * (DDS_GuardCondition _this);
 */
/*
 * implemented API operations
```

```c
*/
DDS_GuardCondition
DDS_GuardCondition__alloc
(void);
DDS_ReturnCode_t
DDS_GuardCondition_set_trigger_value
(DDS_GuardCondition _this,
const DDS_boolean value);
```

The following sections describe the usage of all DDS\_GuardCondition operations.

The inherited operation is listed but not fully described since it is not implemented in this class. The full description of this operation is given in the class from which it is inherited. This is described in their respective paragraph.

# 3.1.8.1 DDS\_GuardCondition\_\_alloc

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
DDS_GuardCondition
DDS_GuardCondition_alloc
(void);
```

# Description

This operation creates a new DDS\_GuardCondition.

# Parameters

```txt
&lt;none&gt;
```

# Return Value

DDS\_GuardCondition - Return value is the handle to the newly-created DDS\_GuardCondition. In case of an error, a DDS\_OBJECT\_NIL pointer is returned.

# Detailed Description

This operation creates a new DDS\_GuardCondition. The DDS\_GuardCondition must be created using this operation. In other words, the application is not allowed to declare an object of type DDS\_GuardCondition. When the application wants to release the DDS\_GuardCondition it must be released using DDS\_free.

I n c a s e t h e r e a r e i n s u f f i c i e n t r e s o u r c e s a v a i l a b l e t o a l l o c a t e t h e DDS\_GuardCondition, a DDS\_OBJECT\_NIL pointer is returned instead.

# 3.1.8.2 DDS\_GuardCondition\_get\_trigger\_value (inherited)

This operation is inherited and therefore not described here. See the class DDS\_Condition for further explanation.

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
DDS_boolean
DDS_GuardCondition_get_trigger_value
(DDS_GuardCondition _this);
```

# 3.1.8.3 DDS\_GuardCondition\_set\_trigger\_value

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
DDS_ReturnCode_t
DDS_GuardCondition_set_trigger_value
(DDS_GuardCondition _this,
const DDS_boolean value);
```

# Description

This operation sets the trigger\_value of the DDS\_GuardCondition.

# Parameters

in DDS\_GuardCondition \_this - the DDS\_GuardCondition object on which the operation is operated.

in const DDS\_boolean value - the boolean value to which the DDS\_GuardCondition is set.

# Return Value

D D S \_ R e t u r n C o d e \_ t - P o s s i b l e r e t u r n c o d e s o f t h e o p e r a t i o n a r e :DDS\_RETCODE\_OK, DDS\_RETCODE\_ERROR or DDS\_RETCODE\_ILLEGAL\_OPERATION.

# Detailed Description

A DDS\_GuardCondition object is a specific DDS\_Condition which trigger\_value is completely under the control of the application. This operation must be used by the application to manually wake-up a DDS\_WaitSet. This operation sets the trigger\_value of the DDS\_GuardCondition to the parameter v a lu e . T h e D D S \_ G u ar d C o n d it i o n i s d i r e c t l y c r e a te d u s i n g t h e DDS\_GuardCondition constructor. When a DDS\_GuardCondition is initially created, the trigger\_value is FALSE.

# Return Code

When the operation returns:

• DDS\_RETCODE\_OK - the specified trigger\_value has successfully been applied
• DDS\_RETCODE\_ERROR - an internal error has occurred
• DDS\_RETCODE\_ILLEGAL\_OPERATION - the operation is invoked on an inappropriate object

# 3.1.9 Class DDS\_StatusCondition

D D S \_ E n t i t y o b j e c t s t h a t h a v e s t a t u s a t t r i b u t e s a l s o h a v e a DDS\_StatusCondition, access is provided to the application by the DDS\_&lt;Entity&gt;\_get\_statuscondition operation.

The communication statuses whose changes can be communicated to the application depend on the DDS\_Entity. The following table shows the relevant statuses for each DDS\_Entity.

Table 17: Status Per DDS\_Entity

<table><tr><td>DDS_Entity</td><td>Status Name</td></tr><tr><td>DDS_Topic</td><td>DDS_INCONSISTENT_TOPIC_STATUSDDS_ALL_DATA_DISPOSED_TOPIC_STATUS</td></tr><tr><td>DDS_Subscriber</td><td>DDS_DATA_ON_READERS_STATUS</td></tr><tr><td rowspan="7">DDS_DataReader</td><td>DDS_SAMPLE_REJECTED_STATUS</td></tr><tr><td>DDS_LIVELINESS_CHANGED_STATUS</td></tr><tr><td>DDS_REQUESTED_DEADLINE_MISSED_STATUS</td></tr><tr><td>DDS_REQUESTED_INCOMPATIBLE_QOS_STATUS</td></tr><tr><td>DDS_DATA_AVAILABLE_STATUS</td></tr><tr><td>DDS_SAMPLE_LOST_STATUS</td></tr><tr><td>DDS_SUBSCRIPTION_MATCHED_STATUS</td></tr><tr><td rowspan="4">DDS_DataWriter</td><td>DDS_LIVELINESS_LOST_STATUS</td></tr><tr><td>DDS_OFFERED_DEADLINE_MISSED_STATUS</td></tr><tr><td>DDS_OFFERED_INCOMPATIBLE_QOS_STATUS</td></tr><tr><td>DDS_PUBLICATION_MATCHED_STATUS</td></tr></table>

The trigger\_value of the DDS\_StatusCondition depends on the communication statuses of that DDS\_Entity (e.g., missed deadline) and also depends on the value of the DDS\_StatusCondition attribute mask (enabled\_statuses mask). A DDS\_StatusCondition can be attached to a DDS\_WaitSet in order to allow an application to suspend until the trigger\_value has become TRUE.

The trigger\_value of a DDS\_StatusCondition will be TRUE if one of the enabled StatusChangedFlags is set. That is, trigger\_value==FALSE only if all the values of the StatusChangedFlags are FALSE.

The sensitivity of the DDS\_StatusCondition to a particular communication status is controlled by the list of enabled\_statuses set on the condition by means of the DDS\_StatusCondition\_set\_enabled\_statuses operation.

W h e n t h e en a b l e d \_s t a t u s e s a r e n o t c h a ng e d b y t h e DDS\_StatusCondition\_set\_enabled\_statuses operation, all statuses are enabled by default.

The interface description of this class is as follows:

```c
/*
 * interface DDS_StatusCondition
 */
/*
 * inherited from DDS_Condition
 */
/* DDS_boolean
 *    DDS_StatusCondition_get_trigger_value
 *    (DDS_StatusCondition _this);
 */
/*
 * implemented API operations
 */
DDS_StatusMask
DDS_StatusCondition_get_enabled statuses
(DDS_StatusCondition _this);
DDS_ReturnCode_t
DDS_StatusCondition_set_enabled statuses
(DDS_StatusCondition _this,
const DDS_StatusMask mask);
DDS_Entity
DDS_StatusCondition_get_entity
(DDS_StatusCondition _this);
```

The next paragraphs describe the usage of all DDS\_StatusCondition operations. The inherited operations are listed but not fully described because they are not implemented in this class. The full description of these operations is given in the classes from which they are inherited.

# 3.1.9.1 DDS\_StatusCondition\_get\_enabled\_statuses

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
DDS_StatusMask
DDS_StatusCondition_get_enabled statuses
(DDS_StatusCondition _this);
```

# Description

This operation returns the list of enabled communication statuses of the DDS\_StatusCondition.

# Parameters

in DDS\_StatusCondition \_this - the DDS\_StatusCondition object on which the operation is operated.

# Return Value

DDS\_StatusMask - Result is a bit-mask in which each bit shows which status is taken into account for the DDS\_StatusCondition.

# Detailed Description

The trigger\_value of the DDS\_StatusCondition depends on the communication status of that DDS\_Entity (e.g., missed deadline, loss of information, etc.), ‘filtered’ by the set of enabled\_statuses on the DDS\_StatusCondition.

This operation returns the list of communication statuses that are taken into account to determine the trigger\_value of the DDS\_StatusCondition. This operation r e t u r n s t h e s t a t u s e s t h a t w e r e e x p l i c i t l y s e t o n t h e l a s t c a l l t o DDS\_StatusCondition\_set\_enabled\_statuses o r , i f DDS\_StatusCondition\_set\_enabled\_statuses was never called, the default list.

The result value is a bit-mask in which each bit shows which status is taken into account for the DDS\_StatusCondition. The relevant bits represents one of the following statuses:

```pickle
DDS_INCONSISTENT_TOPIC_STATUS
DDS_ALL_DATA_DISPOSED_TOPIC_STATUS
DDS_OFFERED_DEADLINE_MISSED_STATUS
DDS_REQUESTED_DEADLINE_MISSED_STATUS
DDS_OFFERED_INCOMPATIBLE_QOS_STATUS
DDS_REQUESTED_INCOMPATIBLE_QOS_STATUS
DDS_SAMPLE_LOST_STATUS
DDS_SAMPLE_REJECTED_STATUS
DDS_DATA_ON_READERS_STATUS
DDS_DATA_AVAILABLE_STATUS
DDS_LIVELINESS_LOST_STATUS
DDS_LIVELINESS_CHANGED_STATUS
DDS_PUBLICATION_MATCHED_STATUS
DDS_SUBSCRIPTION_MATCHED_STATUS.
```

Each status bit is declared as a constant and can be used in an AND operation to check the status bit against the result of type DDS\_StatusMask. Not all statuses are relevant to all DDS\_Entity objects. See the respective Listener objects for each DDS\_Entity for more information.

# 3.1.9.2 DDS\_StatusCondition\_get\_entity

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
DDS_Entity
DDS_StatusCondition_get_entity
(DDS_StatusCondition _this);
```

# Description

T h i s o p e r a t i o n r e t u r n s t h e D D S \_ E n t i t y a s s o c i a t e d w i t h t h e DDS\_StatusCondition or the DDS\_OBJECT\_NIL pointer.

# Parameters

in DDS\_StatusCondition \_this - the DDS\_StatusCondition object on which the operation is operated.

# Return Value

D D S \_ E n t i t y - a p o i n t e r t o t h e D D S \_ E n t i t y a s s o c i a t e d w i t h t h e DDS\_StatusCondition or the DDS\_OBJECT\_NIL pointer.

# Detailed Description

T h i s o p e r a t i o n r e t u r n s t h e D D S \_ E n t i t y a s s o c i a t e d w i t h t h e DDS\_StatusCondition. Note that there is exactly one DDS\_Entity associated with each DDS\_StatusCondition. When the DDS\_Entity was already deleted (there is no associated DDS\_Entity any more), the DDS\_OBJECT\_NIL pointer is returned.

# 3.1.9.3 DDS\_StatusCondition\_get\_trigger\_value (inherited)

This operation is inherited and therefore not described here. See the class DDS\_Condition for further explanation.

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
DDS_boolean
DDS_StatusCondition_get_trigger_value
(DDS_StatusCondition _this);
```

# 3.1.9.4 DDS\_StatusCondition\_set\_enabled\_statuses

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
DDS_ReturnCode_t
DDS_StatusCondition_set_enabled statuses
(DDS_StatusCondition _this,
const DDS_StatusMask mask);
```

# Description

This operation sets the list of communication statuses that are taken into account to determine the trigger\_value of the DDS\_StatusCondition.

# Parameters

in DDS\_StatusCondition \_this - the DDS\_StatusCondition object on which the operation is operated.

in const DDS\_StatusMask mask - a bit-mask in which each bit sets the status which is taken into account for the DDS\_StatusCondition.

# Return Value

D D S \_ R e t u r n C o d e \_ t - P o s s i b l e r e t u r n c o d e s o f t h e o p e r a t i o n a r e :DDS\_RETCODE\_OK, DDS\_RETCODE\_ERROR, DDS\_RETCODE\_ILLEGAL\_OPERATION or DDS\_RETCODE\_ALREADY\_DELETED.

# Detailed Description

The trigger\_value of the DDS\_StatusCondition depends on the communication status of that DDS\_Entity (e.g., missed deadline, loss of information, etc.), ‘filtered’ by the set of enabled\_statuses on the DDS\_StatusCondition.

This operation sets the list of communication statuses that are taken into account to determine the trigger\_value of the DDS\_StatusCondition. This operation may change the trigger\_value of the DDS\_StatusCondition.

DDS\_WaitSet objects behaviour depend on the changes of the trigger\_value of their attached DDS\_Conditions. Therefore, any DDS\_WaitSet to which the DDS\_StatusCondition is attached is potentially affected by this operation.

If this function is not invoked, the default list of enabled\_statuses includes all the statuses.

The parameter mask is a bit-mask in which each bit shows which status is taken into account for the DDS\_StatusCondition. The relevant bits represents one of the following statuses:

```txt
DDS_INCONSISTENT_TOPIC_STATUS
DDS_ALL_DATA_DISPOSED_TOPIC_STATUS
DDS_OFFERED_DEADLINE_MISSED_STATUS
DDS_REQUESTED_DEADLINE_MISSED_STATUS
DDS_OFFERED_INCOMPATIBLE_QOS_STATUS
DDS_REQUESTED_INCOMPATIBLE_QOS_STATUS
DDS_SAMPLE_LOST_STATUS
DDS_SAMPLE_REJECTED_STATUS
DDS_DATA_ON_READERS_STATUS
DDS_DATA_AVAILABLE_STATUS
DDS_LIVELINESS_LOST_STATUS
DDS_LIVELINESS_CHANGED_STATUS
DDS_PUBLICATION_MATCHED_STATUS
DDS_SUBSCRIPTION_MATCHED_STATUS
```

Each status bit is declared as a constant and can be used in an OR operation to set the status bit in the parameter mask of type DDS\_StatusMask. Not all statuses are relevant to all DDS\_Entity objects. See the respective Listener objects for each DDS\_Entity for more information.

# Return Code

When the operation returns:

• DDS\_RETCODE\_OK - the list of communication statuses is set.
• DDS\_RETCODE\_ERROR - an internal error has occurred.
• DDS\_RETCODE\_ILLEGAL\_OPERATION - the operation is invoked on an inappropriate object.
• DDS\_RETCODE\_ALREADY\_DELETED - the DDS\_StatusCondition has already been deleted.

# 3.1.10 Class DDS\_ErrorInfo

The DDS\_ErrorInfo mechanism is an OpenSplice-specific extension to the OMG-DDS standard, that can help DDS users to get a more finegrained overview of the context of an error. The DDS specification only mandates that functions return a DDS\_ReturnCode\_t value as a broad categorization of potential types of problems (there are 12 possible DDS\_ReturnCode\_t values, of which 11 indicate some kind of error), but factory operations do not even have this mechanism at their disposal since they return the object they were requested to create.

The DDS\_ErrorInfo was added to OpenSplice for the following reasons:

• It can provide context for errors that occur in factory operations (e.g. when create\_topic returns NULL).

• It can provide a DDS\_ErrorCode\_t value, that represents a much more fine-grained error categorization than the DDS\_ReturnCode\_t (21 categories vs. the 11 categories provided by DDS\_ReturnCode\_t).
• It can provide an error description that can give a much more dedicated explanation of the exact circumstances of the error.
• It can provide the name of the function call/component that caused the error.
• It can provide source code location where the error occured (file name + line number).
• It can provide a stacktrace of the thread that ran into the error.

The DDS\_ErrorInfo obtains its information from the API-level log messages recorded by the internal mechanisms of the data distribution service. These are messages that are, by default, also written to the ospl-info.log file. The application can access this information through an DDS\_ErrorInfo object, and take appropriate action based on the contents of this information. The DDS\_ErrorInfo has no factory and an instance of the class can be created by the application by calling its constructor.

The interface of this class is as follows:
```c
DDS_ErrorInfo
DDS_ErrorInfo_alloc
(void);

DDS_ReturnCode_t
DDS_ErrorInfo_update
(DDS_ErrorInfo _this);

DDS_ReturnCode_t
DDS_ErrorInfo_get_code
(DDS_ErrorInfo _this,
DDS_ErrorCode_t *code);

DDS_ReturnCode_t
DDS_ErrorInfo_get_message
(DDS_ErrorInfo _this,
DDS_string *message);

DDS_ReturnCode_t
DDS_ErrorInfo_get_location
(DDS_ErrorInfo _this,
DDS_string *location);

DDS_ReturnCode_t
DDS_ErrorInfo_get_source_line
(DDS_ErrorInfo _this,
DDS_string* source_line);
```

```txt
DDS_ReturnCode_t
DDS_ErrorInfo_get_stack_trace
(DDS_ErrorInfo _this,
DDS_string* stack_trace);
```

The following sections describe the usage of all DDS\_ErrorInfo operations.

# 3.1.10.1 DDS\_ErrorInfo\_\_alloc

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
DDS_ErrorInfo
DDS_ErrorInfo_alloc
(void);
```

# Description

This operation creates a new DDS\_ErrorInfo.

# Parameters

```txt
&lt;none&gt;
```

# Return Value

DDS\_ErrorInfo - handle to the newly-created DDS\_ErrorInfo. In case of an error, a DDS\_OBJECT\_NIL pointer is returned.

# Detailed Description

This operation creates a new DDS\_ErrorInfo. The DDS\_ErrorInfo must be created using this operation. In other words, the application is not allowed to declare an object of type DDS\_ErrorInfo. When the application wants to release the DDS\_ErrorInfo it must be released using DDS\_free.

If there are insufficient resources available to allocate the DDS\_ErrorInfo, a DDS\_OBJECT\_NIL pointer is returned instead.

# 3.1.10.2 DDS\_ErrorInfo\_update

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
DDS_ReturnCode_t
DDS_ErrorInfo_update
(DDS_ErrorInfo _this);
```

# Description

This operation updates the DDS\_ErrorInfo object with the latest available information.

# Parameters

in DDS\_ErrorInfo \_this - the DDS\_ErrorInfo object on which the operation is operated.

# Return Value

D D S \_ R e t ur n C o d e \_ t - Possible re turn codes of the operation are: DDS\_RETCODE\_OK, DDS\_RETCODE\_NO\_DATA.

# Detailed Description

This operation requests the latest error information from the data distribution service and stores it in the DDS\_ErrorInfo object. The error information remains available in the DDS\_ErrorInfo object until a new error occurs and the update operation is explicitly invoked on the DDS\_ErrorInfo object. If the information is successfully updated, DDS\_RETCODE\_OK is returned. If no information is available because no error has occurred yet, DDS\_RETCODE\_NO\_DATA is returned.

# 3.1.10.3 DDS\_ErrorInfo\_get\_code

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
DDS_ReturnCode_t
DDS_ErrorInfo_get_code
(DDS_ErrorInfo _this,
DDS_ErrorCode_t* code);
```

![The image displays a triangular warning sign with a thick red border and a white background. Inside the triangle is a black symbol consisting of a vertical line, a small circle at the top, and an arrowhead pointing downward at the bottom.](.vortex-opensplice-c-reference-guide/1f87bfe6db8e5c30976366894269eba0e8d4735ff621e0e4185bff9439bcccc4.jpg)

NOTE: This operation is not yet consistently implemented everywhere: various kinds of errors are still categorized as ‘UNDEFINED’.

# Description

This operation retrieves the error code of the last error message.

# Parameters

in DDS\_ErrorInfo \_this - the DDS\_ErrorInfo object on which the operation is operated.

inout ErrorCode\_t\* code - The DDS\_ErrorCode\_t struct in which the error code will be stored.

# Return Value

D D S \_ R e t u r n C o d e \_ t - P o s s i b l e r e t u r n c o d e s o f t h e o p e r a t i o n a r e : DDS\_RETCODE\_OK, DDS\_RETCODE\_NO\_DATA.

# Detailed Description

This operation stores the error code of the latest error in the provided DDS\_ErrorCode\_t struct. The DDS\_ErrorCode\_t type is an OpenSplice-specific equivalent to the DDS\_ReturnCode\_t type that is mandated by the OMG-DDS standard, but the DDS\_ErrorCode\_t type has a more fine-grained error categorization which uses 21 categories instead of the 11 provided by the DDS\_ReturnCode\_t type.

Table 18: below contains a list of all supported DDS\_ErrorInfo values and their meaning.

Table 18: All DDS\_ErrorInfo values

<table><tr><td>Label</td><td>Value</td><td>Meaning.</td></tr><tr><td>DDS_ERRORCODE_UNDEFINED</td><td>0</td><td>Error has not (yet) been categorized.</td></tr><tr><td>DDS_ERRORCODE_ERROR</td><td>1</td><td>Unexpected error.</td></tr><tr><td>DDS_ERRORCODE_OUT_OF_RESOURCES</td><td>2</td><td>Not enough resources to complete the operation.</td></tr><tr><td>DDS_ERRORCODE_CREATION_KERNEL_ENTITY_FAILED</td><td>3</td><td>The kernel was not able to create the entity. Probably there is not enough shared memory available.</td></tr><tr><td>DDS_ERRORCODE_INVALID_VALUE</td><td>4</td><td>A value is passed that is outside its valid bounds.</td></tr><tr><td>DDS_ERRORCODE_INVALID_DURATION</td><td>5</td><td>A Duration is passed that is outside its valid bounds or that has not been normalized properly.</td></tr><tr><td>DDS_DDS_ERRORCODE_INVALID_TIME</td><td>6</td><td>A Time is passed that is outside its valid bounds or that has not been normalized properly.</td></tr><tr><td>DDS_ERRORCODE_ENTITY_INUSE</td><td>7</td><td>Attempted to delete an entity that is still in use.</td></tr><tr><td>DDS_ERRORCODE_CONTAINS_ENTITIES</td><td>8</td><td>Attempted to delete a factory that still contains entities.</td></tr><tr><td>DDS_ERRORCODE_ENTITY_UNKNOWN</td><td>9</td><td>A pointer to an unknown entity has been passed.</td></tr><tr><td>DDS_ERRORCODE_HANDLE_NOT_REGISTERED</td><td>10</td><td>A handle has been passed that is no longer in use.</td></tr><tr><td>DDS_ERRORCODE_HANDLE_NOT_MATCH</td><td>11</td><td>A handle has been passed to an entity to which it does not belong.</td></tr><tr><td>DDS_ERRORCODE_HANDLE_INVALID</td><td>12</td><td>An unknown handle has been passed.</td></tr><tr><td>DDS_ERRORCODE_INVALID_SEQUENCE</td><td>13</td><td>A sequence has been passed that has inconsistent variables (e.g. length &gt; maximum, buffer equals NULL while maximum &gt; 0, etc.)</td></tr><tr><td>DDS_ERRORCODE_UNSUPPORTED_VALUE</td><td>14</td><td>A value has been passed that is not (yet) supported.</td></tr><tr><td>DDS_ERRORCODE_INCONSISTENT_VALUE</td><td>15</td><td>A value has been passed that is inconsistent</td></tr><tr><td>DDS_ERRORCODE_IMMUTABLE_QOS_POLICY</td><td>16</td><td>Attempted to modify a QosPolicy that is immutable.</td></tr><tr><td>DDS_ERRORCODE_INCONSISTENT_QOS</td><td>17</td><td>Attempted to set QosPolicy values that are mutually inconsistent.</td></tr><tr><td>DDS_ERRORCODE_UNSUPPORTED_QOS_POLICY</td><td>18</td><td>Attempted to pass a QosPolicy setting that is not (yet) supported.</td></tr><tr><td>DDS_ERRORCODE_CONTAINS_CONDITIONS</td><td>19</td><td>Attempted to delete a WaitSet that still has Conditions attached to it.</td></tr><tr><td>DDS_ERRORCODE_CONTAINS_LOANS</td><td>20</td><td>Attempted to delete a DataReader/DataView that has unreturned loans.</td></tr><tr><td>DDS_ERRORCODE_INCONSISTENT_TOPIC</td><td>21</td><td>Attempted to create a topic that is inconsistent with existing topic definitions.</td></tr></table>

# 3.1.10.4 DDS\_ErrorInfo\_get\_message

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
DDS_ReturnCode_t
DDS_ErrorInfo_get_message
(DDS_ErrorInfo _this,
DDS_string* message);
```

# Description

This operation retrieves the description of the latest error.

# Parameters

in DDS\_ErrorInfo \_this - the DDS\_ErrorInfo object on which the operation is operated.

inout DDS\_string\* message - Reference to a string holding the latest description.

# Return Value

D D S \_ R e t u rn C o d e \_ t - Possible re turn codes of the operation are: DDS\_RETCODE\_OK, DDS\_RETCODE\_NO\_DATA.

# Detailed Description

This operation stores the description of the latest error in a newly-allocated string. If the pointer supplied by the application through the message parameter already contains a string, it is freed. If no error has occurred, DDS\_RETCODE\_NO\_DATA is returned and NULL is assigned to the message parameter.

# 3.1.10.5 DDS\_ErrorInfo\_get\_location

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
DDS_ReturnCode_t
DDS_ErrorInfo_get_location
(DDS_ErrorInfo _this,
DDS_string* location);
```

# Description

This operation retrieves the location or context of the latest error.

# Parameters

in DDS\_ErrorInfo \_this - the DDS\_ErrorInfo object on which the operation is operated.

inout DDS\_string\* message - Pointer to a string holding the location of the latest error.

# Return Value

D D S \_ R e t u rn C o d e \_ t - Possible re turn codes of the operation are: DDS\_RETCODE\_OK, DDS\_RETCODE\_NO\_DATA.

# Detailed Description

This operation stores the context or location of the latest error in a newly-allocated string. The string may contain the name of an operation or component of the data distribution service in which the error occurred, or other descriptive information on the location of the error. If the pointer supplied by the application through the location parameter already contains a string, it is freed. If no error has occurred, DDS\_RETCODE\_NO\_DATA is returned and NULL is assigned to the location parameter.

# 3.1.10.6 DDS\_ErrorInfo\_get\_source\_line

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
DDS_ReturnCode_t
DDS_ErrorInfo_get_source_line
(DDS_ErrorInfo _this,
DDS_string* source_line);
```

# Description

This operation retrieves the location within the sourcecode of the latest error.

# Parameters

in DDS\_ErrorInfo \_this - the DDS\_ErrorInfo object on which the operation is operated.

inout DDS\_string\* source\_line - Pointer to a string holding the sourcecode information of the latest error.

# Return Value

D D S \_ R e t ur n C o d e \_ t - Possible re turn codes of the operation are: DDS\_RETCODE\_OK, DDS\_RETCODE\_NO\_DATA.

# Detailed Description

This operation stores the name and line number of the source file in which the latest error occurred, seperated by a colon, in a newly-allocated string. If the pointer supplied by the application through the source\_line parameter already contains a string, it is freed. If no error has occurred, DDS\_RETCODE\_NO\_DATA is returned and NULL is assigned to the source\_line parameter.

# 3.1.10.7 DDS\_ErrorInfo\_get\_stack\_trace

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
```

```c
DDS_ReturnCode_t
DDS_ErrorInfoget_stack_trace
(DDS_ErrorInfo _this,
DDS_string* stack_trace);
```

NOTE: This operation is not yet implemented. It is scheduled for a future release.

# 3.2 Domain Module

![Based on the provided diagram, here is the accurate and concise description of the blocks and connections, with all text verbatim:\n\n**Labeled Blocks:**\n*   `((Interface)) SubscriberListener (from Subscription Module)`\n*   `((Interface)) PublisherListener (from Publication Module)`\n*   `((Interface)) TopicListener on_inconsistent_topic()`\n*   `DomainParticipantListener`\n*   `QosPolicy (from Infrastructure Module)`\n*   `DomainParticipantFactory`\n*   `DomainParticipant` (contains a list of methods including `assert_liveliness()`, `contains_entity()`, `create_contentfiltertopic()`, etc.)\n*   `Entity (from Infrastructure Module)`\n*   `Publisher (from Publication Module)`\n*   `Subscriber (from Subscription Module)`\n*   `DomainEntity (from Infrastructure Module)`\n*   `Topic (from Topic-Definition Module)`\n*   `TopicDescription (from Topic-Definition Module)`\n*   `ContentFilteredTopic (from Topic-Definition Module)`\n*   `MultiTopic (from Topic-Definition Module)`\n\n**Connections:**\n*   **Inheritance (Solid lines with hollow arrowheads):**\n    *   `((Interface)) SubscriberListener` to `DomainParticipantListener`\n    *   `((Interface)) PublisherListener` to `DomainParticipantListener`\n    *   `((Interface)) TopicListener` to `DomainParticipantListener`\n    *   `DomainParticipant` to `Entity`\n    *   `Publisher` to `DomainEntity`\n    *   `Subscriber` to `DomainEntity`\n    *   `Topic` to `TopicDescription`\n    *   `ContentFilteredTopic` to `TopicDescription`\n    *   `MultiTopic` to `TopicDescription`\n\n*   **Creation (Dashed lines with open arrowheads labeled `((create))`):**\n    *   `DomainParticipantFactory` to `DomainParticipant`\n    *   `DomainParticipant` to `Publisher`\n    *   `DomainParticipant` to `Subscriber`\n    *   `DomainParticipant` to `Topic`\n    *   `TopicDescription` to `ContentFilteredTopic`\n    *   `TopicDescription` to `MultiTopic`\n\n*   **Implicit Dependencies and Associations:**\n    *   `DomainParticipantListener` to `DomainParticipant` labeled `((implicit))` with multiplicity `0..1`\n    *   `QosPolicy` to `DomainParticipant` labeled `((implicit)) : qos` with multiplicity `*`. Specific lines are labeled: `default_publisher_qos`, `default_topic_qos`, `default_subscriber_qos`, and `default_participant_qos`.\n    *   `Topic` to `TopicDescription` labeled `((implicit))` with multiplicities `*` on both ends.\n    *   `DomainParticipant` to `DomainEntity` with multiplicity `1` near `DomainParticipant` and `*` near `DomainEntity`.](.vortex-opensplice-c-reference-guide/09f43cfb1d0fb947c07a10bfb7b9698bf93c6e4b6856c7d46791989691e0a9c3.jpg)

Figure 15: DCPS Domain Module’s Class Model

This module contains the following classes:

```txt
DDS_DomainParticipant
DDS_DomainParticipantFactory
DDS_DomainParticipantListener (interface)
DDS_Domain (not depicted)
```

# 3.2.1 Class DDS\_DomainParticipant

All the DCPS DDS\_Entity objects are attached to a DDS\_DomainParticipant. A DDS\_DomainParticipant represents the local membership of the application in a Domain.

A Domain is a distributed concept that links all the applications that must be able to communicate with each other. It represents a communication plane: only the DDS\_Publishers and the DDS\_Subscribers attached to the same Domain can interact.

This class implements several functions:

• It acts as a container for all other DDS\_Entity objects
• It acts as a factory for the DDS\_Publisher, DDS\_Subscriber, DDS\_Topic, DDS\_ContentFilteredTopic and DDS\_MultiTopic objects
• It provides access to the built-in DDS\_Topic objects
• It provides information about DDS\_Topic objects
• It isolates applications within the same Domain (sharing the same domainId) from other applications in a different Domain on the same set of computers. In this way, several independent distributed applications can coexist in the same physical network without interfering, or even being aware of each other
• It provides administration services in the Domain, offering operations, which allow the application to ignore locally any information about a given Participant, Publication, Subscription or Topic.

The interface description of this class is as follows:

```c
/*
 * interface DDS_DomainParticipant
 */
/*
 * inherited from class DDS_Entity
 */
/* DDS_StatusCondition
 *    DDS_DomainParticipant_get_statuscondition
 *    (DDS_DomainParticipant _this);
 */
/* DDS_StatusMask
 *    DDS_DomainParticipant_get_status_changes
 *    (DDS_DomainParticipant _this);
 */
/* DDS_ReturnCode_t
 *    DDS_DomainParticipant_enable
 *    (DDS_DomainParticipant _this);
 */
/*
 * implemented API operations
 */
DDS_Publisher
DDS_DomainParticipant_create_publisher
(DDS_DomainParticipant _this,
const DDS_PublisherQos *qos,
```

```c
const struct DDS_PublisherListener *a_listener,
const DDS_StatusMask mask);
DDS_ReturnCode_t
DDS_DomainParticipant_delete_publisher
(DDS_DomainParticipant _this,
const DDS_Publisher p);
DDS_Subscriber
DDS_DomainParticipant_create_subscriber
(DDS_DomainParticipant _this,
const DDS_SubscriberQos *qos,
const struct DDS_SubscriberListener *a_listener,
const DDS_StatusMask mask);
DDS_ReturnCode_t
DDS_DomainParticipant_delete_subscriber
(DDS_DomainParticipant _this,
const DDS_Subscriber s);
DDS_Subscriber
DDS_DomainParticipant_get_builtin_subscriber
(DDS_DomainParticipant _this);
DDS_Topic
DDS_DomainParticipant_create_topic
(DDS_DomainParticipant _this,
const DDS_char *topic_name,
const DDS_char *type_name,
const DDS_TopicQos *qos,
const struct DDS_TopicListener *a_listener,
const DDS_StatusMask mask);
DDS_ReturnCode_t
DDS_DomainParticipant_delete_topic
(DDS_DomainParticipant _this,
const DDS_Topic a_topic);
DDS_Topic
DDS_DomainParticipant_find_topic
(DDS_DomainParticipant _this,
const DDS_char *topic_name,
const DDS_Duration_t *timeout);
DDS_TopicDescription
DDS_DomainParticipant_lookup_topicdescription
(DDS_DomainParticipant _this,
const DDS_char *name);
DDS_ContentFilteredTopic
DDS_DomainParticipant_create_contentfilteredtopic
(DDS_DomainParticipant _this,
const DDS_char *name,
const DDS_Topic related_topic,
const DDS_char *filter_expression,
const DDS_StringSeq *expression_parameters);
DDS_ReturnCode_t
DDS_DomainParticipant_delete_contentfilteredtopic
(DDS_DomainParticipant _this,
```

```c
const DDS_ContentFilteredTopic
a_contentfilteredtopic);

DDS_MultiTopic

DDS_DomainParticipant_create_multitopic
(DDS_DomainParticipant _this,
    const DDS_char *name,
    const DDS_char *type_name,
    const DDS_char *subscription_expression,
    const DDS_StringSeq *expression_parameters);

DDS_ReturnCode_t

DDS_DomainParticipant_delete_multitopic
(DDS_DomainParticipant _this,
    const DDS_MultiTopic a_multitopic);

DDS_ReturnCode_t

DDS_DomainParticipant_delete_contained_entities
(DDS_DomainParticipant _this);

DDS_ReturnCode_t

DDS_DomainParticipant_set_qos
(DDS_DomainParticipant _this,
    const DDS_DomainParticipantQos *qos);

DDS_ReturnCode_t

DDS_DomainParticipant_get_qos
(DDS_DomainParticipant _this,
    DDS_DomainParticipantQos *qos);

DDS_ReturnCode_t

DDS_DomainParticipant_set_listener
(DDS_DomainParticipant _this,
    const struct DDS_DomainParticipantListener *a_listener,
    const DDS_StatusMask mask);

struct DDS_DomainParticipantListener
DDS_DomainParticipant_get_listener
(DDS_DomainParticipant _this);

DDS_ReturnCode_t

DDS_DomainParticipant_ignore_participant
(DDS_DomainParticipant _this,
    const DDS_InstanceHandle_t handle);

DDS_ReturnCode_t

DDS_DomainParticipant_ignore_topic
(DDS_DomainParticipant _this,
    const DDS_InstanceHandle_t handle);

DDS_ReturnCode_t

DDS_DomainParticipant_ignore_publication
(DDS_DomainParticipant _this,
    const DDS_InstanceHandle_t handle);

DDS_ReturnCode_t

DDS_DomainParticipant_ignore Subscription
(DDS_DomainParticipant _this,
    const DDS_InstanceHandle_t handle);

DomainId_t

DDS_DomainParticipant_get_domain_id
```

```c
(DDS_DomainParticipant _this);
DDS_ReturnCode_t
DDS_DomainParticipant_get_discovered_participants
(DDS_DomainParticipant _this,
DDS_InstanceHandleSeq *participant_handles);
DDS_ReturnCode_t
DDS_DomainParticipant_get_discovered_participant_data
(DDS_DomainParticipant _this,
DDS_ParticipantBuiltinTopicData *participant_data,
DDS_InstanceHandle_t handle);
DDS_ReturnCode_t
DDS_DomainParticipant_get_discovered_topics
(DDS_DomainParticipant _this,
DDS_InstanceHandleSeq *topic_handles);
DDS_ReturnCode_t
DDS_DomainParticipant_get_discovered_topic_data
(DDS_DomainParticipant _this,
DDS_TopicBuiltinTopicData *topic_data,
DDS_InstanceHandle_t handle);
DDS_ReturnCode_t
DDS_DomainParticipant_assert_liveliness
(DDS_DomainParticipant _this);
DDS_ReturnCode_t
DDS_DomainParticipant_set_default_publisher_qos
(DDS_DomainParticipant _this,
const DDS_PublisherQos *qos);
DDS_ReturnCode_t
DDS_DomainParticipant_get_default_publisher_qos
(DDS_DomainParticipant _this,
DDS_PublisherQos *qos);
DDS_ReturnCode_t
DDS_DomainParticipant_set_default_subscriber_qos
(DDS_DomainParticipant _this,
const DDS_SubscriberQos *qos);
DDS_ReturnCode_t
DDS_DomainParticipant_get_default_subscriber_qos
(DDS_DomainParticipant _this,
DDS_SubscriberQos *qos);
DDS_ReturnCode_t
DDS_DomainParticipant_set_default_topic_qos
(DDS_DomainParticipant _this,
const DDS_TopicQos *qos);
DDS_ReturnCode_t
DDS_DomainParticipant_get_default_topic_qos
(DDS_DomainParticipant _this,
DDS_TopicQos *qos);
DDS_boolean
contains_entity
(DDS_InstanceHandle_t a_handle);
DDS_ReturnCode_t
```

```txt
get_current_time
(DDS_Time_t *current_time);
```

The following sections describe the usage of all DDS\_DomainParticipant operations. The inherited operations are listed but not fully described because they are not implemented in this class. The full description of these operations is given in the classes from which they are inherited.

# 3.2.1.1 DDS\_DomainParticipant\_assert\_liveliness

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
DDS_ReturnCode_t
DDS_DomainParticipant_assert_liveliness
(DDS_DomainParticipant _this);
```

# Description

This operation asserts the liveliness for the DDS\_DomainParticipant.

# Parameters

in DDS\_DomainParticipant \_this - the DDS\_DomainParticipant object on which the operation is operated.

# Return Value

```txt
DDS_ReturnCode_t - Possible return codes of the operation are: DDS_RETCODE_OK, DDS_RETCODE_ERROR, DDS_RETCODE_ILLEGAL_OPERATION, DDS_RETCODE_ALREADY_DELETED, DDS_RETCODE_OUT_OF_RESOURCES or DDS_RETCODE_NOT_ENABLED.
```

# Detailed Description

T h i s o p e r a t i o n w i l l m a n u a l l y a s s e r t t h e l i v e l i n e s s f o r t h e DDS\_DomainParticipant. This way, the Data Distribution Service is informed that the DDS\_DomainParticipant is still alive. This operation only needs to be used when the DDS\_DomainParticipant contains DDS\_DataWriters with the DDS\_LivelinessQosPolicy s e t t o DDS\_MANUAL\_BY\_PARTICIPANT\_LIVELINESS\_QOS, and it will only affect the liveliness of those DDS\_DataWriters.

Writing data via the DDS\_DataWriter\_write operation of a DDS\_DataWriter w i l l a s s e r t t h e l i v e l i n e s s o n t h e D D S \_ D a t a W r i t e r i t s e l f a n d i t s DDS\_DomainParticipant. DDS\_DomainParticipant\_assert\_liveliness subsequently is only needed when data is not written regularly.

The liveliness should be asserted by the application, depending on the DDS\_LivelinessQosPolicy.

# Return Code

When the operation returns:

• DDS\_RETCODE\_OK - the liveliness of this DDS\_DomainParticipant has successfully been asserted.
• DDS\_RETCODE\_ERROR - an internal error has occurred.
• DDS\_RETCODE\_ILLEGAL\_OPERATION - the operation is invoked on an inappropriate object.
• DDS\_RETCODE\_ALREADY\_DELETED - the DDS\_DomainParticipant has already been deleted.
• DDS\_RETCODE\_OUT\_OF\_RESOURCES - the Data Distribution Service ran out of resources to complete this operation.
• DDS\_RETCODE\_NOT\_ENABLED - the DDS\_DomainParticipant is not enabled.

# 3.2.1.2 DDS\_DomainParticipant\_contains\_entity

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
DDS_boolean
    contains_entity
    (DDS_DomainParticipant _this,
    DDS_InstanceHandle_t a_handle);
```

# Description

This operation checks whether or not the given Entity represented by a\_handle is created by the DDS\_DomainParticipant or any of its contained entities.

# Parameters

in DDS\_DomainParticipant \_this - the DDS\_DomainParticipant object on which the operation is operated.

in DDS\_InstanceHandle\_t a\_handle - represents a DDS\_Entity in the Data Distribution System.

# Return Value

DDS\_boolean - Return value is TRUE if a\_handle represents a DDS\_Entity that is created by the DDS\_DomainParticipant or any of its contained DDS\_Entites. Otherwise the return value is FALSE.

# Detailed Description

This operation checks whether or not the given Entity represented by a\_handle is created by the DDS\_DomainParticipant itself (DDS\_TopicDescription, DDS\_Publisher or DDS\_Subscriber) or created by any of its contained entities (DDS\_DataReader, DDS\_ReadCondition, DDS\_QueryCondition, DDS\_DataWriter, etc.).

Return value is TRUE if a\_handle represents a DDS\_Entity that is created by the DDS\_DomainParticipant or any of its contained DDS\_Entites. Otherwise the return value is FALSE.

# 3.2.1.3 DDS\_DomainParticipant\_create\_contentfilteredtopic

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
DDS_ContentFilteredTopic
DDS_DomainParticipant_create_contentfilteredtopic
(DDS_DomainParticipant _this,
const DDS_char *name,
const DDS_Topic related_topic,
const DDS_char *filter_expression,
const DDS_StringSeq *expression_parameters);
```

# Description

T h i s o p e r a t i o n c r e a t e s a D D S\_ C o n t e nt F i l t e r ed T o p i c fo r a DDS\_DomainParticipant in order to allow DDS\_DataReaders to subscribe to a subset of the topic content.

# Parameters

in DDS\_DomainParticipant \_this - the DDS\_DomainParticipant object on which the operation is operated.

in const DDS\_char \*name c o n t a i n s t h e n a m e o f t h e DDS\_ContentFilteredTopic.

in const DDS\_Topic related\_topic - the handle to the base DDS\_Topic on which the filtering will be applied. Therefore, a filtered topic is based on an existing DDS\_Topic.

in const DDS\_char \*filter\_expression - holds the SQL expression (subset of SQL), which defines the filtering.

in const DDS\_StringSeq \*expression\_parameters - the handle to a sequence of strings with the parameter value used in the SQL expression (i.e., the number of %n tokens in the expression). The number of values in expression\_parameters must be equal or greater than the highest referenced %n token in the filter\_expression (e.g. if %1 and %8 are used as parameter in the filter\_expression, the expression\_parameters should at least contain n+1 = 9 values).

# Return Value

DDS\_ContentFilteredTopic - Return value is the handle to the newly-created DDS\_ContentFilteredTopic. In case of an error, a nil pointer is returned.

# Detailed Description

T h i s o p e r a t i o n c r e a t e s a D D S\_ C o n t e nt F i l t e r ed T o p i c fo r a DDS\_DomainParticipant in order to allow DDS\_DataReaders to subscribe to a subset of the topic content. The base topic, which is being filtered is defined by the parameter related\_topic. The resulting DDS\_ContentFilteredTopic only relates to the samples published under the related\_topic, which have been filtered according to their content. The resulting DDS\_ContentFilteredTopic only exists at the DDS\_DataReader side and will never be published. The samples of the related\_topic are filtered according to the SQL expression, which is a subset of SQL as defined in the parameter filter\_expression (see Appendix H, DCPS Queries and Filters).

The filter\_expression may also contain parameters, which appear as %n tokens in the expression which must be set by the sequence of strings defined by the pa ra meter e x pr e s s i o n\_ p a r a m e te r s . T h e n u m b e r o f v a l u e s i n expression\_parameters must be equal or greater than the highest referenced %n token in the filter\_expression (e.g. if %1 and %8 are used as parameter in the filter\_expression, the expression\_parameters should at least contain n+1 = 9 values).

The filter\_expression is a string that specifies the criteria to select the data samples of interest. In other words, it identifies the selection of data from the associated DDS\_Topics. It is an SQL expression where the WHERE clause gives the content filter.

# 3.2.1.4 DDS\_DomainParticipant\_create\_multitopic

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
DDS_MultiTopic
DDS_DomainParticipant_create_multitopic
(DDS_DomainParticipant _this,
    const DDS_char *name,
    const DDS_char *type_name,
    const DDS_char *subscription_expression,
    const DDS_StringSeq *expression_parameters);
```

NOTE: This operation is not yet implemented. It is scheduled for a future release.

# Description

This operation creates a DDS\_MultiTopic for a DDS\_DomainParticipant in order to allow DDS\_DataReaders to subscribe to a filtered/re-arranged combination and/or subset of the content of several topics.

# Parameters

in DDS\_DomainParticipant \_this - the DDS\_DomainParticipant object on which the operation is operated.
in const DDS\_char \*name - contains the name of the DDS\_MultiTopic.
in const DDS\_char \*type\_name - contains the name of the type of the DDS\_MultiTopic. This type\_name must have been registered using DDS\_TypeSupport\_register\_type prior to calling this operation.
in const DDS\_char \*subscription\_expression - the SQL expression (subset of SQL), which defines the selection, filtering, combining and re-arranging of the sample data.
in const DDS\_StringSeq \*expression\_parameters - the handle to a sequence of strings with the parameter value used in the SQL expression (i.e., the number of %n tokens in the expression). The number of values in expression\_parameters must be equal or greater than the highest referenced %n token in the subscription\_expression (e.g. if %1 and %8 are used as parameter in the subscription\_expression, the expression\_parameters should at least contain n+1 = 9 values).

# Return Value

DDS\_MultiTopic - Return value is the handle to the newly-created DDS\_MultiTopic. In case of an error, a nil pointer is returned.

# Detailed Description

This operation creates a DDS\_MultiTopic for a DDS\_DomainParticipant in order to allow DDS\_DataReaders to subscribe to a filtered/re-arranged combination and/or subset of the content of several topics. Before the DDS\_MultiTopic can be created, the type\_name of the DDS\_MultiTopic must have been registered prior to calling this operation. Registering is done, using the DDS\_TypeSupport\_register\_type operation from DDS\_TypeSupport. The list of topics and the logic, which defines the selection, filtering, combining and re-arranging of the sample data, is defined by the SQL expression, a subset of SQL defined in subsciption\_expression. The subscription\_expression may also contain parameters, which appear as %n tokens in the expression. These parameters are defined in expression\_parameters. The number of values in expression\_parameters must be equal or greater than the highest referenced %n token in the subscription\_expression (e.g. if %1 and %8 are used as parameter in the subscription\_expression, the expression\_parameters should at least contain n+1 = 9 values).

The subscription\_expression is a string that specifies the criteria to select the data samples of interest. In other words, it identifies the selection and rearrangement of data from the associated DDS\_Topics. It is an SQL expression where the SELECT clause provides the fields to be kept, the FROM part provides the names of the DDS\_Topics that are searched for those fields, and the WHERE clause gives the content filter. The DDS\_Topics combined may have different types but they are restricted in that the type of the fields used for the NATURAL JOIN operation must be the same.

The DDS\_DataReader, which is associated with a DDS\_MultiTopic only accesses information which exist locally in the DDS\_DataReader, based on the DDS\_Topics used in the subscription\_expression. The actual DDS\_MultiTopic will never be produced, only the individual DDS\_Topics.

# 3.2.1.5 DDS\_DomainParticipant\_create\_publisher

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
DDS_Publisher
DDS_DomainParticipant_create_publisher
(DDS_DomainParticipant_this,
const DDS_PublisherQos *qos,
const struct DDS_PublisherListener *a_listener,
const DDS_StatusMask mask);
```

# Description

This operation creates a DDS\_Publisher with the desired QosPolicy settings and if applicable, attaches the optionally specified DDS\_PublisherListener to it.

# Parameters

in DDS\_DomainParticipant \_this - the DDS\_DomainParticipant object on which the operation is operated.

in const DDS\_PublisherQos \*qos - a collection of QosPolicy settings for the new DDS\_Publisher. In case these settings are not self consistent, no DDS\_Publisher is created.

in const struct DDS\_PublisherListener \*a\_listener - a pointer to the DDS\_PublisherListener instance which will be attached to the new DDS\_Publisher. It is permitted to use DDS\_OBJECT\_NIL as the value of the listener: this behaves as a DDS\_PublisherListener whose operations perform no action.

in const DDS\_StatusMask mask - a bit-mask in which each bit enables the invocation of the DDS\_PublisherListener for a certain status.

# Return Value

DDS\_Publisher - Return value is a pointer to the newly-created DDS\_Publisher. In case of an error, the DDS\_OBJECT\_NIL pointer is returned.

# Detailed Description

This operation creates a DDS\_Publisher with the desired QosPolicy settings and if applicable, attaches the optionally specified DDS\_PublisherListener to it. When the DDS\_PublisherListener is not applicable, the DDS\_OBJECT\_NIL pointer must be supplied instead. To delete the DDS\_Publisher the operation DDS\_DomainParticipant\_delete\_publisher o r DDS\_ DomainParticipant\_delete\_contained\_entities must be used.

In case the specified QosPolicy settings are not consistent, no DDS\_Publisher is created and the DDS\_OBJECT\_NIL pointer is returned. DDS\_OBJECT\_NIL can also be returned when insufficient access rights exist for the partition(s) listed in the provided QoS structure.

# Default QoS

The constant DDS\_PUBLISHER\_QOS\_DEFAULT can be used as parameter qos to create a DDS\_Publisher with the default DDS\_PublisherQos as set in the DDS\_DomainParticipant. The effect of using DDS\_PUBLISHER\_QOS\_DEFAULT i s t h e s a m e a s c a l l i n g t h e o p e r a t i o n DDS\_DomainParticipant\_get\_default\_publisher\_qos and using the resulting DDS\_PublisherQos to create the DDS\_Publisher.

# Communication Status

For each communication status, the StatusChangedFlag flag is initially set to FALSE. It becomes TRUE whenever that communication status changes. For each c o m m u n i c a t i o n s t a t u s a c t i v a t e d i n t h e m a s k , t h e a s s o c i a t e d DDS\_PublisherListener operation is invoked and the communication status is reset to FALSE, as the listener implicitly accesses the status which is passed as a parameter to that operation. The fact that the status is reset prior to calling the listener means that if the application calls the get\_&lt;status\_name&gt;\_status from inside the listener it will see the status already reset.

The following statuses are applicable to the DDS\_PublisherListener:

• DDS\_OFFERED\_DEADLINE\_MISSED\_STATUS (propagated)
• DDS\_OFFERED\_INCOMPATIBLE\_QOS\_STATUS (propagated)
• DDS\_LIVELINESS\_LOST\_STATUS (propagated)
• DDS\_PUBLICATION\_MATCHED\_STATUS (propagated).

![The image shows a standard warning sign featuring a red triangle with rounded corners on a white background. Inside the triangle is a black exclamation point.](.vortex-opensplice-c-reference-guide/92105f9bd39bd067ac1aa582d7e79a1452e464faaeb02c207f31cd14f687719d.jpg)

Be aware that the DDS\_PUBLICATION\_MATCHED\_STATUS is not applicable when the infrastructure does not have the information available to determine connectivity. This is the case when OpenSplice is configured not to maintain discovery information in the Networking Service. (See also the description of the NetworkService/Discovery[@enabled] attribute in section 4.4.1.6.1 on page 244 of the Deployment Guide.) In this case the operation will return DDS\_OBJECT\_NIL.

Status bits are declared as a constant and can be used by the application in an OR operation to create a tailored mask. The special constant DDS\_STATUS\_MASK\_NONE can be used to indicate that the created entity should not respond to any of its available statuses. The DDS will therefore attempt to propagate these statuses to its factory. The special constant DDS\_STATUS\_MASK\_ANY\_V1\_2 can be used to select all applicable statuses specified in the “Data Distribution Service for Real-time Systems Version 1.2” specification.

# Status Propagation

The Data Distribution Service will trigger the most specific and relevant Listener. In other words, in case a communication status is also activated on the DDS\_DataWriterListener of a contained DDS\_DataWriter, the DDS\_DataWriterListener on that contained DDS\_DataWriter is invoked instead of the DDS\_PublisherListener. This means that a status change on a contained DDS\_DataWriter only invokes the DDS\_PublisherListener if the contained DDS\_DataWriter itself does not handle the trigger event generated by the status change.

In case a communication status is not activated in the m a sk of the DDS\_PublisherListener, the DDS\_DomainParticipantListener of the containing DDS\_DomainParticipant is invoked (if attached and activated for the status that occurred). This allows the application to set a default behaviour in the DDS\_DomainParticipantListener o f t h e c o n t a i n i n g DDS\_DomainParticipant and a DDS\_Publisher specific behaviour when needed. In case the DDS\_DomainParticipantListener is also not attached or the communication status is not activated in its mask, the application is not notified of the change.

# 3.2.1.6 DDS\_DomainParticipant\_create\_subscriber

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
DDS_Subscriber
DDS_DomainParticipant_create_subscriber
(DDS_DomainParticipant_this,
const DDS_SubscriberQos *qos,
const struct DDS_SubscriberListener *a_listener,
const DDS_StatusMask mask);
```

# Description

This operation creates a DDS\_Subscriber with the desired QosPolicy settings and if applicable, attaches the optionally specified DDS\_SubscriberListener to it.

# Parameters

in DDS\_DomainParticipant \_this - the DDS\_DomainParticipant object on which the operation is operated.
in const DDS\_SubscriberQos \*qos - a collection of QosPolicy settings for the new DDS\_Subscriber. In case these settings are not self consistent, no DDS\_Subscriber is created.
in const struct DDS\_SubscriberListener \*a\_listener - a pointer to the DDS\_SubscriberListener instance which will be attached to the new DDS\_Subscriber. It is permitted to use DDS\_OBJECT\_NIL as the value of the listener: this behaves as a DDS\_SubscriberListener whose operations perform no action.
in const DDS\_StatusMask mask - a bit-mask in which each bit enables the invocation of the DDS\_SubscriberListener for a certain status.

# Return Value

DDS\_Subscriber - Return value is a pointer to the newly-created DDS\_Subscriber. In case of an error, the DDS\_OBJECT\_NIL pointer is returned.

# Detailed Description

This operation creates a DDS\_Subscriber with the desired QosPolicy settings and if applicable, attaches the optionally specified DDS\_SubscriberListener to it. When the DDS\_SubscriberListener is not applicable, the DDS\_OBJECT\_NIL pointer must be supplied instead. To delete the DDS\_Subscriber the operation DDS\_DomainParticipant\_delete\_subscriber o r DDS\_ DomainParticipant\_delete\_contained\_entities must be used.

In case the specified QosPolicy settings are not consistent, no DDS\_Subscriber is created and the DDS\_OBJECT\_NIL pointer is returned. DDS\_OBJECT\_NIL can also be returned when insufficient access rights exist for the partition(s) listed in the provided QoS structure.

# Default QoS

The constant DDS\_SUBSCRIBER\_QOS\_DEFAULT can be used as parameter qos to create a DDS\_Subscriber with the default DDS\_SubscriberQos as set in the Domainparticipant. The effect of using DDS\_SUBSCRIBER\_QOS\_DEFAULT is t h e s a m e a s c a l l i n g t h e o p e r a t i o n DDS\_DomainParticipant\_get\_default\_subscriber\_qos and using the resulting DDS\_SubscriberQos to create the DDS\_Subscriber.

# Communication Status

For each communication status, the StatusChangedFlag flag is initially set to FALSE. It becomes TRUE whenever that communication status changes. For each c o m m u n i c a t i o n s t a t u s a c t i v a t e d i n t h e m a s k , t h e a s s o c i a t e d DDS\_SubscriberListener operation is invoked and the communication status is reset to FALSE, as the listener implicitly accesses the status which is passed as a parameter to that operation. The fact that the status is reset prior to calling the listener means that if the application calls the get\_&lt;status\_name&gt;\_status from inside the listener it will see the status already reset.

The following statuses are applicable to the DDS\_SubscriberListener:

<table><tr><td>DDS_REQUESTED_DEADLINE_MISSED_STATUS</td><td>(propagated)</td></tr><tr><td>DDS_REQUESTED_INCOMPATIBLE_QOS_STATUS</td><td>(propagated)</td></tr><tr><td>DDS_SAMPLE_LOST_STATUS</td><td>(propagated)</td></tr><tr><td>DDS_SAMPLE_REJECTED_STATUS</td><td>(propagated)</td></tr><tr><td>DDS_DATA_AVAILABLE_STATUS</td><td>(propagated)</td></tr><tr><td>DDS_LIVELINESS_CHANGED_STATUS</td><td>(propagated)</td></tr><tr><td>DDS_SUBSCRIPTION_MATCHED_STATUS</td><td>(propagated)</td></tr><tr><td>DDS_DATA_ON_READERS_STATUS</td><td></td></tr></table>

![The image shows a standard warning symbol: a red triangular outline with a black exclamation mark in the center, set against a white background.](.vortex-opensplice-c-reference-guide/badf5ed728d32339c305095d83f256998fd9dee33a3bcdd2cbe47f5776f7885d.jpg)

Be aware that the DDS\_SUBSCRIPTION\_MATCHED\_STATUS is not applicable when the infrastructure does not have the information available to determine connectivity. This is the case when OpenSplice is configured not to maintain discovery information in the Networking Service. (See also the description of the NetworkService/Discovery[@enabled] attribute in section 4.4.1.6.1 on page 244 of the Deployment Guide.) In this case the operation will return DDS\_OBJECT\_NIL.

Status bits are declared as a constant and can be used by the application in an OR operation to create a tailored mask. The special constant DDS\_STATUS\_MASK\_NONE can be used to indicate that the created entity should not respond to any of its available statuses. The DDS will therefore attempt to propagate these statuses to its factory. The special constant DDS\_STATUS\_MASK\_ANY\_V1\_2 can be used to select all applicable statuses specified in the “Data Distribution Service for Real-time Systems Version 1.2” specification.

# Status Propagation

The Data Distribution Service will trigger the most specific and relevant Listener. In other words, in case a communication status is also activated on the DDS\_DataReaderListener of a contained DDS\_DataReader, the DDS\_DataReaderListener on that contained DDS\_DataReader is invoked instead of the DDS\_SubscriberListener. This means that a status change on a contained DDS\_DataReader only invokes the DDS\_SubscriberListener if the contained DDS\_DataReader itself does not handle the trigger event generated by the status change.

In case a communication status is not activated in the m as k of th e DDS\_SubscriberListener, the DDS\_DomainParticipantListener of the containing DDS\_DomainParticipant is invoked (if attached and activated for the status that occurred). This allows the application to set a default behaviour in the DDS\_DomainParticipantListener o f t h e c o n t a i n i n g DDS\_DomainParticipant and a DDS\_Subscriber specific behaviour when needed. In case the DDS\_DomainParticipantListener is also not attached or the communication status is not activated in its mask, the application is not notified of the change.

The statuses DDS\_DATA\_ON\_READERS\_STATUS and DDS\_DATA AVAILABLE\_STATUS are “Read Communication Statuses” and are an exception to all other plain communication statuses: they have no corresponding status structure that can be obtained with a get\_&lt;status\_name&gt;\_status operation and they are mutually exclusive. When new information becomes available to a DataReader, the Data Distribution Service will first look in an attached and activated DDS\_SubscriberListener or DDS\_DomainParticipantListener (in that o r d e r ) f o r t h e D DS \_ D A T A \_ ON \_ R E A D ER S \_ S T A T US . I n c a s e t h e DDS\_DATA\_ON\_READERS\_STATUS can not be handled, the Data Distribution Service will look in an attached and activated DDS\_DataReaderListener, DDS\_SubscriberListener or DDS\_DomainParticipantListener for the DDS\_DATA\_AVAILABLE\_STATUS (in that order).

# 3.2.1.7 DDS\_DomainParticipant\_create\_topic

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
DDS_Topic
DDS_DomainParticipant_create_topic
(DDS_DomainParticipant _this,
    const DDS_char *topic_name,
    const DDS_char *type_name,
    const DDS_TopicQos *qos,
    const struct DDS_TopicListener *a_listener,
    const DDS_StatusMask mask);
```

# Description

This operation creates a pointer to a new or existing DDS\_Topic under the given name, for a specific type, with the desired QosPolicy settings and if applicable, attaches the optionally specified DDS\_TopicListener to it.

# Parameters

in DDS\_DomainParticipant \_this - the DDS\_DomainParticipant object on which the operation is operated.
in const DDS\_char \*topic\_name - the name of the DDS\_Topic to be created. A new DDS\_Topic will only be created, when no DDS\_Topic, with the same name, is found within the DDS\_DomainParticipant.
in const DDS\_char \*type\_name - a local alias of the data type, which must have been registered before creating the DDS\_Topic.
in const DDS\_TopicQos \*qos - a collection of QosPolicy settings for the new DDS\_Topic. In case these settings are not self consistent, no DDS\_Topic is created.
in const struct DDS\_TopicListener \*a\_listener - a pointer to the DDS\_TopicListener instance which will be attached to the new DDS\_Topic. It is permitted to use DDS\_OBJECT\_NIL as the value of the listener: this behaves as a DDS\_TopicListener whose operations perform no action.
in const DDS\_StatusMask mask - a bit-mask in which each bit enables the invocation of the DDS\_TopicListener for a certain status.

# Return Value

DDS\_Topic - Return value is a pointer to the new or existing DDS\_Topic. In case of an error, the DDS\_OBJECT\_NIL pointer is returned.

# Detailed Description

This operation creates a pointer to a new or existing DDS\_Topic under the given name, for a specific type, with the desired QosPolicy settings and if applicable, attaches the optionally specified DDS\_TopicListener to it. When the DDS\_TopicListener is not applicable, the DDS\_OBJECT\_NIL pointer must be supplied instead. In case the specified QosPolicy settings are not consistent, no DDS\_Topic is created and the DDS\_OBJECT\_NIL pointer is returned. To delete the DDS\_Topic the operation DDS\_DomainParticipant\_delete\_topic or DDS\_DomainParticipant\_delete\_contained\_entities must be used.

# Default QoS

The constant DDS\_TOPIC\_QOS\_DEFAULT can be used as parameter qos to create a D D S\_ T o p i c w it h th e d e f a u l t D DS \_ T o p i c Qo s as s e t in th e DDS\_DomainParticipant. The effect of using DDS\_TOPIC\_QOS\_DEFAULT is the s a m e a s c a l l i n g t h e o p e r a t i o n DDS\_DomainParticipant\_get\_default\_topic\_qos and using the resulting DDS\_TopicQos to create the DDS\_Topic.

The DDS\_Topic is bound to the type type\_name. Prior to creating the DDS\_Topic, the type\_name must have been registered with the Data Distribution Service. Registering the type\_name is done using the data type specific DDS\_TypeSupport\_register\_type operation.

# Existing DDS\_Topic name

B e f o r e c r e a t i n g a n e w D D S \_ T o p i c , t h i s o p e r a t i o n p e r f o r m s a DDS\_DomainParticipant\_lookup\_topicdescription for the specified topic\_name. When a DDS\_Topic is found with the same name in the current domain, the QoS and type\_name of the found DDS\_Topic are matched against the parameters qos and type\_name. When they are the same, no DDS\_Topic is created but a new proxy of the existing DDS\_Topic is returned. When they are not exactly the same, no DDS\_Topic is created and the DDS\_OBJECT\_NIL pointer is returned.

When a DDS\_Topic is obtained multiple times, it must also be deleted that same number of times using DDS\_DomainParticipant\_delete\_topic or calling DDS\_DomainParticipant\_delete\_contained\_entities once to delete all the proxies.

# Local proxy

Since a DDS\_Topic is a global concept in the system, access is provided through a local proxy. In other words, the pointer returned is actually not a pointer to a DDS\_Topic but to a locally created proxy. The Data Distribution Service propagates DDS\_Topics and makes remotely created DDS\_Topics locally available through this proxy. For each create, a new proxy is created. Therefore the DDS\_Topic must be deleted the same number of times, as the DDS\_Topic was created with the same topic\_name per Domain. In other words, each pointer (local proxy) must be deleted separately.

# Communication Status

For each communication status, the StatusChangedFlag flag is initially set to FALSE. It becomes TRUE whenever that communication status changes. For each communication status activated in the mask, the associated DDS\_TopicListener operation is invoked and the communication status is reset to FALSE, as the listener implicitly accesses the status which is passed as a parameter to that operation. The fact that the status is reset prior to calling the listener means that if the application calls the get\_&lt;status\_name&gt;\_status from inside the listener it will see the status already reset.

The following statuses are applicable to the DDS\_TopicListener:

• DDS\_INCONSISTENT\_TOPIC\_STATUS

Status bits are declared as a constant and can be used by the application in an OR operation to create a tailored mask. The special constant DDS\_STATUS\_MASK\_NONE can be used to indicate that the created entity should not respond to any of its available statuses. The DDS will therefore attempt to propagate these statuses to its factory. The special constant DDS\_STATUS\_MASK\_ANY\_V1\_2 can be used to select all statuses specified in the “Data Distribution Service for Real-time Systems Version 1.2” specification.

# Status Propagation

In case a communication status is not activated in the m a sk of the DDS\_TopicListener, the DDS\_DomainParticipantListener of the containing DDS\_DomainParticipant is invoked (if attached and activated for the status that occurred). This allows the application to set a default behaviour in the DDS\_DomainParticipantListener o f t h e c o n t a i n i n g DDS\_DomainParticipant and a DDS\_Topic specific behaviour when needed. In case the DDS\_DomainParticipantListener is also not attached or the communication status is not activated in its mask, the application is not notified of the change.

# 3.2.1.8 DDS\_DomainParticipant\_delete\_contained\_entities

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
DDS_ReturnCode_t
DDS_DomainParticipant_delete_contained_entities
(DDS_DomainParticipant _this);
```

# Description

This operation deletes all of the DDS\_Entity objects that were created on the DDS\_DomainParticipant.

# Parameters

in DDS\_DomainParticipant \_this - the DDS\_DomainParticipant object on which the operation is performed.

# Return Value

D D S \_ R e t u r n C o d e \_ t - P o s s i b l e r e t u r n c o d e s o f t h e o p e r a t i o n a r e : DDS\_RETCODE\_OK, DDS\_RETCODE\_ERROR, DDS\_RETCODE\_ILLEGAL\_ OPERATION, DDS\_RETCODE\_ALREADY\_DELETED, DDS\_RETCODE\_ OUT\_OF\_RESOURCES or DDS\_RETCODE\_PRECONDITION\_NOT\_MET.

# Detailed Description

This operation deletes all the DDS\_Entity objects that were created on the DDS\_DomainParticipant. In other words, it deletes all DDS\_Publisher, DDS\_Subscriber, DDS\_Topic, DDS\_ContentFilteredTopic and DDS\_MultiTopic objects. Prior to deleting each contained DDS\_Entity, this o p e r a t i o n r e g r e s s i v e l y c a l l s t h e c o r r e s p o n d i n g DDS\_&lt;Entity&gt;\_delete\_contained\_entities operation on each DDS\_Entity (if applicable). In other words, all DDS\_Entity objects in the DDS\_Publisher and DDS\_Subscriber are deleted, including the DDS\_DataWriter and DDS\_DataReader. Also the DDS\_QueryCondition and DDS\_ReadCondition objects contained by the DDS\_DataReader are deleted.

# DDS\_Topic

Since a DDS\_Topic is a global concept in the system, access is provided through a local proxy. The Data Distribution Service propagates DDS\_Topics and makes remotely created DDS\_Topics locally available through this proxy. Such a proxy is created by the DDS\_DomainParticipant\_create\_topic or DDS\_DomainParticipant\_find\_topic operation. When a pointer to the same DDS\_Topic w a s c r e a t e d m u l t i p l e t i m e s ( e i t h e r b y DDS\_DomainParticipant\_create\_topic o r DDS\_DomainParticipant\_find\_topic), all pointers (local proxies) are deleted. With the last proxy, the DDS\_Topic itself is also removed from the system.

![The image displays a red triangular warning sign with a black exclamation point centered inside it.](.vortex-opensplice-c-reference-guide/109e4a26e81fce371b2ced12bddebbd189c3b9b5b832a6d8a8a57301c1f02863.jpg)

NOTE: The operation will return DDS\_PRECONDITION\_NOT\_MET if the any of the contained entities is in a state where it cannot be deleted. This will occur, for example, if a contained DDS\_DataReader cannot be deleted because the application has called a read or take operation and has not called the corresponding return\_loan operation to return the loaned samples. In such cases, the operation does not roll back any entity deletions performed prior to the detection of the problem.

# Return Code

When the operation returns:

• DDS\_RETCODE\_OK - the contained DDS\_Entity objects are deleted and the application may delete the DDS\_DomainParticipant.
• DDS\_RETCODE\_ERROR - an internal error has occurred.
• DDS\_RETCODE\_ILLEGAL\_OPERATION - the operation is invoked on an inappropriate object.
• DDS\_RETCODE\_ALREADY\_DELETED - the DDS\_DomainParticipant has already been deleted.
• DDS\_RETCODE\_OUT\_OF\_RESOURCES - the Data Distribution Service ran out of resources to complete this operation.
• DDS\_RETCODE\_PRECONDITION\_NOT\_MET - one or more of the contained entities are in a state where they cannot be deleted.

# 3.2.1.9 DDS\_DomainParticipant\_delete\_contentfilteredtopic

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
DDS_ReturnCode_t
DDS_DomainParticipant_delete_contentfilteredtopic
(DDS_DomainParticipant _this,
const DDS_ContentFilteredTopic
a_contentfilteredtopic);
```

# Description

This operation deletes a DDS\_ContentFilteredTopic.

# Parameters

in DDS\_DomainParticipant \_this - the DDS\_DomainParticipant object on which the operation is operated.

in const DDS\_ContentFilteredTopic a\_contentfilteredtopic - a pointer to the DDS\_ContentFilteredTopic, which is to be deleted.

# Return Value

DDS\_ReturnCode\_t - Possible return codes of the operation are: DDS\_RETCODE\_OK, DDS\_RETCODE\_ERROR, DDS\_RETCODE\_ILLEGAL\_ OPERATION, DDS\_RETCODE\_BAD\_PARAMETER, DDS\_RETCODE\_ALREADY\_ DELETED, DDS\_RETCODE\_OUT\_OF\_RESOURCES or DDS\_RETCODE PRECONDITION\_NOT\_MET.

# Detailed Description

This operation deletes a DDS\_ContentFilteredTopic.

The deletion of a DDS\_ContentFilteredTopic is not allowed if there are any e x i s t i n g D D S \_ D a t a R e a d e r o b j e c t s t h a t a r e u s i n g t h e DDS\_ContentFilteredTopic.

If the DDS\_DomainParticipant\_delete\_contentfilteredtopic operation is called on a DDS\_ContentFilteredTopic with existing DDS\_DataReader objects attached to it, it will return PRECONDITION\_NOT\_MET.

The DDS\_DomainParticipant\_delete\_contentfilteredtopic operation must be called on the same DDS\_DomainParticipant object used to create the DDS\_ContentFilteredTopic.

If DDS\_DomainParticipant\_delete\_contentfilteredtopic is called on a different DDS\_DomainParticipant the operation will have no effect and it will return PRECONDITION\_NOT\_MET.

# Return Code

When the operation returns:

• DDS\_RETCODE\_OK - the DDS\_ContentFilteredTopic is deleted.
• DDS\_RETCODE\_ERROR - an internal error has occurred.
• DDS\_RETCODE\_ILLEGAL\_OPERATION - the operation is invoked on an inappropriate object.
• DDS\_RETCODE\_BAD\_PARAMETER - the parameter a\_contentfilteredtopic is not a valid DDS\_ContentFilteredTopic.
• DDS\_RETCODE\_ALREADY\_DELETED - the DDS\_DomainParticipant has already been deleted.
• DDS\_RETCODE\_OUT\_OF\_RESOURCES - the Data Distribution Service ran out of resources to complete this operation.
• DDS\_RETCODE\_PRECONDITION\_NOT\_MET - the operation is called on a different DDS\_DomainParticipant, as used when the DDS\_ContentFilteredTopic was created, or the DDS\_ContentFilteredTopic is being used by one or more DDS\_DataReader objects.

# 3.2.1.10 DDS\_DomainParticipant\_delete\_multitopic

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
DDS_ReturnCode_t
DDS_DomainParticipant_delete_multitopic
(DDS_DomainParticipant_this,
const DDS_MultiTopic a_multitopic);
```

NOTE: This operation is not yet implemented. It is scheduled for a future release.

# Description

This operation deletes a DDS\_MultiTopic.

# Parameters

in DDS\_DomainParticipant \_this - the DDS\_DomainParticipant object on which the operation is operated.

in const DDS\_MultiTopic a\_multitopic - a pointer to the DDS\_MultiTopic, which is to be deleted.

# Return Value

```txt
DDS_ReturnCode_t - Possible return codes of the operation are: DDS_RETCODE_OK, DDS_RETCODE_ERROR, DDS_RETCODE_ILLEGAL_OPERATION, DDS_RETCODE_BAD_PARAMETER, DDS_RETCODE_ALREADY_DELETED, DDS_RETCODE_OUT_OF_RESOURCES or DDS_RETCODE_PRECONDITION_NOT_MET.
```

# Detailed Description

This operation deletes a DDS\_MultiTopic.

The deletion of a DDS\_MultiTopic is not allowed if there are any existing DDS\_DataReader objects that are using the DDS\_MultiTopic. If the DDS\_DomainParticipant\_delete\_multitopic operation is called on a DDS\_MultiTopic with existing DDS\_DataReader objects attached to it, it will return DDS\_RETCODE\_PRECONDITION\_NOT\_MET.

The DDS\_DomainParticipant\_delete\_multitopic operation must be called on the same DDS\_DomainParticipant object used to create the DDS\_MultiTopic. If DDS\_DomainParticipant\_delete\_multitopic is called on a different DDS\_DomainParticipant the operation will have no effect and it will return DDS\_RETCODE\_PRECONDITION\_NOT\_MET.

# Return Code

When the operation returns:

• DDS\_RETCODE\_OK - the DDS\_MultiTopic is deleted.
• DDS\_RETCODE\_ERROR - an internal error has occurred.
• DDS\_RETCODE\_ILLEGAL\_OPERATION - the operation is invoked on an inappropriate object.
• DDS\_RETCODE\_BAD\_PARAMETER - the parameter a\_multitopic is not a valid DDS\_MultiTopic.
• DDS\_RETCODE\_ALREADY\_DELETED - the DDS\_DomainParticipant has already been deleted.
• DDS\_RETCODE\_OUT\_OF\_RESOURCES - the Data Distribution Service ran out of resources to complete this operation.
• DDS\_RETCODE\_PRECONDITION\_NOT\_MET - the operation is called on a different DDS\_DomainParticipant, as used when the DDS\_MultiTopic was created, or the DDS\_MultiTopic is being used by one or more DDS\_DataReader objects.

# 3.2.1.11 DDS\_DomainParticipant\_delete\_publisher

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
DDS_ReturnCode_t
DDS_DomainParticipant_delete_publisher
(DDS_DomainParticipant _this,
const DDS_Publisher p);
```

# Description

This operation deletes a DDS\_Publisher.

# Parameters

in DDS\_DomainParticipant \_this - the DDS\_DomainParticipant object on which the operation is operated.

in const DDS\_Publisher p - a pointer to the DDS\_Publisher, which is to be deleted.

# Return Value

DDS\_ReturnCode\_t - Possible return codes of the operation are: DDS\_RETCODE\_OK, DDS\_RETCODE\_ERROR, DDS\_RETCODE\_ILLEGAL OPERATION, DDS\_RETCODE\_BAD\_PARAMETER, DDS\_RETCODE\_ALREADY\_ DELETED, DDS\_RETCODE\_OUT\_OF\_RESOURCES or DDS\_RETCODE\_ PRECONDITION\_NOT\_MET.

# Detailed Description

This operation deletes a DDS\_Publisher. A DDS\_Publisher cannot be deleted when it has any attached DDS\_DataWriter objects. When the operation is called on a DDS\_Publisher with DDS\_DataWriter objects, the operation returns DDS\_RETCODE\_PRECONDITION\_NOT\_MET. When the operation is called on a different DDS\_DomainParticipant, as used when the DDS\_Publisher was c r e a t e d , t h e o p e r a t i o n h a s n o e ff e c t a n d r e t u r n s DDS\_RETCODE\_PRECONDITION\_NOT\_MET.

# Return Code

When the operation returns:

• DDS\_RETCODE\_OK - the DDS\_Publisher is deleted.
• DDS\_RETCODE\_ERROR - an internal error has occurred.
• DDS\_RETCODE\_ILLEGAL\_OPERATION - the operation is invoked on an inappropriate object.
• DDS\_RETCODE\_BAD\_PARAMETER - the parameter p is not a valid DDS\_Publisher.
• DDS\_RETCODE\_ALREADY\_DELETED - the DDS\_DomainParticipant has already been deleted.
• DDS\_RETCODE\_OUT\_OF\_RESOURCES - the Data Distribution Service ran out of resources to complete this operation.
• DDS\_RETCODE\_PRECONDITION\_NOT\_MET - the operation is called on a different DDS\_DomainParticipant, as used when the DDS\_Publisher was created, or the DDS\_Publisher contains one or more DDS\_DataWriter objects.

# 3.2.1.12 DDS\_DomainParticipant\_delete\_subscriber

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
DDS_ReturnCode_t
DDS_DomainParticipant_delete_subscriber
(DDS_DomainParticipant _this,
const DDS_Subscriber s);
```

# Description

This operation deletes a DDS\_Subscriber.

# Parameters

in DDS\_DomainParticipant \_this - the DDS\_DomainParticipant object on which the operation is operated.

in const DDS\_Subscriber s - a pointer to the DDS\_Subscriber, which is to be deleted.

# Return Value

D D S \_ R e t u r n C o d e \_ t - P o s s i b l e r e t u r n c o d e s o f t h e o p e r a t i o n a r e : DDS\_RETCODE\_OK, DDS\_RETCODE\_ERROR, DDS\_RETCODE\_ILLEGAL OPERATION, DDS\_RETCODE\_BAD\_PARAMETER, DDS\_RETCODE\_ALREADY\_ DELETED, DDS\_RETCODE\_OUT\_OF\_RESOURCES or DDS\_RETCODE\_ PRECONDITION\_NOT\_MET.

# Detailed Description

This operation deletes a DDS\_Subscriber. A DDS\_Subscriber cannot be deleted when it has any attached DDS\_DataReader objects. When the operation is called on a DDS\_Subscriber with DDS\_DataReader objects, the operation returns DDS\_RETCODE\_PRECONDITION\_NOT\_MET. When the operation is called on a different DDS\_DomainParticipant, as used when the DDS\_Subscriber was c r e a t e d , t h e o p e r a t i o n h a s n o e ff e c t a n d r e t u r n s DDS\_RETCODE\_PRECONDITION\_NOT\_MET.

# Return Code

When the operation returns:

• DDS\_RETCODE\_OK - the DDS\_Subscriber is deleted.
• DDS\_RETCODE\_ERROR - an internal error has occurred.
• DDS\_RETCODE\_ILLEGAL\_OPERATION - the operation is invoked on an inappropriate object.
• DDS\_RETCODE\_BAD\_PARAMETER - the parameter s is not a valid DDS\_Subscriber.
• DDS\_RETCODE\_ALREADY\_DELETED - the DDS\_DomainParticipant has already been deleted.
• DDS\_RETCODE\_OUT\_OF\_RESOURCES - the Data Distribution Service ran out of resources to complete this operation.
• DDS\_RETCODE\_PRECONDITION\_NOT\_MET - the operation is called on a different DDS\_DomainParticipant, as used when the DDS\_Subscriber was created, or the DDS\_Subscriber contains one or more DDS\_DataReader objects.

# 3.2.1.13 DDS\_DomainParticipant\_delete\_topic

# Synopsis

#include &lt;dds\_dcps.h&gt; DDS\_ReturnCode\_t

```txt
DDS_DomainParticipant_delete_topic
(DDS_DomainParticipant_this,
const DDS_Topic a_topic);
```

# Description

This operation deletes a DDS\_Topic.

# Parameters

in DDS\_DomainParticipant \_this - the DDS\_DomainParticipant object on which the operation is operated.

in const DDS\_Topic a\_topic - a pointer to the DDS\_Topic, which is to be deleted.

# Return Value

DDS\_ReturnCode\_t - Possible return codes of the operation are: DDS\_RETCODE\_OK, DDS\_RETCODE\_ERROR, DDS\_RETCODE\_ILLEGAL\_ OPERATION, DDS\_RETCODE\_BAD\_PARAMETER, DDS\_RETCODE\_ALREADY\_ DELETED, DDS\_RETCODE\_OUT\_OF\_RESOURCES or DDS\_RETCODE\_ PRECONDITION\_NOT\_MET.

# Detailed Description

This operation deletes a DDS\_Topic. A DDS\_Topic cannot be deleted when there are any DDS\_DataReader, DDS\_DataWriter, DDS\_ContentFilteredTopic or DDS\_MultiTopic objects, which are using the DDS\_Topic. When the operation is called on a DDS\_Topic pointed to by any of these objects, the operation returns DDS\_RETCODE\_PRECONDITION\_NOT\_MET. When the operation is called on a different DDS\_DomainParticipant, as used when the DDS\_Topic was created, the operation has no effect and returns DDS\_RETCODE\_PRECONDITION\_NOT\_MET.

# Local Proxy

Since a DDS\_Topic is a global concept in the system, access is provided through a local proxy. In other words, the pointer is actually not a pointer to a DDS\_Topic but to the local proxy. The Data Distribution Service propagates DDS\_Topics and makes remotely created DDS\_Topics locally available through this proxy. Such a proxy is created by the DDS\_DomainParticipant\_create\_topic or DDS\_DomainParticipant\_find\_topic operation. This operation will delete the local proxy. When a pointer to the same DDS\_Topic was created multiple times ( e i t h e r b y DDS\_DomainParticipant\_create\_topic o r DDS\_DomainParticipant\_find\_topic), each pointer (local proxy) must be deleted separately. When this proxy is the last proxy for this DDS\_Topic, the

DDS\_Topic itself is also removed from the system. As mentioned, a proxy may only be deleted when there are no other entities attached to it. However, it is possible to delete a proxy while there are entities attached to a different proxy.

# Return Code

When the operation returns:

• DDS\_RETCODE\_OK - the DDS\_Topic is deleted.
• DDS\_RETCODE\_ERROR - an internal error has occurred.
• DDS\_RETCODE\_ILLEGAL\_OPERATION - the operation is invoked on an inappropriate object.
• DDS\_RETCODE\_BAD\_PARAMETER - the parameter a\_topic is not a valid DDS\_Topic.
• DDS\_RETCODE\_ALREADY\_DELETED - the DDS\_DomainParticipant has already been deleted.
• DDS\_RETCODE\_OUT\_OF\_RESOURCES - the Data Distribution Service ran out of resources to complete this operation.
• DDS\_RETCODE\_PRECONDITION\_NOT\_MET - the operation is called on a different DDS\_DomainParticipant, as used when the DDS\_Topic was created, or the DDS\_Topic is still pointed to by other objects.

# 3.2.1.14 DDS\_DomainParticipant\_enable (inherited)

This operation is inherited and therefore not described here. See the class DDS\_Entity for further explanation.

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
DDS_ReturnCode_t
DDS_DomainParticipant_enable
(DDS_DomainParticipant _this);
```

# 3.2.1.15 DDS\_DomainParticipant\_find\_topic

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
DDS_Topic
DDS_DomainParticipant_find_topic
(DDS_DomainParticipant_this,
const DDS_char *topic_name,
const DDS_Duration_t *timeout);
```

# Description

This operation gives access to an existing (or ready to exist) enabled DDS\_Topic, based on its topic\_name.

# Parameters

in DDS\_DomainParticipant \_this - the DDS\_DomainParticipant object on which the operation is operated.

in const DDS\_char \*topic\_name - the name of the DDS\_Topic that the application wants access to.

in const DDS\_Duration\_t \*timeout - the maximum duration to block for the DDS\_DomainParticipant\_find\_topic, after which the application thread is unblocked. The special constant DDS\_DURATION\_INFINITE can be used when the maximum waiting time does not need to be bounded.

# Return Value

DDS\_Topic - Return value is a pointer to the DDS\_Topic found.

# Detailed Description

This operation gives access to an existing DDS\_Topic, based on its topic\_name. The operation takes as arguments the topic\_name of the DDS\_Topic and a timeout.

If a DDS\_Topic of the same topic\_name already exists, it gives access to this DDS\_Topic. Otherwise it waits (blocks the caller) until another mechanism creates it. This other mechanism can be another thread, a configuration tool, or some other Data Distribution Service utility. If after the specified timeout the DDS\_Topic can still not be found, the caller gets unblocked and DDS\_HANDLE\_NIL is returned.

A DDS\_Topic obtained by means of DDS\_DomainParticipant\_find\_topic, must also be deleted by means of DDS\_DomainParticipant\_delete\_topic so that the local resources can be released. If a DDS\_Topic is obtained multiple times i t m u s t a l s o b e d e l e t e d t h a t s a m e n u m b e r o f t i m e s u s i n g DDS\_DomainParticipant\_delete\_topic o r c a l l i n g DDS\_DomainParticipant\_delete\_contained\_entities once to delete all the proxies.

A DDS\_Topic t h a t i s o b t a i n e d b y m e a n s o f DDS\_DomainParticipant\_find\_topic i n a s p e c i f i c DDS\_DomainParticipant can only be used to create DDS\_DataReaders and DDS\_DataWriters in that DDS\_DomainParticipant if its corresponding DDS\_TypeSupport has been registered to that same DDS\_DomainParticipant.

# Local Proxy

Since a DDS\_Topic is a global concept in the system, access is provided through a local proxy. In other words, the pointer returned is actually not a pointer to a DDS\_Topic but to a locally created proxy. The Data Distribution Service propagates DDS\_Topics and makes remotely created DDS\_Topics locally available through this proxy. For each time this operation is called, a new proxy is created. Therefore the DDS\_Topic must be deleted the same number of times, as the DDS\_Topic was created with the same topic\_name per Domain. In other words, each pointer (local proxy) must be deleted separately.

# 3.2.1.16 DDS\_DomainParticipant\_get\_builtin\_subscriber

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
DDS_Subscriber
DDS_DomainParticipant_get_builtin_subscriber
(DDS_DomainParticipant_this);
```

# Description

This operation returns the built-in DDS\_Subscriber associated with the DDS\_DomainParticipant.

# Parameters

in DDS\_DomainParticipant \_this - the DDS\_DomainParticipant object on which the operation is operated.

# Return Value

DDS\_Subscriber - Result value is a pointer to the built-in DDS\_Subscriber associated with the DDS\_DomainParticipant.

# Detailed Description

This operation returns the built-in DDS\_Subscriber associated with the DDS\_DomainParticipant. Each DDS\_DomainParticipant contains several built-in DDS\_Topic objects. The built-in DDS\_Subscriber contains the correspo nding D DS \_ Da ta R ea de r objects to access them. All these DDS\_DataReader objects belong to a single built-in DDS\_Subscriber. Note that there is exactly one built-in DDS\_Subscriber associated with each DDS\_DomainParticipant.

# 3.2.1.17 DDS\_DomainParticipant\_get\_current\_time

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
```

```txt
DDS_ReturnCode_t
    get_current_time
    (DDS_DomainParticipant _this,
    DDS_Time_t *current_time);
```

# Description

This operation returns the value of the current time that the Data Distribution Service uses to time-stamp written data as well as received data in current\_time.

# Parameters

in DDS\_DomainParticipant \_this - the DDS\_DomainParticipant object on which the operation is operated.

inout DDS\_Time\_t \*current\_time - the value of the current time as used by the Data Distribution System. The input value of current\_time is ignored.

# Return Value

```txt
DDS_ReturnCode_t - Possible return codes of the operation are: DDS_RETCODE_OK, DDS_RETCODE_ERROR, DDS_RETCODE_ILLEGAL_OPERATION, DDS_RETCODE_BAD_PARAMETER, DDS_RETCODE_ALREADY_DELETED, DDS_RETCODE_OUT_OF_RESOURCES or DDS_RETCODE_NOT_ENABLED.
```

# Detailed Description

This operation returns the value of the current time that the Data Distribution Service uses to time-stamp written data as well as received data in current\_time. The input value of current\_time is ignored by the operation.

# Return Code

When the operation returns:

• DDS\_RETCODE\_OK - the value of the current time is returned in current\_time.
• DDS\_RETCODE\_ERROR - an internal error has occurred.
• DDS\_RETCODE\_ILLEGAL\_OPERATION - the operation is invoked on an inappropriate object.
• DDS\_RETCODE\_BAD\_PARAMETER - the parameter current\_time is not a valid reference.
• DDS\_RETCODE\_ALREADY\_DELETED - the DomainParticipant has already been deleted.
• DDS\_RETCODE\_OUT\_OF\_RESOURCES - the Data Distribution Service ran out of resources to complete this operation.
• DDS\_RETCODE\_NOT\_ENABLED - the DDS\_DomainParticipant is not enabled.

# 3.2.1.18 DDS\_DomainParticipant\_get\_default\_publisher\_qos

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
DDS_ReturnCode_t
DDS_DomainParticipant_get_default_publisher_qos
(DDS_DomainParticipant_this,
DDS_PublisherQos *qos);
```

# Description

This operation gets the struct with the default DDS\_Publisher QosPolicy settings of the DDS\_DomainParticipant.

# Parameters

in DDS\_DomainParticipant \_this - the DDS\_DomainParticipant object on which the operation is operated.

inout DDS\_PublisherQos \*qos - a pointer to the DDS\_PublisherQos struct (provided by the application) in which the default QosPolicy settings for the DDS\_Publisher are written.

# Return Value

```txt
DDS_ReturnCode_t - Possible return codes of the operation are: DDS_RETCODE_OK, DDS_RETCODE_ERROR, DDS_RETCODE_ILLEGAL_OPERATION, DDS_RETCODE_ALREADY_DELETED, DDS_RETCODE_OUT_OF_RESOURCES or DDS_RETCODE_PRECONDITION_NOT_MET.
```

# Detailed Description

This operation gets the struct with the default DDS\_Publisher QosPolicy settings of the DDS\_DomainParticipant (that is the DDS\_PublisherQos) which is used for newly-created DDS\_Publisher objects, in case the constant DDS\_PUBLISHER\_QOS\_DEFAULT is used. The default DDS\_PublisherQos is only used when the constant is supplied as parameter qos to specify the DDS\_PublisherQos in the DDS\_DomainParticipant\_create\_publisher operation. The application must provide the DDS\_PublisherQos struct in which the QosPolicy settings can be stored and pass the qos pointer to the operation. The operation writes the default QosPolicy settings to the struct pointed to by qos. Any settings in the struct are overwritten.

The values retrieved by this operation match the set of values specified on the last successful call to DDS\_DomainParticipant\_set\_default\_publisher\_qos, or, if the call was never made, the default values as specified for each QosPolicy setting as defined in Table 5: on page 65.

![The image displays a red triangular warning sign with a white background. Inside the triangle is a black exclamation mark. Below the exclamation mark is a black downward-pointing arrow.](.vortex-opensplice-c-reference-guide/9e31320fc531b6b5dbef25ab4e93b3b5066ae784c938113ad16edfbbc9b5c5a7.jpg)

NOTE: The operation will return DDS\_PRECONDITION\_NOT\_MET if the any of the contained entities is in a state where it cannot be deleted. This will occur, for example, if a contained DDS\_DataReader cannot be deleted because the application has called a read or take operation and has not called the corresponding return\_loan operation to return the loaned samples. In such cases, the operation does not roll back any entity deletions performed prior to the detection of the problem.

# Return Code

When the operation returns:

• DDS\_RETCODE\_OK - the default DDS\_Publisher QosPolicy settings of this DDS\_DomainParticipant have successfully been copied into the specified DDS\_PublisherQos parameter.
• DDS\_RETCODE\_ERROR - an internal error has occurred.
• DDS\_RETCODE\_ILLEGAL\_OPERATION - the operation is invoked on an inappropriate object.
• DDS\_RETCODE\_ALREADY\_DELETED - the DDS\_DomainParticipant has already been deleted.
• DDS\_RETCODE\_OUT\_OF\_RESOURCES - the Data Distribution Service ran out of resources to complete this operation.
• DDS\_RETCODE\_PRECONDITION\_NOT\_MET - one or more of the contained entities are in a state where they cannot be deleted.

# 3.2.1.19 DDS\_DomainParticipant\_get\_default\_subscriber\_qos

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
DDS_ReturnCode_t
DDS_DomainParticipant_get_default_subscriber_qos
(DDS_DomainParticipant_this,
DDS_SubscriberQos *qos);
```

# Description

This operation gets the struct with the default DDS\_Subscriber QosPolicy settings of the DDS\_DomainParticipant.

# Parameters

in DDS\_DomainParticipant \_this - the DDS\_DomainParticipant object on which the operation is operated.

inout DDS\_SubscriberQos \*qos - a pointer to the QosPolicy struct (provided by the application) in which the default QosPolicy settings for the DDS\_Subscriber is written.

# Return Value

DDS\_ReturnCode\_t - Possible return codes of the operation are: DDS\_RETCODE\_OK, DDS\_RETCODE\_ERROR, DDS\_RETCODE\_ILLEGAL\_ OPERATION, DDS\_RETCODE\_ALREADY\_DELETED or DDS\_RETCODE\_ OUT\_OF\_RESOURCES.

# Detailed Description

This operation gets the struct with the default DDS\_Subscriber QosPolicy settings of the DDS\_DomainParticipant (that is the DDS\_SubscriberQos) which is used for newly-created DDS\_Subscriber objects, in case the constant DDS\_SUBSCRIBER\_QOS\_DEFAULT is used. The default DDS\_SubscriberQos is only used when the constant is supplied as parameter qos to specify the DDS\_SubscriberQos in the DDS\_DomainParticipant\_create\_subscriber operation. The application must provide the QoS struct in which the policy can be stored and pass the qos pointer to the operation. The operation writes the default QosPolicy to the struct pointed to by qos. Any settings in the struct are overwritten.

The values retrieved by this operation match the set of values specified on the last successful call to DDS\_DomainParticipant\_set\_default\_subscriber\_qos, or, if the call was never made, the default values as specified for each QosPolicy defined in Table 5: on page 65.

# Return Code

When the operation returns:

• DDS\_RETCODE\_OK - the default DDS\_Subscriber QosPolicy settings of this DDS\_DomainParticipant have successfully been copied into the specified DDS\_SubscriberQos parameter.
• DDS\_RETCODE\_ERROR - an internal error has occurred.
• DDS\_RETCODE\_ILLEGAL\_OPERATION - the operation is invoked on an inappropriate object.
• DDS\_RETCODE\_ALREADY\_DELETED - the DDS\_DomainParticipant has already been deleted.
• DDS\_RETCODE\_OUT\_OF\_RESOURCES - the Data Distribution Service ran out of resources to complete this operation.

# 3.2.1.20 DDS\_DomainParticipant\_get\_default\_topic\_qos

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
DDS_ReturnCode_t
DDS_DomainParticipant_get_default_topic_qos
(DDS_DomainParticipant _this,
DDS_TopicQos *qos);
```

# Description

This operation gets the struct with the default DDS\_Topic QosPolicy settings of the DDS\_DomainParticipant.

# Parameters

in DDS\_DomainParticipant \_this - the DDS\_DomainParticipant object on which the operation is operated.

inout DDS\_TopicQos \*qos - a pointer to the QosPolicy struct (provided by the application) in which the default QosPolicy settings for the DDS\_Topic is written.

# Return Value

DDS\_ReturnCode\_t - Possible return codes of the operation are: DDS\_RETCODE\_OK, DDS\_RETCODE\_ERROR, DDS\_RETCODE\_ILLEGAL\_ OPERATION, DDS\_RETCODE\_ALREADY\_DELETED or DDS\_RETCODE\_ OUT\_OF\_RESOURCES.

# Detailed Description

This operation gets the struct with the default DDS\_Topic QosPolicy settings of the DDS\_DomainParticipant (that is the DDS\_TopicQos) which is used for n e w l y - c r e a t e d D D S \_ T o p i c o b j e c t s , i n c a s e t h e c o n s t a n t DDS\_TOPIC\_QOS\_DEFAULT is used. The default DDS\_TopicQos is only used when the constant is supplied as parameter qos to specify the DDS\_TopicQos in the DDS\_DomainParticipant\_create\_topic operation. The application must provide the QoS struct in which the policy can be stored and pass the qos pointer to the operation. The operation writes the default QosPolicy to the struct pointed to by qos. Any settings in the struct are overwritten.

The values retrieved by this operation match the set of values specified on the last successful call to DDS\_DomainParticipant\_set\_default\_topic\_qos, or, if the call was never made, the default values as specified for each QosPolicy defined in Table 5: on page 65.

# Return Code

When the operation returns:

• DDS\_RETCODE\_OK - the default DDS\_Topic QosPolicy settings of this DDS\_DomainParticipant have successfully been copied into the specified DDS\_TopicQos parameter.
• DDS\_RETCODE\_ERROR - an internal error has occurred.
• DDS\_RETCODE\_ILLEGAL\_OPERATION - the operation is invoked on an inappropriate object.
• DDS\_RETCODE\_ALREADY\_DELETED - the DDS\_DomainParticipant has already been deleted.
• DDS\_RETCODE\_OUT\_OF\_RESOURCES - the Data Distribution Service ran out of resources to complete this operation.

# 3.2.1.21 DDS\_DomainParticipant\_get\_discovered\_participants

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
DDS_ReturnCode_t
DDS_DomainParticipant_get_discovered_participants
(DDS_DomainParticipant_this,
DDS_InstanceHandleSeq *participant_handles);
```

# Description

This operation retrieves the list of DomainParticipants that have been discovered in the domain.

# Parameters

in DDS\_DomainParticipant \_this - the DDS\_DomainParticipant object on which the operation is operated.

inout InstanceHandleSeq \*participant\_handles - a sequence which is used to pass the list of all associated participants.

# Return Value

```txt
DDS_ReturnCode_t - Possible return codes of the operation are:
DDS_RETCODE_OK, DDS_RETCODE_ERROR,
DDS_RETCODE_ILLEGAL_OPERATION, DDS_RETCODE_UNSUPPORTED,
DDS_RETCODE_ALREADY_DELETED, DDS_RETCODE_OUT_OF_RESOURCES, or
DDS_RETCODE_NOT_ENABLED.
```

# Detailed Description

This operation retrieves the list of DomainParticipants that have been discovered in the domain and that the application has not indicated should be “ignored” by means of the DomainParticipant ignore\_participant operation.

The participant\_handles sequence and its buffer may be pre-allocated by the application and therefore must either be re-used in a subsequent invocation of the DDS\_DomainParticipant\_get\_discovered\_participants operation or be released by calling DDS\_free on the returned participant\_handles. If the pre-allocated sequence is not big enough to hold the number of associated participants, the sequence will automatically be (re-)allocated to fit the required size.

The handles returned in the participant\_handles sequence are the ones that are used by the DDS implementation to locally identify the corresponding matched Participant entities. You can access more detailed information about a particular p a r t i c i p a n t b y p a s s i n g i t s p a r t i c i p a n t \_ h a n d l e t o e i t h e r t h e DDS\_DomainParticipant\_get\_discovered\_participant\_data operation or to the DDS\_ParticipantBuiltinTopicDataDataReader\_read\_instance operation on the built-in reader for the “DCPSParticipant” topic.

Be aware that since DDS\_InstanceHandle\_t is an opaque datatype, it does not n e c e s s a r i l y m e a n t h a t t h e h a n d l e s o b t a i n e d f r o m t h e DDS\_DomainParticipant\_get\_discovered\_participants operation have the same value as the ones that appear in the instance\_handle field of the DDS\_SampleInfo when retrieving the participant info through corresponding “DCPSParticipant” built-in reader. You can’t just compare two handles to determine whether they represent the same participant. If you want to know whether two handles actually do represent the same participant, use both handles to retrieve their corresponding DDS\_ParticipantBuiltinTopicData samples and then compare the key field of both samples.

# Return Code

When the operation returns:

• DDS\_RETCODE\_OK - the list of associated participants has been successfully obtained.
• DDS\_RETCODE\_ERROR - an internal error has occurred.
• DDS\_RETCODE\_ILLEGAL\_OPERATION - the operation is invoked on an inappropriate object.
• DDS\_RETCODE\_UNSUPPORTED - OpenSplice is configured not to maintain the information about “associated” participants.

• DDS\_RETCODE\_ALREADY\_DELETED - the DDS\_DomainParticipant has already been deleted.
• DDS\_RETCODE\_OUT\_OF\_RESOURCES - the Data Distribution Service ran out of resources to complete this operation.
• DDS\_RETCODE\_NOT\_ENABLED - the DDS\_DomainParticipant is not enabled.

# 3.2.1.22 DDS\_DomainParticipant\_get\_discovered\_participant\_data

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
DDS_ReturnCode_t
DDS_DomainParticipant_get_discovered_participant_data
(DDS_DomainParticipant_this,
DDS_ParticipantBuiltinTopicData *participant_data,
DDS_InstanceHandle_t handle);
```

# Description

This operation retrieves information on a DomainParticipant that has been discovered on the network. The participant must be in the same domain as the participant on which this operation is invoked and must not have been “ignored” by means of the DomainParticipant ignore\_participant operation.

# Parameters

in DDS\_DomainParticipant \_this - the DDS\_DomainParticipant object on which the operation is operated.

inout DDS\_ParticipantBuiltinTopicData \*participant\_data - a pointer to the sample in which the information about the specified partition is to be stored.

in const DDS\_InstanceHandle\_t participant\_handle - a handle to the participant whose information needs to be retrieved.

# Return Value

```txt
DDS_ReturnCode_t - Possible return codes of the operation are:
DDS_RETCODE_OK, DDS_RETCODE_ERROR,
DDS_RETCODE_ILLEGAL_OPERATION, DDS_RETCODE_UNSUPPORTED,
DDS_RETCODE_ALREADY_DELETED, DDS_RETCODE_OUT_OF_RESOURCES, or
DDS_RETCODE_NOT_ENABLED.
```

# Detailed Description

This operation retrieves information on a DomainParticipant that has been discovered on the network. The participant must be in the same domain as the participant on which this operation is invoked and must not have been “ignored” by means of the DomainParticipant ignore\_participant operation.

The partition\_handle must correspond to a partition currently associated with the DDS\_DomainParticipant, otherwise the operation will fail and return DDS\_RETCODE\_ERROR. T h e o p e r a t i o n DDS\_DomainParticipant\_get\_discovered\_participant\_data can be used to find more detailed information about a particular participant than is found with the DDS\_DomainParticipant\_get\_discovered\_participants operation.

# Return Code

When the operation returns:

• DDS\_RETCODE\_OK - the information on the specified partition has been successfully retrieved.
• DDS\_RETCODE\_ERROR - an internal error has occurred.
• DDS\_RETCODE\_ILLEGAL\_OPERATION - the operation is invoked on an inappropriate object.
• DDS\_RETCODE\_UNSUPPORTED - OpenSplice is configured not to maintain the information about “associated” partition.
• DDS\_RETCODE\_ALREADY\_DELETED - the DDS\_DomainParticipant has already been deleted.
• DDS\_RETCODE\_OUT\_OF\_RESOURCES - the Data Distribution Service ran out of resources to complete this operation.
• DDS\_RETCODE\_NOT\_ENABLED - the DDS\_DomainParticipant is not enabled.

# 3.2.1.23 DDS\_DomainParticipant\_get\_discovered\_topics

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
DDS_ReturnCode_t
DDS_DomainParticipant_get_discovered_topics
(DDS_DomainParticipant_this,
DDS_InstanceHandleSeq *topic_handles);
```

# Description

This operation retrieves the list of Topics that have been discovered in the domain.

# Parameters

in DDS\_DomainParticipant \_this - the DDS\_DomainParticipant object on which the operation is operated.

inout InstanceHandleSeq \*participant\_handles - a sequence which is used to pass the list of all associated topics.

# Return Value

```txt
DDS_ReturnCode_t - Possible return codes of the operation are:
DDS_RETCODE_OK, DDS_RETCODE_ERROR,
DDS_RETCODE_ILLEGAL_OPERATION, DDS_RETCODE_UNSUPPORTED,
DDS_RETCODE_ALREADY_DELETED, DDS_RETCODE_OUT_OF_RESOURCES, or
DDS_RETCODE_NOT_ENABLED.
```

# Detailed Description

This operation retrieves the list of Topics that have been discovered in the domain and that the application has not indicated should be “ignored” by means of the DomainParticipant ignore\_topic operation.

The topic\_handles sequence and its buffer may be pre-allocated by the application and therefore must either be re-used in a subsequent invocation of the DDS\_DomainParticipant\_get\_discovered\_topics operation or be released by calling DDS\_free on the returned topic\_handles. If the pre-allocated sequence is not big enough to hold the number of associated topics, the sequence will automatically be (re-)allocated to fit the required size.

The handles returned in the topic\_handles sequence are the ones that are used by the DDS implementation to locally identify the corresponding matched Topic entities. You can access more detailed information about a particular topic by p a s s i n g i t s topic\_handle t o e i t h e r t h e DDS\_DomainParticipant\_get\_discovered\_topic\_data operation or to the DDS\_TopicBuiltinTopicDataDataReader\_read\_instance operation on the built-in reader for the “DCPSTopic” topic.

Be aware that since DDS\_InstanceHandle\_t is an opaque datatype, it does not n e c e s s a r i l y m e a n t h a t t h e h a n d l e s o b t a i n e d f r o m t h e DDS\_DomainParticipant\_get\_discovered\_topics operation have the same value as the ones that appear in the instance\_handle field of the DDS\_SampleInfo when retrieving the participant info through corresponding “DCPSTopic” built-in reader. You can’t just compare two handles to determine whether they represent the same topic. If you want to know whether two handles actually do represent the same topic, use both handles to retrieve their corresponding DDS\_TopicBuiltinTopicData samples and then compare the key field of both samples.

# Return Code

When the operation returns:

• DDS\_RETCODE\_OK - the list of associated topics has been successfully obtained.
• DDS\_RETCODE\_ERROR - an internal error has occurred.
• DDS\_RETCODE\_ILLEGAL\_OPERATION - the operation is invoked on an inappropriate object.
• DDS\_RETCODE\_UNSUPPORTED - OpenSplice is configured not to maintain the information about “associated” topics.
• DDS\_RETCODE\_ALREADY\_DELETED - the DDS\_DomainParticipant has already been deleted.
• DDS\_RETCODE\_OUT\_OF\_RESOURCES - the Data Distribution Service ran out of resources to complete this operation.
• DDS\_RETCODE\_NOT\_ENABLED - the DDS\_DomainParticipant is not enabled.

# 3.2.1.24 DDS\_DomainParticipant\_get\_discovered\_topic\_data

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
DDS_ReturnCode_t
DDS_DomainParticipant_get_discovered_topic_data
(DDS_DomainParticipant_this,
DDS_TopicBuiltinTopicData *topic_data,
DDS_InstanceHandle_t handle);
```

# Description

This operation retrieves information on a Topic that has been discovered on the network. The topic have been created by a participant in the same domain as the participant on which this operation is invoked and must not have been “ignored” by means of the DomainParticipant ignore\_topic operation.

# Parameters

in DDS\_DomainParticipant \_this - the DDS\_DomainParticipant object on which the operation is operated.

inout DDS\_ParticipantBuiltinTopicData \*topic\_data - a pointer to the sample in which the information about the specified topic is to be stored.

in const DDS\_InstanceHandle\_t topic\_handle - a handle to the topic whose information needs to be retrieved.

# Return Value

```txt
DDS_ReturnCode_t - Possible return codes of the operation are:
DDS_RETCODE_OK, DDS_RETCODE_ERROR,
DDS_RETCODE_ILLEGAL_OPERATION, DDS_RETCODE_UNSUPPORTED,
DDS_RETCODE_ALREADY_DELETED, DDS_RETCODE_OUT_OF_RESOURCES, or
DDS_RETCODE_NOT_ENABLED.
```

# Detailed Description

This operation retrieves information on a Topic that has been discovered on the network. The topic must have been created by a participant in the same domain as the participant on which this operation is invoked and must not have been “ignored” by means of the DomainParticipant ignore\_topic operation.

The topic\_handle must correspond to a topic currently associated with the DDS\_DomainParticipant, otherwise the operation will fail and return DDS\_RETCODE\_ERROR. T h e o p e r a t i o n DDS\_DomainParticipant\_get\_discovered\_topic\_data can be used to find more detailed information about a particular topic than is found with the DDS\_DomainParticipant\_get\_discovered\_topics operation.

# Return Code

When the operation returns:

• DDS\_RETCODE\_OK - the information on the specified topic has been successfully retrieved.
• DDS\_RETCODE\_ERROR - an internal error has occurred.
• DDS\_RETCODE\_ILLEGAL\_OPERATION - the operation is invoked on an inappropriate object.
• DDS\_RETCODE\_UNSUPPORTED - OpenSplice is configured not to maintain the information about “associated” topic.
• DDS\_RETCODE\_ALREADY\_DELETED - the DDS\_DomainParticipant has already been deleted.
• DDS\_RETCODE\_OUT\_OF\_RESOURCES - the Data Distribution Service ran out of resources to complete this operation.
• DDS\_RETCODE\_NOT\_ENABLED - the DDS\_DomainParticipant is not enabled.

# 3.2.1.25 DDS\_DomainParticipant\_get\_domain\_id

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
DomainId_t
DDS_DomainParticipant_get_domain_id
```

(DDS\_DomainParticipant \_this);

# Description

T h i s o p e r a t i o n r e t u r n s t h e D o m a i n I d o f t h e D o m a i n to wh i ch t h is DDS\_DomainParticipant is attached.

# Parameters

in DDS\_DomainParticipant \_this - the DDS\_DomainParticipant object on which the operation is operated.

# Return Value

DomainId\_t - result is the DomainId.

# Detailed Description

Th i s o p e ra t io n re t u rn s t h e D o m a i n I d o f t h e D o m a i n t o w h i c h t h i s D D S\_ D o m a i n Pa r t i c i pa n t i s a t t a c h e d. S e e a ls o t h e o p e r a t i o n DDS\_DomainParticipantFactory\_create\_participant (section 3.2.2.1 on page 221).

# 3.2.1.26 DDS\_DomainParticipant\_get\_listener

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
struct DDS_DomainParticipantListener
DDS_DomainParticipant_get_listener
(DDS_DomainParticipant _this);
```

# Description

This operation allows access to a DDS\_DomainParticipantListener.

# Parameters

in DDS\_DomainParticipant \_this - the DDS\_DomainParticipant object on which the operation is operated.

# Return Value

struct DDS\_DomainParticipantListener - a pointer to the DDS\_DomainParticipantListener a t t a c h e d t o t h e DDS\_DomainParticipant.

# Detailed Description

This operation allows access to a DDS\_DomainParticipantListener attached t o t h e DDS\_DomainParticipant. Wh en n o DDS\_DomainParticipantListener was attached to the DDS\_DomainParticipant, the DDS\_OBJECT\_NIL pointer is returned.

# 3.2.1.27 DDS\_DomainParticipant\_get\_qos

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
DDS_ReturnCode_t
DDS_DomainParticipant_get_qos
(DDS_DomainParticipant_this,
DDS_DomainParticipantQos *qos);
```

# Description

This operation allows access to the existing set of QoS policies for a DDS\_DomainParticipant.

# Parameters

in DDS\_DomainParticipant \_this - the DDS\_DomainParticipant object on which the operation is operated.

inout DDS\_DomainParticipantQos \*qos - a pointer to the destination DDS\_DomainParticipantQos struct in which the QosPolicy settings will be copied.

# Return Value

```txt
DDS_ReturnCode_t - Possible return codes of the operation are: DDS_RETCODE_OK, DDS_RETCODE_ERROR, DDS_RETCODE_ILLEGAL_OPERATION, DDS_RETCODE_ALREADY_DELETED or DDS_RETCODE_OUT_OF_RESOURCES.
```

# Detailed Description

This operation allows access to the existing set of QoS policies of a DDS\_DomainP articipant on which this oper ation is used. This DDS\_DomainparticipantQos is stored at the location pointed to by the qos parameter.

# Return Code

When the operation returns:

• DDS\_RETCODE\_OK - the existing set of QoS policy values applied to this DDS\_DomainParticipant has successfully been copied into the specified DDS\_DomainParticipantQos parameter.
• DDS\_RETCODE\_ERROR - an internal error has occurred.
• DDS\_RETCODE\_ILLEGAL\_OPERATION - the operation is invoked on an inappropriate object.
• DDS\_RETCODE\_ALREADY\_DELETED - the DDS\_DomainParticipant has already been deleted.
• DDS\_RETCODE\_OUT\_OF\_RESOURCES - the Data Distribution Service ran out of resources to complete this operation.

# 3.2.1.28 DDS\_DomainParticipant\_get\_status\_changes (inherited)

This operation is inherited and therefore not described here. See the class DDS\_Entity for further explanation.

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
DDS_StatusMask
DDS_DomainParticipant_get_status_changes
(DDS_DomainParticipant_this);
```

# 3.2.1.29 DDS\_DomainParticipant\_get\_statuscondition (inherited)

This operation is inherited and therefore not described here. See the class DDS\_Entity for further explanation.

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
DDS_StatusCondition
DDS_DomainParticipant_get_statuscondition
(DDS_DomainParticipant_this);
```

# 3.2.1.30 DDS\_DomainParticipant\_ignore\_participant

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
DDS_ReturnCode_t
DDS_DomainParticipant_ignore_participant
(DDS_DomainParticipant _this,
const DDS_InstanceHandle_t handle);
```

NOTE: This operation is not yet implemented. It is scheduled for a future release.

# 3.2.1.31 DDS\_DomainParticipant\_ignore\_publication

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
DDS_ReturnCode_t
DDS_DomainParticipant_ignore_publication
(DDS_DomainParticipant _this,
const DDS_InstanceHandle_t handle);
```

NOTE: This operation is not yet implemented. It is scheduled for a future release.

# 3.2.1.32 DDS\_DomainParticipant\_ignore\_subscription

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
DDS_ReturnCode_t
DDS_DomainParticipant_ignore Subscription
(DDS_DomainParticipant _this,
const DDS_InstanceHandle_t handle);
```

NOTE: This operation is not yet implemented. It is scheduled for a future release.

# 3.2.1.33 DDS\_DomainParticipant\_ignore\_topic

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
DDS_ReturnCode_t
DDS_DomainParticipant_ignore_topic
(DDS_DomainParticipant _this,
const DDS_InstanceHandle_t handle);
```

NOTE: This operation is not yet implemented. It is scheduled for a future release.

# 3.2.1.34 DDS\_DomainParticipant\_lookup\_topicdescription

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
DDS_TopicDescription
DDS_DomainParticipant_lookup_topicdescription
(DDS_DomainParticipant _this,
const DDS_char *name);
```

# Description

This operation gives access to a locally-created DDS\_TopicDescription, with a matching name.

# Parameters

in DDS\_DomainParticipant \_this - the DDS\_DomainParticipant object on which the operation is operated.

in const DDS\_char \*name - the name of the DDS\_TopicDescription to look for.

# Return Value

D D S\_ T o p i c D es c r i p t io n - R e t u r n v a l u e is a p o i n t e r to t h e DDS\_TopicDescription found. When no such DDS\_TopicDescription is found, the DDS\_OBJECT\_NIL pointer is returned.

# Detailed Description

The operation DDS\_DomainParticipant\_lookup\_topicdescription gives access to a locally-created DDS\_TopicDescription, based on its name. The operation takes as argument the name of the DDS\_TopicDescription.

If one or more local DDS\_TopicDescription proxies (also see Section 3.2.1.15, DDS\_DomainParticipant\_find\_topic, on page 188) of the same name already exist, a p o i n t e r t o o n e o f t h e a l r e a d y e x i s t i n g l o c a l p r o x i e s i s r e t u r n e d : DDS\_DomainParticipant\_lookup\_topicdescription will never create a new local proxy. That means that the proxy that is returned does not need to be deleted separately from its original. When no local proxy exists, it returns the DDS\_OBJECT\_NIL pointer. The operation never blocks.

The operation DDS\_DomainParticipant\_lookup\_topicdescription may be used to locate any locally-created DDS\_Topic, DDS\_ContentFilteredTopic and DDS\_MultiTopic object.

# 3.2.1.35 DDS\_DomainParticipant\_set\_default\_publisher\_qos

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
DDS_ReturnCode_t
DDS_DomainParticipant_set_default_publisher_qos
(DDS_DomainParticipant_this,
const DDS_PublisherQos *qos);
```

# Description

T h i s o p e r a t i o n s e t s t h e d e f a u l t D D S \_ P u b l i s h e r Q o s o f t h e DDS\_DomainParticipant.

# Parameters

in DDS\_DomainParticipant \_this - the DDS\_DomainParticipant object on which the operation is operated.

in const DDS\_PublisherQos \*qos - a collection of QosPolicy settings, which contains the new default QosPolicy settings for the newly-created DDS\_Publishers.

# Return Value

D D S \_ R e t u r n C o d e \_ t - P o s s i b l e r e t u r n c o d e s o f t h e o p e r a t i o n a r e : DDS\_RETCODE\_OK, DDS\_RETCODE\_ERROR, DDS\_RETCODE\_ILLEGAL OPERATION, DDS\_RETCODE\_BAD\_PARAMETER, DDS\_RETCODE UNSUPPORTED, DDS\_RETCODE\_ALREADY\_DELETED or DDS\_RETCODE\_ OUT\_OF\_RESOURCES.

# Detailed Description

T h i s o p e r a t i o n s e t s t h e d e f a u l t D D S \_ P u b l i s h e r Q o s o f t h e DDS\_DomainParticipant (that is the struct with the QosPolicy settings) which is used for newly-created DDS\_Publisher objects, in case the constant DDS\_PUBLISHER\_QOS\_DEFAULT is used. The default DDS\_PublisherQos is only used when the constant is supplied as parameter qos to specify the DDS\_PublisherQos in the DDS\_DomainParticipant\_create\_publisher operation. The DDS\_PublisherQos is always self consistent, because its policies do not depend on each other. This means this operation never returns the DDS\_RETCODE\_INCONSISTENT\_POLICY. The values set by this operation are returned by DDS\_DomainParticipant\_get\_default\_publisher\_qos.

# Return Code

When the operation returns:

• DDS\_RETCODE\_OK - the new default DDS\_PublisherQos is set.
• DDS\_RETCODE\_ERROR - an internal error has occurred.
• DDS\_RETCODE\_ILLEGAL\_OPERATION - the operation is invoked on an inappropriate object.
• DDS\_RETCODE\_BAD\_PARAMETER - the parameter qos is not a valid DDS\_PublisherQos. It contains a QosPolicy setting with an enum value that is outside its legal boundaries, or a sequence that has inconsistent memory settings.
• DDS\_RETCODE\_UNSUPPORTED - one or more of the selected QosPolicy values are currently not supported by OpenSplice.
• DDS\_RETCODE\_ALREADY\_DELETED - the DDS\_DomainParticipant has already been deleted.

• DDS\_RETCODE\_OUT\_OF\_RESOURCES - the Data Distribution Service ran out of resources to complete this operation.

# 3.2.1.36 DDS\_DomainParticipant\_set\_default\_subscriber\_qos

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
DDS_ReturnCode_t
DDS_DomainParticipant_set_default_subscriber_qos
(DDS_DomainParticipant_this,
const DDS_SubscriberQos *qos);
```

# Description

T h i s o p e r a t i o n s e t s t h e d e f a u l t D D S \_ S u b s c r i b e r Q o s o f t h e DDS\_DomainParticipant.

# Parameters

in DDS\_DomainParticipant \_this - the DDS\_DomainParticipant object on which the operation is operated.

in const DDS\_SubscriberQos \*qos - a collection of QosPolicy settings, which contains the new default QosPolicy settings for the newly-created DDS\_Subscribers.

# Return Value

D D S \_ R e t u r n C o d e \_ t - P o s s i b l e r e t u r n c o d e s o f t h e o p e r a t i o n a r e : DDS\_RETCODE\_OK, DDS\_RETCODE\_ERROR, DDS\_RETCODE\_ILLEGAL OPERATION, DDS\_RETCODE\_BAD\_PARAMETER, DDS\_RETCODE UNSUPPORTED, DDS\_RETCODE\_ALREADY\_DELETED or DDS\_RETCODE\_ OUT\_OF\_RESOURCES.

# Detailed Description

T h i s o p e r a t i o n s e t s t h e d e f a u l t D D S \_ S u b s c r i b e r Q o s o f t h e DDS\_DomainParticipant (that is the struct with the QosPolicy settings) which is used for newly-created DDS\_Subscriber objects, in case the constant DDS\_SUBSCRIBER\_QOS\_DEFAULT is used. The default DDS\_SubscriberQos is only used when the constant is supplied as parameter qos to specify the DDS\_SubscriberQos in the DDS\_DomainParticipant\_create\_subscriber operation. The DDS\_SubscriberQos is always self consistent, because its policies do not depend on each other. This means this operation never returns the DDS\_RETCODE\_INCONSISTENT\_POLICY. The values set by this operation are returned by DDS\_DomainParticipant\_get\_default\_subscriber\_qos.

# Return Code

When the operation returns:

• DDS\_RETCODE\_OK - the new default DDS\_SubscriberQos is set.
• DDS\_RETCODE\_ERROR - an internal error has occurred.
• DDS\_RETCODE\_ILLEGAL\_OPERATION - the operation is invoked on an inappropriate object.
• DDS\_RETCODE\_BAD\_PARAMETER - the parameter qos is not a valid DDS\_PublisherQos. It contains a QosPolicy setting with an enum value that is outside its legal boundaries, or a sequence that has inconsistent memory settings.
• DDS\_RETCODE\_UNSUPPORTED - one or more of the selected QosPolicy values are currently not supported by OpenSplice.
• DDS\_RETCODE\_ALREADY\_DELETED - the DDS\_DomainParticipant has already been deleted.
• DDS\_RETCODE\_OUT\_OF\_RESOURCES - the Data Distribution Service ran out of resources to complete this operation.

# 3.2.1.37 DDS\_DomainParticipant\_set\_default\_topic\_qos

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
DDS_ReturnCode_t
DDS_DomainParticipant_set_default_topic_qos
(DDS_DomainParticipant_this,
const DDS_TopicQos *qos);
```

# Description

This operation sets the default DDS\_TopicQos of the DDS\_DomainParticipant.

# Parameters

in DDS\_DomainParticipant \_this - the DDS\_DomainParticipant object on which the operation is operated.

in const DDS\_TopicQos \*qos - a collection of QosPolicy settings, which contains the new default QosPolicy settings for the newly-created DDS\_Topics.

# Return Value

D D S \_ R e t u r n C o d e \_ t - P o s s i b l e r e t u r n c o d e s o f t h e o p e r a t i o n a r e : DDS\_RETCODE\_OK, DDS\_RETCODE\_ERROR, DDS\_RETCODE\_ILLEGAL\_ OPERATION, DDS\_RETCODE\_BAD\_PARAMETER, DDS\_RETCODE UNSUPPORTED, DDS\_RETCODE\_ALREADY\_DELETED, DDS\_RETCODE\_ OUT\_OF\_RESOURCES or DDS\_RETCODE\_ INCONSISTENT\_POLICY.

# Detailed Description

This operation sets the default DDS\_TopicQos of the DDS\_DomainParticipant (that is the struct with the QosPolicy settings) which is used for newly-created DDS\_Topic objects, in case the constant DDS\_TOPIC\_QOS\_DEFAULT is used. The default DDS\_TopicQos is only used when the constant is supplied as parameter qos to specify the DDS\_TopicQos in the DDS\_DomainParticipant\_create\_topic operation. This operation checks if the DDS\_TopicQos is self consistent. If it is not, the operation has no effect and returns DDS\_RETCODE\_INCONSISTENT\_POLICY. T h e v a l u e s s e t b y t h i s o p e r a t i o n a r e r e t u r n e d b y DDS\_DomainParticipant\_get\_default\_topic\_qos.

# Return Code

When the operation returns:

• DDS\_RETCODE\_OK - the new default DDS\_TopicQos is set.
• DDS\_RETCODE\_ERROR - an internal error has occurred.
• DDS\_RETCODE\_ILLEGAL\_OPERATION - the operation is invoked on an inappropriate object.
• DDS\_RETCODE\_BAD\_PARAMETER - the parameter qos is not a valid DDS\_TopicQos. It contains a QosPolicy setting with an invalid DDS\_Duration\_t value, an enum value that is outside its legal boundaries or a sequence that has inconsistent memory settings.
• DDS\_RETCODE\_UNSUPPORTED - one or more of the selected QosPolicy values are currently not supported by OpenSplice.
• DDS\_RETCODE\_ALREADY\_DELETED - the DDS\_DomainParticipant has already been deleted.
• DDS\_RETCODE\_OUT\_OF\_RESOURCES - the Data Distribution Service ran out of resources to complete this operation.
• DDS\_RETCODE\_INCONSISTENT\_POLICY - the parameter qos contains conflicting QosPolicy settings, e.g. a history depth that is higher than the specified resource limits.

# 3.2.1.38 DDS\_DomainParticipant\_set\_listener

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
DDS_ReturnCode_t
DDS_DomainParticipant_set_listener
(DDS_DomainParticipant_this,
const struct DDS_DomainParticipantListener
*a_listener,
const DDS_StatusMask mask);
```

# Description

This operation attaches a DDS\_DomainParticipantListener to the DDS\_DomainParticipant.

# Parameters

in DDS\_DomainParticipant \_this - the DDS\_DomainParticipant object on which the operation is operated.
in const struct DDS\_DomainParticipantListener \*a\_listener - a pointer to the DDS\_DomainParticipantListener instance, which will be attached to the DDS\_DomainParticipant.
in const DDS\_StatusMask mask - a bit-mask in which each bit enables the invocation of the DDS\_DomainParticipantListener for a certain status.

# Return Value

```txt
DDS_ReturnCode_t - Possible return codes of the operation are: DDS_RETCODE_OK, DDS_RETCODE_ERROR, DDS_RETCODE_ILLEGAL_OPERATION, DDS_RETCODE_UNSUPPORTED, DDS_RETCODE_ALREADY_DELETED or DDS_RETCODE_OUT_OF_RESOURCES.
```

# Detailed Description

This operation attaches a DDS\_DomainParticipantListener to the DDS\_DomainParticipant. Only one DDS\_DomainParticipantListener can b e a tt a c he d t o e a c h DD S \_ D o m ai n P a r t i ci p a n t . If a DDS\_DomainParticipantListener was already attached, the operation will replace it with the new one. When a\_listener is the DDS\_OBJECT\_NIL pointer, it represents a listener that is treated as a NOOP1 for all statuses activated in the bitmask.

# Communication Status

For each communication status, the StatusChangedFlag flag is initially set to FALSE. It becomes TRUE whenever that communication status changes. For each c o m m u n i c a t i o n s t a t u s a c t i v a t e d i n t h e m a s k , t h e a s s o c i a t e d DDS\_DomainParticipantListener operation is invoked and the communication status is reset to FALSE, as the listener implicitly accesses the status which is passed as a parameter to that operation. The status is reset prior to calling the listener, so if the application calls the get\_&lt;status\_name&gt;\_status from inside the listener it will see the status already reset. An exception to this rule is the DDS\_OBJECT\_NIL listener, which does not reset the communication statuses for which it is invoked.

The following statuses are applicable to the DDS\_DomainParticipantListener:

<table><tr><td>DDS_INCONSISTENT_TOPIC_STATUS</td><td>(propagated)</td></tr><tr><td>DDS_OFFERED_DEADLINE_MISSED_STATUS</td><td>(propagated)</td></tr><tr><td>DDS_REQUESTED_DEADLINE_MISSED_STATUS</td><td>(propagated)</td></tr><tr><td>DDS_OFFERED_INCOMPATIBLE_QOS_STATUS</td><td>(propagated)</td></tr><tr><td>DDS_REQUESTED_INCOMPATIBLE_QOS_STATUS</td><td>(propagated)</td></tr><tr><td>DDS_SAMPLE_LOST_STATUS</td><td>(propagated)</td></tr><tr><td>DDS_SAMPLE_REJECTED_STATUS</td><td>(propagated)</td></tr><tr><td>DDS_DATA_ON_READERS_STATUS</td><td>(propagated)</td></tr><tr><td>DDS_DATA_AVAILABLE_STATUS</td><td>(propagated)</td></tr><tr><td>DDS_LIVELINESS_LOST_STATUS</td><td>(propagated)</td></tr><tr><td>DDS_LIVELINESS_CHANGED_STATUS</td><td>(propagated)</td></tr><tr><td>DDS_PUBLICATION_MATCHED_STATUS</td><td>(propagated)</td></tr><tr><td>DDS_SUBSCRIPTION_MATCHED_STATUS</td><td>(propagated).</td></tr></table>

![The image displays a triangular warning sign with a thick red border and a white interior. Centered within the triangle is a black exclamation point positioned directly above a black diamond shape.](.vortex-opensplice-c-reference-guide/af30df185385e76582d1ecbc3101e9ac8757bd7854a56c6d5700a93082fd0e24.jpg)

Be aware that the DDS\_PUBLICATION\_MATCHED\_STATUS and DDS\_SUBSCRIPTION\_MATCHED\_STATUS are not applicable when the infrastructure does not have the information available to determine connectivity. This is the case when OpenSplice is configured not to maintain discovery information in the Networking Service. (See also the description of the NetworkService/Discovery[@enabled] attribute in section 4.4.1.6.1 on page 244 of the Deployment Guide.) In this case the operation will return DDS\_RETCODE\_UNSUPPORTED.

Status bits are declared as a constant and can be used by the application in an OR operation to create a tailored mask. The special constant DDS\_STATUS\_MASK\_NONE can be used to indicate that the created entity should not respond to any of its available statuses. The DDS will therefore attempt to propagate these statuses to its factory. The special constant STATUS\_MASK\_ANY\_V1\_2 can be used to select all applicable statuses specified in the “Data Distribution Service for Real-time Systems Version 1.2” specification.

# Status Propagation

The Data Distribution Service will trigger the most specific and relevant Listener. In other words, in case a communication status is also activated on the Listener of a contained entity, the Listener on that contained entity is invoked instead of the DDS\_DomainParticipantListener. This means that a status change on a contained entity only invokes the DDS\_DomainParticipantListener if the contained entity itself does not handle the trigger event generated by the status change.

The statuses DDS\_DATA\_ON\_READERS\_STATUS and DDS\_DATA AVAILABLE\_STATUS are “Read Communication Statuses” and are an exception to all other plain communication statuses: they have no corresponding status structure that can be obtained with a get\_&lt;status\_name&gt;\_status operation and they are mutually exclusive. When new information becomes available to a DataReader, the Data Distribution Service will first look in an attached and activated DDS\_SubscriberListener or DDS\_DomainParticipantListener (in that o r d e r ) f o r t h e D DS \_ D A T A \_ ON \_ R E A D ER S \_ S T A T US . I n c a s e t h e DDS\_DATA\_ON\_READERS\_STATUS can not be handled, the Data Distribution Service will look in an attached and activated DDS\_DataReaderListener, DDS\_SubscriberListener or DDS\_DomainParticipantListener for the DDS\_DATA\_AVAILABLE\_STATUS (in that order).

# Return Code

When the operation returns:

• DDS\_RETCODE\_OK - the DDS\_DomainParticipantListener is attached.
• DDS\_RETCODE\_ERROR - an internal error has occurred.
• DDS\_RETCODE\_ILLEGAL\_OPERATION - the operation is invoked on an inappropriate object.
• DDS\_RETCODE\_UNSUPPORTED - a status was selected that cannot be supported because the infrastructure does not maintain the required connectivity information.
• DDS\_RETCODE\_ALREADY\_DELETED - the DDS\_DomainParticipant has already been deleted.
• DDS\_RETCODE\_OUT\_OF\_RESOURCES - the Data Distribution Service ran out of resources to complete this operation.

# 3.2.1.39 DDS\_DomainParticipant\_set\_qos

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
DDS_ReturnCode_t
DDS_DomainParticipant_set_qos
(DDS_DomainParticipant_this,
const DDS_DomainParticipantQos *qos);
```

# Description

This operation replaces the existing set of QosPolicy settings for a DDS\_DomainParticipant.

# Parameters

in DDS\_DomainParticipant \_this - is the DDS\_DomainParticipant object on which the operation is operated.

in const DDS\_DomainParticipantQos \*qos - must contain the new set of QosPolicy settings for the DDS\_DomainParticipant.

# Return Value

```txt
DDS_ReturnCode_t - Possible return codes of the operation are: DDS_RETCODE_OK, DDS_RETCODE_ERROR, DDS_RETCODE_ILLEGAL_OPERATION, DDS_RETCODE_BAD_PARAMETER, DDS_RETCODE_ALREADY_DELETED or DDS_RETCODE_OUT_OF_RESOURCES.
```

# Detailed Description

This operation replaces the existing set of QosPolicy settings for a DDS\_DomainParticipant. The parameter qos must contain the struct with the QosPolicy settings which is checked for self-consistency.

The set of QosPolicy settings specified by the qos parameter are applied on top of the existing QoS, replacing the values of any policies previously set (provided, the operation returned DDS\_RETCODE\_OK).

# Return Code

When the operation returns:

• DDS\_RETCODE\_OK - the new DDS\_DomainParticipantQos is set.
• DDS\_RETCODE\_ERROR - an internal error has occurred.
• DDS\_RETCODE\_ILLEGAL\_OPERATION - the operation is invoked on an inappropriate object.

• DDS\_RETCODE\_BAD\_PARAMETER - the parameter qos is not a valid DDS\_DomainParticipantQos. It contains a QosPolicy setting with a sequence that has inconsistent memory settings.
• DDS\_RETCODE\_ALREADY\_DELETED - the DDS\_DomainParticipant has already been deleted.
• DDS\_RETCODE\_OUT\_OF\_RESOURCES - the Data Distribution Service ran out of resources to complete this operation.

# 3.2.1.40 DDS\_DomainParticipant\_delete\_historical\_data

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
DDS_ReturnCode_t
DDS_DomainParticipant_delete_historical_data
(DDS_DomainParticipant _this,
const DDS_string partition_expression,
const DDS_string topic_expression);
```

# Description

This operation deletes all historical TRANSIENT and PERSISTENT data that is stored by the durability service that is configured to support this DomainParticipant.

# Parameters

in DDS\_DomainParticipant \_this - is the DDS\_DomainParticipant object on which the operation is operated.
in const DDS\_string partition\_expression - An expression to define a filter on partitions.
in const DDS\_string topic\_expression - An expression to define a filter on topic names.

# Return Value

D D S \_ R e t ur n C o d e \_ t - Possible re turn codes of the operation are: DDS\_RETCODE\_OK, DDS\_RETCODE\_ERROR.

# Detailed Description

This operation deletes all historical TRANSIENT and PERSISTENT data that is stored by the durability service that is configured to support this DomainParticipant. It only deletes the samples stored in the transient and persistent store, samples stored in individual application DataReaders is spared and remains available to these readers. However, late-joiners will no longer be able to obtain the deleted samples.

The partition\_expression and topic\_expression strings can be used to specify selection criteria for the topic and/or partition in which the data will be deleted. Wildcards are supported. Note that these parameters are mandatory and cannot be empty. The "\*" expression can be used to match all partitions and/or topics.

Only data that exists prior to this method invocationis deleted. Data that is still being inserted during this method invocationwill not be removed.

# Return Code

When the operation returns:

• DDS\_RETCODE\_OK - all data matching the topic and partition expressions has been deleted.
• DDS\_RETCODE\_ERROR - an internal error has occurred.

# 3.2.1.41 DDS\_DomainParticipant\_get\_property

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
DDS_ReturnCode_t
DDS_DomainParticipant_get_property
(DDS_DomainParticipant this,
DDS_DomainParticipantProperty *a_property);
```

# Description

This function queries the value of a property set on a DDS\_DomainParticipant.

# Parameters

in DDS\_DomainParticipant \_this - the DDS\_DomainParticipant object on which the operation is operated.

in DDS\_DomainParticipantProperty \*a\_property - on entry, a\_property.name determines which property to query the value of; on successful return, a\_property.value is set to the current value of that property in the DDS\_DomainParticipant.

# Return Value

DDS\_ReturnCode\_t - Possible return codes of the operation are: DDS\_RETCODE\_OK, DDS\_RETCODE\_BAD\_PARAMETER, DDS\_RETCODE\_ERROR, DDS\_RETCODE\_ALREADY\_DELETED, DDS\_RETCODE\_OUT\_OF\_RESOURCES or DDS\_RETCODE\_UNSUPPORTED.

# Detailed Description

This operation looks up the property specified by a\_property.name in the DDS\_DomainParticipant, setting a\_property.value to the current value of the property. If the property has not been set using set\_property, the default value is returned.

![The image displays a red triangular warning sign with a black exclamation mark inside.](.vortex-opensplice-c-reference-guide/957b7548228dc75f87cd7836bc7410ea037b2aa671267ad31a0ebb61c8597bbc.jpg)

NOTE: The user application is responsible for freeing the memory that is allocated by the middleware for a\_property.value.

# Return Code

When the operation returns:

• DDS\_RETCODE\_OK - a\_property.value has been set to the current value of the property.
• DDS\_RETCODE\_BAD\_PARAMETER - an invalid value has been specified.
• DDS\_RETCODE\_ERROR - an internal error has occurred.
• DDS\_RETCODE\_ALREADY\_DELETED - the DDS\_DomainParticipant has already been deleted.
• DDS\_RETCODE\_OUT\_OF\_RESOURCES - the Data Distribution Service ran out of resources to complete this operation.
• DDS\_RETCODE\_UNSUPPORTED - a\_property.name specifies an undefined property or the operation is not supported in this version.

# 3.2.1.42 DDS\_DomainParticipant\_set\_property

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
DDS_ReturnCode_t
DDS_DomainParticipant_set_property
(DDS_DomainParticipant this,
const DDS_DomainParticipantProperty *a_property);
```

# Description

This function sets a property on a DDS\_DomainParticipant.

# Parameters

in DDS\_DomainParticipant \_this - the DDS\_DomainParticipant object on which the operation is operated.
in DDS\_DomainParticipantProperty a\_property - on specifies the property (in a\_property.name) and its new value (in a\_property.value).

# Return Value

DDS\_ReturnCode\_t - Possible return codes of the operation are: DDS\_RETCODE\_OK, DDS\_RETCODE\_BAD\_PARAMETER, DDS\_RETCODE\_ERROR, DDS\_RETCODE\_ALREADY\_DELETED, DDS\_RETCODE\_OUT\_OF\_RESOURCES or DDS\_RETCODE\_UNSUPPORTED.

# Detailed Description

This operation sets the property specified by a\_property.name to the value given by a\_property.value.

Currently, the following properties are defined:

# isolateNode

The isolateNode property allows applications to isolate the federation from the rest of the Domain; i.e. at network level to disconnect the node from the rest of the system.

Applications also need to be able to issue a request to re-connect their federation to the domain again, after which the durability merge-policy that is configured needs to be applied.

To isolate a federation, the application needs to set the isolateNode property value to ‘true’, and to (de)isolate the federation the same property needs to be set to ‘false’. The default value of the isolateNode property is ‘false’.

All data that is published after isolateNode is set to true will not be sent to the network, and any data received from the network will be ignored.

![The image displays a triangular warning sign featuring a thick red border and a white background. Centered within the triangle is a black exclamation point.](.vortex-opensplice-c-reference-guide/2b8d5dd7c505e7724a61d535a5c0d9a7714705d1630d1522fb13e9a1a4dcf176.jpg)

Be aware that data being processed by the network service at the time of isolating a node may still be sent to the network, due to the asynchronous nature of network service internals.

The value is interpreted as a boolean (i.e., it must be either ‘true’ or ‘false’).

• false (default): The federation is connected to the domain.
• true: The federation is disconnected from the domain meaning that data is not published on the network and data from the network is ignored.

# Return Code

When the operation returns:

• DDS\_RETCODE\_OK - the property has been set.
• DDS\_RETCODE\_BAD\_PARAMETER - an invalid value has been specified.
• DDS\_RETCODE\_ERROR - an internal error has occurred.
• DDS\_RETCODE\_ALREADY\_DELETED - the DDS\_DomainParticipant has already been deleted.

• DDS\_RETCODE\_OUT\_OF\_RESOURCES - the Data Distribution Service ran out of resources to complete this operation.
• DDS\_RETCODE\_UNSUPPORTED - a\_property.name specifies an undefined property or the operation is not supported in this version.

# 3.2.2 Class DDS\_DomainParticipantFactory

The purpose of this cl ass is to allow the creation and destruction of DDS\_DomainParticipant objects. DDS\_DomainParticipantFactory itself has no factory. It is a pre-existing singleton object that can be accessed by means of the DDS\_DomainParticipantFactory\_get\_instance operation on the DDS\_DomainParticipantFactory class.

The pre-defined value DDS\_TheParticipantFactory can also be used as an a l i a s f o r t h e s i n g l e t o n f a c t o r y r e t u r n e d b y t h e o p e r a t i o n DDS\_DomainParticipantFactory\_get\_instance.

The interface description of this class is as follows:

```c
/*
 * interface DDS_DomainParticipantFactory
 */
/*
 * implemented API operations
 */
DDS_DomainParticipantFactory
    DDS_DomainParticipantFactory_get_instance
    (void);
DDS_DomainParticipant
    DDS_DomainParticipantFactory_create_participant
    (DDS_DomainParticipantFactory _this,
    const DomainId_t domainId,
    const DDS_DomainParticipantQos *qos,
    const struct DDS_DomainParticipantListener *a_listener,
    const DDS_StatusMask mask);
DDS_ReturnCode_t
    DDS_DomainParticipantFactory_delete_participant
    (DDS_DomainParticipantFactory _this,
    const DDS_DomainParticipant a_participant);
DDS_DomainParticipant
    DDS_DomainParticipantFactory_lookup_participant
    (DDS_DomainParticipantFactory _this,
    const DomainId_t domainId);
DDS_ReturnCode_t
    DDS_DomainParticipantFactory_set_default_participant_qos
    (DDS_DomainParticipantFactory _this,
    const DDS_DomainParticipantQos *qos);
DDS_ReturnCode_t
    DDS_DomainParticipantFactory_get_default_participant_qos
```

```c
(DDS_DomainParticipantFactory _this,
    DDS_DomainParticipantQos *qos);
DDS_ReturnCode_t
DDS_DomainParticipantFactory_set_qos
(DDS_DomainParticipantFactory _this,
    const DDS_DomainParticipantFactoryQos *qos);
DDS_ReturnCode_t
DDS_DomainParticipantFactory_get_qos
(DDS_DomainParticipantFactory _this,
    DDS_DomainParticipantFactoryQos *qos);
DDS_ReturnCode_t
DDS_DomainParticipantFactory_delete_domain
(DDS_DomainParticipantFactory _this,
    DDS_Domain a_domain);
DDS_Domain
DDS_DomainParticipantFactory_lookup_domain
(DDS_DomainParticipantFactory _this,
    const DomainId_t domainId);
DDS_ReturnCode_t
DDS_DomainParticipantFactory_delete_contained_entities
(DDS_DomainParticipantFactory _this);
DDS_ReturnCode_t
DDS_DomainParticipantFactory_detach_all_domains
(DDS_DomainParticipantFactory _this,
    DDS_boolean block_operations,
    DDS_boolean delete_entities);
```

T h e f o l l o w i n g p a r a g r a p h s d e s c r i b e t h e u s a g e o f a l l DDS\_DomainParticipantFactory operations.

# 3.2.2.1 DDS\_DomainParticipantFactory\_create\_participant

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
DDS_DomainParticipant
DDS_DomainParticipantFactory_create_participant
(DDS_DomainParticipantFactory _this,
const DomainId_t domainId,
const DDS_DomainParticipantQos *qos,
const struct DDS_DomainParticipantListener *a_listener,
const DDS_StatusMask mask);
```

# Description

This operation creates a new DDS\_DomainParticipant which will join the domain identified by domainId, with the desired DDS\_DomainParticipantQos and attaches the optionally specified DDS\_DomainParticipantListener to it.

# Parameters

i n DDS\_DomainParticipantFactory this t h e DDS\_DomainParticipantFactory object on which the operation is operated.

in const DomainId\_t domainId - the ID of the Domain to which the DDS\_DomainParticipant is joined. This should be the ID as specified in the configuration file. This will also be applicable for the lookup\_participant, lookup\_domain and get\_domain\_id operations.

in const DDS\_DomainParticipantQos \*qos - a DDS\_DomainParticipantQos for the new DDS\_DomainParticipant. W h e n t h i s s e t o f Q o s P o l i c y s e t t i n g s i s i n c o n s i s t e n t , n o DDS\_DomainParticipant is created.

in const struct DDS\_DomainParticipantListener \*a\_listener - a pointer to the DDS\_DomainParticipantListener instance which will be attached to the new DDS\_DomainParticipant. It is permitted to use DDS\_OBJECT\_NIL as the value of the listener: this behaves as a DDS\_DomainParticipantListener whose operations perform no action.

in const DDS\_StatusMask mask - a bit-mask in which each bit enables the invocation of the DDS\_DomainParticipantListener for a certain status.

# Return Value

DDS\_DomainParticipant -Return value is a pointer to the newly-created DDS\_DomainParticipant. In case of an error, the DDS\_OBJECT\_NIL pointer is returned.

# Detailed Description

This operation creates a new DDS\_DomainParticipant, with the desired DDS\_DomainParticipantQos and attaches the optionally specified DDS\_DomainParticipantListener to it. The DDS\_DomainParticipant signifies that the calling application intends to join the Domain identified by the domainId argument.

If the specified QosPolicy settings are not consistent, the operation will fail; no DDS\_DomainParticipant is created and the operation returns the DDS\_OBJECT\_NIL pointer. To delete the DDS\_DomainParticipant the operation DDS\_DomainParticipantFactory\_delete\_participant must be used.

# Identifying the Domain

The DDS\_DomainParticipant will attach to the Domain that is specified by the domainId parameter. This parameter corresponds to the integer specified in the Id tag in the configuration file. Note that to make multiple connections to a Domain (create multiple Participants for the same Domain) within a single process, all of the Participants must use the same identification (i.e. all use the same domain Id).

The constant DDS\_DOMAIN\_ID\_DEFAULT can be used for this parameter. If this is done the value of Id tag from the configuration file specified by the environment variable called OSPL\_URI will be used.

It is recommended to use this domain Id in conjunction with the OSPL\_URI environment variable instead of hard-coding a domain Id into your application, since this gives you much more flexibility in the deployment phase of your product. See also Section 1.3.2.1, The OSPL\_URI environment variable, in the Deployment Guide.

# Default QoS

The constant DDS\_PARTICIPANT\_QOS\_DEFAULT can be used as parameter qos to create a DDS\_DomainParticipant w i t h t h e d e f a u l t DDS\_DomainParticipantQos a s s e t i n t h e DDS\_DomainParticipantfactory. The effect of using DDS\_PARTICIPANT\_QOS\_DEFAULT is the same as calling the operation DDS\_DomainParticipantFactory\_get\_default\_participant\_qos and u s i n g th e r e s u l t i n g D D S\_ D o m a i n Pa r t i c i pa n t Q o s t o c r e a t e t h e DDS\_DomainParticipant.

# Communication Status

For each communication status, the StatusChangedFlag flag is initially set to FALSE. It becomes TRUE whenever that communication status changes. For each c o m m u n i c a t i o n s t a t u s a c t i v a t e d i n t h e m a s k , t h e a s s o c i a t e d DDS\_DomainParticipantListener operation is invoked and the communication status is reset to FALSE, as the listener implicitly accesses the status which is passed as a parameter to that operation. The fact that the status is reset prior t o c a l l i n g t h e l i s t e n e r m e a n s t h a t i f t h e a p p l i c a t i o n c a l l s t h e get\_&lt;status\_name&gt;\_status from inside the listener it will see the status already reset.

The following statuses are applicable to the DDS\_DomainParticipantListener:

• DDS\_INCONSISTENT\_TOPIC\_STATUS
(propagated)
• DDS\_OFFERED\_DEADLINE\_MISSED\_STATUS
(propagated)
• DDS\_REQUESTED\_DEADLINE\_MISSED\_STATUS
(propagated)

```txt
- DDS_OFFERED_INCOMPATIBLE_QOS_STATUS (propagated)
- DDS_REQUESTED_INCOMPATIBLE_QOS_STATUS (propagated)
- DDS_SAMPLE_LOST_STATUS (propagated)
- DDS_SAMPLE_REJECTED_STATUS (propagated)
- DDS_DATA_ON_READERS_STATUS (propagated)
- DDS_DATA_AVAILABLE_STATUS (propagated)
- DDS_LIVELINESS_LOST_STATUS (propagated)
- DDS_LIVELINESS_CHANGED_STATUS (propagated)
- DDS_PUBLICATION_MATCHED_STATUS (propagated)
- DDS_SUBSCRIPTION_MATCHED_STATUS (propagated).
```

![The image displays a standard warning symbol consisting of a red triangle with a red border containing a black exclamation mark centered on a white background.](.vortex-opensplice-c-reference-guide/59940f65ff987c3637887e34a3dbfb67eef0a0e633fb286efc49bad295509558.jpg)

Be aware that the DDS\_PUBLICATION\_MATCHED\_STATUS and DDS\_SUBSCRIPTION\_MATCHED\_STATUS are not applicable when the infrastructure does not have the information available to determine connectivity. This is the case when OpenSplice is configured not to maintain discovery information in the Networking Service. (See also the description of the NetworkService/Discovery[@enabled] attribute in section 4.4.1.6.1 on page 244 of the Deployment Guide.) In this case the operation will return DDS\_OBJECT\_NIL.

Status bits are declared as a constant and can be used by the application in an OR operation to create a tailored mask. The special constant DDS\_STATUS\_MASK\_NONE can be used to indicate that the created entity should not respond to any of its available statuses. The DDS will therefore attempt to propagate these statuses to its factory. The special constant STATUS\_MASK\_ANY\_V1\_2 can be used to select all applicable statuses specified in the “Data Distribution Service for Real-time Systems Version 1.2” specification.

# Status Propagation

The Data Distribution Service will trigger the most specific and relevant Listener. In other words, in case a communication status is also activated on the Listener of a contained entity, the Listener on that contained entity is invoked instead of the DDS\_DomainParticipantListener. This means that a status change on a contained entity only invokes the DDS\_DomainParticipantListener if the contained entity itself does not handle the trigger event generated by the status change.

The statuses DDS\_DATA\_ON\_READERS\_STATUS and DDS\_DATA AVAILABLE\_STATUS are “Read Communication Statuses” and are an exception to all other plain communication statuses: they have no corresponding status structure that can be obtained with a get\_&lt;status\_name&gt;\_status operation and they are mutually exclusive. When new information becomes available to a DataReader, the Data Distribution Service will first look in an attached and activated DDS\_SubscriberListener or DDS\_DomainParticipantListener (in that o r d e r ) f o r t h e D D S\_ D A T A \_ ON \_ R E A D E RS \_ S T A T US . I n c a s e t h e DDS\_DATA\_ON\_READERS\_STATUS can not be handled, the Data Distribution Service will look in an attached and activated DDS\_DataReaderListener, DDS\_SubscriberListener or DDS\_DomainParticipantListener for the DDS\_DATA\_AVAILABLE\_STATUS (in that order).

# 3.2.2.2 DDS\_DomainParticipantFactory\_delete\_participant

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
DDS_ReturnCode_t
DDS_DomainParticipantFactory_delete_participant
(DDS_DomainParticipantFactory _this,
const DDS_DomainParticipant a_participant);
```

# Description

This operation deletes a DDS\_DomainParticipant.

# Parameters

in DDS\_DomainParticipantFactory this t h e DDS\_DomainParticipantFactory object on which the operation is operated.

in const DDS\_DomainParticipant a\_participant - a pointer to the DDS\_DomainParticipant, which is to be deleted.

# Return Value

D D S \_ R e t u r n C o d e \_ t - P o s s i b l e r e t u r n c o d e s o f t h e o p e r a t i o n a r e : DDS\_RETCODE\_OK, DDS\_RETCODE\_ERROR, DDS\_RETCODE\_ILLEGAL\_ OPERATION, DDS\_RETCODE\_BAD\_PARAMETER, DDS\_RETCODE\_ OUT\_OF\_RESOURCES or DDS\_RETCODE\_ PRECONDITION\_NOT\_MET.

# Detailed Description

T h i s o p e r a ti o n d e l e t e s a D D S\_ D o m a i nP a r t i c i pa n t . A DDS\_DomainParticipant cannot be deleted when it has any attached D D S \_ E n t i t y o b j e c t s . W h e n t h e o p e r a t i o n i s c a l l e d o n a DDS\_DomainParticipant with existing DDS\_Entity objects, the operation returns DDS\_RETCODE\_PRECONDITION\_NOT\_MET.

# Return Code

When the operation returns:

• DDS\_RETCODE\_OK - the DDS\_DomainParticipant is deleted.
• DDS\_RETCODE\_ERROR - an internal error has occurred.
• DDS\_RETCODE\_ILLEGAL\_OPERATION - the operation is invoked on an inappropriate object.
• DDS\_RETCODE\_BAD\_PARAMETER - the parameter a\_participant is not a valid DDS\_DomainParticipant.
• DDS\_RETCODE\_OUT\_OF\_RESOURCES - the Data Distribution Service ran out of resources to complete this operation.
• DDS\_RETCODE\_PRECONDITION\_NOT\_MET - the DDS\_DomainParticipant contains one or more DDS\_Entity objects.

# 3.2.2.3 DDS\_DomainParticipantFactory\_get\_default\_participant\_qos

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
DDS_ReturnCode_t
DDS_DomainParticipantFactory_get_default_participant_qos
(DDS_DomainParticipantFactory _this,
DDS_DomainParticipantQos *qos);
```

# Description

This operation gets the default DDS\_DomainParticipantQos of the DDS\_DomainParticipant.

# Parameters

```txt
in DDS_DomainParticipantFactory _ this - the DDS_DomainParticipantFactory object on which the operation is operated.
```

```txt
inout DDS_DomainParticipantQos *qos - a pointer to the DDS_DomainParticipantQos struct (provided by the application) in which the default DDS_DomainParticipantQos for the DDS_DomainParticipant is written.
```

# Return Value

```txt
DDS_ReturnCode_t - Possible return codes of the operation are: DDS_RETCODE_OK, DDS_RETCODE_ERROR, DDS_RETCODE_ILLEGAL_OPERATION or DDS_RETCODE_OUT_OF_RESOURCES.
```

# Detailed Description

This operation gets the default DDS\_DomainParticipantQos of the DDS\_DomainParticipant (that is the struct with the QosPolicy settings) which is used for newly-created DDS\_DomainParticipant objects, in case the constant DDS\_PARTICIPANT\_QOS\_DEFAULT i s u s e d . T h e d e f a u l t DDS\_DomainParticipantQos is only used when the constant is supplied as parameter qos to specify the DDS\_DomainParticipantQos in the DDS\_DomainParticipantFactory\_create\_participant operation. The application must provide the DDS\_DomainParticipantQos struct in which the QosPolicy settings can be stored and provide a pointer to the struct. The operation writes the default QosPolicy settings to the struct pointed to by qos. Any settings in the struct are overwritten.

The values retrieved by this operation match the set of values specified on the last successful call to DDS\_DomainParticipantFactory\_set\_default participant\_qos, or, if the call was never made, the default values as specified for each QosPolicy setting as defined in Table 5: on page 65.

# Return Code

When the operation returns:

• DDS\_RETCODE\_OK - the default DDS\_DomainParticipant QosPolicy settings of this DDS\_DomainParticipantFactory have successfully been copied into the specified DDS\_DomainParticipantQos parameter.
• DDS\_RETCODE\_ERROR - an internal error has occurred.
• DDS\_RETCODE\_ILLEGAL\_OPERATION - the operation is invoked on an inappropriate object.
• DDS\_RETCODE\_OUT\_OF\_RESOURCES - the Data Distribution Service ran out of resources to complete this operation.

# 3.2.2.4 DDS\_DomainParticipantFactory\_get\_instance

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
DDS_DomainParticipantFactory
DDS_DomainParticipantFactory_get_instance
(void);
```

# Description

This operation returns the DDS\_DomainParticipantFactory singleton.

# Parameters

```txt
&lt;none&gt;
```

# Return Value

DDS\_DomainParticipantFactory - return value is a pointer to the DDS\_DomainParticipantFactory.

# Detailed Description

This operation returns the DDS\_DomainParticipantFactory singleton. The operation can be called multiple times without side-effects and it returns the same DDS\_DomainParticipantFactory instance.

The pre-defined value DDS\_TheParticipantFactory can also be used as an a l i a s f o r t h e s i n g l e t o n f a c t o r y r e t u r n e d b y t h e o p e r a t i o n DDS\_DomainParticipantFactory\_get\_instance.

# 3.2.2.5 DDS\_DomainParticipantFactory\_get\_qos

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
DDS_ReturnCode_t
DDS_DomainParticipantFactory_get_qos
(DDS_DomainParticipantFactory_this,
DDS_DomainParticipantFactoryQos *qos);
```

# Description

This operation allows access to the existing set of QoS policies for a DDS\_DomainParticipantFactory.

# Parameters

in DDS\_DomainParticipantFactory this - t h e DDS\_DomainParticipantFactory object on which the operation is operated.

inout DDS\_DomainParticipantFactoryQos \*qos - a pointer to the destination DDS\_DomainparticipantFactoryQos struct in which the QosPolicy settings will be copied.

# Return Value

DDS\_ReturnCode\_t - Possible return codes of the operation are: DDS\_RETCODE\_OK, DDS\_RETCODE\_ERROR, DDS\_RETCODE\_ILLEGAL\_ OPERATION or DDS\_RETCODE\_ OUT\_OF\_RESOURCES.

# Detailed Description

This operation allows access to the existing set of QoS policies of a DDS\_DomainParticipantFactory on which this operation is used. This DDS\_DomainparticipantFactoryQos is stored at the location pointed to by the qos parameter.

# Return Code

When the operation returns:

• DDS\_RETCODE\_OK - the existing set of QoS policy values applied to this DDS\_DomainParticipantFactory has successfully been copied into the specified DDS\_DomainParticipantFactoryQos parameter.
• DDS\_RETCODE\_ERROR - an internal error has occurred.
• DDS\_RETCODE\_ILLEGAL\_OPERATION - the operation is invoked on an inappropriate object.
• DDS\_RETCODE\_OUT\_OF\_RESOURCES - the Data Distribution Service ran out of resources to complete this operation.

# 3.2.2.6 DDS\_DomainParticipantFactory\_lookup\_participant

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
DDS_DomainParticipant
DDS_DomainParticipantFactory_lookup_participant
(DDS_DomainParticipantFactory _this,
const DomainId_t domainId);
```

# Description

This operation retrieves a previously created DDS\_DomainParticipant belonging to the specified domainId.

# Parameters

in DDS\_DomainParticipantFactory this - t h e DDS\_DomainParticipantFactory object on which the operation is operated.

in const DomainId\_t domainId - the ID of the Domain for which a joining DDS\_DomainParticipant should be retrieved. This should be the ID as specified in the configuration file.

# Return Value

D D S\_ D o m a i nP a r t i c i pa n t - R e tu r n v a l u e i s a p o in t e r t o t h e D D S\_ D o m a i n Pa r t i c i pa n t re tr i e v e d . W he n n o s uc h DDS\_DomainParticipant is found, the DDS\_OBJECT\_NIL pointer is returned.

# Detailed Description

This operation retrieves a previously created DDS\_DomainParticipant belonging to the specified domainId. If no such DDS\_DomainParticipant exists, the operation will return DDS\_OBJECT\_NIL.

The domainId used to search for a specific DDS\_DomainParticipant must be i d e n t i c a l t o t h e d o m a i n I d t h a t w a s u s e d t o c r e a t e t h a t s p e c i f i c DDS\_DomainParticipant.

If multiple DDS\_DomainParticipant entities belonging to the specified domainId exist, then the operation will return one of them. It is not specified which one. See also DDS\_DomainParticipantFactory\_create\_participant (section 3.2.2.1 on page 221).

# 3.2.2.7 DDS\_DomainParticipantFactory\_set\_default\_participant\_qos

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
DDS_ReturnCode_t
DDS_DomainParticipantFactory_set_default_participant_qos
(DDS_DomainParticipantFactory _this,
const DDS_DomainParticipantQos *qos);
```

# Description

This operation sets the default DDS\_DomainParticipantQos of the DDS\_DomainParticipant.

# Parameters

in DDS\_DomainParticipantFactory t h i s - t h e DDS\_DomainParticipantFactory object on which the operation is operated.

in const DDS\_DomainParticipantQos \*qos - t h e DDS\_DomainParticipantQos struct, which contains the new default DDS\_DomainParticipantQos f o r t h e n e w l y - c r e a t e d DDS\_DomainParticipants.

# Return Value

DDS\_ReturnCode\_t - Possible return codes of the operation are: DDS\_RETCODE\_OK, DDS\_RETCODE\_ERROR, DDS\_RETCODE\_ILLEGAL\_ OPERATION, DDS\_RETCODE\_BAD\_PARAMETER or DDS\_RETCODE\_ OUT\_OF\_RESOURCES.

# Detailed Description

This operation sets the default DDS\_DomainParticipantQos of the DDS\_DomainParticipant (that is the struct with the QosPolicy settings) which is used for newly-created DDS\_DomainParticipant objects, in case the constant DDS\_PARTICIPANT\_QOS\_DEFAULT i s u s e d . T h e d e f a u l t DDS\_DomainParticipantQos is only used when the constant is supplied as parameter qos to specify the DDS\_DomainParticipantQos in the DDS\_DomainParticipantFactory\_create\_participant operation. The DDS\_DomainParticipantQos is always self consistent, because its policies do not depend on each other. This means this operation never returns the DDS\_RETCODE\_INCONSISTENT\_POLICY.

T h e v a l u e s s e t b y t h i s o p e r a t i o n a r e r e t u r n e d b y DDS\_DomainParticipantFactory\_get\_default\_participant\_qos.

# Return Code

When the operation returns:

• DDS\_RETCODE\_OK - the new default DDS\_DomainParticipantQos is set.
• DDS\_RETCODE\_ERROR - an internal error has occurred.
• DDS\_RETCODE\_ILLEGAL\_OPERATION - the operation is invoked on an inappropriate object.
• DDS\_RETCODE\_BAD\_PARAMETER - the parameter qos is not a valid DDS\_DomainParticipantQos. It contains a QosPolicy setting with a sequence that has inconsistent memory settings.
• DDS\_RETCODE\_OUT\_OF\_RESOURCES - the Data Distribution Service ran out of resources to complete this operation.

# 3.2.2.8 DDS\_DomainParticipantFactory\_set\_qos

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
DDS_ReturnCode_t
DDS_DomainParticipantFactory_set_qos
(DDS_DomainParticipantFactory_this,
const DDS_DomainParticipantFactoryQos *qos);
```

# Description

This operation replaces the existing set of QosPolicy settings for a DDS\_DomainParticipantFactory.

# Parameters

in DDS\_DomainParticipantFactory t h i s - i s t h e DDS\_DomainParticipantFactory object on which the operation is operated.

in const DDS\_DomainParticipantFactoryQos \*qos - must contain the new set of QosPolicy settings for the DDS\_DomainParticipantFactory.

# Return Value

DDS\_ReturnCode\_t - Possible return codes of the operation are: DDS\_RETCODE\_OK, DDS\_RETCODE\_ERROR, DDS\_RETCODE\_ILLEGAL\_ OPERATION or DDS\_RETCODE\_OUT\_OF\_RESOURCES.

# Detailed Description

This operation replaces the existing set of QosPolicy settings for a DDS\_DomainParticipantFactory. The parameter qos must contain the struct with the QosPolicy settings.

The set of QosPolicy settings specified by the qos parameter are applied on top of the existing QoS, replacing the values of any policies previously set (provided, the operation returned DDS\_RETCODE\_OK).

# Return Code

When the operation returns:

• DDS\_RETCODE\_OK - the new DDS\_DomainParticipantFactoryQos is set.
• DDS\_RETCODE\_ERROR - an internal error has occurred.
• DDS\_RETCODE\_ILLEGAL\_OPERATION - the operation is invoked on an inappropriate object.
• DDS\_RETCODE\_OUT\_OF\_RESOURCES - the Data Distribution Service ran out of resources to complete this operation.

# 3.2.2.9 DDS\_DomainParticipantFactory\_delete\_domain

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
DDS_ReturnCode_t
DDS_DomainParticipantFactory_delete_domain
(DDS_DomainParticipantFactory _this,
```

DDS\_Domain a\_domain);

# Description

This operation deletes a DDS\_Domain.

# Parameters

in DDS\_DomainParticipantFactory \_this - the DDS\_DomainParticipantFactory object on which the operation is operated.

in DDS\_Domain a\_domain - a pointer to the DDS\_Domain, which is to be deleted.

# Return Value

D D S \_ R e t u r n C o d e \_ t - P o s s i b l e r e t u r n c o d e s o f t h e o p e r a t i o n a r e : DDS\_RETCODE\_OK, DDS\_RETCODE\_ERROR, DDS\_RETCODE\_ILLEGAL\_ OPERATION, DDS\_RETCODE\_BAD\_PARAMETER or DDS\_RETCODE\_ OUT\_OF\_RESOURCES.

# Detailed Description

This operation deletes a DDS\_Domain.

# Return Code

When the operation returns:

• DDS\_RETCODE\_OK - the DDS\_Domain is deleted.
• DDS\_RETCODE\_ERROR - an internal error has occurred.
• DDS\_RETCODE\_ILLEGAL\_OPERATION - the operation is invoked on an inappropriate object.
• DDS\_RETCODE\_BAD\_PARAMETER - the parameter a\_domain is not a valid DDS\_Domain.
• DDS\_RETCODE\_OUT\_OF\_RESOURCES - the Data Distribution Service ran out of resources to complete this operation.

# 3.2.2.10 DDS\_DomainParticipantFactory\_lookup\_domain

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
DDS_Domain
DDS_DomainParticipantFactory_lookup_domain
(DDS_DomainParticipantFactory _this,
const DomainId_t domainId);
```

# Description

This operation retrieves a previously created DDS\_Domain proxy belonging to the specified domainId or creates a new DDS\_Domain if no DDS\_Domain yet exists but the Domain itself is available.

# Parameters

in DDS\_DomainParticipantFactory \_this - the DDS\_DomainParticipantFactory object on which the operation is operated. in const DomainId\_t domainId - the ID of the Domain for which a DDS\_Domain proxy should be retrieved. This should be the ID as specified in the configuration file.

# Return Value

DDS\_Domain - Return value is a pointer to the DDS\_Domain proxy retrieved. When n o s u c h D D S \_ D o m a i n p r o x y i s f o u n d o r c o u l d b e c r e a t e d , t h e DDS\_OBJECT\_NIL pointer is returned.

# Detailed Description

This operation retrieves a previously created DDS\_Domain proxy belonging to the specified domainId or creates a new DDS\_Domain proxy if no DDS\_Domain proxy was found, but the DomainId does refer to a valid Domain. If no such DDS\_Domain exists or could be created, the operation will return DDS\_OBJECT\_NIL. See also DDS\_DomainParticipantFactory\_create\_participant (section 3.2.2.1 on page 221).

# 3.2.2.11 DDS\_DomainParticipantFactory\_delete\_contained\_entities

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
DDS_ReturnCode_t
DDS_DomainParticipantFactory_delete_contained_entities
(DDS_DomainParticipantFactory _this);
```

# Description

This operation deletes all of the DDS\_Entity objects that were created on the DDS\_DomainParticipantFactory.

# Parameters

in DDS\_DomainParticipantFactory \_this - the DDS\_DomainParticipantFactory object on which the operation is performed.

# Return Value

DDS\_ReturnCode\_t - Possible return codes of the operation are:

DDS\_RETCODE\_OK, DDS\_RETCODE\_ERROR, DDS\_RETCODE\_ILLEGAL OPERATION, DDS\_RETCODE\_OUT\_OF\_RESOURCES, DDS\_RETCODE\_ PRECONDITION\_NOT\_MET or DDS\_RETCODE\_BAD\_PARAMETER.

# Detailed Description

This operation deletes all of the DDS\_Entity objects that were created on the DDS\_DomainParticipantFactory (it deletes all contained DDS\_DomainParticipant objects). Prior to deleting each contained DDS\_Entity, t h i s o p e r a t i o n r e g r e s s i v e l y c a l l s t h e DDS\_DomainParticipant\_delete\_contained\_entities operation on each DDS\_Participant. In other words, this operation cleans up all DDS\_Entity objects in the process.

![The image shows a red triangular warning sign with rounded corners. Inside the triangle is a black exclamation mark, with the dot at the bottom shaped like a small black diamond.](.vortex-opensplice-c-reference-guide/5ac80ea178728f00aa92e0430a576de4bd0ef249efa5c98b62bafeee836b9944.jpg)

NOTE: The operation will return DDS\_PRECONDITION\_NOT\_MET if the any of the contained entities is in a state where it cannot be deleted. This will occur, for example, if a contained DDS\_DataReader cannot be deleted because the application has called a read or take operation and has not called the corresponding return\_loan operation to return the loaned samples. In such cases, the operation does not roll back any entity deletions performed prior to the detection of the problem.

# Return Code

When the operation returns:

• DDS\_RETCODE\_OK - all contained DDS\_Entity objects are deleted.
• DDS\_RETCODE\_ERROR - an internal error has occurred.
• DDS\_RETCODE\_ILLEGAL\_OPERATION - the operation is invoked on an inappropriate object.
• DDS\_RETCODE\_OUT\_OF\_RESOURCES - the Data Distribution Service ran out of resources to complete this operation.
• DDS\_RETCODE\_PRECONDITION\_NOT\_MET - one or more of the contained entities are in a state where they cannot be deleted.
• DDS\_RETCODE\_BAD\_PARAMETER - the parameter \_this is not a valid DDS\_DomainParticipantFactory.

# 3.2.2.12 DDS\_DomainParticipantFactory\_detach\_all\_domains

# Synopsis

#include &lt;dds\_dcps.h&gt;

```txt
DDS_ReturnCode_t
DDS_DomainParticipantFactory_detach_all_domains
(DDS_DomainParticipantFactory _this,
DDS_boolean block_operations,
DDS_boolean delete_entities);
```

# Description

This operation will safely detach the application from all domains it is currently participating in.

# Parameters

```txt
in DDS_DomainParticipantFactory _this-
The DDS_DomainParticipantFactory object on which the operation is performed.

in DDS_boolean block_operations -
Indicates whether the application wants any operations that are called while detaching to be blocked or not.

in DDS_boolean delete_entities -
Indicates whether the application DDS entities in the 'connected' domains must be deleted synchronously during detaching.
```

# Return Value

```txt
DDS_ReturnCode_t - Possible return codes of the operation are:
DDS_RETCODE_OK
```

# Detailed Description

This operation safely detaches the application from all domains it is currently participating in. When this operation has been performed successfully, the application is no longer connected to any Domain.

• For Federated domains, finishing this operation successfully means that all shared memory segments have been safely un-mapped from the application process.
• For SingleProcess mode domains, this means all services for all domains have been stopped. This allows graceful termination of the OSPL services that run as threads within the application. Graceful termination of services in this mode would for instance allow durability flushing of persistent data and networking termination announcement over the network.

When this call returns, further access to all domains will be denied and it will not be possible for the application to open or re-open any DDS domain.

The behavior of the detach\_all\_domains operation is determined by the block\_operations and delete\_entities parameters

block\_operations – This parameter specifies whether the application wants any DDS operation to be blocked or not while detaching. When TRUE, any DDS operation called during this operation will be blocked and remain blocked forever (so also after the detach operation has completed and returns to the caller). When FALSE, any DDS operation called during this operation may return DDS\_RETCODE\_ALREADY\_DELETED.

Please note that a listener callback is not considered an operation in progress. Of course, if a DDS operation is called from within the listener callback, that operation will be blocked during the detaching if this attribute is set to TRUE.

delete\_entities – This parameter specifies whether the application wants the DDS entities created by the application to be deleted (synchronously) while detaching from the domain or not. If TRUE, all application entities are guaranteed to be deleted when the call returns. If FALSE, application entities will not explicitly be deleted by this operation.

In federated mode, the splice-daemon will delete them asynchronously after this operation has returned successfully. In SingleProcess mode this attribute is ignored and clean up will always be performed, as this cannot be delegated to a different process.

![The image displays a red triangular warning sign with a white interior. Inside the triangle is a black exclamation mark, and directly beneath it is a black arrow pointing downwards.](.vortex-opensplice-c-reference-guide/1e72ac6a180be269f023bb6bb1ea5a997a30b0be8605af860c72b234cb62362b.jpg)

NOTE: In federated mode when the detach\_all\_domain operation is called with block\_operations set to FALSE and delete\_entities also FALSE then the DDS operations which are in progress and which are waiting for some condition to become true (or waiting for an event to occur) while the detach operation is performed may be blocked.

# Return Code

When the operation returns:

• DDS\_RETCODE\_OK – the application is detached from all domains.

# 3.2.3 Class DDS\_Domain

The purpose of this class is to represent the Domain and allow certain Domain-wide operations to be performed. In essence it is a proxy to the Domain.

A Domain is a distributed concept that links all the applications that must be able to communicate with each other. It represents a communication plane: only the DDS\_Publishers and the DDS\_Subscribers attached to the same Domain can interact.

This class currently implements one function:

• It allows for a snapshot to be taken of all persistent data available within this Domain on local node level.

The interface description of this class is as follows:

/\*

```c
* interface DDS_Domain
*/
DDS_ReturnCode_t
DDS_Domain_create_persistent_snapshot(
DDS_Domain _this,
const DDS_char* partition_expression,
const DDS_char* topic_expression,
const DDS_char* URI);
```

The following sections describe the usage of all DDS\_Domain operations.

# 3.2.3.1 DDS\_Domain\_create\_persistent\_snapshot

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
DDS_ReturnCode_t
DDS_Domain_create_persistent_snapshot(
DDS_Domain _this,
const DDS_char* partition_expression,
const DDS_char* topic_expression,
const DDS_char* URI);
```

# Description

This operation will create a snapshot of all persistent data matching the provided partition and topic expressions and store the snapshot at the location indicated by the URI. Only persistent data available on the local node is considered.

# Parameters

in DDS\_Domain \_this - the DDS\_Domain object on which the operation is operated.
in DDS\_char\* partition\_expression - the expression of all partitions involved in the snapshot; this may contain wildcards.
in DDS\_char\* topic\_expression - the expression of all topics involved in the snapshot; this may contain wildcards.
in DDS\_char\* uri - the location where to store the snapshot. Currently only directories are supported.

# Return Value

```txt
DDS_ReturnCode_t - Possible return codes of the operation are: DDS_RETCODE_OK, DDS_RETCODE_ERROR, DDS_RETCODE_ILLEGAL_OPERATION, DDS_RETCODE_BAD_PARAMETER, DDS_RETCODE_ALREADY_DELETED or DDS_RETCODE_OUT_OF_RESOURCES.
```

# Detailed Description

This operation will create a snapshot of all persistent data matching the provided partition and topic expressions and store the snapshot at the location indicated by the URI. Only persistent data available on the local node is considered. This operation will fire an event to trigger the snapshot creation by the durability service and then return while the durability service fulfills the snapshot request; if no durability service is available then there is no persistent data available and the operation will return OK as a snapshot of an empty store is an empty store.

The created snapshot can then be used as the persistent store for the durability service next time it starts up by configuring the location of the snapshot as the persistent store in the configuration file. The durability service will then use the snapshot as the regular store (and can thus also alter its contents).

# Return Code

When the operation returns:

• DDS\_RETCODE\_OK – The persistent snapshot is (being) created.
• DDS\_RETCODE\_ERROR - an internal error has occurred.
• DDS\_RETCODE\_ILLEGAL\_OPERATION - the operation is invoked on an inappropriate object.
• DDS\_RETCODE\_BAD\_PARAMETER - the parameter partition\_expression, topic\_expression or uri is NIL.
• DDS\_RETCODE\_ALREADY\_DELETED - the DDS\_Domain proxy has already been deleted.
• DDS\_RETCODE\_OUT\_OF\_RESOURCES - the Data Distribution Service ran out of resources to complete this operation.

# 3.2.4 DDS\_DomainParticipantListener interface

Since a DDS\_DomainParticipant is a DDS\_Entity, it has the ability to have a Listener associated with it. In this case, the associated Listener should be of type DDS\_DomainParticipantListener. This interface must be implemented by the application. A user-defined class must be provided by the application which must extend from the DDS\_DomainParticipantListener class. All DDS\_DomainParticipantListener operations must be implemented in the user-defined class, it is up to the application whether an operation is empty or contains some functionality.

![This image shows a triangular warning sign with a thick red border and a white background. Centered inside is a black exclamation point (!) with a small black arrow pointing downwards located directly beneath it.](.vortex-opensplice-c-reference-guide/e24f630704a95cd0b0f31a34ee5ad502bf137f0ce42e75fe06cc6d348821734c.jpg)

All operations for this interface must be implemented in the user-defined class, it is up to the application whether an operation is empty or contains some functionality.

The DDS\_DomainParticipantListener provides a generic mechanism (actually a callback function) for the Data Distribution Service to notify the application of relevant asynchronous status change events, such as a missed d e a d l i n e , v i o l a t i o n o f a Q o s P o l i c y s e t t i n g , e t c . T h e DDS\_DomainParticipantListener is related to changes in communication status DDS\_StatusConditions.

The interface description of this class is as follows:
```c
/*
 * interface DDS_DomainParticipantListener
 */
/*
 * inherited from DDS_TopicListener
 */
/* void
 *    DDS_DomainParticipantListener_on_inconsistent_topic
 *    (void *listener_data,
 *    DDS_Topic the_topic,
 *    const DDS_InconsistentTopicStatus *status);
 */
/*
 * inherited from DDS_PublisherListener
 */
/* void
 *    DDS_DomainParticipantListener_on_offered_deadline_missed
 *    (void *listener_data,
 *    DDS_DataWriter writer,
 *    const DDS_OfferedDeadlineMissedStatus *status);
 */
/* void
 *    DDS_DomainParticipantListener_on_offered_incompatible_qos
 *    (void *listener_data,
 *    DDS_DataWriter writer,
 *    const DDS_OfferedIncompatibleQosStatus *status);
 */
/* void
 *    DDS_DomainParticipantListener_on_liveliness_lost
 *    (void *listener_data,
 *    DDS_DataWriter writer,
 *    const DDS_LivelinessLostStatus *status);
 */
/* void
 *    DDS_DomainParticipantListener_on_publication_matched
 *    (void *listener_data,
 *    DDS_DataWriter writer,
 *    const DDS_PublicationMatchedStatus *status);
```

```c
*/
/*
 * inherited from DDS_SubscriberListener
 */
/* void
 * DDS_DomainParticipantListener_on_data_on_readers
 * (void *listener_data,
 * DDS_Subscriber subs);
 */
/* void
* DDS_DomainParticipantListener_on_requested_deadline_missed
 * (void *listener_data,
 * DDS_DataReader reader,
 * const DDS_RequestedDeadlineMissedStatus *status);
 */
/* void
 * DDS_DomainParticipantListener_on_requested_incompatible_qos
 * (void *listener_data,
 * DDS_DataReader reader,
 * const DDS_RequestedIncompatibleQosStatus *status);
 */
/* void
 * DDS_DomainParticipantListener_on_sample_rejected
 * (void *listener_data,
 * DDS_DataReader reader,
 * const DDS_SampleRejectedStatus *status);
 */
/* void
 * DDS_DomainParticipantListener_on_liveliness_changed
 * (void *listener_data,
 * DDS_DataReader reader,
 * const DDS_LivelinessChangedStatus *status);
 */
/* void
 * DDS_DomainParticipantListener_on_data_available
 * (void *listener_data,
 * DDS_DataReader reader);
 */
/* void
 * DDS_DomainParticipantListener_on_subscription_matched
 * (void *listener_data,
 * DDS_DataReader reader,
 * const DDS_SubscriptionMatchedStatus *status);
 */
```

```c
/* void
* DDS_DomainParticipantListener_on_sample_lost
* (void *listener_data,
* DDS_DataReader reader,
* const DDS_SampleLostStatus *status);
*/
/*
* implemented API operations
*/
struct DDS_DomainParticipantListener *
DDS_DomainParticipantListener_alloc
(void);
```

The next paragraphs list all DDS\_DomainParticipantListener operations. Since these operations are all inherited, they are listed but not fully described because they are not implemented in this class. The full description of these operations is given in the classes from which they are inherited.

# 3.2.4.1 DDS\_DomainParticipantListener\_\_alloc

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
struct DDS_DomainParticipantListener *
DDS_DomainParticipantListener__alloc
(void);
```

# Description

This operation creates a new DDS\_DomainParticipantListener.

# Parameters

```txt
&lt;none&gt;
```

# Return Value

struct DDS\_DomainParticipantListener \* - Return value is the handle to the newly-created DDS\_DomainParticipantListener. In case of an error, a DDS\_OBJECT\_NIL pointer is returned.

# Detailed Description

This operation creates a new DDS\_DomainParticipantListener. The DDS\_DomainParticipantListener must be created using this operation. In other words, the application is not allowed to declare an object of type DDS\_DomainParticipantListener. When the application wants to release the DDS\_DomainParticipantListener it must be released using DDS\_free.

I n c a s e t h e r e a r e i n s u ff i c i e n t r e s o u r c e s a v a i l a b l e t o a l l o c a t e t h e DDS\_DomainParticipantListener, a DDS\_OBJECT\_NIL pointer is returned instead.

# 3.2.4.2 DDS\_DomainParticipantListener\_on\_data\_available (inherited, abstract)

This operation is inherited and therefore not described here. See the class DDS\_DataReaderListener for further explanation.

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
void
DDS_DomainParticipantListener_on_data_available
(void *listener_data,
DDS_DataReader reader);
```

# 3.2.4.3 DDS\_DomainParticipantListener\_on\_data\_on\_readers (inherited, abstract)

This operation is inherited and therefore not described here. See the class DDS\_SubscriberListener for further explanation.

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
void
DDS_DomainParticipantListener_on_data_on_readers
(void *listener_data,
DDS_Subscriber_subs);
```

# 3.2.4.4 DDS\_DomainParticipantListener\_on\_inconsistent\_topic (inherited, abstract)

This operation is inherited and therefore not described here. See the class DDS\_TopicListener for further explanation.

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
void
DDS_DomainParticipantListener_on_inconsistent_topic
(void *listener_data,
DDS_Topic the_topic,
const DDS_InconsistentTopicStatus *status);
```

# 3.2.4.5 DDS\_DomainParticipantListener\_on\_liveliness\_changed (inherited,

# abstract)

This operation is inherited and therefore not described here. See the class DDS\_DataReaderListener for further explanation.

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
void
DDS_DomainParticipantListener_on_liveliness_changed
(void *listener_data,
DDS_DataReader reader,
const DDS_LivelinessChangedStatus *status);
```

# 3.2.4.6 DDS\_DomainParticipantListener\_on\_liveliness\_lost (inherited, abstract)

This operation is inherited and therefore not described here. See the class DDS\_DataWriterListener for further explanation.

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
void
DDS_DomainParticipantListener_on_liveliness_lost
(void *listener_data,
DDS_DataWriter writer,
const DDS_LivelinessLostStatus *status);
```

# 3.2.4.7 DDS\_DomainParticipantListener\_on\_offered\_deadline\_missed (inherited, abstract)

This operation is inherited and therefore not described here. See the class DDS\_DataWriterListener for further explanation.

```c
Synopsis
#include &lt;dds_dcps.h&gt;
void
DDS_DomainParticipantListener_on_offered_deadline_missed
(void *listener_data,
DDS_DataWriter writer,
const DDS_OfferedDeadlineMissedStatus *status);
```

# 3.2.4.8 DDS\_DomainParticipantListener\_on\_offered\_incompatible\_qos (inherited, abstract)

This operation is inherited and therefore not described here. See the class DDS\_DataWriterListener for further explanation.

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
```

```txt
void
DDS_DomainParticipantListener_on_offered_incompatible_qos
(void *listener_data,
DDS_DataWriter writer,
const DDS_OfferedIncompatibleQosStatus *status);
```

# 3.2.4.9 DDS\_DomainParticipantListener\_on\_publication\_matched (inherited, abstract)

This operation is inherited and therefore not described here. See the class DDS\_DataWriterListener for further explanation.

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
void
DDS_DomainParticipantListener_on_publication_matched
(void *listener_data,
DDS_DataWriter writer,
const DDS_PublicationMatchedStatus *status);
```

# 3.2.4.10 DDS\_DomainParticipantListener\_on\_requested\_deadline\_missed (inherited, abstract)

This operation is inherited and therefore not described here. See the class DDS\_DataReaderListener for further explanation.

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
void
DDS_DomainParticipantListener_on_requested_deadline_missed
(void *listener_data,
DDS_DataReader reader,
const DDS_RequestedDeadlineMissedStatus *status);
```

# 3.2.4.11 DDS\_DomainParticipantListener\_on\_requested\_incompatible\_qos (inherited, abstract)

This operation is inherited and therefore not described here. See the class DDS\_DataReaderListener for further explanation.

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
void
DDS_DomainParticipantListener_on_requested_incompatible_qos
(void *listener_data,
DDS_DataReader reader,
const DDS_RequestedIncompatibleQosStatus *status);
```

# 3.2.4.12 DDS\_DomainParticipantListener\_on\_sample\_lost (inherited, abstract)

This operation is inherited and therefore not described here. See the class DDS\_DataReaderListener for further explanation.

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
void
DDS_DomainParticipantListener_on_sample_lost
(void *listener_data,
DDS_DataReader reader,
const DDS_SampleLostStatus *status);
```

# 3.2.4.13 DDS\_DomainParticipantListener\_on\_sample\_rejected (inherited, abstract)

This operation is inherited and therefore not described here. See the class DDS\_DataReaderListener for further explanation.

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
void
DDS_DomainParticipantListener_on_sample_rejected
(void *listener_data,
DDS_DataReader reader,
const DDS_SampleRejectedStatus *status);
```

# 3.2.4.14 DDS\_DomainParticipantListener\_on\_subscription\_matched (inherited, abstract)

This operation is inherited and therefore not described here. See the class DDS\_DataReaderListener for further explanation.

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
void
DDS_DomainParticipantListener_on_subscription_matched
(void *listener_data,
DDS_DataReader reader,
const DDS_SubscriptionMatchedStatus *status);
```

# 3.2.5 DDS\_ExtDomainParticipantListener interface

The ExtDomainParticipantListener interface is a subtype of both DomainParticipantListener and ExtTopicListener and thereby provides an additional OpenSplice-specific callback, on\_all\_disposed\_data, usable from the DomainParticipant.

![The image shows a red triangular warning sign with a white background. Inside the triangle is a black exclamation point, and directly beneath it is a small black arrow pointing downward.](.vortex-opensplice-c-reference-guide/fabef986a5b54f38aae87dbdef8e529d4acbc404109000961f09f0543661ba21.jpg)

All operations for this interface must be implemented in the user-defined class, it is up to the application whether an operation is empty or contains some functionality.

The interface description of this class is as follows:
```c
/*
 * interface DDS_ExtDomainParticipantListener
 */
/*
 * inherited from DDS_TopicListener
 */
/* void
 *    DDS_ExtDomainParticipantListener_on_inconsistent_topic
 *    (void *listener_data,
 *    DDS_Topic the_topic,
 *    const DDS_InconsistentTopicStatus *status);
 */
/*
 * inherited from DDS_ExtTopicListener
 */
/* void
 *    DDS_ExtDomainParticipantListener_on_all_data_disposed
 *    (void *listener_data,
 *    DDS_Topic the_topic);
 */
/*
 * inherited from DDS_PublisherListener
 */
/* void
 * DDS_ExtDomainParticipantListener_on_offered_deadline_missed
 *    (void *listener_data,
 *    DDS_DataWriter writer,
 *    const DDS_OfferedDeadlineMissedStatus *status);
 */
/* void
 *    DDS_ExtDomainParticipantListener_on_offered_incompatible_qos
 *    (void *listener_data,
 *    DDS_DataWriter writer,
 *    const DDS_OfferedIncompatibleQosStatus *status);
 */
/* void
 *    DDS_ExtDomainParticipantListener_on_liveliness_lost
 *    (void *listener_data,
 *    DDS_DataWriter writer,
 *    const DDS_LivelinessLostStatus *status);
 */
```

```c
/* void
* DDS_ExtDomainParticipantListener_on_publication_matched
* (void *listener_data,
* DDS_DataWriter writer,
* const DDS_PublicationMatchedStatus *status);
*/
/*
* inherited from DDS_SubscriberListener
*/
/* void
* DDS_ExtDomainParticipantListener_on_data_on_readers
* (void *listener_data,
* DDS_Subscriber subs);
*/
/* void
* DDS_ExtDomainParticipantListener_on_requested_deadline_missed
* (void *listener_data,
* DDS_DataReader reader,
* const DDS_RequestedDeadlineMissedStatus *status);
*/
/* void
* DDS_ExtDomainParticipantListener_on_requested_incompatible_qos
* (void *listener_data,
* DDS_DataReader reader,
* const DDS_RequestedIncompatibleQosStatus *status);
*/
/* void
* DDS_ExtDomainParticipantListener_on_sample_rejected
* (void *listener_data,
* DDS_DataReader reader,
* const DDS_SampleRejectedStatus *status);
*/
/* void
* DDS_ExtDomainParticipantListener_on_liveliness_changed
* (void *listener_data,
* DDS_DataReader reader,
* const DDS_LivelinessChangedStatus *status);
*/
/* void
* DDS_ExtDomainParticipantListener_on_data_available
* (void *listener_data,
* DDS_DataReader reader);
*/
/* void
* DDS_ExtDomainParticipantListener_on_subscription_matched
```

```c
* (void *listener_data,
* DDS_DataReader reader,
* const DDS_SubscriptionMatchedStatus *status);
*/
/* void
* DDS_ExtDomainParticipantListener_on_sample_lost
* (void *listener_data,
* DDS_DataReader reader,
* const DDS_SampleLostStatus *status);
*/
/*
* implemented API operations
*/
struct DDS_ExtDomainParticipantListener *
DDS_ExtDomainParticipantListener__alloc
(void);
```

The following paragraphs list all ExtDomainParticipantListener operations. Since these operations are all inherited, they are listed but not fully described because they are not implemented in this class. The full descriptions of these operations are given in the classes from which they are inherited.

# 3.2.5.1 DDS\_ExtDomainParticipantListener\_\_alloc

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
struct DDS_ExtDomainParticipantListener *
DDS_ExtDomainParticipantListener__alloc
(void);
```

# Description

This operation creates a new DDS\_ExtDomainParticipantListener.

# Parameters

```txt
&lt;none&gt;
```

# Return Value

struct DDS\_ExtDomainParticipantListener \* - Return value is the handle to the newly-created DDS\_ExtDomainParticipantListener. In case of an error, a DDS\_OBJECT\_NIL pointer is returned.

# Detailed Description

This operation creates a new DDS\_ExtDomainParticipantListener. The DDS\_ExtDomainParticipantListener must be created using this operation. In other words, the application is not allowed to declare an object of type

DDS\_ExtDomainParticipantListener. When the application wants to release the DDS\_ExtDomainParticipantListener it must be released using DDS\_free.

I n c a s e t h e r e a r e i n s u f f i c i e n t r e s o u r c e s a v a i l a b l e t o a l l o c a t e t h e DDS\_ExtDomainParticipantListener, a DDS\_OBJECT\_NIL pointer is returned instead.

# 3.2.5.2 DDS\_ExtDomainParticipantListener\_on\_data\_available (inherited, abstract)

This operation is inherited and therefore not described here. See the class DDS\_DataReaderListener for further explanation.

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
void
DDS_ExtDomainParticipantListener_on_data_available
(void *listener_data,
DDS_DataReader reader);
```

# 3.2.5.3 DDS\_ExtDomainParticipantListener\_on\_data\_on\_readers (inherited, abstract)

This operation is inherited and therefore not described here. See the class DDS\_SubscriberListener for further explanation.

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
void
DDS_ExtDomainParticipantListener_on_data_on_readers
(void *listener_data,
DDS_Subscriber subs);
```

# 3.2.5.4 DDS\_ExtDomainParticipantListener\_on\_inconsistent\_topic (inherited, abstract)

This operation is inherited and therefore not described here. See the class DDS\_TopicListener for further explanation.

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
void
DDS_ExtDomainParticipantListener_on_inconsistent_topic
(void *listener_data,
DDS_Topic the_topic,
const DDS_InconsistentTopicStatus *status);
```

# 3.2.5.5 DDS\_ExtDomainParticipantListener\_on\_liveliness\_changed (inherited, abstract)

This operation is inherited and therefore not described here. See the class DDS\_DataReaderListener for further explanation.

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
void
DDS_ExtDomainParticipantListener_on_liveliness_changed
(void *listener_data,
DDS_DataReader reader,
const DDS_LivelinessChangedStatus *status);
```

# 3.2.5.6 DDS\_ExtDomainParticipantListener\_on\_liveliness\_lost (inherited, abstract)

This operation is inherited and therefore not described here. See the class DDS\_DataWriterListener for further explanation.

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
void
DDS_ExtDomainParticipantListener_on_liveliness_lost
(void *listener_data,
DDS_DataWriter writer,
const DDS_LivelinessLostStatus *status);
```

# 3.2.5.7 DDS\_ExtDomainParticipantListener\_on\_offered\_deadline\_missed (inherited, abstract)

This operation is inherited and therefore not described here. See the class DDS\_DataWriterListener for further explanation.

```c
Synopsis
#include &lt;dds_dcps.h&gt;
void
DDS_ExtDomainParticipantListener_on_offered_deadline_missed
(void *listener_data,
DDS_DataWriter writer,
const DDS_OfferedDeadlineMissedStatus *status);
```

# 3.2.5.8 DDS\_ExtDomainParticipantListener\_on\_offered\_incompatible\_qos (inherited, abstract)

This operation is inherited and therefore not described here. See the class DDS\_DataWriterListener for further explanation.

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
void
DDS_ExtDomainParticipantListener_on_offered_incompatible_qos
(void *listener_data,
DDS_DataWriter writer,
const DDS_OfferedIncompatibleQosStatus *status);
```

# 3.2.5.9 DDS\_ExtDomainParticipantListener\_on\_publication\_matched (inherited, abstract)

This operation is inherited and therefore not described here. See the class DDS\_DataWriterListener for further explanation.

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
void
DDS_ExtDomainParticipantListener_on_publication_matched
(void *listener_data,
DDS_DataWriter writer,
const DDS_PublicationMatchedStatus *status);
```

# 3.2.5.10 DDS\_ExtDomainParticipantListener\_on\_requested\_deadline\_missed (inherited, abstract)

This operation is inherited and therefore not described here. See the class DDS\_DataReaderListener for further explanation.

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
void
DDS_ExtDomainParticipantListener_on_requested_deadline_missed
(void *listener_data,
DDS_DataReader reader,
const DDS_RequestedDeadlineMissedStatus *status);
```

# 3.2.5.11 DDS\_ExtDomainParticipantListener\_on\_requested\_incompatible\_qos (inherited, abstract)

This operation is inherited and therefore not described here. See the class DDS\_DataReaderListener for further explanation.

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
void
DDS_ExtDomainParticipantListener_on_requested_incompatible_qos
(void *listener_data,
DDS_DataReader reader,
```

```javascript
const DDS_RequestedIncompatibleQosStatus *status);
```

# 3.2.5.12 DDS\_ExtDomainParticipantListener\_on\_sample\_lost (inherited, abstract)

This operation is inherited and therefore not described here. See the class DDS\_DataReaderListener for further explanation.

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
void
DDS_ExtDomainParticipantListener_on_sample_lost
(void *listener_data,
DDS_DataReader reader,
const DDS_SampleLostStatus *status);
```

# 3.2.5.13 DDS\_ExtDomainParticipantListener\_on\_sample\_rejected (inherited, abstract)

This operation is inherited and therefore not described here. See the class DDS\_DataReaderListener for further explanation.

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
void
DDS_ExtDomainParticipantListener_on_sample_rejected
(void *listener_data,
DDS_DataReader reader,
const DDS_SampleRejectedStatus *status);
```

# 3.2.5.14 DDS\_ExtDomainParticipantListener\_on\_subscription\_matched (inherited, abstract)

This operation is inherited and therefore not described here. See the class DDS\_DataReaderListener for further explanation.

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
void
DDS_ExtDomainParticipantListener_on_subscription_matched
(void *listener_data,
DDS_DataReader reader,
const DDS_SubscriptionMatchedStatus *status);
```

# 3.2.5.15 DDS\_ExtDomainParticipantListener\_on\_all\_data\_disposed (inherited, abstract)

This operation is inherited and therefore not described here. See the class DDS\_ExtTopicListener for further explanation.

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
void
DDS_ExtDomainParticipantListener_on_all_data_disposed
(DDS_Topic the_topic);
```

# 3.3 Topic-Definition Module

![Based on the provided flowchart/block diagram, here is the accurate description of the labeled blocks and their connections:\n\n**Labeled Blocks:**\n\n*   **DataReader** (from Subscription Module)\n*   **TopicDescription**\n    *   get_name()\n    *   get_participant()\n    *   get_type_name()\n*   **ContentFilteredTopic**\n    *   get_expression_parameters()\n    *   get_filter_expression()\n    *   get_related_topic()\n    *   set_expression_parameters()\n*   **DomainParticipant** (from Domain Module)\n*   **MultiTopic**\n    *   get_expression_parameters()\n    *   get_subscription_expression()\n    *   set_expression_parameters()\n*   **DomainEntity** (from Infrastructure Module)\n*   **Topic**\n    *   get_inconsistent_topic_status()\n    *   get_listener()\n    *   get_qos()\n    *   set_listener()\n    *   set_qos()\n*   **DataWriter** (from Publication Module)\n*   **QosPolicy** (from Infrastructure Module)\n*   **((Interface)) TopicListener**\n    *   on_inconsistent_topic()\n*   **StatusCondition** (from Infrastructure Module)\n*   **WaitSet** (from Infrastructure Module)\n*   **((Interface)) TypeSupport**\n    *   get_type_name()\n    *   register_type()\n\n**Connections:**\n\n*   **DataReader** connects to **TopicDescription** (Solid line with arrowhead pointing to TopicDescription; multiplicity `*` at DataReader end, `1` at TopicDescription end).\n*   **TopicDescription** connects to **ContentFilteredTopic** (Solid line with hollow triangle arrowhead pointing to ContentFilteredTopic).\n*   **DomainParticipant** connects to **ContentFilteredTopic** (Solid line labeled `((create))`).\n*   **DomainParticipant** connects to **TopicDescription** (Solid line with hollow triangle arrowhead pointing to TopicDescription).\n*   **DomainParticipant** connects to **MultiTopic** (Solid line labeled `((create))`).\n*   **TopicDescription** connects to **MultiTopic** (Solid line with hollow triangle arrowhead pointing to MultiTopic).\n*   **Topic** connects to **TopicDescription** (Solid line with arrowhead pointing to TopicDescription; multiplicity `1` at TopicDescription end).\n*   **Topic** connects to **DomainEntity** (Solid line with hollow triangle arrowhead pointing to DomainEntity).\n*   **DataWriter** connects to **Topic** (Solid line with arrowhead pointing to Topic; multiplicity `1` at Topic end, `*` at DataWriter end).\n*   **Topic** connects to **QosPolicy** (Solid line with arrowhead pointing to QosPolicy; multiplicity `*` at QosPolicy end).\n*   **Topic** connects to **TopicListener** (Solid line with arrowhead pointing to TopicListener; multiplicity `0..1` at TopicListener end).\n*   **Topic** connects to **StatusCondition** (Solid line with arrowhead pointing to StatusCondition; multiplicity `1` at StatusCondition end).\n*   **StatusCondition** connects to **WaitSet** (Dashed line with arrowheads on both ends; multiplicity `*` at both ends).\n*   **TopicDescription** connects to **TypeSupport** (Solid line with hollow triangle arrowhead pointing to TypeSupport).](.vortex-opensplice-c-reference-guide/526048b4762c7213072e6e370459139c016e64f402c4cf3c4d94d0fc3226f6a6.jpg)

Figure 16: DCPS Topic-Definition Module Class Model

This module contains the following classes:

• DDS\_TopicDescription (abstract)
• DDS\_Topic
• DDS\_ContentFilteredTopic
• DDS\_MultiTopic
• DDS\_TopicListener (interface)
• Topic-Definition type specific classes.

“Topic-Definition type specific classes” contains the generic class and the generated data type specific classes. For each data type, a data type specific class &lt;NameSpace&gt;\_&lt;type&gt;TypeSupport is generated (based on IDL) by calling the pre-processor.

![Based on the provided UML class diagram, here is the accurate description of the blocks and connections:\n\n**Labeled Blocks:**\n\n1.  **`((Interface)) TypeSupport`**: Contains methods `get_type_name()` and `register_type()`.\n2.  **`FooTypeSupport`**: Contains methods `get_type_name()` and `register_type()`.\n3.  **`DataWriter (from Publication Module)`**: A class/interface block.\n4.  **`FooDataWriter`**: Contains methods `dispose()`, `dispose_w_timestamp()`, `get_key_value()`, `register()`, `register_w_timestamp()`, `unregister()`, `unregister_w_timestamp()`, `write()`, and `write_w_timestamp()`.\n5.  **`DataReader (from Subscription Module)`**: A class/interface block.\n6.  **`FooDataReader`**: Contains methods `get_key_value()`, `read()`, `read_instance()`, `read_next_instance()`, `read_next_instance_w_condition()`, `read_next_sample()`, `read_w_condition()`, `return_loan()`, `take()`, `take_instance()`, `take_next_instance()`, `take_next_instance_w_condition()`, `take_next_sample()`, and `take_w_condition()`.\n7.  **`Foo`**: A class block at the bottom with an empty body section.\n\n**Connections:**\n\n*   **Inheritance (Generalization):**\n    *   An upward arrow connects **`FooTypeSupport`** to **`((Interface)) TypeSupport`**.\n    *   An upward arrow connects **`FooDataWriter`** to **`DataWriter (from Publication Module)`**.\n    *   An upward arrow connects **`FooDataReader`** to **`DataReader (from Subscription Module)`**.\n\n*   **Dependencies/Associations:**\n    *   A line connects **`FooTypeSupport`** to **`Foo`** (tracing down and turning right with an arrow pointing left into `Foo`).\n    *   A line connects **`FooDataWriter`** to **`Foo`** (tracing straight down with an arrow pointing down into `Foo`).\n    *   A line connects **`FooDataReader`** to **`Foo`** (tracing down and turning left with an arrow pointing right into `Foo`).](.vortex-opensplice-c-reference-guide/790d371670cf040126c32c1cc6c23cadc1df29154591d8d2f0bc2ac8f0b0ba3e.jpg)

Figure 17: Pre-processor Generation of the Typed Classes for Data Type “Foo”

For instance, for the user-defined data type Foo (this also applies to other types), defined in the module SPACE; “Topic-Definition type specific classes” contains the following classes:

• DDS\_TypeSupport (abstract)
• SPACE\_FooTypeSupport.

DDS\_Topic objects conceptually fit between publications and subscriptions. Publications must be known in such a way that subscriptions can refer to them unambiguously. A DDS\_Topic is meant to fulfil that purpose: it associates a name (unique in the Domain), a data type, and DDS\_TopicQos related to the data itself.

# 3.3.1 Class DDS\_TopicDescription (abstract)

T h i s c l a s s i s a n a b s t r a c t c l a s s . I t i s t h e b a s e c l a s s f o r D D S \_ T o p i c , DDS\_ContentFilteredTopic and DDS\_MultiTopic.

The DDS\_TopicDescription attribute type\_name defines an unique data type that is made available to the Data Distribution Service via the DDS\_TypeSupport. DDS\_TopicDescription has also a name that allows it to be retrieved locally.

The interface description of this class is as follows:

```c
/*
 * interface DDS_TopicDescription
 */
/*
 * implemented API operations
 */
DDS_string
DDS_TopicDescription_get_type_name
(DDS_TopicDescription _this);

DDS_string
DDS_TopicDescription_get_name
(DDS_TopicDescription _this);

DDS_DomainParticipant
DDS_TopicDescription_get_participant
(DDS_TopicDescription _this);
```

The next paragraphs describe the usage of all DDS\_TopicDescription operations.

# 3.3.1.1 DDS\_TopicDescription\_get\_name

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
DDS_string
DDS_TopicDescription_get_name
(DDS_TopicDescription _this);
```

# Description

This operation returns the name used to create the DDS\_TopicDescription.

# Parameters

in DDS\_TopicDescription \_this - the DDS\_TopicDescription object on which the operation is operated.

# Return Value

DDS\_string - the name of the DDS\_TopicDescription.

# Detailed Description

This operation returns the name used to create the DDS\_TopicDescription.

# 3.3.1.2 DDS\_TopicDescription\_get\_participant

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
```

```txt
DDS_DomainParticipant
DDS_TopicDescription_get_participant
(DDS_TopicDescription _this);
```

# Description

This operation returns the DDS\_DomainParticipant associated with the DDS\_TopicDescription or the DDS\_OBJECT\_NIL pointer.

# Parameters

in DDS\_TopicDescription \_this - the DDS\_TopicDescription object on which the operation is operated.

# Return Value

DDS\_DomainParticipant - a pointer to the DDS\_DomainParticipant associated with the DDS\_TopicDescription or the DDS\_OBJECT\_NIL pointer.

# Detailed Description

This operation returns the DDS\_DomainParticipant associated with the D D S\_ T o p i c D es c r i p t io n . N o t e t h a t t h e r e i s e x a c t l y o n e DDS\_DomainParticipant associated with each DDS\_TopicDescription. When the DDS\_TopicDescription was already deleted (there is no associated DDS\_DomainParticipant any more), the DDS\_OBJECT\_NIL pointer is returned.

# 3.3.1.3 DDS\_TopicDescription\_get\_type\_name

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
DDS_string
DDS_TopicDescription_get_type_name
(DDS_TopicDescription _this);
```

# Description

This operation returns the registered name of the data type associated with the DDS\_TopicDescription.

# Parameters

in DDS\_TopicDescription \_this - the DDS\_TopicDescription object on which the operation is operated.

# Return Value

D D S \_ s t r i n g - r e t u r n v a l u e i s t h e n a m e o f t h e d a t a t y p e o f t h e DDS\_TopicDescription.

# Detailed Description

This operation returns the registered name of the data type associated with the DDS\_TopicDescription.

# 3.3.2 Class DDS\_Topic

DDS\_Topic is the most basic description of the data to be published and subscribed.

A DDS\_Topic is identified by its name, which must be unique in the whole Domain. In addition (by virtue of extending DDS\_TopicDescription) it fully identifies the type of data that can be communicated when publishing or subscribing to the DDS\_Topic.

DDS\_Topic is the only DDS\_TopicDescription that can be used for publications and therefore a specialized DDS\_DataWriter is associated to the DDS\_Topic.

The interface description of this class is as follows:

```c
/*
 * interface DDS_Topic
 */
/*
 * inherited from class DDS_Entity
 */
/* DDS_StatusCondition
 *    DDS_Topic_get_statuscondition
 *    (DDS_Topic _this);
 */
/* DDS_StatusMask
 *    DDS_Topic_get_status_changes
 *    (DDS_Topic _this);
 */
/* DDS_ReturnCode_t
 *    DDS_Topic_enable
 *    (DDS_Topic _this);
 */
/*
 * inherited from class DDS_TopicDescription
 */
/* DDS_string
 *    DDS_Topic_get_type_name
 *    (DDS_Topic _this);
 */
/* DDS_string
 *    DDS_Topic_get_name
 *    (DDS_Topic _this);
 */
/* DDS_DomainParticipant
```

```c
* DDS_Topic_get_participant
* (DDS_Topic _this);
*/
/*
* implemented API operations
*/
DDS_ReturnCode_t
DDS_Topic_set_qos
(DDS_Topic _this,
const DDS_TopicQos *qos);
DDS_ReturnCode_t
DDS_Topic_get_qos
(DDS_Topic _this,
DDS_TopicQos *qos);
DDS_ReturnCode_t
DDS_Topic_set_listener
(DDS_Topic _this,
const struct DDS_TopicListener *a_listener,
const DDS_StatusMask mask);
struct DDS_TopicListener
DDS_Topic_get_listener
(DDS_Topic _this);
DDS_ReturnCode_t
DDS_Topic_get_inconsistent_topic_status
(DDS_Topic _this,
DDS_InconsistentTopicStatus *a_status);
DDS_ReturnCode_t dispose_all_data();
```

The next paragraphs describe the usage of all DDS\_Topic operations. The inherited operations are listed but not fully described because they are not implemented in this class. The full description of these operations is given in the classes from which they are inherited.

# 3.3.2.1 DDS\_Topic\_enable (inherited)

This operation is inherited and therefore not described here. See the class DDS\_Entity for further explanation.

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
DDS_ReturnCode_t
DDS_Topic_enable
(DDS_Topic _this);
```

NOTE: This operation is not yet implemented. It is scheduled for a future release.

# 3.3.2.2 DDS\_Topic\_get\_inconsistent\_topic\_status

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
DDS_ReturnCode_t
DDS_Topic_get_inconsistent_topic_status
(DDS_Topic _this,
DDS_InconsistentTopicStatus *a_status);
```

# Description

This operation obtains the DDS\_InconsistentTopicStatus of the DDS\_Topic.

# Parameters

in DDS\_Topic \_this - the DDS\_Topic object on which the operation is operated.

inout DDS\_InconsistentTopicStatus \*a\_status - the contents of the DDS\_InconsistentTopicStatus struct of the DDS\_Topic will be copied into the location specified by a\_status.

# Return Value

DDS\_ReturnCode\_t - Possible return codes of the operation are: DDS\_RETCODE\_OK, DDS\_RETCODE\_ERROR, DDS\_RETCODE\_ILLEGAL OPERATION, DDS\_RETCODE\_ALREADY\_DELETED or DDS\_RETCODE\_ OUT\_OF\_RESOURCES.

# Detailed Description

This operation obtains the DDS\_InconsistentTopicStatus of the DDS\_Topic. The DDS\_InconsistentTopicStatus can also be monitored using a DDS\_TopicListener or by using the associated DDS\_StatusCondition.

# Return Code

When the operation returns:

• DDS\_RETCODE\_OK - the current DDS\_InconsistentTopicStatus of this DDS\_Topic has successfully been copied into the specified a\_status parameter.
• DDS\_RETCODE\_ERROR - an internal error has occurred.
• DDS\_RETCODE\_ILLEGAL\_OPERATION - the operation is invoked on an inappropriate object.
• DDS\_RETCODE\_ALREADY\_DELETED - the DDS\_Topic has already been deleted.
• DDS\_RETCODE\_OUT\_OF\_RESOURCES - the Data Distribution Service ran out of resources to complete this operation.

# 3.3.2.3 DDS\_Topic\_get\_listener

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
struct DDS_TopicListener
DDS_Topic_get_listener
(DDS_Topic _this);
```

# Description

This operation allows access to a DDS\_TopicListener.

# Parameters

in DDS\_Topic \_this - the DDS\_Topic object on which the operation is operated.

# Return Value

struct DDS\_TopicListener - to the DDS\_TopicListener attached to the DDS\_Topic.

# Detailed Description

This operation allows access to a DDS\_TopicListener attached to the DDS\_Topic. When no DDS\_TopicListener was attached to the DDS\_Topic, the DDS\_OBJECT\_NIL pointer is returned.

# 3.3.2.4 DDS\_Topic\_get\_name (inherited)

This operation is inherited and therefore not described here. See the class DDS\_TopicDescription for further explanation.

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
DDS_string
DDS_Topic_get_name
(DDS_Topic _this);
```

# 3.3.2.5 DDS\_Topic\_get\_participant (inherited)

This operation is inherited and therefore not described here. See the class DDS\_TopicDescription for further explanation.

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
DDS_DomainParticipant
DDS_Topic_get_participant
(DDS_Topic_this);
```

# 3.3.2.6 DDS\_Topic\_get\_qos

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
DDS_ReturnCode_t
DDS_Topic_get_qos
(DDS_Topic_this,
DDS_TopicQos *qos);
```

# Description

This operation allows access to the existing set of QoS policies for a DDS\_Topic.

# Parameters

in DDS\_Topic \_this - the DDS\_Topic object on which the operation is operated.

inout DDS\_TopicQos \*qos - a pointer to the destination DDS\_TopicQos struct in which the QosPolicy settings will be copied.

# Return Value

DDS\_ReturnCode\_t - Possible return codes of the operation are: DDS\_RETCODE\_OK, DDS\_RETCODE\_ERROR, DDS\_RETCODE\_ILLEGAL OPERATION, DDS\_RETCODE\_ALREADY\_DELETED or DDS\_RETCODE\_ OUT\_OF\_RESOURCES.

# Detailed Description

This operation allows access to the existing set of QoS policies of a DDS\_Topic on which this operation is used. This DDS\_TopicQos is stored at the location pointed to by the qos parameter.

# Return Code

When the operation returns:

• DDS\_RETCODE\_OK - the existing set of QoS policy values applied to this DDS\_Topic has successfully been copied into the specified DDS\_TopicQos parameter.
• DDS\_RETCODE\_ERROR - an internal error has occurred.
• DDS\_RETCODE\_ILLEGAL\_OPERATION - the operation is invoked on an inappropriate object.
• DDS\_RETCODE\_ALREADY\_DELETED - the DDS\_Topic has already been deleted.
• DDS\_RETCODE\_OUT\_OF\_RESOURCES - the Data Distribution Service ran out of resources to complete this operation.

# 3.3.2.7 DDS\_Topic\_get\_status\_changes (inherited)

This operation is inherited and therefore not described here. See the class DDS\_Entity for further explanation.

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
DDS_StatusMask
DDS_Topic_get_status_changes
(DDS_Topic _this);
```

# 3.3.2.8 DDS\_Topic\_get\_statuscondition (inherited)

This operation is inherited and therefore not described here. See the class DDS\_Entity for further explanation.

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
DDS_StatusCondition
DDS_Topic_get_statuscondition
(DDS_Topic_this);
```

# 3.3.2.9 DDS\_Topic\_get\_type\_name (inherited)

This operation is inherited and therefore not described here. See the class DDS\_TopicDescription for further explanation.

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
DDS_string
DDS_Topic_get_type_name
(DDS_Topic _this);
```

# 3.3.2.10 DDS\_Topic\_set\_listener

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
DDS_ReturnCode_t
DDS_Topic_set_listener
(DDS_Topic _this,
const struct DDS_TopicListener *a_listener,
const DDS_StatusMask mask);
```

# Description

This operation attaches a DDS\_TopicListener to the DDS\_Topic.

# Parameters

in DDS\_Topic \_this - the DDS\_Topic object on which the operation is operated.
in const struct DDS\_TopicListener \*a\_listener - a pointer to the DDS\_TopicListener instance, which will be attached to the DDS\_Topic.
in const DDS\_StatusMask mask - a bit-mask in which each bit enables the invocation of the DDS\_TopicListener for a certain status.

# Return Value

D D S \_ R e t u r n C o d e \_ t - P o s s i b l e r e t u r n c o d e s o f t h e o p e r a t i o n a r e : DDS\_RETCODE\_OK, DDS\_RETCODE\_ERROR, DDS\_RETCODE\_ILLEGAL\_ OPERATION, DDS\_RETCODE\_ALREADY\_DELETED or DDS\_RETCODE\_ OUT\_OF\_RESOURCES.

# Detailed Description

This operation attaches a DDS\_TopicListener to the DDS\_Topic. Only one D D S\_ T o p i c Li s t e n e r c an b e a t t a c h e d t o e a c h DD S \_ T o p i c. I f a DDS\_TopicListener was already attached, the operation will replace it with the new one. When a\_listener is the DDS\_OBJECT\_NIL pointer, it represents a listener that is treated as a NOOP1 for all statuses activated in the bitmask.

# Communication Status

For each communication status, the StatusChangedFlag flag is initially set to FALSE. It becomes TRUE whenever that plain communication status changes. For each plain communication status activated in the mask, the associated DDS\_TopicListener operation is invoked and the communication status is reset to FALSE, as the listener implicitly accesses the status which is passed as a parameter to that operation. The status is reset prior to calling the listener, so if the application calls the get\_&lt;status\_name&gt; from inside the listener it will see the status already reset. An exception to this rule is the DDS\_OBJECT\_NIL listener, which does not reset the communication statuses for which it is invoked.

The following statuses are applicable to the DDS\_TopicListener:

• DDS\_INCONSISTENT\_TOPIC\_STATUS.

Status bits are declared as a constant and can be used by the application in an OR operation to create a tailored mask. The special constant DDS\_STATUS\_MASK\_NONE can be used to indicate that the created entity should not respond to any of its available statuses. The DDS will therefore attempt to propagate these statuses to its factory. The special constant STATUS\_MASK\_ANY\_V1\_2 can be used to select all statuses specified in the “Data Distribution Service for Real-time Systems Version 1.2” specification.

# Status Propagation

In case a communication status is not activated in the m a sk of the DDS\_TopicListener, the DDS\_DomainParticipantListener of the containing DDS\_DomainParticipant is invoked (if attached and activated for the status that occurred). This allows the application to set a default behaviour in the DDS\_DomainParticipantListener o f t h e c o n t a i n i n g DDS\_DomainParticipant and a DDS\_Topic specific behaviour when needed. In case the DDS\_DomainParticipantListener is also not attached or the communication status is not activated in its mask, the application is not notified of the change.

# Return Code

When the operation returns:

• DDS\_RETCODE\_OK - the DDS\_TopicListener is attached.
• DDS\_RETCODE\_ERROR - an internal error has occurred.
• DDS\_RETCODE\_ILLEGAL\_OPERATION - the operation is invoked on an inappropriate object.
• DDS\_RETCODE\_ALREADY\_DELETED - the DDS\_Topic has already been deleted.
• DDS\_RETCODE\_OUT\_OF\_RESOURCES - the Data Distribution Service ran out of resources to complete this operation.

# 3.3.2.11 DDS\_Topic\_set\_qos

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
DDS_ReturnCode_t
DDS_Topic_set_qos
(DDS_Topic _this,
const DDS_TopicQos *qos);
```

# Description

This operation replaces the existing set of QosPolicy settings for a DDS\_Topic.

# Parameters

in DDS\_Topic \_this - the DDS\_Topic object on which the operation is operated.

in const DDS\_TopicQos \*qos - new set of QosPolicy settings for the DDS\_Topic.

# Return Value

DDS\_ReturnCode\_t - Possible return codes of the operation are: DDS\_RETCODE\_OK, DDS\_RETCODE\_ERROR, DDS\_RETCODE\_ILLEGAL\_ OPERATION, DDS\_RETCODE\_BAD\_PARAMETER, DDS\_RETCODE\_ UNSUPPORTED, DDS\_RETCODE\_ALREADY\_DELETED, DDS\_RETCODE\_ OUT\_OF\_RESOURCES, DDS\_RETCODE\_IMMUTABLE\_POLICY or DDS\_RETCODE\_INCONSISTENT\_POLICY.

# Detailed Description

This replaces the existing set of QosPolicy settings for a DDS\_Topic. The parameter qos must contain the struct with the QosPolicy settings which is checked for self-consistency and mutability. When the application tries to change a QosPolicy setting for an enabled DDS\_Topic, which can only be set before the D D S \_ T o p i c i s e n a b l e d , t h e o p e r a t i o n w i l l f a i l a n d a DDS\_RETCODE\_IMMUTABLE\_POLICY is returned. In other words, the application must provide the currently set QosPolicy settings in case of the immutable QosPolicy settings. Only the mutable QosPolicy settings can be changed. When qos contains conflicting QosPolicy settings (not self-consistent), the operation will fail and a DDS\_RETCODE\_INCONSISTENT\_POLICY is returned.

The set of QosPolicy settings specified by the qos parameter are applied on top of the existing QoS, replacing the values of any policies previously set (provided, the operation returned DDS\_RETCODE\_OK).

# Return Code

When the operation returns:

• DDS\_RETCODE\_OK - the new DDS\_TopicQos is set.
• DDS\_RETCODE\_ERROR - an internal error has occurred.
• DDS\_RETCODE\_ILLEGAL\_OPERATION - the operation is invoked on an inappropriate object.
• DDS\_RETCODE\_BAD\_PARAMETER - the parameter qos is not a valid DDS\_TopicQos. It contains a QosPolicy setting with an invalid DDS\_Duration\_t value, an enum value that is outside its legal boundaries or a sequence that has inconsistent memory settings.
• DDS\_RETCODE\_UNSUPPORTED - one or more of the selected QosPolicy values are currently not supported by OpenSplice.
• DDS\_RETCODE\_ALREADY\_DELETED - the DDS\_Topic has already been deleted.

• DDS\_RETCODE\_OUT\_OF\_RESOURCES - the Data Distribution Service ran out of resources to complete this operation.
• DDS\_RETCODE\_IMMUTABLE\_POLICY - the parameter qos contains an immutable QosPolicy setting with a different value than set during enabling of the DDS\_Topic.
• DDS\_RETCODE\_INCONSISTENT\_POLICY - the parameter qos contains conflicting QosPolicy settings, e.g. a history depth that is higher than the specified resource limits.

# 3.3.2.12 DDS\_Topic\_dispose\_all\_data

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
DDS_ReturnCode_t dispose_all_data();
```

# Description

This operation allows the application to dispose of all of the instances for a particular topic without the network overhead of using a separate dispose call for each instance.

# Parameters

```txt
&lt;none&gt;
```

# Return Value

```txt
DDS_ReturnCode_t - Possible return codes of the operation are:
DDS_RETCODE_OK, DDS_RETCODE_ERROR,
DDS_RETCODE_OUT_OF_RESOURCES, DDS_RETCODE_ALREADY_DELETED,
DDS_RETCODE_NOT_ENABLED.
```

# DetailedDescription

This operation allows the application to dispose of all of the instances for a particular topic without the network overhead of using a separate dispose call for each instance. Its effect is equivalent to invoking a separate dispose operation for each individual instance on the DataWriter that owns it. (See the description of FooDataWriter.dispose in Section 3.4.2.33, SPACE\_FooDataWriter\_dispose, on page 349.)

(The dispose\_all\_data is an asynchronous C&M operation that is not part of a coherent update; it operates on the DataReaders history cache and not on the incomplete transactions. The dispose\_all\_data is effectuated as soon as a transaction becomes complete and is inserted into the DataReaders history cache; at that point messages will be inserted according to the destination\_order qos p o l ic y. F or B Y \_ S OU R C E \_ T IM E S T A M P all messa ges olde r than the dispose\_all\_data will be disposed and all newer will be alive; for BY\_RECEPTION\_TIMESTAMP all messages will be alive if the transaction is completed after receiving the dispose\_all\_data command.)

![The image displays a standard warning sign. It is an equilateral triangle with a thick red border and a white interior. Centered inside the triangle is a black exclamation point.](.vortex-opensplice-c-reference-guide/55991d802a5aae8c472f1e6f293c2af247b6849dc55859bd8434ac84e06e6efd.jpg)

This operation only sets the instance state of the instances concerned to NOT\_ALIVE\_DISPOSED. It does not unregister the instances, and so does not automatically clean up the memory that is claimed by the instances in both the DataReaders and DataWriters.

# Blocking

The blocking (or nonblocking) behaviour of this call is undefined.

# Concurrency

If there are subsequent calls to this function before the action has been completed (completion of the disposes on all nodes, not simply return from the function), then the behaviour is undefined.

# Other notes

The effect of this call on disposed\_generation\_count, generation\_rank and absolute\_generation\_rank is undefined.

# Return Code

• DDS\_RETCODE\_OK - a request to dispose the topic has been sucessfully queued.
• DDS\_RETCODE\_ERROR - and internal error has occured.
• DDS\_RETCODE\_OUT\_OF\_RESOURCES - the Data Distribution Service ran out of resources to complete this operation.
• DDS\_RETCODE\_ALREADY\_DELETED - the topic has already been deleted.
• DDS\_RETCODE\_NOT\_ENABLED - the topic is not enabled.

# 3.3.3 Class DDS\_ContentFilteredTopic

DDS\_ContentFilteredTopic is a specialization of DDS\_TopicDescription that allows for content based subscriptions.

DDS\_ContentFilteredTopic describes a more sophisticated subscription that indicates the DDS\_Subscriber does not necessarily want to see all values of each instance published under the DDS\_Topic. Rather, it only wants to see the values whose contents satisfy certain criteria. Therefore this class must be used to request content-based subscriptions.

The selection of the content is done using the SQL based filter with parameters to adapt the filter clause.

Appendix H, DCPS Queries and Filters describes the syntax of the SQL based filter and the parameters.

The interface description of this class is as follows:

```c
/*
 * interface DDS_ContentFilteredTopic
 */
/*
 * inherited from class DDS_TopicDescription
 */
/* DDS_string
 *    DDS_ContentFilteredTopic_get_type_name
 *    (DDS_ContentFilteredTopic _this);
 */
/* DDS_string
 *    DDS_ContentFilteredTopic_get_name
 *    (DDS_ContentFilteredTopic _this);
 */

/* DDS_DomainParticipant
 *    DDS_ContentFilteredTopic_get_participant
 *    (DDS_ContentFilteredTopic _this);
 */
/*
 * implemented API operations
 */
DDS_string
DDS_ContentFilteredTopic_get_filter_expression
(DDS_ContentFilteredTopic _this);

DDS_ReturnCode_t
DDS_ContentFilteredTopic_get_expression_parameters
(DDS_ContentFilteredTopic _this,
DDS_StringSeq *expression_parameters);

DDS_ReturnCode_t
DDS_ContentFilteredTopic_set_expression_parameters
(DDS_ContentFilteredTopic _this,
const DDS_StringSeq *expression_parameters);

DDS_Topic
DDS_ContentFilteredTopic_get_related_topic
(DDS_ContentFilteredTopic _this);
*/
```

The next paragraphs describe the usage of all DDS\_ContentFilteredTopic operations.

# 3.3.3.1 DDS\_ContentFilteredTopic\_get\_expression\_parameters

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
DDS_ReturnCode_t
DDS_ContentFilteredTopic_get_expression_parameters
(DDS_ContentFilteredTopic _this,
DDS_StringSeq *expression_parameters);
```

# Description

This operation obtains the expression parameters associated with the DDS\_ContentFilteredTopic.

# Parameters

```txt
in DDS_ContentFilteredTopic _this - the DDS_ContentFilteredTopic object on which the operation is operated.
```

inout DDS\_StringSeq \*expression\_parameters - a handle to a sequence of strings that will be used to store the parameters used in the SQL expression.

# Return Value

```txt
DDS_ReturnCode_t - Possible return codes of the operation are: DDS_RETCODE_OK, DDS_RETCODE_ERROR, DDS_RETCODE_ILLEGAL_OPERATION, DDS_RETCODE_ALREADY_DELETED or DDS_RETCODE_OUT_OF_RESOURCES.
```

# Detailed Description

This operation obtains the expression parameters associated with the DDS\_ContentFilteredTopic. That is, the parameters specified on the last successful call to DDS\_ContentFilteredTopic\_set\_expression\_ parameters, or if DDS\_ContentFilteredTopic\_set\_expression\_ p a r a m e t e r s w a s n e v e r c a l l e d , t h e p a r a m e t e r s s p e c i f i e d w h e n t h e DDS\_ContentFilteredTopic was created.

The resulting handle contains a sequence of strings with the parameters used in the SQL expression (i.e., the %n tokens in the expression). The number of parameters in the result sequence will exactly match the number of %n tokens in the filter expression associated with the DDS\_ContentFilteredTopic.

# Return Code

When the operation returns:

• DDS\_RETCODE\_OK - the existing set of expression parameters applied to this DDS\_ContentFilteredTopic has successfully been copied into the specified expression\_parameters parameter.
• DDS\_RETCODE\_ERROR - an internal error has occurred.
• DDS\_RETCODE\_ILLEGAL\_OPERATION - the operation is invoked on an inappropriate object.
• DDS\_RETCODE\_ALREADY\_DELETED - the DDS\_ContentFilteredTopic has already been deleted.
• DDS\_RETCODE\_OUT\_OF\_RESOURCES - the Data Distribution Service ran out of resources to complete this operation.

# 3.3.3.2 DDS\_ContentFilteredTopic\_get\_filter\_expression

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
DDS_string
DDS_ContentFilteredTopic_get_filter_expression
(DDS_ContentFilteredTopic_this);
```

# Description

This operation returns the filter\_expression associated with the DDS\_ContentFilteredTopic.

# Parameters

in DDS\_ContentFilteredTopic \_this - the DDS\_ContentFilteredTopic object on which the operation is operated.

# Return Value

DDS\_string - result is a handle to a string which holds the SQL filter expression.

# Detailed Description

This operation returns the filter\_expression associated with the DDS\_ContentFilteredTopic. That is, the expression specified when the DDS\_ContentFilteredTopic was created.

The filter expression result is a string that specifies the criteria to select the data samples of interest. It is similar to the WHERE clause of an SQL expression.

# 3.3.3.3 DDS\_ContentFilteredTopic\_get\_name (inherited)

This operation is inherited and therefore not described here. See the class DDS\_TopicDescription for further explanation.

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
DDS_string
DDS_ContentFilteredTopic_get_name
(DDS_ContentFilteredTopic _this);
```

# 3.3.3.4 DDS\_ContentFilteredTopic\_get\_participant (inherited)

This operation is inherited and therefore not described here. See the class DDS\_TopicDescription for further explanation.

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
DDS_DomainParticipant
DDS_ContentFilteredTopic_get_participant
(DDS_ContentFilteredTopic _this);
```

# 3.3.3.5 DDS\_ContentFilteredTopic\_get\_related\_topic

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
DDS_Topic
DDS_ContentFilteredTopic_get_related_topic
(DDS_ContentFilteredTopic _this);
```

# Description

T h i s o p e r a t i o n r e t u r n s t h e D D S \_ T o p i c a s s o c i a t e d w i t h t h e DDS\_ContentFilteredTopic.

# Parameters

in DDS\_ContentFilteredTopic \_this - the DDS\_ContentFilteredTopic object on which the operation is operated.

# Return Value

DDS\_Topic - result is a handle to the base topic on which the filtering will be applied.

# Detailed Description

T h i s o p e r a t i o n r e t u r n s t h e D D S \_ T o p i c a s s o c i a t e d w i t h t h e DDS\_ContentFilteredTopic. That is, the DDS\_Topic specified when the DDS\_ContentFilteredTopic was created. This DDS\_Topic is the base topic on which the filtering will be applied.

# 3.3.3.6 DDS\_ContentFilteredTopic\_get\_type\_name (inherited)

This operation is inherited and therefore not described here. See the class DDS\_TopicDescription for further explanation.

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
DDS_string
DDS_ContentFilteredTopic_get_type_name
(DDS_ContentFilteredTopic _this);
```

# 3.3.3.7 DDS\_ContentFilteredTopic\_set\_expression\_parameters

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
DDS_ReturnCode_t
DDS_ContentFilteredTopic_set_expression_parameters
(DDS_ContentFilteredTopic _this,
const DDS_StringSeq *expression_parameters);
```

NOTE: This operation is not yet implemented. It is scheduled for a future release.

# 3.3.4 Class DDS\_MultiTopic

DDS\_MultiTopic is a specialization of DDS\_TopicDescription that allows subscriptions to combine, filter and/or rearrange data coming from several DDS\_Topics.

DDS\_MultiTopic allows a more sophisticated subscription that can select and combine data received from multiple DDS\_Topics into a single data type (specified by the inherited type\_name). The data will then be filtered (selection) and possibly re-arranged (aggregation and/or projection) according to an SQL expression with parameters to adapt the filter clause.

The interface description of this class is as follows:

```c
/*
 * interface DDS_MultiTopic
 */
/*
 * inherited from class DDS_TopicDescription
 */
/* DDS_string
 *    DDS_MultiTopic_get_type_name
 *    (DDS_MultiTopic _this);
 */
/* DDS_string
 *    DDS_MultiTopic_get_name
 *    (DDS_MultiTopic _this);
 */
```

```c
/* DDS_DomainParticipant
*    DDS_MultiTopic_get_participant
*    (DDS_MultiTopic _this);
*/
/*
* implemented API operations
*/
DDS_string
DDS_MultiTopic_get Subscription_expression
(DDS_MultiTopic _this);

DDS_ReturnCode_t
DDS_MultiTopic_get_expression_parameters
(DDS_MultiTopic _this,
DDS_StringSeq *expression_parameters);

DDS_ReturnCode_t
DDS_MultiTopic_set_expression_parameters
(DDS_MultiTopic _this,
const DDS_StringSeq *expression_parameters);
```

The next paragraphs describe the usage of all DDS\_MultiTopic operations. The inherited operations are listed but not fully described because they are not implemented in this class. The full description of these operations is given in the classes from which they are inherited.

NOTE: DDS\_MultiTopic operations have not been yet been implemented. Multitopic functionality is scheduled for a future release.

# 3.3.4.1 DDS\_MultiTopic\_get\_expression\_parameters

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
DDS_ReturnCode_t
DDS_MultiTopic_get_expression_parameters
(DDS_MultiTopic _this,
DDS_StringSeq *expression_parameters);
```

NOTE: This operation is not yet implemented. It is scheduled for a future release.

# Description

This operation returns the expression parameters associated with the DDS\_MultiTopic.

# Parameters

in DDS\_MultiTopic \_this - the DDS\_MultiTopic object on which the operation is operated.

inout DDS\_StringSeq \*expression\_parameters - a handle to a sequence of strings that will be used to store the parameters used in the SQL expression.

# Return Value

D D S \_ R e t u r n C o d e \_ t - P o s s i b l e r e t u r n c o d e s o f t h e o p e r a t i o n a r e : DDS\_RETCODE\_OK, DDS\_RETCODE\_ERROR, DDS\_RETCODE\_ILLEGAL\_ OPERATION, DDS\_RETCODE\_ALREADY\_DELETED or DDS\_RETCODE\_ OUT\_OF\_RESOURCES.

# Detailed Description

This operation obtains the expression parameters associated with the DDS\_MultiTopic. That is, the parameters specified on the last successful call to DDS\_MultiTopic\_set\_expression\_parameters, o r i f DDS\_MultiTopic\_set\_expression\_parameters was never called, the parameters specified when the DDS\_MultiTopic was created.

The resulting handle contains a sequence of strings with the values of the parameters used in the SQL expression (i.e., the %n tokens in the expression). The number of parameters in the result sequence will exactly match the number of %n tokens in the filter expression associated with the DDS\_MultiTopic.

# Return Code

When the operation returns:

• DDS\_RETCODE\_OK - the existing set of expression parameters applied to this DDS\_MultiTopic has successfully been copied into the specified expression\_parameters parameter.
• DDS\_RETCODE\_ERROR - an internal error has occurred.
• DDS\_RETCODE\_ILLEGAL\_OPERATION - the operation is invoked on an inappropriate object.
• DDS\_RETCODE\_ALREADY\_DELETED - the DDS\_MultiTopic has already been deleted.
• DDS\_RETCODE\_OUT\_OF\_RESOURCES - the Data Distribution Service ran out of resources to complete this operation.

# 3.3.4.2 DDS\_MultiTopic\_get\_name (inherited)

This operation is inherited and therefore not described here. See the class DDS\_TopicDescription for further explanation.

# Synopsis

#include &lt;dds\_dcps.h&gt; DDS\_string

```txt
DDS_MultiTopic_get_name
(DDS_MultiTopic_this);
```

NOTE: This operation is not yet implemented. It is scheduled for a future release.

# 3.3.4.3 DDS\_MultiTopic\_get\_participant (inherited)

This operation is inherited and therefore not described here. See the class DDS\_TopicDescription for further explanation.

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
DDS_DomainParticipant
DDS_MultiTopic_get_participant
(DDS_MultiTopic_this);
```

NOTE: This operation is not yet implemented. It is scheduled for a future release.

# 3.3.4.4 DDS\_MultiTopic\_get\_subscription\_expression

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
DDS_string
DDS_MultiTopic_get Subscription_expression
(DDS_MultiTopic _this);
```

NOTE: This operation is not yet implemented. It is scheduled for a future release.

# Description

This operation returns the subscription expression associated with the DDS\_MultiTopic.

# Parameters

in DDS\_MultiTopic \_this - is the DDS\_MultiTopic object on which the operation is operated.

# Return Value

DDS\_string - a handle to a string which holds the SQL subscription expression.

# Detailed Description

This operation returns the subscription expression associated with the DDS\_MultiTopic. That is, the expression specified when the DDS\_MultiTopic was created.

The subscription expression result is a string that specifies the criteria to select the data samples of interest. In other words, it identifies the selection and rearrangement of data from the associated DDS\_Topics. It is an SQL expression where the

SELECT clause provides the fields to be kept, the FROM part provides the names of the DDS\_Topics that are searched for those fields, and the WHERE clause gives the content filter. The DDS\_Topics combined may have different types but they are restricted in that the type of the fields used for the NATURAL JOIN operation must be the same.

# 3.3.4.5 DDS\_MultiTopic\_get\_type\_name (inherited)

This operation is inherited and therefore not described here. See the class DDS\_TopicDescription for further explanation.

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
DDS_string
DDS_MultiTopic_get_type_name
(DDS_MultiTopic _this);
```

NOTE: This operation is not yet implemented. It is scheduled for a future release.

# 3.3.4.6 DDS\_MultiTopic\_set\_expression\_parameters

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
DDS_ReturnCode_t
DDS_MultiTopic_set_expression_parameters
(DDS_MultiTopic _this,
const DDS_StringSeq *expression_parameters);
```

NOTE: This operation is not yet implemented. It is scheduled for a future release.

# Description

This operation changes the expression parameters associated with the DDS\_MultiTopic.

# Parameters

in DDS\_MultiTopic \_this - the DDS\_MultiTopic object on which the operation is operated.

in const DDS\_StringSeq \*expression\_parameters - the handle to a sequence of strings with the parameters used in the SQL expression.

# Return Value

```txt
DDS_ReturnCode_t - Possible return codes of the operation are: DDS_RETCODE_OK, DDS_RETCODE_ERROR, DDS_RETCODE_ILLEGAL_OPERATION, DDS_RETCODE_BAD_PARAMETER, DDS_RETCODE_ALREADY_DELETED or DDS_RETCODE_OUT_OF_RESOURCES.
```

# Detailed Description

This operation changes the expression parameters associated with the DDS\_MultiTopic. The parameter expression\_parameters is a handle to a sequence of strings with the parameters used in the SQL expression. The number of parameters in expression\_parameters must exactly match the number of %n tokens in the subscription expression associated with the DDS\_MultiTopic. This is the subscription expression specified when the DDS\_MultiTopic was created.

# Return Code

When the operation returns:

• DDS\_RETCODE\_OK - the new expression parameters are set.
• DDS\_RETCODE\_ERROR - an internal error has occurred.
• DDS\_RETCODE\_ILLEGAL\_OPERATION - the operation is invoked on an inappropriate object.
• DDS\_RETCODE\_BAD\_PARAMETER - the number of parameters in expression\_parameters does not match the number of “%n” tokens in the expression for this DDS\_MultiTopic or one of the parameters is an illegal parameter.
• DDS\_RETCODE\_ALREADY\_DELETED - the DDS\_MultiTopic has already been deleted.
• DDS\_RETCODE\_OUT\_OF\_RESOURCES - the Data Distribution Service ran out of resources to complete this operation.

# 3.3.5 DDS\_TopicListener Interface

Since a DDS\_Topic is a DDS\_Entity, it has the ability to have a Listener associated with it. In this case, the associated Listener should be of type DDS\_TopicListener. This interface must be implemented by the application. A user-defined class must be provided by the application which must extend from the DDS\_TopicListener class. All DDS\_TopicListener operations must be implemented in the user-defined class, it is up to the application whether an operation is empty or contains some functionality.

![The image displays a standard warning sign featuring a red-bordered equilateral triangle pointing upwards. Inside the white interior of the triangle is a black exclamation mark.](.vortex-opensplice-c-reference-guide/60360031eb2c2eeb5afc4e12d6df04dfedc6075b11e8fe6338492e1db83eaf54.jpg)

NOTE: All operations for this interface must be implemented in the user-defined class, it is up to the application whether an operation is empty or contains some functionality.

The DDS\_TopicListener provides a generic mechanism (actually a callback function) for the Data Distribution Service to notify the application of relevant asynchronous status change events, such as an inconsistent DDS\_Topic. The DDS\_TopicListener is related to changes in communication status.

The interface description of this class is as follows:
```c
/*
 * interface DDS_TopicListener
 */
/*
 * abstract external operations
 */
/* void
 *    DDS_TopicListener_on_inconsistent_topic
 *    (void *listener_data,
 *    DDS_Topic the_topic,
 *    const DDS_InconsistentTopicStatus *status);
 */
/*
 * implemented API operations
 */
struct DDS_TopicListener *
DDS_TopicListener__alloc
(void);
```

The next paragraph describes the usage of the DDS\_TopicListener operation. This abstract operation is fully described since it must be implemented by the application.

# 3.3.5.1 DDS\_TopicListener\_\_alloc

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
struct DDS_TopicListener *
DDS_TopicListener__alloc
(void);
```

# Description

This operation creates a new DDS\_TopicListener.

# Parameters

```txt
&lt;none&gt;
```

# Return Value

DDS\_TopicListener - the handle to the newly-created DDS\_TopicListener. In case of an error, a DDS\_OBJECT\_NIL pointer is returned.

# Detailed Description

This operation creates a new DDS\_TopicListener. The DDS\_TopicListener must be created using this operation. In other words, the application is not allowed to declare an object of type DDS\_TopicListener. When the application wants to release the DDS\_TopicListener it must be released using DDS\_free.

I n c a s e t h e r e a r e i n s u f f i c i e n t r e s o u r c e s a v a i l a b l e t o a l l o c a t e t h e DDS\_TopicListener, a DDS\_OBJECT\_NIL pointer is returned instead.

# 3.3.5.2 DDS\_TopicListener\_on\_inconsistent\_topic (abstract)

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
void
DDS_TopicListener_on_inconsistent_topic
(void *listener_data,
DDS_Topic the_topic,
const DDS_InconsistentTopicStatus *status);
```

# Description

This operation must be implemented by the application and is called by the Data Distribution Service when the DDS\_InconsistentTopicStatus changes.

# Parameters

inout void \*listener\_data - a pointer to a user-defined object which may be used for identification of the Listener.

in DDS\_Topic the\_topic - a pointer to the DDS\_Topic on which the conflict occurred (this is an input to the application).

in const DDS\_InconsistentTopicStatus \*status - the DDS\_InconsistentTopicStatus struct (this is an input to the application).

# Return Value

```txt
&lt;none&gt;
```

# Detailed Description

This operation is the external operation (interface, which must be implemented by the application) that is called by the Data Distribution Service when the DDS\_InconsistentTopicStatus changes. The implementation may be left empty when this functionality is not needed. This operation will only be called when th e relevant D DS \_ To p ic Li s te n er is installed and enabled for the

DDS\_InconsistentTopicStatus. The DDS\_InconsistentTopicStatus will change when another DDS\_Topic exists with the same topic\_name but different characteristics.

The Data Distribution Service will call the DDS\_TopicListener operation with a parameter the\_topic, which will contain a pointer to the DDS\_Topic on which the conflict occurred and a parameter status, which will contain the DDS\_InconsistentTopicStatus struct.

# 3.3.6 DDS\_ExtTopicListener interface

The DDS\_ExtTopicListener interface is a subtype of DDS\_TopicListener and provides an OpenSplice-specific callback on\_all\_disposed\_data.

![This image displays a red triangular warning sign with a white interior. Centered inside is a black exclamation mark (!). Directly beneath the exclamation mark is a black arrow pointing downward.](.vortex-opensplice-c-reference-guide/5d85464a31ae33e1686ffbd82c665c52c72a901533c9211a8611627e33dff57b.jpg)

All operations for this interface must be implemented in the user-defined class, it is up to the application whether an operation is empty or contains some functionality.

The interface description of this class is as follows:

```c
/*
 * interface DDS_ExtTopicListener
 */
/*
 * inherited from DDS_TopicListener
 */
/* void
 *    DDS_ExtTopicListener_on_inconsistent_topic
 *    (void *listener_data,
 *    DDS_Topic the_topic,
 *    const DDS_InconsistentTopicStatus);
 */
/*
 * abstract external operations
 */
/* void
 *    DDS_ExtTopicListener_on_all_data_disposed
 *    (void *listener_data,
 *    DDS_Topic the_topic);
 */
/*
 * implemented API operations
 */
struct DDS_ExtTopicListener *
DDS_ExtTopicListener_alloc
(void);
```

# 3.3.6.1 DDS\_ExtTopicListener\_on\_all\_data\_disposed (abstract)

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
void
DDS_ExtTopicListener_on_all_data_disposed(void *listener_data, DDS_Topic_the_topic);
```

# Description

This operation must be implemented by the application and is called by the Data Distribution Service when the node has completed disposal of data as a result of a call to DDS\_Topic\_dispose\_all\_data().

# Parameters

inout void \*listener\_data - a pointer to a user-defined object which may be used for identification of the Listener.

in DDS\_Topic the\_topic - contains a pointer to the Topic which has been disposed.

# Return Value

```txt
&lt;none&gt;
```

# Detailed Description

This operation is the external operation (interface, which must be implemented by the application) that is called by the Data Distribution Service when the node has c o m p l e t e d d i s p o s a l o f d a t a a s a r e s u l t o f a c a l l t o DDS\_Topic\_dispose\_all\_data().

The implementation may be left empty when this functionality is not needed. This operation will only be called when the relevant ExtTopicListener is installed.

# Concurrency

The threading behaviour of calls to this method are undefined, so:

• Subsequent disposal via DDS\_Topic\_dispose\_all\_data(), and the associated callbacks may be blocked until this method returns.
• This method may be called concurrently by OpenSplice if other DDS\_Topic\_dispose\_all\_data() operations complete before this method returns.

# 3.3.7 Topic-Definition Type Specific Classes

This paragraph describes the generic DDS\_TypeSupport class and the derived application type specific &lt;NameSpace&gt;\_&lt;type&gt;TypeSupport classes which together implement the application DDS\_Topic interface. For each application type, u s e d a s D D S \_ T o p i c d a t a t y p e , t h e p r e - p r o c e s s o r g e n e r a t e s a &lt;NameSpace&gt;\_&lt;type&gt;DataReader class from an IDL type description. The SPACE\_FooTypeSupport class that would be generated by the pre-processor for a f i c t i o n a l t y p e F o o ( d e f i n e d i n t h e m o d u l e S P A C E ) d e s c r i b e s t h e &lt;NameSpace&gt;\_&lt;type&gt;TypeSupport classes.

# 3.3.7.1 Class DDS\_TypeSupport (abstract)

The DDS\_Topic, DDS\_MultiTopic or DDS\_ContentFilteredTopic is bound to a data type described by the type name argument. Prior to creating a DDS\_Topic, DDS\_MultiTopic or DDS\_ContentFilteredTopic, the data type must have been registered with the Data Distribution Service. This is done using the data type specific DDS\_TypeSupport\_register\_type operation on a derived class of the DDS\_TypeSupport interface. A derived class is generated for each data type used by the application, by calling the pre-processor.

The interface description of this class is as follows:

```c
/*
 * interface DDS_TypeSupport
 */
/*
 * abstract operations
 */
/* DDS_TypeSupport
 *    DDS_TypeSupport_alloc
 *    (void);
 */
/* DDS_ReturnCode_t
 *    DDS_TypeSupport_register_type
 *    (DDS_TypeSupport _this,
 *    Domainparticipant domain,
 *    DDS_string type_name);
 *
 *    DDS_string
 *    DDS_TypeSupport_get_type_name
 *    (DDS_TypeSupport _this);
 */
/*
 * implemented API operations
 *    &lt;no operations&gt;
 */
```

The next paragraph list the DDS\_TypeSupport operation. This abstract operation is listed but not fully described since it is not implemented in this class. The full description of this operation is given in the SPACE\_FooTypeSupport class (for the data type example Foo), which contains the data type specific implementation of this operation.

# 3.3.7.2 DDS\_TypeSupport\_\_alloc (abstract)

This abstract operation is defined as a generic operation, which is implemented by the &lt;NameSpace&gt;\_&lt;type&gt;TypeSupport class. Therefore, to use this operation, the data type specific implementation of this operation in its respective derived class must be used. For further explanation see the description for the fictional data type Foo (defined in the module SPACE) derived SPACE\_FooTypeSupport class.

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
DDS_TypeSupport
DDS_TypeSupport_alloc
(void);
```

# 3.3.7.3 DDS\_TypeSupport\_get\_type\_name (abstract)

This abstract operation is defined as a generic operation, which is implemented by the &lt;NameSpace&gt;\_&lt;type&gt;TypeSupport class. For further explanation see the description for the fictional data type Foo (defined in the module SPACE) derived SPACE\_FooTypeSupport class.

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
DDS_string
DDS_TypeSupport_get_type_name
(DDS_TypeSupport _this);
```

# 3.3.7.4 DDS\_TypeSupport\_register\_type (abstract)

This abstract operation is defined as a generic operation, which is implemented by the &lt;NameSpace&gt;\_&lt;type&gt;TypeSupport class. For further explanation see the description for the fictional data type Foo (defined in the module SPACE) derived SPACE\_FooTypeSupport class.

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
DDS_ReturnCode_t
DDS_TypeSupport_register_type
(DDS_TypeSupport _this,
Domainparticipant domain,
DDS_string type_name);
```

# 3.3.7.5 Class SPACE\_FooTypeSupport

The pre-processor generates from IDL type descriptions the application &lt;NameSpace&gt;\_&lt;type&gt;TypeSupport classes. For each application data type that i s u s e d a s D D S \_ T o p i c d a t a t y p e , a t y p e d c l a s s &lt;NameSpace&gt;\_&lt;type&gt;TypeSupport is derived from the DDS\_TypeSupport class. In this paragraph, the class SPACE\_FooTypeSupport describes the operations of these derived &lt;NameSpace&gt;\_&lt;type&gt;TypeSupport classes as an example for the fictional application type Foo (defined in the module SPACE).

For instance, for an application, the definitions are located in the Space.idl file. The pre-processor will generate a Space.h include file.

The DDS\_Topic, DDS\_MultiTopic or DDS\_ContentFilteredTopic is bound to a data type described by the type type\_name argument. Prior to creating a DDS\_Topic, DDS\_MultiTopic or DDS\_ContentFilteredTopic, the data type must have been registered with the Data Distribution Service. This is done using the data type specific SPACE\_FooTypeSupport\_register\_type operation on the &lt;NameSpace&gt;\_&lt;type&gt;TypeSupport class for each data type. A derived class is generated for each data type used by the application, by calling the pre-processor.

The interface description of this class is as follows:

```c
/*
 * interface SPACE_FooTypeSupport
 */
/*
 * implemented API operations
 */
SPACE_FooTypeSupport
SPACE_FooTypeSupport_alloc
(void);
DDS_ReturnCode_t
SPACE_FooTypeSupport_register_type
(SPACE_FooTypeSupport _this,
DDS_DomainParticipant domain,
DDS_string type_name);
DDS_string
SPACE_FooTypeSupport_get_type_name
(SPACE_FooTypeSupport _this);
```

The next paragraph describes the usage of the SPACE\_FooTypeSupport operations.

# 3.3.7.6 SPACE\_FooTypeSupport\_\_alloc

# Synopsis

```txt
#include &lt;Space.h&gt;
SPACE_FooTypeSupport
```

```txt
SPACE_FooTypeSupport_alloc (void);
```

# Description

This operation creates a new SPACE\_FooTypeSupport.

# Parameters

```txt
&lt;none&gt;
```

# Return Value

S P AC E \_ F o o Ty p e S u p p or t - t h e h a n d l e t o t h e n e w l y - c r e a t e d SPACE\_FooTypeSupport. In case of an error, a nil pointer is returned.

# Detailed Description

T h i s o p e r a t i o n c r e at e s a n e w S P AC E \_ F o o T yp e S u p p or t . T h e SPACE\_FooTypeSupport must be created using this operation. In other words, the application is not allowed to declare an object of type SPACE\_FooTypeSupport. When the application wants to release the SPACE\_FooTypeSupport it must be released using DDS\_free.

I n c a s e t h e r e a r e i n s u f f i c i e n t r e s o u r c e s a v a i l a b l e t o a l l o c a t e t h e SPACE\_FooTypeSupport, a nil pointer is returned instead.

# 3.3.7.7 SPACE\_FooTypeSupport\_get\_type\_name

# Synopsis

```c
#include &lt;Space.h&gt;
DDS_string
SPACE_FooTypeSupport_get_type_name
(SPACE_FooTypeSupport _this);
```

# Description

This operation returns the default name of the data type associated with the SPACE\_FooTypeSupport.

# Parameters

in SPACE\_FooTypeSupport \_this - the SPACE\_FooTypeSupport object on which the operation is operated.

# Return Value

DDS\_string - the name of the data type of the SPACE\_FooTypeSupport.

# Detailed Description

This operation returns the default name of the data type associated with the SPACE\_FooTypeSupport. The default name is derived from the type name as specified in the IDL definition. It is composed of the scope names and the type name, each separated by “::”, in order of lower scope level to deeper scope level followed by the type name.

# 3.3.7.8 SPACE\_FooTypeSupport\_register\_type

# Synopsis

```c
#include &lt;Space.h&gt;
DDS_ReturnCode_t
SPACE_FooTypeSupport_register_type
(SPACE_FooTypeSupport _this,
DDS_DomainParticipant domain,
DDS_string type_name);
```

# Description

This operation registers a new data type name to a DDS\_DomainParticipant.

# Parameters

in SPACE\_FooTypeSupport \_this - the SPACE\_FooTypeSupport object on which the operation is operated.

in DDS\_DomainParticipant domain - a pointer to a DDS\_DomainParticipant object to which the new data type is registered.

in DDS\_string type\_name - a local alias of the new data type to be registered.

# Return Value

D D S \_ R e t u r n C o d e \_ t - P o s s i b l e r e t u r n c o d e s o f t h e o p e r a t i o n a r e : DDS\_RETCODE\_OK, DDS\_RETCODE\_ERROR, DDS\_RETCODE\_ILLEGAL\_ OPERATION, DDS\_RETCODE\_BAD\_PARAMETER, DDS\_RETCODE\_ OUT\_OF\_RESOURCES or DDS\_RETCODE\_PRECONDITION\_NOT\_MET.

# Detailed Description

This operation registers a new data type name to a DDS\_DomainParticipant. This operation informs the Data Distribution Service, in order to allow it to manage the new registered data type. This operation also informs the Data Distribution Service about the key definition, which allows the Data Distribution Service to distinguish different instances of the same data type.

# Precondition

A t y p e \_ n a m e c a n n o t b e r e g i s t e r e d w i t h t w o d i ff e r e n t &lt;NameSpace&gt;\_&lt;type&gt;TypeSupport classes (this means of a different data type) with the same DDS\_DomainParticipant. When the operation is called on the same DDS\_DomainParticipant with the same type\_name for a different &lt;NameSpace&gt;\_&lt;type&gt;TypeSupport class, the operation returns DDS\_RETCODE\_PRECONDITION\_NOT\_MET. However, it is possible to register the same &lt;NameSpace&gt;\_&lt;type&gt;TypeSupport classes with the same DDS\_DomainParticipant and the same or different type\_name multiple times. All registrations return DDS\_RETCODE\_OK, but any subsequent registrations with the same type\_name are ignored.

# Return Code

When the operation returns:

• DDS\_RETCODE\_OK - the SPACE\_FooTypeSupport class is registered with the new data type name to the DDS\_DomainParticipant or the SPACE\_FooTypeSupport class was already registered.
• DDS\_RETCODE\_ERROR - an internal error has occurred.
• DDS\_RETCODE\_ILLEGAL\_OPERATION - the operation is invoked on an inappropriate object.
• DDS\_RETCODE\_BAD\_PARAMETER - one or both of the parameters is invalid, the domain parameter is the DDS\_OBJECT\_NIL pointer, or the parameter type\_name has zero length.
• DDS\_RETCODE\_OUT\_OF\_RESOURCES - the Data Distribution Service ran out of resources to complete this operation.
• DDS\_RETCODE\_PRECONDITION\_NOT\_MET - this type\_name is already registered with this DDS\_DomainParticipant for a different &lt;NameSpace&gt;\_&lt;type&gt;TypeSupport class.

# 3.4 Publication Module

![**Blocks:**\n*   **DataWriter**\n*   **Publisher**\n*   **QosPolicy** (from Infrastructure Module)\n*   **Topic** (from Topic-Definition Module)\n*   **StatusCondition** (from Infrastructure Module)\n*   **((Interface)) DataWriterListener**\n*   **((Interface)) PublisherListener**\n*   **WaitSet** (from Infrastructure Module)\n*   **DomainParticipant** (from Domain Module)\n\n**Connections:**\n*   **Publisher** to **DataWriter**: Dashed line with arrow, label `((create))`, multiplicity `1` at Publisher end.\n*   **DataWriter** to **QosPolicy**: Line with arrow, label `((implicit))`, multiplicity `*` at QosPolicy end.\n*   **DataWriter** to **Topic**: Line with arrow, multiplicity `*` at DataWriter end, `1` at Topic end.\n*   **DataWriter** to **StatusCondition**: Line with arrow, label `((implicit))`, multiplicity `1` at DataWriter end, `0..1` at StatusCondition end.\n*   **DataWriter** to **DataWriterListener**: Line with arrow, label `((implicit))`, multiplicity `*` at DataWriter end, `0..1` at DataWriterListener end.\n*   **Publisher** to **QosPolicy**: Line with arrow, label `((implicit))` and `qos`, multiplicity `1` at Publisher end, `*` at QosPolicy end.\n*   **Publisher** to **Topic**: Line with arrow, multiplicity `*` at Publisher end, `*` at Topic end.\n*   **Publisher** to **StatusCondition**: Line with arrow, label `((implicit))`, multiplicity `1` at Publisher end, `0..1` at StatusCondition end.\n*   **Publisher** to **PublisherListener**: Line with arrow, label `((implicit))`, multiplicity `1` at Publisher end, `*` at PublisherListener end.\n*   **Publisher** to **DomainParticipant**: Dashed line with arrow, label `((create))`.\n*   **Topic** to **QosPolicy**: Line with arrow, multiplicity `*` at Topic end, `*` at QosPolicy end.\n*   **Publisher** to **QosPolicy**: Line with arrow, label `default_datawriter_qos`, multiplicity `*` at QosPolicy end.\n*   **StatusCondition** to **WaitSet**: Bidirectional line (double arrow), multiplicity `*` at StatusCondition end, `*` at WaitSet end.\n*   **PublisherListener** to **DataWriterListener**: Solid line with hollow triangle at DataWriterListener end (Inheritance).](.vortex-opensplice-c-reference-guide/1038e531af36c4f678e25e89c061d7151f1a076a7f4278daf590eb6505e3b247.jpg)

Figure 18: The DCPS Publication Module’s Class Model

This module contains the following classes:

• DDS\_Publisher
• Publication type specific classes
• DDS\_PublisherListener (interface)
• DDS\_DataWriterListener (interface).

The paragraph “Publication type specific classes” contains the generic class and the generated data type specific classes. For each data type, a data type specific class &lt;NameSpace&gt;\_&lt;type&gt;DataWriter is generated (based on IDL) by calling the pre-processor.

For instance, for the fictional data type Foo (this also applies to other types), defined in the module SPACE; “Publication type specific classes” contains the following classes:

• DDS\_DataWriter (abstract)

• SPACE\_FooDataWriter.

A DDS\_Publisher is an object responsible for data distribution. It may publish data of different data types. A DDS\_DataWriter acts as a typed accessor to a DDS\_Publisher. The DDS\_DataWriter is the object the application must use to communicate the existence and value of data-objects of a given data type to a DDS\_Publisher. When data-object values have been communicated to the DDS\_Publisher through the appropriate DDS\_DataWriter, it is the DD S \_P u bl i sh er ’ s responsibility to perform th e distribu tion. The DDS\_Publisher will do this according to its own DDS\_PublisherQos, and the DDS\_DataWriterQos attached to the corresponding DDS\_DataWriter. A publication is defined by the association of a DDS\_DataWriter to a DDS\_Publisher. This association expresses the intent of the application to publish the data described by the DDS\_DataWriter in the context provided by the DDS\_Publisher.

# 3.4.1 Class DDS\_Publisher

The DDS\_Publisher acts on behalf of one or more DDS\_DataWriter objects that belong to it. When it is informed of a change to the data associated with one of its DDS\_DataWriter objects, it decides when it is appropriate to actually process the s a m p l e - u p d a t e m e s s a g e . I n m a k i n g t h i s d e c i s i o n , i t c o n s i d e r s t h e DDS\_PublisherQos and the DDS\_DataWriterQos.

The interface description of this class is as follows:

```c
/*
 * interface DDS_Publisher
 */
/*
 * inherited from class DDS_Entity
 */
/* DDS_StatusCondition
 *    DDS_Publisher_get_statuscondition
 *    (DDS_Publisher _this);
 */
/* DDS_StatusMask
 *    DDS_Publisher_get_status_changes
 *    (DDS_Publisher _this);
 */
/* DDS_ReturnCode_t
 *    DDS_Publisher_enable
 *    (DDS_Publisher _this);
 */
/*
 * implemented API operations
 */
DDS_DataWriter
DDS_Publisher_create_datawriter
```

```c
(DDS_Publisher _this,
    const DDS_Topic a_topic,
    const DDS_DataWriterQos *qos,
    const struct DDS_DataWriterListener *a_listener,
    const DDS_StatusMask mask);

DDS_ReturnCode_t
DDS_Publisher_delete_datawriter
(DDS_Publisher _this,
    const DDS_DataWriter a_datawriter);

DDS_DataWriter
DDS_Publisher_lookup_datawriter
(DDS_Publisher _this,
    const DDS_char *topic_name);
DDS_ReturnCode_t
DDS_Publisher_delete_contained_entities
(DDS_Publisher _this);

DDS_ReturnCode_t
DDS_Publisher_set_qos
(DDS_Publisher _this,
    const DDS_PublisherQos *qos);

DDS_ReturnCode_t
DDS_Publisher_get_qos
(DDS_Publisher _this,
    DDS_PublisherQos *qos);

DDS_ReturnCode_t
DDS_Publisher_set_listener
(DDS_Publisher _this,
    const struct DDS_PublisherListener *a_listener,
    const DDS_StatusMask mask);

struct DDS_PublisherListener
DDS_Publisher_get_listener
(DDS_Publisher _this);

DDS_ReturnCode_t
DDS_Publisher_suspend_publications
(DDS_Publisher _this);

DDS_ReturnCode_t
DDS_Publisher_resume_publications
(DDS_Publisher _this);

DDS_ReturnCode_t
DDS_Publisher_begin_coherent_changes
(DDS_Publisher _this);

DDS_ReturnCode_t
DDS_Publisher_end_coherent_changes
(DDS_Publisher _this);
```

```c
DDS_ReturnCode_t
DDS_Publisher_wait_for_acknowledgments
(DDS_Publisher _this,
const DDS_Duration_t *max_wait);

DDS_DomainParticipant
DDS_Publisher_get_participant
(DDS_Publisher _this);

DDS_ReturnCode_t
DDS_Publisher_set_default_datawriter_qos
(DDS_Publisher _this,
const DDS_DataWriterQos *qos);

DDS_ReturnCode_t
DDS_Publisher_get_default_datawriter_qos
(DDS_Publisher _this,
DDS_DataWriterQos *qos);

DDS_ReturnCode_t
DDS_Publisher_copy_from_topic_qos
(DDS_Publisher _this,
DDS_DataWriterQos *a_datawriter_qos,
const DDS_TopicQos *a_topic_qos);
```

The following paragraphs describe the usage of all DDS\_Publisher operations. The inherited operations are listed but not fully described because they are not implemented in this class. The full description of these operations is given in the classes from which they are inherited.

# 3.4.1.1 DDS\_Publisher\_begin\_coherent\_changes

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
DDS_ReturnCode_t
DDS_Publisher_begin_coherent_changes
(DDS_Publisher _this);
```

# Description

This operation requests that the application will begin a ‘coherent set’ of modifications using DDS\_DataWriter objects attached to this DDS\_Publisher. The ‘coherent set’ will be completed by a matching call to DDS\_Publisher\_ end\_coherent\_changes.

# Parameters

in DDS\_Publisher \_this - the DDS\_Publisher object on which the operation is operated.

# Return Value

D D S \_ R e t u r n C o d e \_ t - P o s s i b l e r e t u r n c o d e s o f t h e o p e r a t i o n a r e : DDS\_RETCODE\_OK, DDS\_RETCODE\_ERROR, DDS\_RETCODE\_ILLEGAL\_ OPERATION, DDS\_RETCODE\_BAD\_PARAMETER, DDS\_RETCODE\_ ALREADY\_DELETED or DDS\_RETCODE\_PRECONDITION\_NOT\_MET.

# Detailed Description

This operation requests that the application will begin a ‘coherent set’ of modifications using DDS\_DataWriter objects attached to this DDS\_Publisher. The ‘coherent set’ will be completed by a matching call to DDS\_Publisher\_ end\_coherent\_changes.

A ‘coherent set’ is a set of modifications that must be propagated in such a way that they are interpreted at the receivers’ side as a consistent set of modifications; that is, the receiver will only be able to access the data after all the modifications in the set are available at the receiver end.

A precondition for making coherent changes is that the PresentationQos of the DDS\_Publisher has its coherent\_access attribute set to TRUE. If this is not the case, the Publisher will not accept any coherent start requests and return DDS\_RETCODE\_PRECONDITION\_NOT\_MET.

A connectivity change may occur in the middle of a set of coherent changes; for example, the set of partitions used by the DDS\_Publisher or one of its connected DDS\_Subscribers may change, a late-joining DDS\_DataReader may appear on the network, or a communication failure may occur. In the event that such a change prevents an entity from receiving the entire set of coherent changes, that entity must behave as if it had received none of the set.

These calls can be nested. In that case, the coherent set terminates only with the last call to DDS\_Publisher\_end\_coherent\_changes.

The support for ‘coherent changes’ enables a publishing application to change the value of several data-instances that could belong to the same or different topics and have those changes be seen ‘atomically’ by the readers. This is useful in cases where the values are inter-related (for example, if there are two data-instances representing the ‘altitude’ and ‘velocity vector’ of the same aircraft and both are changed, it may be useful to communicate those values in a way the reader can see both together; otherwise, it may e.g., erroneously interpret that the aircraft is on a collision course).

# Return Code

When the operation returns:

• DDS\_RETCODE\_OK - a new coherent change has successfully been started.
• DDS\_RETCODE\_ERROR - an internal error has occurred.
• DDS\_RETCODE\_ILLEGAL\_OPERATION - the operation is invoked on an inappropriate object.
• DDS\_RETCODE\_BAD\_PARAMETER - the parameter passed to the operation is NULL, or is not pointing to any valid object.
• DDS\_RETCODE\_ALREADY\_DELETED - the DDS\_Publisher has already been deleted.
• DDS\_RETCODE\_PRECONDITION\_NOT\_MET - the DDS\_Publisher is not able to handle coherent changes because its PresentationQos has not set coherent\_access to TRUE.

# 3.4.1.2 DDS\_Publisher\_copy\_from\_topic\_qos

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
DDS_ReturnCode_t
DDS_Publisher_copy_from_topic_qos
(DDS_Publisher _this,
DDS_DataWriterQos *a_datawriter_qos,
const DDS_TopicQos *a_topic_qos);
```

# Description

This operation will copy policies in a\_topic\_qos to the corresponding policies in a\_datawriter\_qos.

# Parameters

in DDS\_Publisher \_this - the DDS\_Publisher object on which the operation is operated.

inout DDS\_DataWriterQos \*a\_datawriter\_qos - the destination DDS\_DataWriterQos struct to which the QosPolicy settings should be copied.

in const DDS\_TopicQos \*a\_topic\_qos - the source DDS\_TopicQos struct, which should be copied.

# Return Value

D D S \_ R e t u r n C o d e \_ t - P o s s i b l e r e t u r n c o d e s o f t h e o p e r a t i o n a r e : DDS\_RETCODE\_OK, DDS\_RETCODE\_ERROR, DDS\_RETCODE\_ILLEGAL\_ OPERATION, DDS\_RETCODE\_ALREADY\_DELETED or DDS\_RETCODE\_ OUT\_OF\_RESOURCES.

# Detailed Description

This operation will copy the QosPolicy settings in a\_topic\_qos to the corresponding QosPolicy settings in a\_datawriter\_qos (replacing the values in a\_datawriter\_qos, if present). This will only apply to the common QosPolicy settings in each &lt;DDS\_Entity&gt;Qos.

This is a “convenience” operation, useful in combination with the operations DDS\_Publisher\_get\_default\_datawriter\_qos and DDS\_Topic\_get\_qos. The operation DDS\_Publisher\_copy\_from\_topic\_qos can be used to merge the DDS\_DataWriter default QosPolicy settings with the corresponding ones on the DDS\_TopicQos. The resulting DDS\_DataWriterQos can then be used to create a new DDS\_DataWriter, or set its DDS\_DataWriterQos.

This operation does not check the resulting a\_datawriter\_qos for consistency. This is because the “merged” a\_datawriter\_qos may not be the final one, as the application can still modify some QosPolicy settings prior to applying the DDS\_DataWriterQos to the DDS\_DataWriter.

# Return Code

When the operation returns:

• DDS\_RETCODE\_OK - the QosPolicy settings have successfully been copied from the DDS\_TopicQos to the DDS\_DataWriterQos.
• DDS\_RETCODE\_ERROR - an internal error has occurred.
• DDS\_RETCODE\_ILLEGAL\_OPERATION - the operation is invoked on an inappropriate object.
• DDS\_RETCODE\_ALREADY\_DELETED - the DDS\_Publisher has already been deleted.
• DDS\_RETCODE\_OUT\_OF\_RESOURCES - the Data Distribution Service ran out of resources to complete this operation.

# 3.4.1.3 DDS\_Publisher\_create\_datawriter

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
DDS_DataWriter
DDS_Publisher_create_datawriter
```

```c
(DDS_Publisher _this,
    const DDS_Topic a_topic,
    const DDS_DataWriterQos *qos,
    const struct DDS_DataWriterListener *a_listener,
    const DDS_StatusMask mask);
```

# Description

T h i s o p e r a t i o n c r e a t e s a D D S \_ D a t a W r i t e r w i t h t h e d e s i r e d DDS\_DataWriterQos, for the desired DDS\_Topic and attaches the optionally specified DDS\_DataWriterListener to it.

# Parameters

in DDS\_Publisher \_this - the DDS\_Publisher object on which the operation is operated.
in const DDS\_Topic a\_topic - a pointer to the topic for which the DDS\_DataWriter is created.
in const DDS\_DataWriterQos \*qos - the DDS\_DataWriterQos for the new DDS\_DataWriter. In case these settings are not self consistent, no DDS\_DataWriter is created.
in const struct DDS\_DataWriterListener \*a\_listener - a pointer to the DDS\_DataWriterListener instance which will be attached to the new DDS\_DataWriter. It is permitted to use DDS\_OBJECT\_NIL as the value of the listener: this behaves as a DDS\_DataWriterListener whose operations perform no action.
in const DDS\_StatusMask mask - a bit-mask in which each bit enables the invocation of the DDS\_DataWriterListener for a certain status.

# Return Value

DD S \_D at aW ri t er - Return value is a pointer to the newly-created DDS\_DataWriter. In case of an error, the DDS\_OBJECT\_NIL pointer is returned.

# Detailed Description

T h i s o p e r a t i o n c r e a t e s a D D S \_ D a t a W r i t e r w i t h t h e d e s i r e d DDS\_DataWriterQos, for the desired DDS\_Topic and attaches the optionally specified DDS\_DataWriterListener to it. The returned DDS\_DataWriter is attached (and belongs) to the DDS\_Publisher on which this operation is being called. To delete the DDS\_DataWriter the operation DDS\_Publisher\_ delete\_datawriter or DDS\_Publisher\_delete\_contained\_entities must be used. If no write rights are defined for the specific topic then the creation of the DataWriter will fail.

# Application Data Type

The DDS\_DataWriter returned by this operation is an object of a derived class, specific to the data type associated with the DD S\_ To pi c . For each a p p l i c a t i o n - d e f i n e d d a t a t y p e &lt; t y p e &gt; t h e r e i s a c l a s s &lt;NameSpace&gt;\_&lt;type&gt;DataWriter generated by calling the pre-processor. This data type specific class extends DDS\_DataWriter and contains the operations to write data of data type &lt;type&gt;.

# QosPolicy

The possible application pattern to construct the DDS\_DataWriterQos for the DDS\_DataWriter is to:

• Retrieve the QosPolicy settings on the associated DDS\_Topic by means of the get\_qos operation on the DDS\_Topic.
• Retrieve the default DDS\_DataWriterQos by means of the DDS\_Publisher\_get\_default\_datawriter\_qos operation on the DDS\_Publisher
• Combine those two lists of QosPolicy settings and selectively modify QosPolicy settings as desired
• Use the resulting DDS\_DataWriterQos to construct the DDS\_DataWriter.
• In case the specified QosPolicy settings are not consistent, no DDS\_DataWriter is created and the DDS\_OBJECT\_NIL pointer is returned.

# Default QoS

The constant DDS\_DATAWRITER\_QOS\_DEFAULT can be used as parameter qos to create a DDS\_DataWriter with the default DDS\_DataWriterQos as set in the DDS\_Publisher. The effect of using DDS\_DATAWRITER\_QOS\_DEFAULT is the same as calling the operation DDS\_Publisher\_get\_default\_datawriter\_qos and using the resulting DDS\_DataWriterQos to create the DDS\_DataWriter.

The special DDS\_DATAWRITER\_QOS\_USE\_TOPIC\_QOS can be used to create a DDS\_DataWriter with a combination of the default DDS\_DataWriterQos and t h e DDS\_TopicQos. T h e e f f e c t o f u s i n g DDS\_DATAWRITER\_QOS\_USE\_TOPIC\_QOS is the same as calling the operation DDS\_Publisher\_get\_default\_datawriter\_qos and retrieving the DDS\_TopicQos (by means of the operation DDS\_Topic\_get\_qos) and then c o m b i n i n g t h e s e t w o Q o s P o l i c y s e t t i n g s u s i n g t h e o p e r a t i o n DDS\_Publisher\_copy\_from\_topic\_qos, whereby any common policy that is set on the DDS\_TopicQos “overrides” the corresponding policy on the default DDS\_DataWriterQos. The resulting DDS\_DataWriterQos is then applied to create the DDS\_DataWriter.

# Communication Status

For each communication status, the StatusChangedFlag flag is initially set to FALSE. It becomes TRUE whenever that communication status changes. For each c o m m u n i c a t i o n s t a t u s a c t i v a t e d i n t h e m a s k , t h e a s s o c i a t e d DDS\_DataWriterListener operation is invoked and the communication status is reset to FALSE, as the listener implicitly accesses the status which is passed as a parameter to that operation. The fact that the status is reset prior to calling the listener means that if the application calls the get\_&lt;status\_name&gt;\_status from inside the listener it will see the status already reset.

The following statuses are applicable to the DDS\_DataWriterListener:

```pickle
DDS_OFFERED_DEADLINE_MISSED_STATUS
DDS_OFFERED_INCOMPATIBLE_QOS_STATUS
DDS_LIVELINESS_LOST_STATUS
DDS_PUBLICATION_MATCHED_STATUS.
```

![The image displays a triangular warning sign with a red border and a white background. In the center is a black exclamation mark with a small horizontal dash or dot positioned directly beneath it.](.vortex-opensplice-c-reference-guide/d04aa32d3160e3dcffc80c93059187096e924b46215df68f2d49ff48ef767738.jpg)

Be aware that the DDS\_PUBLICATION\_MATCHED\_STATUS is not applicable when the infrastructure does not have the information available to determine connectivity. This is the case when OpenSplice is configured not to maintain discovery information in the Networking Service. (See also the description of the NetworkService/Discovery[@enabled] attribute in section 4.4.1.6.1 on page 244 of the Deployment Guide.) In this case the operation will return DDS\_OBJECT\_NIL.

Status bits are declared as a constant and can be used by the application in an OR operation to create a tailored mask. The special constant DDS\_STATUS\_MASK\_NONE can be used to indicate that the created entity should not respond to any of its available statuses. The DDS will therefore attempt to propagate these statuses to its factory. The special constant STATUS\_MASK\_ANY\_V1\_2 can be used to select all applicable statuses specified in the “Data Distribution Service for Real-time Systems Version 1.2” specification.

# Status Propagation

In case a communication status is not activated in the m as k of th e DDS\_DataWriterListener, the DDS\_PublisherListener of the containing DDS\_Publisher is invoked (if attached and activated for the status that occurred). T h i s a l l o w s t h e a p p l i c a t i o n t o s e t a d e f a u l t b e h a v i o u r i n t h e DDS\_PublisherListener of the containing DDS\_Publisher and a DDS\_DataWriter specific behaviour when needed. In case the communication status is not activated in the mask of the DDS\_PublisherListener as well, the c o m m u n i c a t i o n s t a t u s w i l l b e p r o p a g a t e d t o t h e DDS\_DomainParticipantListener o f t h e c o n t a i n i n g

DDS\_DomainParticipant. In case the DDS\_DomainParticipantListener is also not attached or the communication status is not activated in its mask, the application is not notified of the change.

# 3.4.1.4 DDS\_Publisher\_delete\_contained\_entities

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
DDS_ReturnCode_t
DDS_Publisher_delete_contained_entities
(DDS_Publisher _this);
```

# Description

This operation deletes all the DDS\_DataWriter objects that were created by means of one of the DDS\_Publisher\_create\_datawriter operations on the DDS\_Publisher.

# Parameters

in DDS\_Publisher \_this - the DDS\_Publisher object on which the operation is operated.

# Return Value

```txt
DDS_ReturnCode_t - Possible return codes of the operation are: DDS_RETCODE_OK, DDS_RETCODE_ERROR, DDS_RETCODE_ILLEGAL_OPERATION, DDS_RETCODE_ALREADY_DELETED, DDS_RETCODE_OUT_OF_RESOURCES or DDS_RETCODE_PRECONDITION_NOT_MET.
```

# Detailed Description

This operation deletes all the DDS\_DataWriter objects that were created by means of one of the DDS\_Publisher\_create\_datawriter operations on the DDS\_Publisher. In other words, it deletes all contained DDS\_DataWriter objects.

![The image displays a triangular warning sign with a thick red border and a white background. Centered inside the triangle is a black exclamation mark (!). There is no text present in the image.](.vortex-opensplice-c-reference-guide/9c33970f73775ff42bbb640af076b46392022f9e5759e9066dd8ec388ca7fe51.jpg)

NOTE: The operation will return DDS\_PRECONDITION\_NOT\_MET if the any of the contained entities is in a state where it cannot be deleted. In such cases, the operation does not roll back any entity deletions performed prior to the detection of the problem.

# Return Code

When the operation returns:

• DDS\_RETCODE\_OK - the contained DDS\_Entity objects are deleted and the application may delete the DDS\_Publisher.

• DDS\_RETCODE\_ERROR - an internal error has occurred.
• DDS\_RETCODE\_ILLEGAL\_OPERATION - the operation is invoked on an inappropriate object.
• DDS\_RETCODE\_ALREADY\_DELETED - the DDS\_Publisher has already been deleted.
• DDS\_RETCODE\_OUT\_OF\_RESOURCES - the Data Distribution Service ran out of resources to complete this operation.
• DDS\_RETCODE\_PRECONDITION\_NOT\_MET - one or more of the contained entities are in a state where they cannot be deleted.

# 3.4.1.5 DDS\_Publisher\_delete\_datawriter

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
DDS_ReturnCode_t
DDS_Publisher_delete_datawriter
(DDS_Publisher _this,
const DDS_DataWriter a_datawriter);
```

# Description

This operation deletes a DDS\_DataWriter that belongs to the DDS\_Publisher.

# Parameters

in DDS\_Publisher \_this - the DDS\_Publisher object on which the operation -is operated.

i n const DDS\_DataWriter a\_datawriter - a pointer to the DDS\_DataWriter, which is to be deleted.

# Return Value

```txt
DDS_ReturnCode_t - Possible return codes of the operation are: DDS_RETCODE_OK, DDS_RETCODE_ERROR, DDS_RETCODE_ILLEGAL_OPERATION, DDS_RETCODE_BAD_PARAMETER, DDS_RETCODE_ALREADY_DELETED, DDS_RETCODE_OUT_OF_RESOURCES or DDS_RETCODE_PRECONDITION_NOT_MET.
```

# Detailed Description

This operation deletes a DDS\_DataWriter that belongs to the DDS\_Publisher. When the operation is called on a different DDS\_Publisher, as used when the DDS\_DataWriter was created, the operation has no effect and returns DDS\_RETCODE\_PRECONDITION\_NOT\_MET. The deletion of the DDS\_DataWriter will automatically unregister all instances. Depending on the settings of DDS\_WriterDataLifecycleQosPolicy, the deletion of the DDS\_DataWriter may also dispose of all instances.

# Return Code

When the operation returns:

• DDS\_RETCODE\_OK - the DDS\_DataWriter is deleted.
• DDS\_RETCODE\_ERROR - an internal error has occurred.
• DDS\_RETCODE\_ILLEGAL\_OPERATION - the operation is invoked on an inappropriate object.
• DDS\_RETCODE\_BAD\_PARAMETER - the parameter a\_datawriter is not a valid DDS\_DataWriter.
• DDS\_RETCODE\_ALREADY\_DELETED - the DDS\_Publisher has already been deleted.
• DDS\_RETCODE\_OUT\_OF\_RESOURCES - the Data Distribution Service ran out of resources to complete this operation.
• DDS\_RETCODE\_PRECONDITION\_NOT\_MET - the operation is called on a different DDS\_Publisher, as used when the DDS\_DataWriter was created.

# 3.4.1.6 DDS\_Publisher\_enable (inherited)

This operation is inherited and therefore not described here. See the class DDS\_Entity for further explanation.

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
DDS_ReturnCode_t
DDS_Publisher_enable
(DDS_Publisher _this);
```

# 3.4.1.7 DDS\_Publisher\_end\_coherent\_changes

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
DDS_ReturnCode_t
DDS_Publisher_end_coherent_changes
(DDS_Publisher_this);
```

# Description

This operation terminates the ‘coherent set’ initiated by the matching call to DDS\_Publisher\_begin\_coherent\_changes.

# Parameters

in DDS\_Publisher \_this - the DDS\_Publisher object on which the operation is operated.

# Return Value

D D S \_ R e t u r n C o d e \_ t - P o s s i b l e r e t u r n c o d e s o f t h e o p e r a t i o n a r e : DDS\_RETCODE\_OK, DDS\_RETCODE\_ERROR, DDS\_RETCODE\_ILLEGAL\_ OPERATION, DDS\_RETCODE\_BAD\_PARAMETER, DDS\_RETCODE\_ ALREADY\_DELETED or DDS\_RETCODE\_PRECONDITION\_NOT\_MET.

# Detailed Description

This operation terminates the ‘coherent set’ initiated by the matching call to DDS\_Publisher\_begin\_coherent\_changes. If there is no matching call to DDS\_Publisher\_begin\_coherent\_changes, the operation will return the error DDS\_PRECONDITION\_NOT\_MET.

# Return Code

When the operation returns:

• DDS\_RETCODE\_OK - the coherent change has successfully been closed.
• DDS\_RETCODE\_ERROR - an internal error has occurred.
• DDS\_RETCODE\_ILLEGAL\_OPERATION - the operation is invoked on an inappropriate object.
• DDS\_RETCODE\_BAD\_PARAMETER - the parameter passed to the operation is NULL, or is not pointing to any valid object.
• DDS\_RETCODE\_ALREADY\_DELETED - the DDS\_Publisher has already been deleted.
• DDS\_RETCODE\_PRECONDITION\_NOT\_MET - there is no matching DDS\_Publisher\_begin\_coherent\_changes call that can be closed.

# 3.4.1.8 DDS\_Publisher\_get\_default\_datawriter\_qos

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
DDS_ReturnCode_t
DDS_Publisher_get_default_datawriter_qos
(DDS_Publisher _this,
DDS_DataWriterQos *qos);
```

# Description

This operation gets the default DDS\_DataWriterQos of the DDS\_Publisher.

# Parameters

in DDS\_Publisher \_this - the DDS\_Publisher object on which the operation is operated.

inout DDS\_DataWriterQos \*qos - a pointer to the DDS\_DataWriterQos struct (provided by the application) in which the default DDS\_DataWriterQos for the DDS\_DataWriter is written.

# Return Value

DDS\_ReturnCode\_t - Possible return codes of the operation are: DDS\_RETCODE\_OK, DDS\_RETCODE\_ERROR, DDS\_RETCODE\_ILLEGAL\_ OPERATION, DDS\_RETCODE\_ALREADY\_DELETED or DDS\_RETCODE\_ OUT\_OF\_RESOURCES.

# Detailed Description

This operation gets the default DDS\_DataWriterQos of the DDS\_Publisher (that is the struct with the QosPolicy settings) which is used for newly-created DDS\_DataWriter objects, in case the constant DDS\_DATAWRITER\_QOS\_DEFAULT is used. The default DDS\_DataWriterQos is only used when the constant is supplied as parameter qos to specify the DDS\_DataWriterQos in the DDS\_Publisher\_create\_datawriter operation. The application must provide the DDS\_DataWriterQos struct in which the QosPolicy settings can be stored and pass the qos pointer to the operation. The operation writes the default DDS\_DataWriterQos to the struct pointed to by qos. Any settings in the struct are overwritten.

The values retrieved by this operation match the set of values specified on the last successful call to DDS\_Publisher\_set\_default\_datawriter\_qos, or, if the call was never made, the default values as specified for each QosPolicy setting as defined in Table 5: on page 65.

# Return Code

When the operation returns:

• DDS\_RETCODE\_OK - the default DDS\_DataWriter QosPolicy settings of this DDS\_Publisher have successfully been copied into the specified DDS\_DataWriterQos parameter.
• DDS\_RETCODE\_ERROR - an internal error has occurred.
• DDS\_RETCODE\_ILLEGAL\_OPERATION - the operation is invoked on an inappropriate object.
• DDS\_RETCODE\_ALREADY\_DELETED - the DDS\_Publisher has already been deleted.

• DDS\_RETCODE\_OUT\_OF\_RESOURCES - the Data Distribution Service ran out of resources to complete this operation.

# 3.4.1.9 DDS\_Publisher\_get\_listener

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
struct DDS_PublisherListener
DDS_Publisher_get_listener
(DDS_Publisher_this);
```

# Description

This operation allows access to a DDS\_PublisherListener.

# Parameters

in DDS\_Publisher \_this - the DDS\_Publisher object on which the operation is operated.

# Return Value

struct DDS\_PublisherListener - a pointer to the DDS\_PublisherListener attached to the DDS\_Publisher.

# Detailed Description

This operation allows access to a DDS\_PublisherListener attached to the DDS\_Publisher. When no DDS\_PublisherListener was attached to the DDS\_Publisher, the DDS\_OBJECT\_NIL pointer is returned.

# 3.4.1.10 DDS\_Publisher\_get\_participant

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
DDS_DomainParticipant
DDS_Publisher_get_participant
(DDS_Publisher _this);
```

# Description

This operation returns the DDS\_DomainParticipant associated with the DDS\_Publisher or the DDS\_OBJECT\_NIL pointer.

# Parameters

in DDS\_Publisher \_this - the DDS\_Publisher object on which the operation is operated.

# Return Value

DDS\_DomainParticipant - a pointer to the DDS\_DomainParticipant associated with the DDS\_Publisher or the DDS\_OBJECT\_NIL pointer.

# Detailed Description

This operation returns the DDS\_DomainParticipant associated with the DDS\_Publisher. Note that there is exactly one DDS\_DomainParticipant associated with each DDS\_Publisher. When the DDS\_Publisher was already deleted (there is no associated DDS\_DomainParticipant any more), the DDS\_OBJECT\_NIL pointer is returned.

# 3.4.1.11 DDS\_Publisher\_get\_qos

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
DDS_ReturnCode_t
DDS_Publisher_get_qos
(DDS_Publisher _this,
DDS_PublisherQos *qos);
```

# Description

This operation allows access to the existing set of QoS policies for a DDS\_Publisher.

# Parameters

in DDS\_Publisher \_this - the DDS\_Publisher object on which the operation is operated.

i no u t D D S\_ P u bl i s he r Qo s \*q o s - a pointer to the destination DDS\_PublisherQos struct in which the QosPolicy settings will be copied.

# Return Value

DDS\_ReturnCode\_t - Possible return codes of the operation are: DDS\_RETCODE\_OK, DDS\_RETCODE\_ERROR, DDS\_RETCODE\_ILLEGAL\_ OPERATION, DDS\_RETCODE\_ALREADY\_DELETED or DDS\_RETCODE\_ OUT\_OF\_RESOURCES.

# Detailed Description

This operation allows access to the existing set of QoS policies of a DDS\_Publisher on which this operation is used. This DDS\_PublisherQos is stored at the location pointed to by the qos parameter.

# Return Code

When the operation returns:

• DDS\_RETCODE\_OK - the existing set of QoS policy values applied to this DDS\_Publisher has successfully been copied into the specified DDS\_PublisherQos parameter.
• DDS\_RETCODE\_ERROR - an internal error has occurred.
• DDS\_RETCODE\_ILLEGAL\_OPERATION - the operation is invoked on an inappropriate object.
• DDS\_RETCODE\_ALREADY\_DELETED - the DDS\_Publisher has already been deleted.
• DDS\_RETCODE\_OUT\_OF\_RESOURCES - the Data Distribution Service ran out of resources to complete this operation.

# 3.4.1.12 DDS\_Publisher\_get\_status\_changes (inherited)

This operation is inherited and therefore not described here. See the class DDS\_Entity for further explanation.

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
DDS_StatusMask
DDS_Publisher_get_status_changes
(DDS_Publisher_this);
```

# 3.4.1.13 DDS\_Publisher\_get\_statuscondition (inherited)

This operation is inherited and therefore not described here. See the class DDS\_Entity for further explanation.

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
DDS_StatusCondition
DDS_Publisher_get_statuscondition
(DDS_Publisher_this);
```

# 3.4.1.14 DDS\_Publisher\_lookup\_datawriter

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
DDS_DataWriter
DDS_Publisher_lookup_datawriter
(DDS_Publisher _this,
const DDS_char *topic_name);
```

# Description

This operation returns a previously created DDS\_DataWriter belonging to the DDS\_Publisher which is attached to a DDS\_Topic with the matching topic\_name.

# Parameters

in DDS\_Publisher \_this - the DDS\_Publisher object on which the operation is operated.
in const DDS\_char \*topic\_name - the name of the DDS\_Topic, which is attached to the DDS\_DataWriter to look for.

# Return Value

DDS\_DataWriter - Return value is a pointer to the DDS\_DataWriter found. When no such DDS\_DataWriter is found, the DDS\_OBJECT\_NIL pointer is returned.

# Detailed Description

This operation returns a previously created DDS\_DataWriter belonging to the DDS\_Publisher which is attached to a DDS\_Topic with the matching topic\_name. When multiple DDS\_DataWriter objects (which satisfy the same condition) exist, this operation will return one of them. It is not specified which one.

# 3.4.1.15 DDS\_Publisher\_resume\_publications

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
DDS_ReturnCode_t
DDS_Publisher_resume_publications
(DDS_Publisher _this);
```

# Description

This operation resumes a previously suspended publication.

# Parameters

in DDS\_Publisher \_this - the DDS\_Publisher object on which the operation is operated.

# Return Value

```txt
DDS_ReturnCode_t - Possible return codes of the operation are: DDS_RETCODE_OK, DDS_RETCODE_ERROR, DDS_RETCODE_ILLEGAL_OPERATION, DDS_RETCODE_ALREADY_DELETED, DDS_RETCODE_OUT_OF_RESOURCES, DDS_RETCODE_NOT_ENABLED or DDS_RETCODE_PRECONDITION_NOT_MET.
```

# Detailed Description

If the DDS\_Publisher is suspended, this operation will resume the publication of all DDS\_DataWriter objects contained by this DDS\_Publisher. All data held in the history buffer of the DDS\_DataWriter's is actively published to the consumers. When the operation returns, all DDS\_DataWriter's have resumed the publication of suspended updates.

# Return Code

When the operation returns:

• DDS\_RETCODE\_OK - the DDS\_Publisher object has been resumed.
• DDS\_RETCODE\_ERROR - an internal error has occurred.
• DDS\_RETCODE\_ILLEGAL\_OPERATION - the operation is invoked on an inappropriate object.
• DDS\_RETCODE\_ALREADY\_DELETED - the DDS\_Publisher has already been deleted.
• DDS\_RETCODE\_OUT\_OF\_RESOURCES - the Data Distribution Service ran out of resources to complete this operation.
• DDS\_RETCODE\_NOT\_ENABLED - the DDS\_Publisher is not enabled.
• DDS\_RETCODE\_PRECONDITION\_NOT\_MET - the DDS\_Publisher is not suspended.

# 3.4.1.16 DDS\_Publisher\_set\_default\_datawriter\_qos

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
DDS_ReturnCode_t
DDS_Publisher_set_default_datawriter_qos
(DDS_Publisher_this,
const DDS_DataWriterQos *qos);
```

# Description

This operation sets the default DDS\_DataWriterQos of the DDS\_Publisher.

# Parameters

in DDS\_Publisher \_this - the DDS\_Publisher object on which the operation is operated.

in const DDS\_DataWriterQos \*qos - the DDS\_DataWriterQos struct, which contains the new default DDS\_DataWriterQos for the newly-created DDS\_DataWriters.

# Return Value

D D S \_ R e t u r n C o d e \_ t - P o s s i b l e r e t u r n c o d e s o f t h e o p e r a t i o n a r e : DDS\_RETCODE\_OK, DDS\_RETCODE\_ERROR, DDS\_RETCODE\_ILLEGAL\_ OPERATION, DDS\_RETCODE\_BAD\_PARAMETER, DDS\_RETCODE\_ UNSUPPORTED, DDS\_RETCODE\_ALREADY\_DELETED, DDS\_RETCODE\_ OUT\_OF\_RESOURCES or DDS\_RETCODE\_INCONSISTENT\_POLICY.

# Detailed Description

This operation sets the default DDS\_DataWriterQos of the DDS\_Publisher (that is the struct with the QosPolicy settings) which is used for newly-created DDS\_DataWriter objects, in case the constant DDS\_DATAWRITER\_QOS\_DEFAULT is used. The default DDS\_DataWriterQos is only used when the constant is supplied as parameter qos to specify the DDS\_DataWriterQos in the DDS\_Publisher\_create\_datawriter operation.

The DDS\_Publisher\_set\_default\_datawriter\_qos operation checks if the DDS\_DataWriterQos is self consistent. If it is not, the operation has no effect and returns DDS\_RETCODE\_INCONSISTENT\_POLICY.

T h e v a l u e s s e t b y t h i s o p e r a t i o n a r e r e t u r n e d b y DDS\_Publisher\_get\_default\_datawriter\_qos.

# Return Code

When the operation returns:

• DDS\_RETCODE\_OK - the new default DDS\_DataWriterQos is set.

• DDS\_RETCODE\_ERROR - an internal error has occurred.

• DDS\_RETCODE\_ILLEGAL\_OPERATION - the operation is invoked on an inappropriate object.

• DDS\_RETCODE\_BAD\_PARAMETER - the parameter qos is not a valid DDS\_DataWriterQos. It contains a QosPolicy setting with an invalid DDS\_Duration\_t value, an enum value that is outside its legal boundaries or a sequence that has inconsistent memory settings.

• DDS\_RETCODE\_UNSUPPORTED - one or more of the selected QosPolicy values are currently not supported by OpenSplice.

• DDS\_RETCODE\_ALREADY\_DELETED - the DDS\_Publisher has already been deleted.
• DDS\_RETCODE\_OUT\_OF\_RESOURCES - the Data Distribution Service ran out of resources to complete this operation.
• DDS\_RETCODE\_INCONSISTENT\_POLICY - the parameter qos contains conflicting QosPolicy settings, e.g. a history depth that is higher than the specified resource limits.

# 3.4.1.17 DDS\_Publisher\_set\_listener

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
DDS_ReturnCode_t
DDS_Publisher_set_listener
(DDS_Publisher _this,
const struct DDS_PublisherListener *a_listener,
const DDS_StatusMask mask);
```

# Description

This operation attaches a DDS\_PublisherListener to the DDS\_Publisher.

# Parameters

in DDS\_Publisher \_this - the DDS\_Publisher object on which the operation is operated.
in const struct DDS\_PublisherListener \*a\_listener - a pointer to the DDS\_PublisherListener instance, which will be attached to the DDS\_Publisher.
in const DDS\_StatusMask mask - a bit-mask in which each bit enables the invocation of the DDS\_PublisherListener for a certain status.

# Return Value

```txt
DDS_ReturnCode_t - Possible return codes of the operation are: DDS_RETCODE_OK, DDS_RETCODE_ERROR, DDS_RETCODE_ILLEGAL_OPERATION, DDS_RETCODE_UNSUPPORTED, DDS_RETCODE_ALREADY_DELETED or DDS_RETCODE_OUT_OF_RESOURCES.
```

# Detailed Description

This operation attaches a DDS\_PublisherListener to the DDS\_Publisher. Only one DDS\_PublisherListener can be attached to each DDS\_Publisher. If a DDS\_PublisherListener was already attached, the operation will replace it with the new one. When a\_listener is the DDS\_OBJECT\_NIL pointer, it represents a listener that is treated as a NOOP1 for all statuses activated in the bitmask.

# Communication Status

For each communication status, the StatusChangedFlag flag is initially set to FALSE. It becomes TRUE whenever that communication status changes. For each c o m m u n i c a t i o n s t a t u s a c t i v a t e d i n t h e m a s k , t h e a s s o c i a t e d DDS\_PublisherListener operation is invoked and the communication status is reset to FALSE, as the listener implicitly accesses the status which is passed as a parameter to that operation. The status is reset prior to calling the listener, so if the application calls the get\_&lt;status\_name&gt;\_status from inside the listener it will see the status already reset. An exception to this rule is the DDS\_OBJECT\_NIL listener, which does not reset the communication statuses for which it is invoked.

The following statuses are applicable to the DDS\_PublisherListener:

• DDS\_OFFERED\_DEADLINE\_MISSED\_STATUS (propagated)
• DDS\_OFFERED\_INCOMPATIBLE\_QOS\_STATUS (propagated)
• DDS\_LIVELINESS\_LOST\_STATUS (propagated)
• DDS\_PUBLICATION\_MATCHED\_STATUS (propagated).

![The image displays a red triangular warning sign with a thick red border. Centered inside is a black exclamation mark.](.vortex-opensplice-c-reference-guide/b7155e444c43eb1ce140d2a96f33f0c0addc866eba8951756a263bd703b18aab.jpg)

Be aware that the DDS\_PUBLICATION\_MATCHED\_STATUS is not applicable when the infrastructure does not have the information available to determine connectivity. This is the case when OpenSplice is configured not to maintain discovery information in the Networking Service. (See also the description of the NetworkService/Discovery[@enabled] attribute in section 4.4.1.6.1 on page 244 of the Deployment Guide.) In this case the operation will return DDS\_RETCODE\_UNSUPPORTED.

Status bits are declared as a constant and can be used by the application in an OR operation to create a tailored mask. The special constant DDS\_STATUS\_MASK\_NONE can be used to indicate that the created entity should not respond to any of its available statuses. The DDS will therefore attempt to propagate these statuses to its factory. The special constant STATUS\_MASK\_ANY\_V1\_2 can be used to select all applicable statuses specified in the “Data Distribution Service for Real-time Systems Version 1.2” specification.

# Status Propagation

The Data Distribution Service will trigger the most specific and relevant Listener. In other words, in case a communication status is also activated on the DDS\_DataWriterListener of a contained DDS\_DataWriter, the

DDS\_DataWriterListener on that contained DDS\_DataWriter is invoked instead of the DDS\_PublisherListener. This means that a status change on a contained DDS\_DataWriter only invokes the DDS\_PublisherListener if the contained DDS\_DataWriter itself does not handle the trigger event generated by the status change.

In case a status is not activated in the mask of the DDS\_PublisherListener, the DDS\_DomainParticipantListener o f t h e c o n t a i n i n g DDS\_DomainParticipant is invoked (if attached and activated for the status that occurred). This allows the application to set a default behaviour in the DDS\_DomainParticipantListener o f t h e c o n t a i n i n g DDS\_DomainParticipant and a DDS\_Publisher specific behaviour when needed. In case the DDS\_DomainParticipantListener is also not attached or the communication status is not activated in its mask, the application is not notified of the change.

# Return Code

When the operation returns:

• DDS\_RETCODE\_OK - the DDS\_PublisherListener is attached.
• DDS\_RETCODE\_ERROR - an internal error has occurred.
• DDS\_RETCODE\_ILLEGAL\_OPERATION - the operation is invoked on an inappropriate object.
• DDS\_RETCODE\_UNSUPPORTED - a status was selected that cannot be supported because the infrastructure does not maintain the required connectivity information.
• DDS\_RETCODE\_ALREADY\_DELETED - the DDS\_Publisher has already been deleted.
• DDS\_RETCODE\_OUT\_OF\_RESOURCES - the Data Distribution Service ran out of resources to complete this operation.

# 3.4.1.18 DDS\_Publisher\_set\_qos

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
DDS_ReturnCode_t
DDS_Publisher_set_qos
(DDS_Publisher_this,
const DDS_PublisherQos *qos);
```

# Description

This operation replaces the existing set of QosPolicy settings for a DDS\_Publisher.

# Parameters

in DDS\_Publisher \_this - the DDS\_Publisher object on which the operation is operated.

in const DDS\_PublisherQos \*qos - contains the new set of QosPolicy settings for the DDS\_Publisher.

# Return Value

DDS\_ReturnCode\_t - Possible return codes of the operation are: DDS\_RETCODE\_OK, DDS\_RETCODE\_ERROR, DDS\_RETCODE\_ILLEGAL\_ OPERATION, DDS\_RETCODE\_BAD\_PARAMETER, DDS\_RETCODE\_ UNSUPPORTED, DDS\_RETCODE\_ALREADY\_DELETED, DDS\_RETCODE\_ OUT\_OF\_RESOURCES, DDS\_RETCODE\_IMMUTABLE\_POLICY or DDS\_RETCODE\_PRECONDITION\_NOT\_MET.

# Detailed Description

This operation replaces the existing set of QosPolicy settings for a DDS\_Publisher. The parameter qos contains the QosPolicy settings which is checked for self-consistency and mutability. When the application tries to change a QosPolicy setting for an enabled DDS\_Publisher, which can only be set before t h e D D S \_ P u b l i s h e r i s e n a b l e d , t h e o p e r a t i o n w i l l f a i l a n d a DDS\_RETCODE\_IMMUTABLE\_POLICY is returned. In other words, the application must provide the currently set QosPolicy settings in case of the immutable QosPolicy settings. Only the mutable QosPolicy settings can be changed. When qos contains conflicting QosPolicy settings (not self-consistent), the operation will fail and a DDS\_RETCODE\_INCONSISTENT\_POLICY is returned.

The set of QosPolicy settings specified by the qos parameter are applied on top of the existing QoS, replacing the values of any policies previously set (provided, the operation returned DDS\_RETCODE\_OK). If one or more of the partitions in the QoS structure have insufficient access rights configured then the set\_qos function will fail with a DDS\_RETCODE\_PRECONDITION\_NOT\_MET error code.

# Return Code

When the operation returns:

• DDS\_RETCODE\_OK - the new DDS\_PublisherQos is set.
• DDS\_RETCODE\_ERROR - an internal error has occurred.
• DDS\_RETCODE\_ILLEGAL\_OPERATION - the operation is invoked on an inappropriate object.
• DDS\_RETCODE\_BAD\_PARAMETER - the parameter qos is not a valid DDS\_PublisherQos. It contains a QosPolicy setting with an enum value that is outside its legal boundaries or a sequence that has inconsistent memory settings.

• DDS\_RETCODE\_UNSUPPORTED - one or more of the selected QosPolicy values are currently not supported by OpenSplice.
• DDS\_RETCODE\_ALREADY\_DELETED - the DDS\_Publisher has already been deleted.
• DDS\_RETCODE\_OUT\_OF\_RESOURCES - the Data Distribution Service ran out of resources to complete this operation.
• DDS\_RETCODE\_IMMUTABLE\_POLICY - the parameter qos contains an immutable QosPolicy setting with a different value than set during enabling of the DDS\_Publisher.
• DDS\_RETCODE\_PRECONDITION\_NOT\_MET - returned when insufficient access rights exist for the partition(s) listed in the QoS structure.

# 3.4.1.19 DDS\_Publisher\_suspend\_publications

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
DDS_ReturnCode_t
DDS_Publisher_suspend_publications
(DDS_Publisher _this);
```

# Description

This operation will suspend the dissemination of the publications by all contained DataWriter objects.

# Parameters

in DDS\_Publisher \_this - the DDS\_Publisher object on which the operation is operated.

# Return Value

```txt
DDS_ReturnCode_t - Possible return codes of the operation are: DDS_RETCODE_OK, DDS_RETCODE_ERROR, DDS_RETCODE_ILLEGAL_OPERATION, DDS_RETCODE_ALREADY_DELETED, DDS_RETCODE_OUT_OF_RESOURCES or DDS_RETCODE_NOT_ENABLED.
```

# Detailed Description

This operation suspends the publication of all DDS\_DataWriter objects contained by this DDS\_Publisher. The data written, disposed or unregistered by a DDS\_DataWriter is stored in the history buffer of the DDS\_DataWriter and therefore, depending on its QoS settings, the following operations may block (see the operation descriptions for more information):

• DDS\_DataWriter\_dispose

• DDS\_DataWriter\_dispose\_w\_timestamp
• DDS\_DataWriter\_write
• DDS\_DataWriter\_write\_w\_timestamp
• DDS\_DataWriter\_writedispose
• DDS\_DataWriter\_writedispose\_w\_timestamp
• DDS\_DataWriter\_unregister\_instance
• DDS\_DataWriter\_unregister\_instance\_w\_timestamp

Subsequent calls to the DDS\_Publisher\_suspend\_publications operation h a v e n o e ff e c t . W h e n t h e D D S \_ P u b l i s h e r i s d e l e t e d b e f o r e DDS\_Publisher\_resume\_publications is called, all suspended updates are discarded.

# Return Code

When the operation returns:

• DDS\_RETCODE\_OK - the DDS\_Publisher has been suspended.
• DDS\_RETCODE\_ERROR - an internal error has occurred.
• DDS\_RETCODE\_ILLEGAL\_OPERATION - the operation is invoked on an inappropriate object.
• DDS\_RETCODE\_ALREADY\_DELETED - the DDS\_Publisher has already been deleted.
• DDS\_RETCODE\_OUT\_OF\_RESOURCES - the Data Distribution Service ran out of resources to complete this operation.
• DDS\_RETCODE\_NOT\_ENABLED - the DDS\_Publisher is not enabled.

# 3.4.1.20 DDS\_Publisher\_wait\_for\_acknowledgments

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
DDS_ReturnCode_t
DDS_Publisher_wait_for_acknowledgments
(DDS_Publisher _this,
const DDS_Duration_t *max_wait);
```

# Description

This operation blocks the calling thread until either all data written by all contained DataWriters is acknowledged by the local infrastructure, or until the duration specified by max\_wait parameter elapses, whichever happens first.

# Parameters

in DDS\_Publisher \_this - the DDS\_Publisher object on which the operation is operated.

in const DDS\_Duration\_t \*max\_wait - the maximum duration to block for the DDS\_Publisher\_wait\_for\_acknowledgments, after which the a p p l i c a t i o n t h r e a d i s u n b l o c k e d . T h e s p e c i a l c o n s t a n t DDS\_DURATION\_INFINITE can be used when the maximum waiting time does not need to be bounded.

# Return Value

```txt
DDS_ReturnCode_t - Possible return codes of the operation are: DDS_RETCODE_OK, DDS_RETCODE_ERROR, DDS_RETCODE_ILLEGAL_OPERATION, DDS_RETCODE_ALREADY_DELETED, DDS_RETCODE_OUT_OF_RESOURCES, DDS_RETCODE_NOT_ENABLED or DDS_RETCODE_TIMEOUT.
```

# Detailed Description

This operation blocks the calling thread until either all data written by all contained DataWriters is acknowledged by the local infrastructure, or until the duration specified by max\_wait parameter elapses, whichever happens first.

Data is acknowledged by the local infrastructure when it does not need to be stored in its DataWriter’s local history. When a locally-connected subscription (including the networking service) has no more resources to store incoming samples it will start to reject these samples, resulting in their source DataWriters to store them temporarily in their own local history to be retransmitted at a later moment in time. In such scenarios, the DDS\_Publisher\_wait\_for\_acknowledgments operation will block until all contained DataWriters have retransmitted their entire history, which is therefore effectively empty, or until the max\_wait timeout expires, w h i c h e v e r h a p p e n s f i r s t . I n t h e f i r s t c a s e t h e o p e r a t i o n w i l l r e t u r n DDS\_RETCODE\_OK, in the latter it will return DDS\_RETCODE\_TIMEOUT.

![The image displays a standard triangular warning sign. It features a thick red border surrounding a white interior. Inside the triangle, there is a black exclamation mark. Directly beneath the exclamation mark is a black arrow pointing downward.](.vortex-opensplice-c-reference-guide/ce07ca33fb1171fec1e74afbb4c26cb0c7381f390bbd2e5bfdaf161dee7b0ad5.jpg)

Be aware that in case the operation returns DDS\_RETCODE\_OK, the data has only been acknowledged by the local infrastructure: it does not mean all remote subscriptions have already received the data. However, delivering the data to remote nodes is then the sole responsibility of the networking service: even when the publishing application would terminate, all data that has not yet been received may be considered ‘on-route’ and will therefore eventually arrive (unless the networking service itself crashes). In contrast, if a DataWriter would still have data in its local history buffer when it terminates, this data is considered ‘lost’.

This operation is intended to be used only if one or more of the contained DataWriters has its DDS\_ReliabilityQosPolicyKind set to DDS\_RELIABLE\_RELIABILITY\_QOS. Otherwise the operation will return immediately with DDS\_RETCODE\_OK, since best-effort DataWriters will never store rejected samples in their local history: they will just drop them and continue business as usual.

# Return Code

When the operation returns:

• DDS\_RETCODE\_OK - the data of all contained DataWriters has been acknowledged by the local infrastructure.
• DDS\_RETCODE\_ERROR - an internal error has occurred.
• DDS\_RETCODE\_ILLEGAL\_OPERATION - the operation is invoked on an inappropriate object.
• DDS\_RETCODE\_ALREADY\_DELETED - the DDS\_Publisher has already been deleted.
• DDS\_RETCODE\_OUT\_OF\_RESOURCES - the Data Distribution Service ran out of resources to complete this operation.
• DDS\_RETCODE\_NOT\_ENABLED - the DDS\_Publisher is not enabled.
• DDS\_RETCODE\_TIMEOUT - not all data is acknowledged before max\_wait elapsed.

# 3.4.2 Publication Type Specific Classes

This paragraph describes the generic DDS\_DataWriter class and the derived application type specific &lt;NameSpace&gt;\_&lt;type&gt;DataWriter classes which together implement the application publication interface. For each application type, u s e d a s D D S \_ T o p i c d a t a t y p e , t h e p r e - p r o c e s s o r g e n e r a t e s a &lt;NameSpace&gt;\_&lt;type&gt;DataWriter class from an IDL type description. The SPACE\_FooDataWriter class that would be generated by the pre-processor for a f i c t i o n a l t y p e F o o ( d e f i n e d i n t h e m o d u l e S P A C E ) d e s c r i b e s t h e &lt;NameSpace&gt;\_&lt;type&gt;DataWriter classes.

# 3.4.2.1 Class DDS\_DataWriter (abstract)

DDS\_DataWriter allows the application to set the value of the sample to be published under a given DDS\_Topic.

A DDS\_DataWriter is attached to exactly one DDS\_Publisher which acts as a factory for it.

A DDS\_DataWriter is bound to exactly one DDS\_Topic and therefore to exactly one data type. The DDS\_Topic must exist prior to the DDS\_DataWriter's creation.

DDS\_DataWriter is an abstract class. It must be specialized for each particular application data type. For a fictional application data type Foo (defined in the module SPACE) the specialized class would be SPACE\_FooDataWriter.

The interface description of this class is as follows:

```c
/*
 * interface DDS_DataWriter
 */
 *
 * inherited from class DDS_Entity
 */
/* DDS_StatusCondition
 *    DDS_DataWriter_get_statuscondition
 *    (DDS_DataWriter _this);
 */
/* DDS_StatusMask
 *    DDS_DataWriter_get_status_changes
 *    (DDS_DataWriter _this);
 */
/* DDS_ReturnCode_t
 *    DDS_DataWriter_enable
 *    (DDS_DataWriter _this);
 */
/*
 * abstract operations
 *    (implemented in the data type specific DDS_DataWriter)
 */
/* DDS_InstanceHandle_t
 *    DDS_DataWriter_register_instance
 *    (DDS_DataWriter _this);
 *    const &lt;data&gt; *instance_data);
 */
/* DDS_InstanceHandle_t
 *    DDS_DataWriter_register_instance_w_timestamp
 *    (DDS_DataWriter _this);
 *    const &lt;data&gt; *instance_data,
 *    const DDS_Time_t *source_timestamp);
 */
/* DDS_ReturnCode_t
 *    DDS_DataWriter_unregister_instance
 *    (DDS_DataWriter _this);
 *    const &lt;data&gt; *instance_data,
 *    const DDS_InstanceHandle_t handle);
 */
/* DDS_ReturnCode_t
```

```c
* DDS_DataWriter_unregister_instance_w_timestamp
* (DDS_DataWriter _this);
* const &lt;data&gt; *instance_data,
* const DDS_InstanceHandle_t handle,
* const DDS_Time_t *source_timestamp);
*/
/* DDS_ReturnCode_t
* DDS_DataWriter_write
* (DDS_DataWriter _this);
* const &lt;data&gt; *instance_data,
* const DDS_InstanceHandle_t handle);
*/
/* DDS_ReturnCode_t
* DDS_DataWriter_write_w_timestamp
* (DDS_DataWriter _this);
* const &lt;data&gt; *instance_data,
* const DDS_InstanceHandle_t handle,
* const DDS_Time_t *source_timestamp);
*/
/* DDS_ReturnCode_t
* DDS_DataWriter_dispose
* (DDS_DataWriter _this);
* const &lt;data&gt; *instance_data,
* const DDS_InstanceHandle_t instance_handle);
*/
/* DDS_ReturnCode_t
* DDS_DataWriter_dispose_w_timestamp
* (DDS_DataWriter _this);
* const &lt;data&gt; *instance_data,
* const DDS_InstanceHandle_t instance_handle,
* const DDS_Time_t *source_timestamp);
*/
/* DDS_ReturnCode_t
* DDS_DataWriter_writedispose
* (DDS_DataWriter _this,
* const &lt;data&gt; *instance_data,
* const DDS_InstanceHandle_t instance_handle);
*/
/* DDS_ReturnCode_t
* DDS_DataWriter_writedispose_w_timestamp
* (DDS_DataWriter _this,
* const &lt;data&gt; *instance_data,
* const DDS_InstanceHandle_t instance_handle,
* const DDS_Time_t *source_timestamp);
*/
/* DDS_ReturnCode_t
* DDS_DataWriter_get_key_value
* (DDS_DataWriter _this);
* &lt;data&gt; *key_holder,
```

```c
*    const DDS_InstanceHandle_t handle);
*/
/* DDS_InstanceHandle_t
*    DDS_DataWriter_lookup_instance
*/    (DDS_DataWriter _this,
*    &lt;data&gt; *instance_data);
/*
/*
* implemented API operations
*/
DDS_ReturnCode_t
    DDS_DataWriter_set_qos
    (DDS_DataWriter this,
    const DDS_DataWriterQos *qos);

DDS_ReturnCode_t
    DDS_DataWriter_get_qos
    (DDS_DataWriter this,
    DDS_DataWriterQos *qos);

DDS_ReturnCode_t
    DDS_DataWriter_set_listener
    (DDS_DataWriter this,
    const struct DDS_DataWriterListener *a_listener,
    const DDS_StatusMask mask);

struct DDS_DataWriterListener
    struct DDS_DataWriter_get_listener
    (DDS_DataWriter this);

DDS_Topic
    DDS_DataWriter_get_topic
    (DDS_DataWriter this);

DDS_Publisher
    DDS_DataWriter_get_publisher
    (DDS_DataWriter this);

DDS_ReturnCode_t
    DDS_DataWriter_wait_for_acknowledgments
    (DDS_DataWriter _this,
    const DDS_Duration_t *max_wait);

DDS_ReturnCode_t
    DDS_DataWriter_get_liveliness_lost_status
    (DDS_DataWriter this,
    DDS_LivelinessLostStatus *status);

DDS_ReturnCode_t
    DDS_DataWriter_get_offered_deadline_missed_status
```

```c
(DDS_DataWriter this,
DDS_OfferedDeadlineMissedStatus *status);

DDS_ReturnCode_t
DDS_DataWriter_get_offered_incompatible_qos_status
(DDS_DataWriter this,
DDS_OfferedIncompatibleQosStatus *status);

DDS_ReturnCode_t
DDS_DataWriter_get_publication_matched_status
(DDS_DataWriter this,
DDS_PublicationMatchedStatus *status);

DDS_ReturnCode_t
DDS_DataWriter_assert_liveliness
(DDS_DataWriter this);

DDS_ReturnCode_t
DDS_DataWriter_get_matched_subscriptions
(DDS_DataWriter this,
DDS_InstanceHandleSeq *subscription_handles);

DDS_ReturnCode_t
DDS_DataWriter_get_matched_subscription_data
(DDS_DataWriter this,
DDS_SubscriptionBuiltinTopicData
*subscription_data,
const DDS_InstanceHandle_t subscription_handle
);
```

The following paragraphs describe the usage of all DDS\_DataWriter operations. The inherited operations are listed but not fully described because they are not implemented in this class. The full description of these operations is given in the classes from which they are inherited. The abstract operations are listed but not fully described because they are not implemented in this specific class. The full description of these operations is located in the subclasses, which contain the data type specific implementation of these operations.

# 3.4.2.2 DDS\_DataWriter\_assert\_liveliness

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
DDS_ReturnCode_t
DDS_DataWriter_assert_liveliness
(DDS_DataWriter _this);
```

# Description

This operation asserts the liveliness for the DDS\_DataWriter.

# Parameters

in DDS\_DataWriter \_this - is the DDS\_DataWriter object on which the operation is operated.

# Return Value

DDS\_ReturnCode\_t - Possible return codes of the operation are: DDS\_RETCODE\_OK, DDS\_RETCODE\_ERROR, DDS\_RETCODE\_ILLEGAL\_ OPERATION, DDS\_RETCODE\_ALREADY\_DELETED, DDS\_RETCODE\_ OUT\_OF\_RESOURCES or DDS\_RETCODE\_NOT\_ENABLED.

# Detailed Description

This operation will manually assert the liveliness for the DDS\_DataWriter. This way, the Data Distribution Service is informed that the corresponding DDS\_DataWriter is still alive. This operation is used in combination with the DDS\_LivelinessQosPolicy set to DDS\_MANUAL\_BY\_PARTICIPANT LIVELINESS\_QOS or DDS\_MANUAL\_BY\_TOPIC\_LIVELINESS\_QOS. See Section 3.1.3.10, DDS\_LivelinessQosPolicy, on page 85, for more information on LivelinessQosPolicy.

Writing data via the DDS\_DataWriter\_write operation of a DDS\_DataWriter will assert the liveliness on the DDS\_DataWriter itself and its containing DDS\_DomainParticipant. Therefore, DDS\_DataWriter\_assert\_ liveliness is only needed when data is not written regularly.

The liveliness should be asserted by the application, depending on the DDS\_LivelinessQosPolicy. Asserting the liveliness for this DDS\_DataWriter can also be achieved by asserting the liveliness to the DDS\_DomainParticipant.

# Return Code

When the operation returns:

• DDS\_RETCODE\_OK - the liveliness of this DDS\_DataWriter has successfully been asserted.
• DDS\_RETCODE\_ERROR - an internal error has occurred.
• DDS\_RETCODE\_ILLEGAL\_OPERATION - the operation is invoked on an inappropriate object.
• DDS\_RETCODE\_ALREADY\_DELETED - the DDS\_DataWriter has already been deleted.
• DDS\_RETCODE\_OUT\_OF\_RESOURCES - the Data Distribution Service ran out of resources to complete this operation.
• DDS\_RETCODE\_NOT\_ENABLED - the DDS\_DataWriter is not enabled.

# 3.4.2.3 DDS\_DataWriter\_dispose (abstract)

This abstract operation is defined as a generic operation, which is implemented by the &lt;NameSpace&gt;\_&lt;type&gt;DataWriter class. Therefore, to use this operation, the data type specific implementation of this operation in its respective derived class must be used. For further explanation see the description for the fictional data type Foo (defined in the module SPACE) derived SPACE\_FooDataWriter class.

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
DDS_ReturnCode_t
DDS_DataWriter_dispose
(DDS_DataWriter _this,
const &lt;data&gt; *instance_data,
const DDS_InstanceHandle_t instance_handle);
```

# 3.4.2.4 DDS\_DataWriter\_dispose\_w\_timestamp (abstract)

This abstract operation is defined as a generic operation, which is implemented by the &lt;NameSpace&gt;\_&lt;type&gt;DataWriter class. Therefore, to use this operation, the data type specific implementation of this operation in its respective derived class must be used. For further explanation see the description for the fictional data type Foo (defined in the module SPACE) derived SPACE\_FooDataWriter class.

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
DDS_ReturnCode_t
DDS_DataWriter_dispose_w_timestamp
(DDS_DataWriter _this,
const &lt;data&gt; *instance_data,
const DDS_InstanceHandle_t instance_handle,
const DDS_Time_t *source_timestamp);
```

# 3.4.2.5 DDS\_DataWriter\_enable (inherited)

This operation is inherited and therefore not described here. See the class DDS\_Entity for further explanation.

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
DDS_ReturnCode_t
DDS_DataWriter_enable
(DDS_DataWriter _this);
```

# 3.4.2.6 DDS\_DataWriter\_get\_key\_value (abstract)

This abstract operation is defined as a generic operation, which is implemented by the &lt;NameSpace&gt;\_&lt;type&gt;DataWriter class. Therefore, to use this operation, the data type specific implementation of this operation in its respective derived class must be used. For further explanation see the description for the fictional data type Foo (defined in the module SPACE) derived SPACE\_FooDataWriter class.

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
DDS_ReturnCode_t
DDS_DataWriter_get_key_value
(DDS_DataWriter _this,
    &lt;data&gt; *key_holder,
    const DDS_InstanceHandle_t handle);
```

# 3.4.2.7 DDS\_DataWriter\_get\_listener

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
struct DDS_DataWriterListener
DDS_DataWriter_get_listener
(DDS_DataWriter _this);
```

# Description

This operation allows access to a DDS\_DataWriterListener.

# Parameters

in DDS\_DataWriter \_this - the DDS\_DataWriter object on which the operation is operated.

# Return Value

struct DDS\_DataWriterListener - a pointer to the DDS\_DataWriterListener attached to the DDS\_DataWriter.

# Detailed Description

This operation allows access to a DDS\_DataWriterListener attached to the DDS\_DataWriter. When no DDS\_DataWriterListener was attached to the DDS\_DataWriter, the DDS\_OBJECT\_NIL pointer is returned.

# 3.4.2.8 DDS\_DataWriter\_get\_liveliness\_lost\_status

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
DDS_ReturnCode_t
```

```c
DDS_DataWriter_get_liveliness_lost_status
(DDS_DataWriter _this,
DDS_LivelinessLostStatus *status);
```

# Description

This operation obtains the DDS\_LivelinessLostStatus struct of the DDS\_DataWriter.

# Parameters

in DDS\_DataWriter \_this - the DDS\_DataWriter object on which the operation is operated.

inout DDS\_LivelinessLostStatus \*status - the contents of the DDS\_LivelinessLostStatus struct of the DDS\_DataWriter will be copied into the location specified by status.

# Return Value

DDS\_ReturnCode\_t - Possible return codes of the operation are: DDS\_RETCODE\_OK, DDS\_RETCODE\_ERROR, DDS\_RETCODE\_ILLEGAL OPERATION, DDS\_RETCODE\_ALREADY\_DELETED or DDS\_RETCODE OUT\_OF\_RESOURCES.

# Detailed Description

This operation obtains the DDS\_LivelinessLostStatus struct of the DDS\_DataWriter. This struct contains the information whether the liveliness (that the DDS\_DataWriter has committed through its DDS\_LivelinessQosPolicy) was respected.

This means that the status represents whether the DDS\_DataWriter failed to actively signal its liveliness within the offered liveliness period. If the liveliness is lost, the DDS\_DataReader objects will consider the DDS\_DataWriter as no longer “alive”.

The DDS\_LivelinessLostStatus can also be monitored using a DDS\_DataWriterListener or by using the associated DDS\_StatusCondition.

# Return Code

When the operation returns:

• DDS\_RETCODE\_OK - the current DDS\_LivelinessLostStatus of this DDS\_DataWriter has successfully been copied into the specified status parameter.

• DDS\_RETCODE\_ERROR - an internal error has occurred.

• DDS\_RETCODE\_ILLEGAL\_OPERATION - the operation is invoked on an inappropriate object.
• DDS\_RETCODE\_ALREADY\_DELETED - the DDS\_DataWriter has already been deleted.
• DDS\_RETCODE\_OUT\_OF\_RESOURCES - the Data Distribution Service ran out of resources to complete this operation.

# 3.4.2.9 DDS\_DataWriter\_get\_matched\_subscription\_data

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
DDS_ReturnCode_t
DDS_DataWriter_get_matched_subscription_data
(DDS_DataWriter _this,
DDS_SubscriptionBuiltinTopicData *subscription_data,
const DDS_InstanceHandle_t subscription_handle);
```

# Description

This operation retrieves information on the specified subscription that is currently “associated” with the DDS\_DataWriter.

# Parameters

in DDS\_DataWriter \_this - the DDS\_DataWriter object on which the operation is operated.

inout DDS\_SubscriptionBuiltinTopicData \*subscription\_data - a pointer to the sample in which the information about the specified subscription is to be stored.

in const DDS\_InstanceHandle\_t subscription\_handle - a handle to the subscription whose information needs to be retrieved.

# Return Value

DDS\_ReturnCode\_t - Possible return codes of the operation are: DDS\_RETCODE\_OK, DDS\_RETCODE\_ERROR, DDS\_RETCODE\_ILLEGAL OPERATION, DDS\_RETCODE\_UNSUPPORTED, DDS\_RETCODE\_ALREADY\_DELETED, DDS\_RETCODE\_OUT\_OF\_RESOURCES or DDS\_RETCODE\_NOT\_ENABLED.

# Detailed Description

This operation retrieves information on the specified subscription that is currently “associated” with the DDS\_DataWriter. That is, a subscription with a matching Topic and compatible QoS that the application has not indicated should be “ignored” by means of the DDS\_DomainParticipant\_ignore\_subscription operation.

The subscription\_handle must correspond to a subscription currently associated with the DDS\_DataWriter, otherwise the operation will fail and return DDS\_RETCODE\_BAD\_PARAMETER. The operation DDS\_DataWriter\_ get\_matched\_subscriptions can be used to find the subscriptions that are currently matched with the DDS\_DataWriter.

The operation may also fail if the infrastructure does not hold the information necessary to fill in the subscription\_data. This is the case when OpenSplice is configured not to maintain discovery information in the Networking Service. (See also the description of the NetworkService/Discovery[@enabled] attribute in section 4.4.1.6.1 on page 244 of the Deployment Guide.) In this case the operation will return DDS\_RETCODE\_UNSUPPORTED.

# Return Code

When the operation returns:

• DDS\_RETCODE\_OK - the information on the specified subscription has been successfully retrieved.
• DDS\_RETCODE\_ERROR - an internal error has occurred.
• DDS\_RETCODE\_ILLEGAL\_OPERATION - the operation is invoked on an inappropriate object.
• DDS\_RETCODE\_UNSUPPORTED - OpenSplice is configured not to maintain the information about “associated” subscriptions.
• DDS\_RETCODE\_ALREADY\_DELETED - the DDS\_DataWriter has already been deleted.
• DDS\_RETCODE\_OUT\_OF\_RESOURCES - the Data Distribution Service ran out of resources to complete this operation.
• DDS\_RETCODE\_NOT\_ENABLED - the DDS\_DataWriter is not enabled.

# 3.4.2.10 DDS\_DataWriter\_get\_matched\_subscriptions

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
DDS_ReturnCode_t
DDS_DataWriter_get_matched_subscriptions
(DDS_DataWriter _this,
DDS_InstanceHandleSeq *subscription_handles);
```

# Description

This operation retrieves the list of subscriptions currently "associated" with the DDS\_DataWriter.

# Parameters

in DDS\_DataWriter \_this - the DDS\_DataWriter object on which the operation is operated.

inout DDS\_InstanceHandleSeq \*subscription\_handles - a sequence which is used to pass the list of all associated subscribtions.

# Return Value

D D S \_ R e t ur n C o d e \_ t - Possible re turn codes of the operation are: DDS\_RETCODE\_OK, DDS\_RETCODE\_ERROR, DDS\_RETCODE\_ILLEGAL OPERATION, DDS\_RETCODE\_UNSUPPORTED, DDS\_RETCODE\_ALREADY\_DELETED, DDS\_RETCODE\_OUT\_OF\_RESOURCES or DDS\_RETCODE\_NOT\_ENABLED.

# Detailed Description

This operation retrieves the list of subscriptions currently "associated" with the DDS\_DataWriter. That is, subscriptions that have a matching Topic and compatible QoS that the application has not indicated should be “ignored” by means of the DDS\_DomainParticipant\_ignore\_subscription operation.

The subscription\_handles sequence and its buffer may be pre-allocated by the application and therefore must either be re-used in a subsequent invocation of the DDS\_DataWriter\_get\_matched\_subscriptions operation or be released by calling DDS\_free on the returned subscription\_handles. If the pre-allocated sequence is not big enough to hold the number of associated subscriptions, the sequence will automatically be (re-)allocated to fit the required size.

The handles returned in the subscription\_handles sequence are the ones that are used by the DDS implementation to locally identify the corresponding matched DataReader entities. You can access more detailed information about a particular subscription by passing its subscription\_handle to either the DDS\_DataWriter\_get\_matched\_subscription\_data operation or to the DDS\_SubscriptionBuiltinTopicDataDataReader\_read\_instance operation on the built-in reader for the “DCPSSubscription” topic.

![The image displays a standard warning symbol consisting of a red triangle border on a white background. Inside the triangle is a bold, black exclamation point.](.vortex-opensplice-c-reference-guide/29c107be46885e386bf2f8245b9f258096b54ae653361bc79a5b1d80d9ed1366.jpg)

Be aware that since DDS\_InstanceHandle\_t is an opaque datatype, it does not necessarily mean that the handles obtained from the DDS\_DataWriter get\_matched\_subscriptions operation have the same value as the ones that appear in the instance\_handle field of the DDS\_SampleInfo when retrieving the subscription info through corresponding "DCPSSubscriptions" built-in reader. You can’t just compare two handles to determine whether they represent the same subscription. If you want to know whether two handles actually do represent the same subscription, use both handles to retrieve their corresponding DDS\_SubscriptionBuiltinTopicData samples and then compare the key field of both samples.

The operation may fail if the infrastructure does not locally maintain the connectivity information. This is the case when OpenSplice is configured not to maintain discovery information in the Networking Service. (See also the description of the NetworkService/Discovery[@enabled] attribute in section 4.4.1.6.1 on page 244 of the Deployment Guide.) In this case the operation will return DDS\_RETCODE\_UNSUPPORTED.

# Return Code

When the operation returns:

• DDS\_RETCODE\_OK - the list of associated subscriptions has successfully been obtained.
• DDS\_RETCODE\_ERROR - an internal error has occurred.
• DDS\_RETCODE\_ILLEGAL\_OPERATION - the operation is invoked on an inappropriate object.
• DDS\_RETCODE\_UNSUPPORTED - OpenSplice is configured not to maintain the information about “associated” subscriptions.
• DDS\_RETCODE\_ALREADY\_DELETED - the DDS\_DataWriter has already been deleted.
• DDS\_RETCODE\_OUT\_OF\_RESOURCES - the Data Distribution Service ran out of resources to complete this operation.
• DDS\_RETCODE\_NOT\_ENABLED - the DDS\_DataWriter is not enabled.

# 3.4.2.11 DDS\_DataWriter\_get\_offered\_deadline\_missed\_status

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
DDS_ReturnCode_t
DDS_DataWriter_get_offered_deadline_missed_status
(DDS_DataWriter_this,
DDS_OfferedDeadlineMissedStatus *status);
```

# Description

This operation obtains the DDS\_OfferedDeadlineMissedStatus struct of the DDS\_DataWriter.

# Parameters

in DDS\_DataWriter \_this - the DDS\_DataWriter object on which the operation is operated.

inout DDS\_OfferedDeadlineMissedStatus \*status - the contents of the DDS\_OfferedDeadlineMissedStatus struct of the DDS\_DataWriter will be copied into the location specified by status.

# Return Value

DDS\_ReturnCode\_t - Possible return codes of the operation are: DDS\_RETCODE\_OK, DDS\_RETCODE\_ERROR, DDS\_RETCODE\_ILLEGAL OPERATION, DDS\_RETCODE\_ALREADY\_DELETED or DDS\_RETCODE\_ OUT\_OF\_RESOURCES.

# Detailed Description

This operation obtains the DDS\_OfferedDeadlineMissedStatus struct of the DDS\_DataWriter. This struct contains the information whether the deadline (that the DDS\_DataWriter has committed through its DDS\_DeadlineQosPolicy) was respected for each instance.

The DDS\_OfferedDeadlineMissedStatus can also be monitored using a DDS\_DataWriterListener or by using the associated DDS\_StatusCondition.

# Return Code

When the operation returns:

• DDS\_RETCODE\_OK - the current DDS\_LivelinessLostStatus of this DDS\_DataWriter has successfully been copied into the specified status parameter.
• DDS\_RETCODE\_ERROR - an internal error has occurred.
• DDS\_RETCODE\_ILLEGAL\_OPERATION - the operation is invoked on an inappropriate object.
• DDS\_RETCODE\_ALREADY\_DELETED - the DDS\_DataWriter has already been deleted.
• DDS\_RETCODE\_OUT\_OF\_RESOURCES - the Data Distribution Service ran out of resources to complete this operation.

# 3.4.2.12 DDS\_DataWriter\_get\_offered\_incompatible\_qos\_status

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
DDS_ReturnCode_t
DDS_DataWriter_get_offered_incompatible_qos_status
(DDS_DataWriter_this,
DDS_OfferedIncompatibleQosStatus *status);
```

# Description

This operation obtains the DDS\_OfferedIncompatibleQosStatus struct of the DDS\_DataWriter.

# Parameters

in DDS\_DataWriter \_this - the DDS\_DataWriter object on which the operation is operated.

inout DDS\_OfferedIncompatibleQosStatus \*status - the contents of the DDS\_OfferedIncompatibleQosStatus struct of the DDS\_DataWriter will be copied into the location specified by status.

# Return Value

DDS\_ReturnCode\_t - Possible return codes of the operation are: DDS\_RETCODE\_OK, DDS\_RETCODE\_ERROR, DDS\_RETCODE\_ILLEGAL OPERATION, DDS\_RETCODE\_ALREADY\_DELETED or DDS\_RETCODE OUT\_OF\_RESOURCES.

# Detailed Description

This operation obtains the DDS\_OfferedIncompatibleQosStatus struct of the DDS\_DataWriter. This struct contains the information whether a QosPolicy setting was incompatible with the requested QosPolicy setting.

This means that the status represents whether a DDS\_DataReader object has been discovered by the DDS\_DataWriter with the same DDS\_Topic and a requested DDS\_DataReaderQos that was incompatible with the one offered by the DDS\_DataWriter.

The DDS\_OfferedIncompatibleQosStatus can also be monitored using a DDS\_DataWriterListener or by using the associated DDS\_StatusCondition.

# Return Code

When the operation returns:

• DDS\_RETCODE\_OK - the current DDS\_OfferedIncompatibleQosStatus of this DDS\_DataWriter has successfully been copied into the specified status parameter.
• DDS\_RETCODE\_ERROR - an internal error has occurred.
• DDS\_RETCODE\_ILLEGAL\_OPERATION - the operation is invoked on an inappropriate object.
• DDS\_RETCODE\_ALREADY\_DELETED - the DDS\_DataWriter has already been deleted.

• DDS\_RETCODE\_OUT\_OF\_RESOURCES - the Data Distribution Service ran out of resources to complete this operation.

# 3.4.2.13 DDS\_DataWriter\_get\_publication\_matched\_status

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
DDS_ReturnCode_t
DDS_DataWriter_get_publication_matched_status
(DDS_DataWriter _this,
DDS_PublicationMatchedStatus *status);
```

# Description

This operation obtains the DDS\_PublicationMatchedStatus struct of the DDS\_DataWriter.

# Parameters

in DDS\_DataWriter \_this - the DDS\_DataWriter object on which the operation is operated.

inout DDS\_PublicationMatchedStatus \*status - the contents of the DDS\_PublicationMatchedStatus struct of the DDS\_DataWriter will be copied into the location specified by status.

# Return Value

D D S \_ R e t ur n C o d e \_ t - Possible re turn codes of the operation are: DDS\_RETCODE\_OK, DDS\_RETCODE\_ERROR, DDS\_RETCODE\_ILLEGAL\_ OPERATION, RETCODE\_UNSUPPORTED, DDS\_RETCODE\_ALREADY\_DELETED or DDS\_RETCODE\_OUT\_OF\_RESOURCES.

# Detailed Description

This operation obtains the DDS\_PublicationMatchedStatus struct of the DDS\_DataWriter. This struct contains information about whether a new match has been discovered for the current publication, or whether an existing match has ceased to exist.

This means that the status represents that either a DataReader object has been discovered by the DDS\_DataWriter with the same Topic and a compatible Qos, or that a previously-discovered DataReader has ceased to be matched to the current DDS\_DataWriter. A DataReader may cease to match when it gets deleted, when it changes its Qos to a value that is incompatible with the current DDS\_DataWriter or when either the DDS\_DataWriter or the DataReader has chosen to put its matching counterpart on its ignore-list using the DDS\_DomainParticipant\_ ignore\_subcription or DDS\_DomainParticipant\_ignore\_publication operations.

The operation may fail if the infrastructure does not hold the information necessary to fill in the DDS\_PublicationMatchedStatus. This is the case when OpenSplice is configured not to maintain discovery information in the Networking S e r v i c e . ( S e e t h e d e s c r i p t i o n f o r t h e N e t w o r k i n g S e r v i c e / Discovery/enabled property in the Deployment Manual for more information a b o u t t h i s s u b j e c t . ) I n t h i s c a s e t h e o p e r a t i o n w i l l r e t u r n DDS\_RETCODE\_UNSUPPORTED.

The DDS\_PublicationMatchedStatus can also be monitored using a DDS\_DataWriterListener or by using the associated DDS\_StatusCondition.

# Return Code

When the operation returns:

• DDS\_RETCODE\_OK - the current DDS\_PublicationMatchedStatus of this DDS\_DataWriter has successfully been copied into the specified status parameter.
• DDS\_RETCODE\_ERROR - an internal error has occurred.
• DDS\_RETCODE\_ILLEGAL\_OPERATION - the operation is invoked on an inappropriate object.
• DDS\_RETCODE\_UNSUPPORTED - OpenSplice is configured not to maintain the information about “associated” subscriptions.
• DDS\_RETCODE\_ALREADY\_DELETED - the DDS\_DataWriter has already been deleted.
• DDS\_RETCODE\_OUT\_OF\_RESOURCES - the Data Distribution Service ran out of resources to complete this operation.

# 3.4.2.14 DDS\_DataWriter\_get\_publisher

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
DDS_Publisher
DDS_DataWriter_get_publisher
(DDS_DataWriter _this);
```

# Description

This operation returns the DDS\_Publisher to which the DDS\_DataWriter belongs.

# Parameters

in DDS\_DataWriter \_this - the DDS\_DataWriter object on which the operation is operated.

# Return Value

DDS\_Publisher - a pointer to the DDS\_Publisher to which the DDS\_DataWriter belongs.

# Detailed Description

This operation returns the DDS\_Publisher to which the DDS\_DataWriter belongs, thus the DDS\_Publisher that has created the DDS\_DataWriter. If the DDS\_DataWriter is already deleted, the DDS\_OBJECT\_NIL pointer is returned.

# 3.4.2.15 DDS\_DataWriter\_get\_qos

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
DDS_ReturnCode_t
DDS_DataWriter_get_qos
(DDS_DataWriter_this,
DDS_DataWriterQos *qos);
```

# Description

This operation allows access to the existing list of QosPolicy settings for a DDS\_DataWriter.

# Parameters

in DDS\_DataWriter \_this - the DDS\_DataWriter object on which the operation is operated.

inout DDS\_DataWriterQos \*qos - a pointer to the destination DDS\_DataWriterQos struct in which the QosPolicy settings will be copied.

# Return Value

DDS\_ReturnCode\_t - Possible return codes of the operation are: DDS\_RETCODE\_OK, DDS\_RETCODE\_ERROR, DDS\_RETCODE\_ILLEGAL OPERATION, DDS\_RETCODE\_ALREADY\_DELETED or DDS\_RETCODE OUT\_OF\_RESOURCES.

# Detailed Description

This operation allows access to the existing list of QosPolicy settings of a DDS\_DataWriter on which this operation is used. This DDS\_DataWriterQos is stored at the location pointed to by the qos parameter.

# Return Code

When the operation returns:

• DDS\_RETCODE\_OK - the existing set of QoS policy values applied to this DDS\_DataWriter has successfully been copied into the specified DDS\_DataWriterQos parameter.
• DDS\_RETCODE\_ERROR - an internal error has occurred.
• DDS\_RETCODE\_ILLEGAL\_OPERATION - the operation is invoked on an inappropriate object.
• DDS\_RETCODE\_ALREADY\_DELETED - the DDS\_DataWriter has already been deleted.
• DDS\_RETCODE\_OUT\_OF\_RESOURCES - the Data Distribution Service ran out of resources to complete this operation.

# 3.4.2.16 DDS\_DataWriter\_get\_status\_changes (inherited)

This operation is inherited and therefore not described here. See the class DDS\_Entity for further explanation.

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
DDS_StatusMask
DDS_DataWriter_get_status_changes
(DDS_DataWriter _this);
```

# 3.4.2.17 DDS\_DataWriter\_get\_statuscondition (inherited)

This operation is inherited and therefore not described here. See the class DDS\_Entity for further explanation.

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
DDS_StatusCondition
DDS_DataWriter_get_statuscondition
(DDS_DataWriter_this);
```

# 3.4.2.18 DDS\_DataWriter\_get\_topic

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
DDS_Topic
DDS_DataWriter_get_topic
(DDS_DataWriter _this);
```

# Description

This operation returns the DDS\_Topic which is associated with the DDS\_DataWriter.

# Parameters

in DDS\_DataWriter \_this - the DDS\_DataWriter object on which the operation is operated.

# Return Value

DDS\_Topic - Return value is a pointer to the DDS\_Topic which is associated with the DDS\_DataWriter.

# Detailed Description

This operation returns the DDS\_Topic which is associated with the DDS\_DataWriter, thus the DDS\_Topic with which the DDS\_DataWriter is created. If the DDS\_DataWriter is already deleted, the DDS\_OBJECT\_NIL pointer is returned.

# 3.4.2.19 DDS\_DataWriter\_lookup\_instance (abstract)

This abstract operation is defined as a generic operation, which is implemented by the &lt;NameSpace&gt;\_&lt;type&gt;DataWriter class. Therefore, to use this operation, the data type specific implementation of this operation in its respective derived class must be used. For further explanation see the description for the fictional data type Foo (defined in the module SPACE) derived SPACE\_FooDataWriter class.

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
DDS_InstanceHandle_t
DDS_DataWriter_lookup_instance
(DDS_DataWriter _this,
&lt;data&gt; *instance_data);
```

# 3.4.2.20 DDS\_DataWriter\_register\_instance (abstract)

This abstract operation is defined as a generic operation, which is implemented by the &lt;NameSpace&gt;\_&lt;type&gt;DataWriter class. Therefore, to use this operation, the data type specific implementation of this operation in its respective derived class must be used. For further explanation see the description for the fictional data type Foo (defined in the module SPACE) derived SPACE\_FooDataWriter class.

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
const DDS_InstanceHandle_t
```

```txt
DDS_DataWriter_register_instance
(DDS_DataWriter _this,
const &lt;data&gt; *instance_data);
```

# 3.4.2.21 DDS\_DataWriter\_register\_instance\_w\_timestamp (abstract)

This abstract operation is defined as a generic operation, which is implemented by the &lt;NameSpace&gt;\_&lt;type&gt;DataWriter class. Therefore, to use this operation, the data type specific implementation of this operation in its respective derived class must be used. For further explanation see the description for the fictional data type Foo (defined in the module SPACE) derived SPACE\_FooDataWriter class.

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
const DDS_InstanceHandle_t
DDS_DataWriter_register_instance_w_timestamp
(DDS_DataWriter _this,
    const &lt;data&gt; *instance_data,
    const DDS_Time_t *source_timestamp);
```

# 3.4.2.22 DDS\_DataWriter\_set\_listener

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
DDS_ReturnCode_t
DDS_DataWriter_set_listener
(DDS_DataWriter _this,
const struct DDS_DataWriterListener *a_listener,
const DDS_StatusMask mask);
```

# Description

This operation attaches a DDS\_DataWriterListener to the DDS\_DataWriter.

# Parameters

in DDS\_DataWriter \_this - the DDS\_DataWriter object on which the operation is operated.

in const struct DDS\_DataWriterListener \*a\_listener - a pointer to the DDS\_DataWriterListener instance, which will be attached to the DDS\_DataWriter.

in const DDS\_StatusMask mask - a bit-mask in which each bit enables the invocation of the DDS\_DataWriterListener for a certain status.

# Return Value

D D S \_ R e t u r n C o d e \_ t - P o s s i b l e r e t u r n c o d e s o f t h e o p e r a t i o n a r e : DDS\_RETCODE\_OK, DDS\_RETCODE\_ERROR, DDS\_RETCODE\_ILLEGAL\_ OPERATION, DDS\_RETCODE\_UNSUPPORTED, DDS\_RETCODE\_ ALREADY\_DELETED or DDS\_RETCODE\_OUT\_OF\_RESOURCES.

# Detailed Description

This operation attaches a DDS\_DataWriterListener to the DDS\_DataWriter. Only one DDS\_DataWriterListener can be attached to each DDS\_DataWriter. If a DDS\_DataWriterListener was already attached, the operation will replace it with the new one. When a\_listener is the DDS\_OBJECT\_NIL pointer, it represents a listener that is treated as a NOOP1 for all statuses activated in the bitmask.

# Communication Status

For each communication status, the StatusChangedFlag flag is initially set to FALSE. It becomes TRUE whenever that communication status changes. For each c o m m u n i c a t i o n s t a t u s a c t i v a t e d i n t h e m a s k , t h e a s s o c i a t e d DDS\_DataWriterListener operation is invoked and the communication status is reset to FALSE, as the listener implicitly accesses the status which is passed as a parameter to that operation. The status is reset prior to calling the listener, so if the application calls the get\_&lt;status\_name&gt;\_status from inside the listener it will see the status already reset. An exception to this rule is the DDS\_OBJECT\_NIL listener, which does not reset the communication statuses for which it is invoked.

The following statuses are applicable to the DDS\_DataWriterListener:

• DDS\_OFFERED\_DEADLINE\_MISSED\_STATUS
• DDS\_OFFERED\_INCOMPATIBLE\_QOS\_STATUS
• DDS\_LIVELINESS\_LOST\_STATUS
• DDS\_PUBLICATION\_MATCHED\_STATUS.

Be aware that the DDS\_PUBLICATION\_MATCHED\_STATUS is not applicable when the infrastructure does not have the information available to determine connectivity. This is the case when OpenSplice is configured not to maintain discovery information in the Networking Service. (See also the description of the NetworkService/Discovery[@enabled] attribute in section 4.4.1.6.1 on page 244 of the Deployment Guide.) In this case the operation will return DDS\_RETCODE\_UNSUPPORTED.

Status bits are declared as a constant and can be used by the application in an OR operation to create a tailored mask. The special constant DDS\_STATUS\_MASK\_NONE can be used to indicate that the created entity should not respond to any of its available statuses. The DDS will therefore attempt to propagate these statuses to its factory. The special constant STATUS\_MASK\_ANY\_V1\_2 can be used to select all applicable statuses specified in the “Data Distribution Service for Real-time Systems Version 1.2” specification.

# Status Propagation

In case a communication status is not activated in the m a sk of the DDS\_DataWriterListener, the DDS\_PublisherListener of the containing DDS\_Publisher is invoked (if attached and activated for the status that occurred). T h i s a l l o w s t h e a p p l i c a t i o n t o s e t a d e f a u l t b e h a v i o u r i n t h e DDS\_PublisherListener of the containing DDS\_Publisher and a DDS\_DataWriter specific behaviour when needed. In case the communication status is not activated in the mask of the DDS\_PublisherListener as well, the c o m m u n i c a t i o n s t a t u s w i l l b e p r o p a g a t e d t o t h e DDS\_DomainParticipantListener o f t h e c o n t a i n i n g DDS\_DomainParticipant. In case the DDS\_DomainParticipantListener is also not attached or the communication status is not activated in its mask, the application is not notified of the change.

# Return Code

When the operation returns:

• DDS\_RETCODE\_OK - the DDS\_DataWriterListener is attached.
• DDS\_RETCODE\_ERROR - an internal error has occurred.
• DDS\_RETCODE\_ILLEGAL\_OPERATION - the operation is invoked on an inappropriate object.
• DDS\_RETCODE\_UNSUPPORTED - a status was selected that cannot be supported because the infrastructure does not maintain the required connectivity information.
• DDS\_RETCODE\_ALREADY\_DELETED - the DDS\_DataWriter has already been deleted.
• DDS\_RETCODE\_OUT\_OF\_RESOURCES - the Data Distribution Service ran out of resources to complete this operation.

# 3.4.2.23 DDS\_DataWriter\_set\_qos

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
DDS_ReturnCode_t
```

```c
DDS_DataWriter_set_qos
(DDS_DataWriter_this,
const DDS_DataWriterQos *qos);
```

# Description

This operation replaces the existing set of QosPolicy settings for a DDS\_DataWriter.

# Parameters

in DDS\_DataWriter \_this - the DDS\_DataWriter object on which the operation is operated.

in const DDS\_DataWriterQos \*qos - contain the new set of QosPolicy settings for the DDS\_DataWriter.

# Return Value

```txt
DDS_ReturnCode_t - Possible return codes of the operation are: DDS_RETCODE_OK, DDS_RETCODE_ERROR, DDS_RETCODE_ILLEGAL_OPERATION, DDS_RETCODE_BAD_PARAMETER, DDS_RETCODE_UNSUPPORTED, DDS_RETCODE_ALLREADY_DELETED, DDS_RETCODE_OUT_OF_RESOURCES, DDS_RETCODE_IMMUTABLE_POLICY or DDS_RETCODE_INCONSISTENT_POLICY.
```

# Detailed Description

This operation replaces the existing set of QosPolicy settings for a DDS\_DataWriter. The parameter qos contains the struct with the QosPolicy settings which is checked for self-consistency and mutability. When the application tries to change a QosPolicy setting for an enabled DDS\_DataWriter, which can only be set before the DDS\_DataWriter is enabled, the operation will fail and a DDS\_RETCODE\_IMMUTABLE\_POLICY is returned. In other words, the application must provide the presently set QosPolicy settings in case of the immutable QosPolicy settings. Only the mutable QosPolicy settings can be changed. When qos contains conflicting QosPolicy settings (not self-consistent), the operation will fail and a DDS\_RETCODE\_INCONSISTENT\_POLICY is returned.

The set of QosPolicy settings specified by the qos parameter are applied on top of the existing QoS, replacing the values of any policies previously set (provided, the operation returned DDS\_RETCODE\_OK).

# Return Code

When the operation returns:

• DDS\_RETCODE\_OK - the new default DDS\_DataWriterQos is set.
• DDS\_RETCODE\_ERROR - an internal error has occurred.

• DDS\_RETCODE\_ILLEGAL\_OPERATION - the operation is invoked on an inappropriate object.
• DDS\_RETCODE\_BAD\_PARAMETER - the parameter qos is not a valid. DDS\_DataWriterQos. It contains a QosPolicy setting with an invalid DDS\_Duration\_t value, an enum value that is outside its legal boundaries or a sequence that has inconsistent memory settings.
• DDS\_RETCODE\_UNSUPPORTED - one or more of the selected QosPolicy values are currently not supported by OpenSplice.
• DDS\_RETCODE\_ALREADY\_DELETED - the DDS\_DataWriter has already been deleted.
• DDS\_RETCODE\_OUT\_OF\_RESOURCES - the Data Distribution Service ran out of resources to complete this operation.
• DDS\_RETCODE\_IMMUTABLE\_POLICY - the parameter qos contains an immutable QosPolicy setting with a different value than set during enabling of the DDS\_DataWriter.
• DDS\_RETCODE\_INCONSISTENT\_POLICY - the parameter qos contains conflicting QosPolicy settings, e.g. a history depth that is higher than the specified resource limits.

# 3.4.2.24 DDS\_DataWriter\_unregister\_instance (abstract)

This abstract operation is defined as a generic operation, which is implemented by the &lt;NameSpace&gt;\_&lt;type&gt;DataWriter class. Therefore, to use this operation, the data type specific implementation of this operation in its respective derived class must be used. For further explanation see the description for the fictional data type Foo (defined in the module SPACE) derived SPACE\_FooDataWriter class.

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
DDS_ReturnCode_t
DDS_DataWriter_unregister_instance
(DDS_DataWriter _this,
const &lt;data&gt; *instance_data,
const DDS_InstanceHandle_t handle);
```

# 3.4.2.25 DDS\_DataWriter\_unregister\_instance\_w\_timestamp (abstract)

This abstract operation is defined as a generic operation, which is implemented by the &lt;NameSpace&gt;\_&lt;type&gt;DataWriter class. Therefore, to use this operation, the data type specific implementation of this operation in its respective derived class must be used. For further explanation see the description for the fictional data type Foo (defined in the module SPACE) derived SPACE\_FooDataWriter class.

Synopsis
```c
#include &lt;dds_dcps.h&gt;
DDS_ReturnCode_t
DDS_DataWriter_unregister_instance_w_timestamp
(DDS_DataWriter _this,
const &lt;data&gt; *instance_data,
const DDS_InstanceHandle_t handle,
const DDS_Time_t *source_timestamp);
```

# 3.4.2.26 DDS\_DataWriter\_wait\_for\_acknowledgments

Synopsis
```c
#include &lt;dds_dcps.h&gt;
DDS_ReturnCode_t
DDS_DataWriter_wait_for_acknowledgments
(DDS_DataWriter _this,
const DDS_Duration_t *max_wait);
```

# Description

This operation blocks the calling thread until either all data written by the DDS\_DataWriter is acknowledged by the local infrastructure, or until the duration specified by max\_wait parameter elapses, whichever happens first.

Parameters
```txt
in DDS_DataWriter _this - the DDS_DataWriter object on which the operation is operated.
in const DDS_Duration_t *max_wait - the maximum duration to block for the DDS_DataWriter_wait_for_acknowledgments, after which the application thread is unblocked. The special constant DDS_DURATION_INFINITE can be used when the maximum waiting time does not need to be bounded.
```

Return Value
```txt
DDS_ReturnCode_t - Possible return codes of the operation are: DDS_RETCODE_OK, DDS_RETCODE_ERROR, DDS_RETCODE_ILLEGAL_OPERATION, DDS_RETCODE_ALREADY_DELETED, DDS_RETCODE_OUT_OF_RESOURCES, DDS_RETCODE_NOT_ENABLED or DDS_RETCODE_TIMEOUT.
```

# Detailed Description

This operation blocks the calling thread until either all data written by the DDS\_DataWriter is acknowledged by the local infrastructure, or until the duration specified by max\_wait parameter elapses, whichever happens first.

Data is acknowledged by the local infrastructure when it does not need to be stored in its DataWriter’s local history. When a locally-connected subscription (including the networking service) has no more resources to store incoming samples it will start to reject these samples, resulting in its source DataWriter to store them temporarily in its own local history to be retransmitted at a later moment in time. In such scenarios, the DDS\_DataWriter\_wait\_for\_acknowledgments operation will block until the DDS\_DataWriter has retransmitted its entire history, which is therefore effectively empty, or until the max\_wait timeout expires, whichever happens first. In the first case the operation will return DDS\_RETCODE\_OK, in the latter it will return DDS\_RETCODE\_TIMEOUT.

![The image shows a triangular warning sign with a white background. It features a thick red border surrounded by a thin black outer border. Inside the triangle, there is a black exclamation mark. Directly below the exclamation mark is a small black arrow pointing downwards.](.vortex-opensplice-c-reference-guide/c478eabe11691b85a7ece963cff93d868472ce1833061f46418fd0bdc8bd6496.jpg)

Be aware that in case the operation returns DDS\_RETCODE\_OK, the data has only been acknowledged by the local infrastructure: it does not mean all remote subscriptions have already received the data. However, delivering the data to remote nodes is then the sole responsibility of the networking service: even when the publishing application would terminate, all data that has not yet been received may be considered ‘on-route’ and will therefore eventually arrive (unless the networking service itself crashes). In contrast, if the DDS\_DataWriter would still have data in it’s local history buffer when it terminates, this data is considered ‘lost’.

This operation is intended to be used only if the DDS\_DataWriter has its DDS\_ReliabilityQosPolicyKind set to DDS\_RELIABLE\_RELIABILITY\_QOS. Otherwise the operation will return immediately with DDS\_RETCODE\_OK, since best-effort DataWriters will never store rejected samples in their local history: they will just drop them and continue business as usual.

# Return Code

When the operation returns:

• DDS\_RETCODE\_OK - the data of the DDS\_DataWriter has been acknowledged by the local infrastructure.
• DDS\_RETCODE\_ERROR - an internal error has occurred.
• DDS\_RETCODE\_ILLEGAL\_OPERATION - the operation is invoked on an inappropriate object.
• DDS\_RETCODE\_ALREADY\_DELETED - the DDS\_DataWriter has already been deleted.
• DDS\_RETCODE\_OUT\_OF\_RESOURCES - the Data Distribution Service ran out of resources to complete this operation.
• DDS\_RETCODE\_NOT\_ENABLED - the DDS\_DataWriter is not enabled.
• DDS\_RETCODE\_TIMEOUT - not all data is acknowledged before max\_wait elapsed.

# 3.4.2.27 DDS\_DataWriter\_write (abstract)

This abstract operation is defined as a generic operation, which is implemented by the &lt;NameSpace&gt;\_&lt;type&gt;DataWriter class. Therefore, to use this operation, the data type specific implementation of this operation in its respective derived class must be used. For further explanation see the description for the fictional data type Foo (defined in the module SPACE) derived SPACE\_FooDataWriter class.

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
DDS_ReturnCode_t
DDS_DataWriter_write
(DDS_DataWriter _this,
const &lt;data&gt; *instance_data,
const DDS_InstanceHandle_t handle);
```

# 3.4.2.28 DDS\_DataWriter\_write\_w\_timestamp (abstract)

This abstract operation is defined as a generic operation, which is implemented by the &lt;NameSpace&gt;\_&lt;type&gt;DataWriter class. Therefore, to use this operation, the data type specific implementation of this operation in its respective derived class must be used. For further explanation see the description for the fictional data type Foo (defined in the module SPACE) derived SPACE\_FooDataWriter class.

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
DDS_ReturnCode_t
DDS_DataWriter_write_w_timestamp
(DDS_DataWriter _this,
const &lt;data&gt; *instance_data,
const DDS_InstanceHandle_t handle,
const DDS_Time_t *source_timestamp);
```

# 3.4.2.29 DDS\_DataWriter\_writedispose (abstract)

This abstract operation is defined as a generic operation, which is implemented by the &lt;NameSpace&gt;\_&lt;type&gt;DataWriter class. Therefore, to use this operation, the data type specific implementation of this operation in its respective derived class must be used. For further explanation see the description for the fictional data type Foo (defined in the module SPACE) derived SPACE\_FooDataWriter class.

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
DDS_ReturnCode_t
DDS_DataWriter_writedispose
(DDS_DataWriter _this,
const &lt;data&gt; *instance_data,
```

const DDS\_InstanceHandle\_t instance\_handle);

# 3.4.2.30 DDS\_DataWriter\_writedispose\_w\_timestamp (abstract)

This abstract operation is defined as a generic operation, which is implemented by the &lt;NameSpace&gt;\_&lt;type&gt;DataWriter class. Therefore, to use this operation, the data type specific implementation of this operation in its respective derived class must be used. For further explanation see the description for the fictional data type Foo (defined in the module SPACE) derived SPACE\_FooDataWriter class.

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
DDS_ReturnCode_t
DDS_DataWriter_writedispose_w_timestamp
(DDS_DataWriter _this,
const &lt;data&gt; *instance_data,
const DDS_InstanceHandle_t instance_handle,
const DDS_Time_t *source_timestamp);
```

# 3.4.2.31 Class SPACE\_FooDataWriter

The pre-processor generates from IDL type descriptions the application &lt;NameSpace&gt;\_&lt;type&gt;DataWriter classes. For each application data type that is used as DDS\_Topic data type, a typed class &lt;NameSpace&gt;\_&lt;type&gt;DataWriter is derived from the DDS\_DataWriter class. In this paragraph, the class SPACE\_FooDataWriter describes the operations of these derived &lt;NameSpace&gt;\_&lt;type&gt;DataWriter classes as an example for the fictional application type Foo (defined in the module SPACE).

For instance, for an application, the definitions are located in the Space.idl file. The pre-processor will generate a Space.h include file.

A SPACE\_FooDataWriter is attached to exactly one DDS\_Publisher which acts as a factory for it. The SPACE\_FooDataWriter is bound to exactly one DDS\_Topic that has been registered to use a data type Foo (defined in the module SPACE). The DDS\_Topic must exist prior to the SPACE\_FooDataWriter creation.

The interface description of this class is as follows:

```c
/*
 * interface SPACE_FooDataWriter
 */
/*
 * inherited from class DDS_Entity
 */
/* DDS_StatusCondition
 * SPACE_FooDataWriter_get_statuscondition
 * (SPACE_FooDataWriter _this);
 */
/* DDS_StatusMask
```

```c
* SPACE_FooDataWriter_get_status_changes
* (SPACE_FooDataWriter _this);
*/
/* DDS_ReturnCode_t
* SPACE_FooDataWriter_enable
* (SPACE_FooDataWriter _this);
*/
/*
* inherited from class DDS_DataWriter
*/
/* DDS_ReturnCode_t
* SPACE_FooDataWriter_set_qos
* (SPACE_FooDataWriter _this,
* const DDS_DataWriterQos *qos);
*/
/* DDS_ReturnCode_t
* SPACE_FooDataWriter_get_qos
* (SPACE_FooDataWriter _this,
* SPACE_FooDataWriterQos *qos);
*/
/* DDS_ReturnCode_t
* SPACE_FooDataWriter_set_listener
* (SPACE_FooDataWriter _this,
* const struct DDS_DataWriterListener *a_listener,
* const DDS_StatusMask mask);
*/
/* struct SPACE_FooDataWriterListener
* SPACE_FooDataWriter_get_listener
* (SPACE_FooDataWriter _this);
*/
/* DDS_Topic
* SPACE_FooDataWriter_get_topic
* (SPACE_FooDataWriter _this);
*/
/* DDS_Publisher
* SPACE_FooDataWriter_get_publisher
* (SPACE_FooDataWriter _this);
*/
/* DDS_ReturnCode_t
* SPACE_FooDataWriter_wait_for_acknowledgments
* (DDS_DataWriter _this,
* const DDS_Duration_t *max_wait);
*/
```

```c
/* DDS_ReturnCode_t
* SPACE_FooDataWriter_get_liveliness_lost_status
* (SPACE_FooDataWriter _this,
* DDS_LivelinessLostStatus *status);
*/

/* DDS_ReturnCode_t
* SPACE_FooDataWriter_get_offered_deadline_missed_status
* (SPACE_FooDataWriter _this,
* DDS_OfferedDeadlineMissedStatus *status);
*/

/* DDS_ReturnCode_t
* SPACE_FooDataWriter_get_offered_incompatible_qos_status
* (SPACE_FooDataWriter _this,
* DDS_OfferedIncompatibleQosStatus *status);
*/

/* DDS_ReturnCode_t
* SPACE_FooDataWriter_get_publication_matched_status
* (SPACE_FooDataWriter _this,
* DDS_PublicationMatchedStatus *status);
*/

/* DDS_ReturnCode_t
* SPACE_FooDataWriter_assert_liveliness
* (SPACE_FooDataWriter _this);
*/

/* DDS_ReturnCode_t
* SPACE_FooDataWriter_get_matched_subscriptions
* (SPACE_FooDataWriter _this,
* DDS_InstanceHandleSeq *subscription_handles);
*/

/* DDS_ReturnCode_t
* SPACE_FooDataWriter_get_matched_subscription_data
* (SPACE_FooDataWriter _this,
* DDS_SubscriptionBuiltinTopicData *subscription_data,
* const DDS_InstanceHandle_t subscription_handle);
*/

/*
* implemented API operations
*/

DDS_InstanceHandle_t
SPACE_FooDataWriter_register_instance
(SPACE_FooDataWriter _this,
const Foo *instance_data);
DDS_InstanceHandle_t
SPACE_FooDataWriter_register_instance_w_timestamp
```

```c
(SPACE_FooDataWriter _this,
    const Foo *instance_data,
    const DDS_Time_t *source_timestamp);
DDS_ReturnCode_t
SPACE_FooDataWriter_unregister_instance
(SPACE_FooDataWriter _this,
    const Foo *instance_data,
    const DDS_InstanceHandle_t handle);
DDS_ReturnCode_t
SPACE_FooDataWriter_unregister_instance_w_timestamp
(SPACE_FooDataWriter _this,
    const Foo *instance_data,
    const DDS_InstanceHandle_t handle,
    const DDS_Time_t *source_timestamp);
DDS_ReturnCode_t
SPACE_FooDataWriter_write
(SPACE_FooDataWriter _this,
    const Foo *instance_data,
    const DDS_InstanceHandle_t handle);
DDS_ReturnCode_t
SPACE_FooDataWriter_write_w_timestamp
(SPACE_FooDataWriter _this,
    const Foo *instance_data,
    const DDS_InstanceHandle_t handle,
    const DDS_Time_t *source_timestamp);
DDS_ReturnCode_t
SPACE_FooDataWriter_dispose
(SPACE_FooDataWriter _this,
    const Foo *instance_data,
    const DDS_InstanceHandle_t instance_handle);
DDS_ReturnCode_t
SPACE_FooDataWriter_dispose_w_timestamp
(SPACE_FooDataWriter _this,
    const Foo *instance_data,
    const DDS_InstanceHandle_t instance_handle,
    const DDS_Time_t *source_timestamp);
DDS_ReturnCode_t
SPACE_FooDataWriter_writedispose
(SPACE_FooDataWriter _this,
    const Foo *instance_data,
    const DDS_InstanceHandle_t instance_handle);
DDS_ReturnCode_t
SPACE_FooDataWriter_writedispose_w_timestamp
(SPACE_FooDataWriter _this,
    const Foo *instance_data,
    const DDS_InstanceHandle_t instance_handle,
    const DDS_Time_t *source_timestamp);
DDS_ReturnCode_t
SPACE_FooDataWriter_get_key_value
(SPACE_FooDataWriter _this,
```

```c
Foo *key_holder,
const DDS_InstanceHandle_t handle);
DDS_InstanceHandle_t
SPACE_FooDataWriter_lookup_instance
(SPACE_FooDataWriter _this,
Foo *instance_data);
```

The next paragraphs describe the usage of all SPACE\_FooDataWriter operations. The inherited operations are listed but not fully described because they are not implemented in this class. The full description of these operations is given in the classes from which they are inherited.

# 3.4.2.32 SPACE\_FooDataWriter\_assert\_liveliness (inherited)

This operation is inherited and therefore not described here. See the class DDS\_DataWriter for further explanation.

# Synopsis

```c
#include &lt;Space.h&gt;
DDS_ReturnCode_t
SPACE_FooDataWriter_assert_liveliness
(SPACE_FooDataWriter _this);
```

# 3.4.2.33 SPACE\_FooDataWriter\_dispose

# Synopsis

```c
#include &lt;Space.h&gt;
DDS_ReturnCode_t
SPACE_FooDataWriter_dispose
SPACE_FooDataWriter_this,
const Foo *instance_data,
const DDS_InstanceHandle_t instance_handle);
```

# Description

This operation requests the Data Distribution Service to mark the instance for deletion.

# Parameters

in SPACE\_FooDataWriter \_this - the SPACE\_FooDataWriter object on which the operation is operated.

in const Foo \*instance\_data - the actual instance to be disposed of.

in const DDS\_InstanceHandle\_t instance\_handle - the handle to the instance to be disposed of.

# Return Value

```txt
DDS_ReturnCode_t - Possible return codes of the operation are: DDS_RETCODE_OK, DDS_RETCODE_ERROR, DDS_RETCODE_ILLEGAL_OPERATION, DDS_RETCODE_BAD_PARAMETER, DDS_RETCODE_ALREADY_DELETED, DDS_RETCODE_OUT_OF_RESOURCES, DDS_RETCODE_NOT_ENABLED, DDS_RETCODE_PRECONDITION_NOT_MET or DDS_RETCODE_TIMEOUT.
```

# Detailed Description

This operation requests the Data Distribution Service to mark the instance for deletion. Copies of the instance and its corresponding samples, which are stored in every connected DDS\_DataReader and, dependent on the QoSPolicy settings, also in the Transient and Persistent stores, will be marked for deletion by setting their DDS\_InstanceStateKind to DDS\_NOT\_ALIVE\_DISPOSED\_INSTANCE\_ STATE.

When this operation is used, the Data Distribution Service will automatically supply the value of the source\_timestamp that is made available to connected DDS\_DataReader objects. This timestamp is important for the interpretation of the DDS\_DestinationOrderQosPolicy.

As a side effect, this operation asserts liveliness on the DDS\_DataWriter itself and on the containing DDS\_DomainParticipant.

# Effects on DataReaders

Actual deletion of the instance administration in a connected DDS\_DataReader will be postponed until the following conditions have been met:

• the instance must be unregistered (either implicitly or explicitly) by all connected DDS\_DataWriters that have previously registered it

- A DDS\_DataWriter can register an instance explicitly by using one of the special operations SPACE\_FooDataWriter\_register\_instance or SPACE\_FooDataWriter\_register\_instance\_w\_timestamp.
- A DDS\_DataWriter can register an instance implicitly by using the special constant DDS\_HANDLE\_NIL in any of the other DDS\_DataWriter operations.
- A DDS\_DataWriter can unregister an instance explicitly by using one of the special operations SPACE\_FooDataWriter\_unregister\_instance or SPACE\_FooDataWriter\_unregister\_instance\_w\_timestamp.
- A DDS\_DataWriter will unregister all its contained instances implicitly when it is deleted.

\- When a DDS\_DataReader detects a loss of liveliness in one of its connected DDS\_DataWriters, it will consider all instances registered by that DDS\_DataWriter as being implicitly unregistered.

• and the application must have consumed all samples belonging to the instance, either implicitly or explicitly.

\- An application can consume samples explicitly by invoking the SPACE\_FooDataReader\_take operation, or one of its variants.

\- The DDS\_DataReader can consume disposed samples implicitly when the autopurge\_disposed\_samples\_delay of the DDS\_ReaderData LifecycleQosPolicy has expired.

The DDS\_DataReader may also remove instances that haven’t been disposed first: this happens when the autopurge\_nowriter\_samples\_delay of the DDS\_ReaderDataLifecycleQosPolicy has expired after the instance is considered unregistered by all connected DDS\_DataWriters (i.e. when it has a DDS\_InstanceStateKind of DDS\_NOT\_ALIVE\_NO\_WRITERS). See also Section 3.1.3.15, DDS\_ReaderDataLifecycleQosPolicy, on page 99.

# Effects on Transient/Persistent Stores

Actual deletion of the instance administration in the connected Transient and Persistent stores will be postponed until the following conditions have been met:

• the instance must be unregistered (either implicitly or explicitly) by all connected DDS\_DataWriters that have previously registered it. (See above.)
• and the period of time specified by the service\_cleanup\_delay attribute in the DDS\_DurabilityServiceQosPolicy on the DDS\_Topic must have elapsed after the instance is considered unregistered by all connected DDS\_DataWriters.

See also Section 3.1.3.4, DDS\_DurabilityServiceQosPolicy, on page 76.

# Instance Handle

The D DS \_ H A N D L E \_N I L handle value can be used for th e parameter instance\_handle. This indicates the identity of the instance is automatically deduced from the instance\_data (by means of the key).

If instance\_handle is any value other than DDS\_HANDLE\_NIL, then it must c o r r e s p o n d t o t h e v a l u e t h a t w a s r e t u r n e d b y e i t h e r t h e SPACE\_FooDataWriter\_register\_instance operation or the SPACE\_FooDataWriter\_register\_instance\_w\_timestamp operation when the instance (identified by its key) was registered. If there is no correspondence, then the result of the operation is unspecified.

The sample that is passed as instance\_data is only used to check for consistency between its key values and the supplied instance\_handle: the sample itself will not actually be delivered to the connected DDS\_DataReaders. Use the SPACE\_FooDataWriter\_writedispose operation if the sample itself should be delivered together with the dispose request.

# Blocking

If the DDS\_HistoryQosPolicy is set to DDS\_KEEP\_ALL\_HISTORY\_QOS, the SPACE\_FooDataWriter\_dispose operation on the DDS\_DataWriter may block if the modification would cause data to be lost because one of the limits, specified in the DDS\_ResourceLimitsQosPolicy, to be exceeded. Under these c i r c u m s t a n c e s , t h e m a x \_ b l o c k i n g \_ t i m e a t t r i b u t e o f t h e R e li a b i l i ty Q o s P o l ic y c o n f i g u r e s t h e m a x i m u m t i m e t h e SPACE\_FooDataWriter\_dispose operation may block (waiting for space to become available). If max\_blocking\_time elapses before the DDS\_DataWriter i s a b l e t o s t o r e t h e m o d i f i c a t i o n w i t h o u t e x c e e d i n g t h e l i m i t s , t h e SPACE\_FooDataWriter\_dispose operation will fail and returns DDS\_RETCODE\_TIMEOUT.

# Sample Validation

OpenSplice offers the possibility to check the sample that is passed as instance\_data for validity. Because validity checking might reduce the overall performance, it is by default disabled. This has been done by enclosing the validity checking with conditional compiler directives like this:

```cpp
#ifdef OSPL_BOUNDS_CHECK
    // check a specific bound.
#endif
```

i By defining a macro called OSPL\_OSPL\_BOUNDS\_CHECK, the validity checking will be included. On most compilers this macro can be defined by passing an additional command line parameter called -DOSPL\_BOUNDS\_CHECK.

Since the SPACE\_FooDataWriter\_dispose operation only uses the sample to check for consistency between its key values and the supplied instance\_handle, only those keyfields will be validated against the restrictions imposed by the IDL to C language mapping, where:

• an enum may not exceed the value of its highest label
• a string (bounded or unbounded) may not be NULL. (Use “” for an empty string instead)
• the length of a bounded string may not exceed the limit specified in IDL

If any of these restrictions is violated when validity checking is enabled, then the operation will fail and return a DDS\_RETCODE\_BAD\_PARAMETER. More specific information about the context of this error will be written to the error log. When validity checking is disabled, any of these violations may result in undefined behaviour.

# Return Code

When the operation returns:

• DDS\_RETCODE\_OK - the Data Distribution Service is informed that the instance data must be disposed of.
• DDS\_RETCODE\_ERROR - an internal error has occurred.
• DDS\_RETCODE\_ILLEGAL\_OPERATION - the operation is invoked on an inappropriate object.
• DDS\_RETCODE\_BAD\_PARAMETER - instance\_handle is not a valid handle or instance\_data is not a valid sample.
• DDS\_RETCODE\_ALREADY\_DELETED - the SPACE\_FooDataWriter has already been deleted.
• DDS\_RETCODE\_OUT\_OF\_RESOURCES - the Data Distribution Service ran out of resources to complete this operation.
• DDS\_RETCODE\_NOT\_ENABLED - the SPACE\_FooDataWriter is not enabled.
• DDS\_RETCODE\_PRECONDITION\_NOT\_MET - the instance\_handle has not been registered with this SPACE\_FooDataWriter.
• DDS\_RETCODE\_TIMEOUT - the current action overflowed the available resources as specified by the combination of the DDS\_ReliabilityQosPolicy, DDS\_HistoryQosPolicy and DDS\_ResourceLimitsQosPolicy. This caused blocking of the SPACE\_FooDataWriter\_dispose operation, which could not be resolved before max\_blocking\_time of the DDS\_ReliabilityQosPolicy elapsed.

# 3.4.2.34 SPACE\_FooDataWriter\_dispose\_w\_timestamp

# Synopsis

```c
#include &lt;Space.h&gt;
DDS_ReturnCode_t
SPACE_FooDataWriter_dispose_w_timestamp
(SPACE_FooDataWriter _this,
const Foo *instance_data,
const DDS_InstanceHandle_t instance_handle,
const DDS_Time_t *source_timestamp);
```

# Description

This operation requests the Data Distribution Service to mark the instance for deletion and provides a value for the source\_timestamp explicitly.

# Parameters

in SPACE\_FooDataWriter \_this - the SPACE\_FooDataWriter object on which the operation is operated.

in const Foo \*instance\_data - the actual instance to be disposed of.

in const DDS\_InstanceHandle\_t instance\_handle - the handle to the instance to be disposed of.

in const DDS\_Time\_t \*source\_timestamp - the timestamp which is provided for the DDS\_DataReader.

# Return Value

D D S \_ R e t u r n C o d e \_ t - P o s s i b l e r e t u r n c o d e s o f t h e o p e r a t i o n a r e : DDS\_RETCODE\_OK, DDS\_RETCODE\_ERROR, DDS\_RETCODE\_ILLEGAL OPERATION, DDS\_RETCODE\_BAD\_PARAMETER, DDS\_RETCODE\_ ALREADY\_DELETED, DDS\_RETCODE\_OUT\_OF\_RESOURCES, DDS\_RETCODE\_ NOT\_ENABLED, DDS\_RETCODE\_PRECONDITION\_NOT\_MET or DDS\_RETCODE\_TIMEOUT.

# Detailed Description

This operation performs the same functions as SPACE\_FooDataWriter\_dispose except that the application provides the value for the source\_timestamp that is made available to connected DDS\_DataReader objects. This timestamp is important for the interpretation of the DDS\_DestinationOrderQosPolicy.

# Return Code

When the operation returns:

• DDS\_RETCODE\_OK - the Data Distribution Service is informed that the instance data must be disposed of.
• DDS\_RETCODE\_ERROR - an internal error has occurred.
• DDS\_RETCODE\_ILLEGAL\_OPERATION - the operation is invoked on an inappropriate object.
• DDS\_RETCODE\_BAD\_PARAMETER - instance\_handle is not a valid handle or instance\_data is not a valid sample.
• DDS\_RETCODE\_ALREADY\_DELETED - the SPACE\_FooDataWriter has already been deleted.

• DDS\_RETCODE\_OUT\_OF\_RESOURCES - the Data Distribution Service ran out of resources to complete this operation.
• DDS\_RETCODE\_NOT\_ENABLED - the SPACE\_FooDataWriter is not enabled.
• DDS\_RETCODE\_PRECONDITION\_NOT\_MET - the instance\_handle has not been registered with this SPACE\_FooDataWriter.
• DDS\_RETCODE\_TIMEOUT - the current action overflowed the available resources as specified by the combination of the DDS\_ReliabilityQosPolicy, DDS\_HistoryQosPolicy and DDS\_ResourceLimitsQosPolicy. This caused blocking of the SPACE\_FooDataWriter\_dispose\_w\_timestamp operation, which could not be resolved before max\_blocking\_time of the DDS\_ReliabilityQosPolicy elapsed.

# 3.4.2.35 SPACE\_FooDataWriter\_enable (inherited)

This operation is inherited and therefore not described here. See the class DDS\_Entity for further explanation.

# Synopsis

```c
#include &lt;Space.h&gt;
DDS_ReturnCode_t
SPACE_FoodataWriter_enable
(SPACE_FoodataWriter _this);
```

# 3.4.2.36 SPACE\_FooDataWriter\_get\_key\_value

# Synopsis

```c
#include &lt;Space.h&gt;
DDS_ReturnCode_t
SPACE_FooDataWriter_get_key_value
(SPACE_FooDataWriter _this,
Foo *key_holder,
const DDS_InstanceHandle_t handle);
```

# Description

This operation retrieves the key value of a specific instance.

# Parameters

in SPACE\_FooDataWriter \_this - the SPACE\_FooDataWriter object on which the operation is operated.

inout Foo \*key\_holder - the sample in which the key values are stored.

in const DDS\_InstanceHandle\_t handle - the handle to the instance from which to get the key value.

# Return Value

```txt
DDS_ReturnCode_t - Possible return codes of the operation are: DDS_RETCODE_OK, DDS_RETCODE_ERROR, DDS_RETCODE_ILLEGAL_OPERATION, DDS_RETCODE_BAD_PARAMETER, DDS_RETCODE_ALREADY_DELETED, DDS_RETCODE_OUT_OF_RESOURCES, DDS_RETCODE_NOT_ENABLED or DDS_RETCODE_PRECONDITION_NOT_MET.
```

# Detailed Description

This operation retrieves the key value of the instance pointed to by instance\_handle. When the operation is called with an DDS\_HANDLE\_NIL h a n d l e v a l u e a s a n i n s t a n c e \_ h a n d l e , t h e o p e r a t i o n w i l l r e t u r n DDS\_RETCODE\_BAD\_PARAMETER. The operation will only fill the fields that form the key inside the key\_holder instance. This means that the non-key fields are not applicable and may contain garbage.

The operation must only be called on registered instances. Otherwise the operation returns the error DDS\_RETCODE\_PRECONDITION\_NOT\_MET.

# Return Code

When the operation returns:

• DDS\_RETCODE\_OK - the key\_holder instance contains the key values of the instance.
• DDS\_RETCODE\_ERROR - an internal error has occurred.
• DDS\_RETCODE\_ILLEGAL\_OPERATION - the operation is invoked on an inappropriate object.
• DDS\_RETCODE\_BAD\_PARAMETER - handle is not a valid handle or key\_holder is not a valid pointer.
• DDS\_RETCODE\_ALREADY\_DELETED - the SPACE\_FooDataWriter has already been deleted.
• DDS\_RETCODE\_OUT\_OF\_RESOURCES - the Data Distribution Service ran out of resources to complete this operation.
• DDS\_RETCODE\_NOT\_ENABLED - the SPACE\_FooDataWriter is not enabled.
• DDS\_RETCODE\_PRECONDITION\_NOT\_MET - this instance is not registered.

# 3.4.2.37 SPACE\_FooDataWriter\_get\_listener (inherited)

This operation is inherited and therefore not described here. See the class DDS\_DataWriter for further explanation.

# Synopsis

```c
#include &lt;Space.h&gt;
```

```txt
struct SPACE_FooDataWriterListener
SPACE_FooDataWriter_get_listener
(SPACE_FooDataWriter _this);
```

# 3.4.2.38 SPACE\_FooDataWriter\_get\_liveliness\_lost\_status (inherited)

This operation is inherited and therefore not described here. See the class DDS\_DataWriter for further explanation.

# Synopsis

```c
#include &lt;Space.h&gt;
DDS_ReturnCode_t
SPACE_FooDataWriter_get_liveliness_lost_status
(SPACE_FooDataWriter_this,
DDS_LivelinessLostStatus *status);
```

# 3.4.2.39 SPACE\_FooDataWriter\_get\_matched\_subscription\_data (inherited)

This operation is inherited and therefore not described here. See the class DDS\_DataWriter for further explanation.

# Synopsis

```c
#include &lt;Space.h&gt;
DDS_ReturnCode_t
SPACE_FooDataWriter_get_matched_subscription_data
(SPACE_FooDataWriter _this,
DDS_SubscriptionBuiltinTopicData *subscription_data,
const DDS_InstanceHandle_t subscription_handle);
```

# 3.4.2.40 SPACE\_FooDataWriter\_get\_matched\_subscriptions (inherited)

This operation is inherited and therefore not described here. See the class DDS\_DataWriter for further explanation.

# Synopsis

```c
#include &lt;Space.h&gt;
DDS_ReturnCode_t
SPACE_FooDataWriter_get_matched_subscriptions
(SPACE_FooDataWriter _this,
DDS_InstanceHandleSeq *subscription_handles);
```

# 3.4.2.41 SPACE\_FooDataWriter\_get\_offered\_deadline\_missed\_status (inherited)

This operation is inherited and therefore not described here. See the class DDS\_DataWriter for further explanation.

# Synopsis

```c
#include &lt;Space.h&gt;
```

```txt
DDS_ReturnCode_t
SPACE_FooDataWriter_get_offered_deadline_missed_status
(SPACE_FooDataWriter _this,
DDS_OfferedDeadlineMissedStatus *status);
```

# 3.4.2.42 SPACE\_FooDataWriter\_get\_offered\_incompatible\_qos\_status (inherited)

This operation is inherited and therefore not described here. See the class DDS\_DataWriter for further explanation.

# Synopsis

```c
#include &lt;Space.h&gt;
DDS_ReturnCode_t
SPACE_FooDataWriter_get_offered_incompatible_qos_status
(SPACE_FooDataWriter _this,
DDS_OfferedIncompatibleQosStatus *status);
```

# 3.4.2.43 SPACE\_FooDataWriter\_get\_publication\_matched\_status (inherited)

This operation is inherited and therefore not described here. See the class DDS\_DataWriter for further explanation.

# Synopsis

```c
#include &lt;Space.h&gt;
DDS_ReturnCode_t
SPACE_FooDataWriter_get_publication_matched_status
(SPACE_FooDataWriter _this,
DDS_PublicationMatchedStatus *status);
```

# 3.4.2.44 SPACE\_FooDataWriter\_get\_publisher (inherited)

This operation is inherited and therefore not described here. See the class DDS\_DataWriter for further explanation.

# Synopsis

```c
#include &lt;Space.h&gt;
DDS_Publisher
SPACE_FooDataWriter_get_publisher
(SPACE_FooDataWriter_this);
```

# 3.4.2.45 SPACE\_FooDataWriter\_get\_qos (inherited)

This operation is inherited and therefore not described here. See the class DDS\_DataWriter for further explanation.

# Synopsis

```c
#include &lt;Space.h&gt;
DDS_ReturnCode_t
```

```txt
SPACE_FooDataWriter_get_qos
(SPACE_FooDataWriter_this,
SPACE_FooDataWriterQos *qos);
```

# 3.4.2.46 SPACE\_FooDataWriter\_get\_status\_changes (inherited)

This operation is inherited and therefore not described here. See the class DDS\_Entity for further explanation.

# Synopsis

```c
#include &lt;Space.h&gt;
DDS_StatusMask
SPACE_FoodataWriter_get_status_changes
(SPACE_FoodataWriter_this);
```

# 3.4.2.47 SPACE\_FooDataWriter\_get\_statuscondition (inherited)

This operation is inherited and therefore not described here. See the class DDS\_Entity for further explanation.

# Synopsis

```c
#include &lt;Space.h&gt;
DDS_StatusCondition
SPACE_FooDataWriter_get_statuscondition
(SPACE_FooDataWriter _this);
```

# 3.4.2.48 SPACE\_FooDataWriter\_get\_topic (inherited)

This operation is inherited and therefore not described here. See the class DDS\_DataWriter for further explanation.

# Synopsis

```c
#include &lt;Space.h&gt;
DDS_Topic
SPACE_FoodataWriter_get_topic
(SPACE_FoodataWriter _this);
```

# 3.4.2.49 SPACE\_FooDataWriter\_lookup\_instance

# Synopsis

```c
#include &lt;Space.h&gt;
DDS_InstanceHandle_t
SPACE_FooDataWriter_lookup_instance
(SPACE_FooDataWriter _this,
Foo *instance_data);
```

# Description

This operation returns the value of the instance handle which corresponds to the instance\_data.

# Parameters

in SPACE\_FooDataWriter \_this - the SPACE\_FooDataWriter object on which the operation is operated.

in Foo \*instance\_data - the instance for which the corresponding instance handle needs to be looked up.

# Return Value

DDS\_InstanceHandle\_t - Result value is the instance handle which corresponds to the instance\_data.

# Detailed Description

This operation returns the value of the instance handle which corresponds to the instance\_data. The instance\_data parameter is only used for the purpose of examining the fields that define the key. The instance handle can be used in any write, dispose or unregister operations (or their timestamped variants) that operate on a specific instance. Note that DDS\_DataWriter instance handles are local, and are not interchangeable with DDS\_DataReader instance handles nor with instance handles of an other DDS\_DataWriter.

This operation does not register the instance in question. If the instance has not been previously registered, if the DDS\_DataWriter is already deleted or if for any other reason the Service is unable to provide an instance handle, the Service will return the special value DDS\_HANDLE\_NIL.

# Sample Validation

OpenSplice offers the possibility to check the sample that is passed as instance\_data for validity. Because validity checking might reduce the overall performance, it is by default disabled. This has been done by enclosing the validity checking with conditional compiler directives like this:

```cpp
#ifdef OSPL_BOUNDS_CHECK
    // check a specific bound.
#endif
```

i

By defining a macro called OSPL\_OSPL\_BOUNDS\_CHECK, the validity checking will be included. On most compilers this macro can be defined by passing an additional command line parameter called -DOSPL\_BOUNDS\_CHECK.

Since the SPACE\_FooDataWriter\_lookup\_instance operation merely uses the sample to determine its identity based on the uniqueness of its key values, only the keyfields will be validated against the restrictions imposed by the IDL to C language mapping, where:

• an enum may not exceed the value of its highest label
• a string (bounded or unbounded) may not be NULL. (Use “” for an empty string instead)
• the length of a bounded string may not exceed the limit specified in IDL

If any of these restrictions is violated when validity checking is enabled, then the operation will fail and return a DDS\_HANDLE\_NIL. More specific information about the context of this error will be written to the error log. When validity checking is disabled, any of these violations may result in undefined behaviour.

# 3.4.2.50 SPACE\_FooDataWriter\_register\_instance

# Synopsis

```c
#include &lt;Space.h&gt;
DDS_InstanceHandle_t
SPACE_FooDataWriter_register_instance
(SPACE_FooDataWriter _this,
const Foo *instance_data);
```

# Description

This operation informs the Data Distribution Service that the application will be modifying a particular instance.

# Parameters

in SPACE\_FooDataWriter \_this - the SPACE\_FooDataWriter object on which the operation is operated.

in const Foo \*instance\_data - the new instance, which the application writes to or disposes of.

# Return Value

DDS\_InstanceHandle\_t - Result value is the handle to the Instance, which may be used for writing and disposing of. In case of an error, a DDS\_HANDLE\_NIL handle value is returned.

# Detailed Description

This operation informs the Data Distribution Service that the application will be modifying a particular instance. This operation may be invoked prior to calling any operation that modifies the instance, such as SPACE\_FooDataWriter\_write,

SPACE\_FooDataWriter\_write\_w\_timestamp, SPACE\_FooData Writer\_unregister\_instance, SPACE\_FooDataWriter\_unregister\_ instance\_w\_timestamp, SPACE\_FooDataWriter\_dispose, SPACE\_FooDataWriter\_dispose\_w\_timestamp, SPACE\_FooDataWriter\_ writedispose and SPACE\_FooDataWriter\_writedispose\_w\_timestamp. When the application does register the instance before modifying, the Data Distribution Service will handle the instance more efficiently. It takes as a parameter (instance\_data) an instance (to get the key value) and returns a handle that can be used in successive DDS\_DataWriter operations. In case of an error, a DDS\_HANDLE\_NIL handle value is returned.

The explicit use of this operation is optional as the application can directly call the SPACE\_FooDataWriter\_write, SPACE\_FooDataWriter\_write\_ w\_timestamp, SPACE\_FooDataWriter\_unregister\_instance, SPACE\_FooDataWriter\_unregister\_instance\_w\_timestamp, SPACE\_FooDataWriter\_dispose, SPACE\_FooDataWriter dispose\_w\_timestamp, SPACE\_FooDataWriter\_writedispose and SPACE\_FooDataWriter\_writedispose\_w\_timestamp operations and specify a DDS\_HANDLE\_NIL handle value to indicate that the sample should be examined to identify the instance.

When this operation is used, the Data Distribution Service will automatically supply the value of the source\_timestamp that is made available to connected DDS\_DataReader objects. This timestamp is important for the interpretation of the DDS\_DestinationOrderQosPolicy.

# Blocking

If the DDS\_HistoryQosPolicy is set to KEEP\_ALL\_HISTORY\_QOS, the SPACE\_FooDataWriter\_register\_instance operation on the DDS\_DataWriter may block if the modification would cause data to be lost because one of the limits, specified in the DDS\_ResourceLimitsQosPolicy, to b e e x c e e d e d . I n c a s e t h e s y n c h r o n o u s a t t r i b u t e v a l u e o f t h e ReliabilityQosPolicy is set to TRUE for communicating DataWriters and DataReaders then the DataWriter will wait until all synchronous DataReaders have acknowledged the data. Under these circumstances, the max\_blocking\_time attribute of the ReliabilityQosPolicy configures the maximum time the SPACE\_FooDataWriter\_register\_instance operation may block (either waiting for space to become available or data to be acknowledged). If max\_blocking\_time elapses before the DDS\_DataWriter is able to store the modification without exceeding the limits and all expected acknowledgeme nts are receive d, the S PA C E \_ F o oD a t a W r i te r \_ register\_instance operation will fail and returns DDS\_HANDLE\_NIL.

# Sample Validation

OpenSplice offers the possibility to check the sample that is passed as instance\_data for validity. Because validity checking might reduce the overall performance, it is by default disabled. This has been done by enclosing the validity checking with conditional compiler directives like this:

```cpp
#ifdef OSPL_BOUNDS_CHECK
    // check a specific bound.
#endif
```

i By defining a macro called OSPL\_OSPL\_BOUNDS\_CHECK, the validity checking will be included. On most compilers this macro can be defined by passing an additional command line parameter called -DOSPL\_BOUNDS\_CHECK.

Since the SPACE\_FooDataWriter\_register\_instance operation merely uses the sample to determine its identity based on the uniqueness of its key values, only the keyfields will be validated against the restrictions imposed by the IDL to C language mapping, where:

• an enum may not exceed the value of its highest label
• a string (bounded or unbounded) may not be NULL. (Use “” for an empty string instead)
• the length of a bounded string may not exceed the limit specified in IDL

If any of these restrictions is violated when validity checking is enabled, then the operation will fail and return a DDS\_HANDLE\_NIL. More specific information about the context of this error will be written to the error log. When validity checking is disabled, any of these violations may result in undefined behaviour.

# Multiple Calls

If this operation is called for an already registered instance, it just returns the already allocated instance handle. This may be used to look up and retrieve the handle allocated to a given instance.

# 3.4.2.51 SPACE\_FooDataWriter\_register\_instance\_w\_timestamp

# Synopsis

```c
#include &lt;Space.h&gt;
DDS_InstanceHandle_t
SPACE_FooDataWriter_register_instance_w_timestamp
(SPACE_FooDataWriter _this,
const Foo *instance_data,
const DDS_Time_t *source_timestamp);
```

# Description

This operation will inform the Data Distribution Service that the application will be modifying a particular instance and provides a value for the source\_timestamp explicitly.

# Parameters

in SPACE\_FooDataWriter \_this - the SPACE\_FooDataWriter object on which the operation is operated.

in Foo \*instance\_data - the instance, which the application will write to or dispose of.

in const DDS\_Time\_t \*source\_timestamp - the timestamp used.

# Return Value

DDS\_InstanceHandle\_t - Result value is the handle to the Instance, which must be used for writing and disposing. In case of an error, a DDS\_HANDLE\_NIL handle value is returned.

# Detailed Description

T h i s o p e r a t i o n p e r f o r m s t h e s a m e f u n c t i o n s a s SPACE\_FooDataWriter\_register\_instance except that the application provides the value for the source\_timestamp that is made available to connected DDS\_DataReader objects. This timestamp is important for the interpretation of the DDS\_DestinationOrderQosPolicy.

# Multiple Calls

If this operation is called for an already registered instance, it just returns the already allocated instance handle. This may be used to look up and retrieve the handle allocated to a given instance. The source\_timestamp is ignored in that case.

# 3.4.2.52 SPACE\_FooDataWriter\_set\_listener (inherited)

This operation is inherited and therefore not described here. See the class DDS\_DataWriter for further explanation.

# Synopsis

```c
#include &lt;Space.h&gt;
DDS_ReturnCode_t
SPACE_FooDataWriter_set_listener
(SPACE_FooDataWriter_this,
const struct DDS_DataWriterListener *a_listener,
const DDS_StatusMask mask);
```

# 3.4.2.53 SPACE\_FooDataWriter\_set\_qos (inherited)

This operation is inherited and therefore not described here. See the class DDS\_DataWriter for further explanation.

# Synopsis

```c
#include &lt;Space.h&gt;
DDS_ReturnCode_t
SPACE_FooDataWriter_set_qos
(SPACE_FooDataWriter _this,
const DDS_DataWriterQos *qos);
```

# 3.4.2.54 SPACE\_FooDataWriter\_unregister\_instance

# Synopsis

```c
#include &lt;Space.h&gt;
DDS_ReturnCode_t
SPACE_FooDataWriter_unregister_instance
(SPACE_FooDataWriter _this,
const Foo *instance_data,
const DDS_InstanceHandle_t handle);
```

# Description

This operation informs the Data Distribution Service that the application will not be modifying a particular instance any more.

# Parameters

in SPACE\_FooDataWriter \_this - the SPACE\_FooDataWriter object on which the operation is operated.

in const Foo \*instance\_data - the instance to which the application was writing or disposing.

in const DDS\_InstanceHandle\_t handle - the handle to the instance that has been used for writing and disposing.

# Return Value

D D S \_ R e t u r n C o d e \_ t - P o s s i b l e r e t u r n c o d e s o f t h e o p e r a t i o n a r e : DDS\_RETCODE\_OK, DDS\_RETCODE\_ERROR, DDS\_RETCODE\_ILLEGAL OPERATION, DDS\_RETCODE\_BAD\_PARAMETER, DDS\_RETCODE ALREADY\_DELETED, DDS\_RETCODE\_OUT\_OF\_RESOURCES, DDS\_RETCODE\_ NOT\_ENABLED, DDS\_RETCODE\_PRECONDITION\_NOT\_MET or DDS\_RETCODE\_TIMEOUT.

# Detailed Description

This operation informs the Data Distribution Service that the application will not be modifying a particular instance any more. Therefore, this operation reverses the action of SPACE\_FooDataWriter\_register\_instance or SPACE\_FooDataWriter\_register\_instance\_w\_timestamp. It should only be called on an instance that is currently registered. This operation should be c a l l e d j u s t o n c e p e r i n s t a n c e , r e g a r d l e s s o f h o w m a n y t i m e s SPACE\_FooDataWriter\_register\_instance was called for that instance. This operation also indicates that the Data Distribution Service can locally remove all information regarding that instance. The application should not attempt to use the handle, previously allocated to that instance, after calling this operation.

When this operation is used, the Data Distribution Service will automatically supply the value of the source\_timestamp that is made available to connected DDS\_DataReader objects. This timestamp is important for the interpretation of the DDS\_DestinationOrderQosPolicy.

# Effects

If, after unregistering, the application wants to modify (write or dispose) the instance, it first has to register the instance again, or it has to use the special handle value DDS\_HANDLE\_NIL.

This operation does not indicate that the instance should be deleted (that is the purpose of SPACE\_FooDataWriter\_dispose). This operation just indicates that the DDS\_DataWriter no longer has “anything to say” about the instance. If there is no other DDS\_DataWriter that has registered the instance as well, then the DDS\_InstanceStateKind in all connected DDS\_DataReaders will be changed to DDS\_NOT\_ALIVE\_NO\_WRITERS\_INSTANCE\_STATE, provided this DDS\_InstanceStateKind w a s n o t a l r e a d y s e t t o DDS\_NOT\_ALIVE\_DISPOSED\_INSTANCE\_STATE. In the last case the D D S\_ I n s t a nc e S t a t e Ki n d w i l l n o t b e e ff e c t e d b y t h e SPACE\_FooDataWriter\_unregister\_instance call, see also Figure 21:, State Chart of the instance\_state for a Single Instance, on page 632.

This operation can affect the ownership of the data instance. If the DDS\_DataWriter was the exclusive owner of the instance, calling this operation will release that ownership, meaning ownership may be transferred to another, possibly lower strength, DDS\_DataWriter.

The operation must be called only on registered instances. Otherwise the operation returns the error DDS\_RETCODE\_PRECONDITION\_NOT\_MET.

# Instance Handle

The DDS\_HANDLE\_NIL handle value can be used for the parameter handle. This indicates that the identity of the instance is automatically deduced from the instance\_data (by means of the key).

If handle is any value other than DDS\_HANDLE\_NIL, then it must correspond to the value returned by SPACE\_FooDataWriter\_register\_instance or SPACE\_FooDataWriter\_register\_instance\_w\_timestamp when the instance (identified by its key) was registered. If there is no correspondence, then the result of the operation is unspecified.

The sample that is passed as instance\_data is used to check for consistency between its key values and the supplied instance\_handle: the sample itself will not actually be delivered to the connected DDS\_DataReaders.

# Blocking

If the DDS\_HistoryQosPolicy is set to DDS\_KEEP\_ALL\_HISTORY\_QOS, then the SPACE\_FooDataWriter\_unregister\_instance operation on the DDS\_DataWriter may block if the modification would cause data to be lost because one of the limits, specified in the DDS\_ResourceLimitsQosPolicy, to b e e x c e e d e d . I n c a s e t h e s y n c h r o n o u s a t t r i b u t e v a l u e o f t h e ReliabilityQosPolicy is set to TRUE for communicating DataWriters and DataReaders then the DataWriter will wait until all synchronous DataReaders have acknowledged the data. Under these circumstances, the max\_blocking\_time attribute of the ReliabilityQosPolicy configures the maximum time the SPACE\_FooDataWriter\_unregister\_instance operation may block (either waiting for space to become available or data to be acknowledged). If max\_blocking\_time elapses before the DDS\_DataWriter is able to store the modification without exceeding the limits and all expected a c k n o w l e d g e m e n t s a r e r e c e i v e d , t h e

SPACE\_FooDataWriter\_unregister\_instance operation will fail and returns DDS\_RETCODE\_TIMEOUT.

# Sample Validation

OpenSplice offers the possibility to check the sample that is passed as instance\_data for validity. Because validity checking might reduce the overall performance, it is by default disabled. This has been done by enclosing the validity checking with conditional compiler directives like this:

```cpp
#ifdef OSPL_BOUNDS_CHECK
    // check a specific bound.
#endif
```

# i

By defining a macro called OSPL\_OSPL\_BOUNDS\_CHECK, the validity checking will be included. On most compilers this macro can be defined by passing an additional command line parameter called -DOSPL\_BOUNDS\_CHECK.

Since the SPACE\_FooDataWriter\_unregister\_instance operation merely uses the sample to check for consistency between its key values and the supplied instance\_handle, only these keyfields will be validated against the restrictions imposed by the IDL to C language mapping:

• an enum may not exceed the value of its highest label.
• a string (bounded or unbounded) may not be NULL. (Use “” for an empty string instead).
• the length of a bounded string may not exceed the limit specified in IDL.

If any of these restrictions is violated when validity checking is enabled, the operation will fail and return a DDS\_RETCODE\_BAD\_PARAMETER. More specific information about the context of this error will be written to the error log. When validity checking is disabled, any of these violations may result in undefined behaviour.

# Return Code

When the operation returns:

• DDS\_RETCODE\_OK - the Data Distribution Service is informed that the instance will not be modified any more.
• DDS\_RETCODE\_ERROR - an internal error has occurred.
• DDS\_RETCODE\_ILLEGAL\_OPERATION - the operation is invoked on an inappropriate object.
• DDS\_RETCODE\_BAD\_PARAMETER - handle is not a valid handle or instance\_data is not a valid sample.
• DDS\_RETCODE\_ALREADY\_DELETED - the SPACE\_FooDataWriter has already been deleted.
• DDS\_RETCODE\_OUT\_OF\_RESOURCES - the Data Distribution Service ran out of resources to complete this operation.
• DDS\_RETCODE\_NOT\_ENABLED - the SPACE\_FooDataWriter is not enabled.
• DDS\_RETCODE\_PRECONDITION\_NOT\_MET - the handle has not been registered with this SPACE\_FooDataWriter.
• DDS\_RETCODE\_TIMEOUT - either the current action overflowed the available resources as specified by the combination of the DDS\_ReliabilityQosPolicy, DDS\_HistoryQosPolicy and DDS\_ResourceLimitsQosPolicy, or the current action was waiting for data delivery acknowledgement by synchronous DataReaders. This caused blocking of the

SPACE\_FooDataWriter\_unregister\_instance\_w\_timestamp operation, which could not be resolved before max\_blocking\_time of the DDS\_ReliabilityQosPolicy elapsed.

# 3.4.2.55 SPACE\_FooDataWriter\_unregister\_instance\_w\_timestamp

# Synopsis

```c
#include &lt;Space.h&gt;
DDS_ReturnCode_t
SPACE_FooDataWriter_unregister_instance_w_timestamp
(SPACE_FooDataWriter _this,
const Foo *instance_data,
const DDS_InstanceHandle_t handle,
const DDS_Time_t *source_timestamp);
```

# Description

This operation will inform the Data Distribution Service that the application will not be modifying a particular instance any more and provides a value for the source\_timestamp explicitly.

# Parameters

in SPACE\_FooDataWriter \_this - the SPACE\_FooDataWriter object on which the operation is operated.

in Foo \*instance\_data - the instance to which the application was writing or disposing.

in const DDS\_InstanceHandle\_t handle - the handle to the instance that has been used for writing and disposing.

in const DDS\_Time\_t \*source\_timestamp - the timestamp used.

# Return Value

```txt
DDS_ReturnCode_t - Possible return codes of the operation are: DDS_RETCODE_OK, DDS_RETCODE_ERROR, DDS_RETCODE_ILLEGAL_OPERATION, DDS_RETCODE_BAD_PARAMETER, DDS_RETCODE_ALREADY_DELETED, DDS_RETCODE_OUT_OF_RESOURCES, DDS_RETCODE_NOT_ENABLED, DDS_RETCODE_PRECONDITION_NOT_MET or DDS_RETCODE_TIMEOUT.
```

# Detailed Description

T h i s o p e r a t i o n p e r f o r m s t h e s a m e f u n c t i o n s a s SPACE\_FooDataWriter\_unregister\_instance except that the application provides the value for the source\_timestamp that is made available to connected DDS\_DataReader objects. This timestamp is important for the interpretation of the DDS\_DestinationOrderQosPolicy.

# Return Code

When the operation returns:

• DDS\_RETCODE\_OK - the Data Distribution Service is informed that the instance will not be modified any more.
• DDS\_RETCODE\_ERROR - an internal error has occurred.
• DDS\_RETCODE\_ILLEGAL\_OPERATION - the operation is invoked on an inappropriate object.
• DDS\_RETCODE\_BAD\_PARAMETER - handle is not a valid handle or instance\_data is not a valid sample.
• DDS\_RETCODE\_ALREADY\_DELETED - the SPACE\_FooDataWriter has already been deleted.
• DDS\_RETCODE\_OUT\_OF\_RESOURCES - the Data Distribution Service ran out of resources to complete this operation.
• DDS\_RETCODE\_NOT\_ENABLED - the SPACE\_FooDataWriter is not enabled.
• DDS\_RETCODE\_PRECONDITION\_NOT\_MET - the handle has not been registered with this SPACE\_FooDataWriter.
• DDS\_RETCODE\_TIMEOUT - the current action overflowed the available resources as specified by the combination of the DDS\_ReliabilityQosPolicy, DDS\_HistoryQosPolicy and DDS\_ResourceLimitsQosPolicy. This caused blocking of the SPACE\_FooDataWriter\_unregister\_ instance\_w\_timestamp operation, which could not be resolved before max\_blocking\_time of the DDS\_ReliabilityQosPolicy elapsed.

# 3.4.2.56 SPACE\_FooDataWriter\_wait\_for\_acknowledgments (inherited)

This operation is inherited and therefore not described here. See the class DDS\_DataWriter for further explanation.

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
DDS_ReturnCode_t
SPACE_FooDataWriter_wait_for_acknowledgments
(SPACE_FooDataWriter _this,
```

const DDS\_Duration\_t \*max\_wait);

# 3.4.2.57 SPACE\_FooDataWriter\_write

# Synopsis

```c
#include &lt;Space.h&gt;
DDS_ReturnCode_t
SPACE_FooDataWriter_write
(SPACE_FooDataWriter _this,
const Foo *instance_data,
const DDS_InstanceHandle_t handle);
```

# Description

This operation modifies the value of a data instance.

# Parameters

in SPACE\_FooDataWriter \_this - the SPACE\_FooDataWriter object on which the operation is operated.

in const Foo \*instance\_data - the data to be written.

in const DDS\_InstanceHandle\_t handle - the handle to the instance as supplied by SPACE\_FooDataWriter\_register\_instance.

# Return Value

```txt
DDS_ReturnCode_t - Possible return codes of the operation are: DDS_RETCODE_OK, DDS_RETCODE_ERROR, DDS_RETCODE_ILLEGAL_OPERATION, DDS_RETCODE_BAD_PARAMETER, DDS_RETCODE_ALREADY_DELETED, DDS_RETCODE_OUT_OF_RESOURCES, DDS_RETCODE_NOT_ENABLED, DDS_RETCODE_PRECONDITION_NOT_MET or DDS_RETCODE_TIMEOUT.
```

# Detailed Description

This operation modifies the value of a data instance. When this operation is used, the Data Distribution Service will automatically supply the value of the source\_timestamp that is made available to connected DDS\_DataReader o b j e c t s . T h i s t i m e s t a m p i s i m p o r t a n t f o r t h e i n t e r p r e t a t i o n o f t h e DDS\_DestinationOrderQosPolicy.

As a side effect, this operation asserts liveliness on the DDS\_DataWriter itself and on the containing DDS\_DomainParticipant.

Before writing data to an instance, the instance may be registered with the SPACE\_FooDataWriter\_register\_instance o r SPACE\_FooDataWriter\_register\_instance\_w\_timestamp operation. The handle returned by one of the SPACE\_FooDataWriter\_register\_instance o p e r a t i o n s c a n b e s u p p l i e d t o t h e p a r a m e t e r h a n d l e o f t h e SPACE\_FooDataWriter\_write operation. However, it is also possible to supply the special DDS\_HANDLE\_NIL handle value, which means that the identity of the instance is automatically deduced from the instance\_data (identified by the key).

# Instance Handle

The DDS\_HANDLE\_NIL handle value can be used for the parameter handle. This indicates the identity of the instance is automatically deduced from the instance\_data (by means of the key).

If handle is any value other than DDS\_HANDLE\_NIL, it must correspond to the value returned by SPACE\_FooDataWriter\_register\_instance or SPACE\_FooDataWriter\_register\_instance\_w\_timestamp when the instance (identified by its key) was registered. Passing such a registered handle helps the Data Distribution Service to process the sample more efficiently. If there is no correspondence between handle and sample, the result of the operation is unspecified.

# Blocking

If the DDS\_HistoryQosPolicy is set to DDS\_KEEP\_ALL\_HISTORY\_QOS, the SPACE\_FooDataWriter\_write operation on the DDS\_DataWriter may block if the modification would cause data to be lost because one of the limits, specified in the DDS\_ResourceLimitsQosPolicy, is exceeded. In case the synchronous attribute value of the ReliabilityQosPolicy is set to TRUE for communicating DataWriters and DataReaders then the DataWriter will wait until all synchronous DataReaders have acknowledged the data. Under these c i r c u m s t a n c e s , t h e m a x \_ b l o c k i n g \_ t i m e a t t r i b u t e o f t h e R e li a b i l i ty Q o s P o l ic y c o n f i g u r e s t h e m a x i m u m t i m e t h e SPACE\_FooDataWriter\_write operation may block (either waiting for space to become available or data to be acknowledged). If max\_blocking\_time elapses before the DDS\_DataWriter is able to store the modification without exceeding t h e l i m i t s a n d a l l e x p e c t e d a c k n o w l e d g e m e n t s a r e r e c e i v e d , t h e S P AC E \_ F o o Da t a W r i t er \_ w r i t e o p e r a ti o n w i l l f a il a n d r e t u r n s DDS\_RETCODE\_TIMEOUT.

# Sample Validation

OpenSplice offers the possibility to check the sample that is passed as instance\_data for validity. Because validity checking might reduce the overall performance, it is by default disabled. This has been done by enclosing the validity checking with conditional compiler directives like this:

```txt
#ifdef OSPL_BOUNDS_CHECK
    // check a specific bound.
```

# #endif

i By defining a macro called OSPL\_OSPL\_BOUNDS\_CHECK, the validity checking will be included. On most compilers this macro can be defined by passing an additional command line parameter called -DOSPL\_BOUNDS\_CHECK.

Before the sample is accepted by the DataWriter, it is validated against the restrictions imposed by the IDL to C language mapping:

• an enum may not exceed the value of its highest label.
• a string (bounded or unbounded) may not be NULL. (Use “” for an empty string instead).
• the length of a bounded string may not exceed the limit specified in IDL.
• the length of a bounded sequence may not exceed the limit specified in IDL.

If any of these restrictions is violated when validity checking is enabled, the operation will fail and return a DDS\_RETCODE\_BAD\_PARAMETER. More specific information about the context of this error will be written to the error log. When validity checking is disabled, any of these violations may result in undefined behaviour.

4 Be aware that it is not possible for the middleware to determine whether a union is correctly initialized, since according to the IDL-C language mapping a union just returns its current contents in the format of the requested branch without performing any checks. It is therefore the responsibility of the application programmer to make sure that the requested branch actually corresponds to the currently active branch. Not doing so may result in undefined behaviour as well.

# Return Code

When the operation returns:

• DDS\_RETCODE\_OK - the value of a data instance is modified.
• DDS\_RETCODE\_ERROR - an internal error has occurred.
• DDS\_RETCODE\_ILLEGAL\_OPERATION - the operation is invoked on an inappropriate object.
• DDS\_RETCODE\_BAD\_PARAMETER - handle is not a valid handle or instance\_data is not a valid sample.
• DDS\_RETCODE\_ALREADY\_DELETED - the SPACE\_FooDataWriter has already been deleted.
• DDS\_RETCODE\_OUT\_OF\_RESOURCES - the Data Distribution Service ran out of resources to complete this operation.
• DDS\_RETCODE\_NOT\_ENABLED - the SPACE\_FooDataWriter is not enabled.

• DDS\_RETCODE\_PRECONDITION\_NOT\_MET - the handle has not been registered with this SPACE\_FooDataWriter.
• DDS\_RETCODE\_TIMEOUT - either the current action overflowed the available resources as specified by the combination of the DDS\_ReliabilityQosPolicy, DDS\_HistoryQosPolicy and DDS\_ResourceLimitsQosPolicy, or the current action was waiting for data delivery acknowledgement by synchronous DataReaders. This caused blocking of the SPACE\_FooDataWriter\_write operation, which could not be resolved before max\_blocking\_time of the DDS\_ReliabilityQosPolicy elapsed.

# 3.4.2.58 SPACE\_FooDataWriter\_write\_w\_timestamp

# Synopsis

```c
#include &lt;Space.h&gt;
DDS_ReturnCode_t
SPACE_FooDataWriter_write_w_timestamp
(SPACE_FooDataWriter _this,
const Foo *instance_data,
const DDS_InstanceHandle_t handle,
const DDS_Time_t *source_timestamp);
```

# Description

This operation modifies the value of a data instance and provides a value for the source\_timestamp explicitly.

# Parameters

in SPACE\_FooDataWriter \_this - the SPACE\_FooDataWriter object on which the operation is operated.

in const Foo \*instance\_data - the data to be written.

in const DDS\_InstanceHandle\_t handle - the handle to the instance as supplied by SPACE\_FooDataWriter\_register\_instance.

in const DDS\_Time\_t \*source\_timestamp - the timestamp used.

# Return Value

```txt
DDS_ReturnCode_t - Possible return codes of the operation are: DDS_RETCODE_OK, DDS_RETCODE_ERROR, DDS_RETCODE_ILLEGAL_OPERATION, DDS_RETCODE_BAD_PARAMETER, DDS_RETCODE_ALREADY_DELETED, DDS_RETCODE_OUT_OF_RESOURCES, DDS_RETCODE_NOT_ENABLED, DDS_RETCODE_PRECONDITION_NOT_MET or DDS_RETCODE_TIMEOUT.
```

# Detailed Description

This operation performs the same functions as SPACE\_FooDataWriter\_write except that the application provides the value for the source\_timestamp that is made available to connected DDS\_DataReader objects. This timestamp is important for the interpretation of the DDS\_DestinationOrderQosPolicy.

# Return Code

When the operation returns:

• DDS\_RETCODE\_OK - the value of a data instance is modified.
• DDS\_RETCODE\_ERROR - an internal error has occurred.
• DDS\_RETCODE\_ILLEGAL\_OPERATION - the operation is invoked on an inappropriate object.
• DDS\_RETCODE\_BAD\_PARAMETER - handle is not a valid handle or instance\_data is not a valid sample.
• DDS\_RETCODE\_ALREADY\_DELETED - the SPACE\_FooDataWriter has already been deleted.
• DDS\_RETCODE\_OUT\_OF\_RESOURCES - the Data Distribution Service ran out of resources to complete this operation.
• DDS\_RETCODE\_NOT\_ENABLED - the SPACE\_FooDataWriter is not enabled.
• DDS\_RETCODE\_PRECONDITION\_NOT\_MET - the instance\_data does not correspond to the handle that should have been obtained from this SPACE\_FooDataWriter.
• DDS\_RETCODE\_TIMEOUT - either the current action overflowed the available resources as specified by the combination of the DDS\_ReliabilityQosPolicy, DDS\_HistoryQosPolicy and DDS\_ResourceLimitsQosPolicy, or the current action was waiting for data delivery acknowledgement by synchronous DataReaders. This caused blocking of the SPACE\_FooDataWriter\_register\_instance\_w\_timestamp operation, which could not be resolved before max\_blocking\_time of the DDS\_ReliabilityQosPolicy elapsed.

# 3.4.2.59 SPACE\_FooDataWriter\_writedispose

# Synopsis

```c
#include &lt;Space.h&gt;
DDS_ReturnCode_t
SPACE_FooDataWriter_writedispose
(SPACE_FooDataWriter_this,
const Foo *instance_data,
const DDS_InstanceHandle_t handle);
```

# Description

This operation modifies and disposes a data instance.

# Parameters

in SPACE\_FooDataWriter \_this - the SPACE\_FooDataWriter object on which the operation is operated.

in const Foo \*instance\_data - the data to be written and disposed.

in const DDS\_InstanceHandle\_t instance - the handle to the instance as supplied by SPACE\_FooDataWriter\_register\_instance.

# Return Value

```txt
DDS_ReturnCode_t - Possible return codes of the operation are: DDS_RETCODE_OK, DDS_RETCODE_ERROR, DDS_RETCODE_ILLEGAL_OPERATION, DDS_RETCODE_BAD_PARAMETER, DDS_RETCODE_ALREADY_DELETED, DDS_RETCODE_OUT_OF_RESOURCES, DDS_RETCODE_NOT_ENABLED, DDS_RETCODE_PRECONDITION_NOT_MET or DDS_RETCODE_TIMEOUT.
```

# Detailed Description

This operation requests the Data Distribution Service to modify the instance and mark it for deletion. Copies of the instance and its corresponding samples, which are stored in every connected DDS\_DataReader and, dependent on the QoSPolicy settings, also in the Transient and Persistent stores, will be modified and marked for deletion by setting their DDS\_InstanceStateKind to DDS\_NOT\_ALIVE\_ DISPOSED\_INSTANCE\_STATE.

When this operation is used, the Data Distribution Service will automatically supply the value of the source\_timestamp that is made available to connected DDS\_DataReader objects. This timestamp is important for the interpretation of the DDS\_DestinationOrderQosPolicy.

As a side effect, this operation asserts liveliness on the DDS\_DataWriter itself and on the containing DDS\_DomainParticipant.

# Effects on DataReaders

Actual deletion of the instance administration in a connected DDS\_DataReader will be postponed until the following conditions have been met:

• the instance must be unregistered (either implicitly or explicitly) by all connected DDS\_DataWriters that have previously registered it.

- A DDS\_DataWriter can register an instance explicitly by using one of the special operations SPACE\_FooDataWriter\_register\_instance or SPACE\_FooDataWriter\_register\_instance\_w\_timestamp.
- A DDS\_DataWriter can register an instance implicitly by using the special constant DDS\_HANDLE\_NIL in any of the other DDS\_DataWriter operations.
- A DDS\_DataWriter can unregister an instance explicitly by using one of the special operations SPACE\_FooDataWriter\_unregister\_instance or SPACE\_FooDataWriter\_unregister\_ instance\_w\_timestamp.
- A DDS\_DataWriter will unregister all its contained instances implicitly when it is deleted.
- When a DDS\_DataReader detects a loss of liveliness in one of its connected DDS\_DataWriters, it will consider all instances registered by that DDS\_DataWriter as being implicitly unregistered.

• and the application must have consumed all samples belonging to the instance, either implicitly or explicitly.

- An application can consume samples explicitly by invoking the SPACE\_FooDataReader\_take operation, or one of its variants.
- The DDS\_DataReader can consume disposed samples implicitly when the autopurge\_disposed\_samples\_delay of the DDS\_ReaderData LifecycleQosPolicy has expired.

The DDS\_DataReader may also remove instances that haven’t been disposed first: this happens when the autopurge\_nowriter\_samples\_delay of the DDS\_ReaderDataLifecycleQosPolicy has expired after the instance is considered unregistered by all connected DDS\_DataWriters (i.e. when it has a DDS\_InstanceStateKind of DDS\_NOT\_ALIVE\_NO\_WRITERS). See also Section 3.1.3.15, DDS\_ReaderDataLifecycleQosPolicy, on page 99.

# Effects on Transient/Persistent Stores

Actual deletion of the instance administration in the connected Transient and Persistent stores will be postponed until the following conditions have been met:

• the instance must be unregistered (either implicitly or explicitly) by all connected DDS\_DataWriters that have previously registered it. (See above.)
• and the period of time specified by the service\_cleanup\_delay attribute in the DDS\_DurabilityServiceQosPolicy on the DDS\_Topic must have elapsed after the instance is considered unregistered by all connected DDS\_DataWriters.

See also Section 3.1.3.4, DDS\_DurabilityServiceQosPolicy, on page 76.

# Instance Handle

The DDS\_HANDLE\_NIL handle value can be used for the parameter handle. This indicates the identity of the instance is automatically deduced from the instance\_data (by means of the key).

If handle is any value other than DDS\_HANDLE\_NIL, it must correspond to the value returned by SPACE\_FooDataWriter\_register\_instance or SPACE\_FooDataWriter\_register\_instance\_w\_timestamp when the instance (identified by its key) was registered. Passing such a registered handle helps the Data Distribution Service to process the sample more efficiently. If there is no correspondence between handle and sample, the result of the operation is unspecified.

The sample that is passed as instance\_data will actually be delivered to the connected DDS\_DataReaders, but will immediately be marked for deletion.

# Blocking

If the DDS\_HistoryQosPolicy is set to DDS\_KEEP\_ALL\_HISTORY\_QOS, the SPACE\_FooDataWriter\_writedispose operation on the DDS\_DataWriter may block if the modification would cause data to be lost because one of the limits, specified in the DDS\_ResourceLimitsQosPolicy, to be exceeded. In case the synchronous attribute value of the ReliabilityQosPolicy is set to TRUE for communicating DataWriters and DataReaders then the DataWriter will wait until all synchronous DataReaders have acknowledged the data. Under these c i r c u m s t a n c e s , t h e m a x \_ b l o c k i n g \_ t i m e a t t r i b u t e o f t h e R e li a b i l i ty Q o s P o l ic y c o n f i g u r e s t h e m a x i m u m t i m e t h e SPACE\_FooDataWriter\_writedispose operation may block (either waiting for space to become available or data to be acknowledged). If max\_blocking\_time elapses before the DDS\_DataWriter is able to store the modification without exceeding the limits and all expected acknowledgements are received, the SPACE\_FooDataWriter\_writedispose operation will fail and returns DDS\_RETCODE\_TIMEOUT.

# Sample Validation

OpenSplice offers the possibility to check the sample that is passed as instance\_data for validity. Because validity checking might reduce the overall performance, it is by default disabled. This has been done by enclosing the validity checking with conditional compiler directives like this:

```cpp
#ifdef OSPL_BOUNDS_CHECK
    // check a specific bound.
#endif
```

i By defining a macro called OSPL\_OSPL\_BOUNDS\_CHECK, the validity checking will be included. On most compilers this macro can be defined by passing an additional command line parameter called -DOSPL\_BOUNDS\_CHECK.

Before the sample is accepted by the DataWriter, it is validated against the restrictions imposed by the IDL to C language mapping, where:

• an enum may not exceed the value of its highest label
• a string (bounded or unbounded) may not be NULL. (Use “” for an empty string instead)
• the length of a bounded string may not exceed the limit specified in IDL
• the length of a bounded sequence may not exceed the limit specified in IDL

If any of these restrictions is violated when validity checking is enabled, the operation will fail and return a DDS\_RETCODE\_BAD\_PARAMETER. More specific information about the context of this error will be written to the error log. When validity checking is disabled, any of these violations may result in undefined behaviour.

4 Be aware that it is not possible for the middleware to determine whether a union is correctly initialized, since according to the IDL-C language mapping a union just returns its current contents in the format of the requested branch without performing any checks. It is therefore the responsibility of the application programmer to make sure that the requested branch actually corresponds to the currently active branch. Not doing so may result in undefined behaviour as well.

# Return Code

When the operation returns:

• DDS\_RETCODE\_OK - the Data Distribution Service has modified the instance and marked it for deletion.
• DDS\_RETCODE\_ERROR - an internal error has occurred.
• DDS\_RETCODE\_ILLEGAL\_OPERATION - the operation is invoked on an inappropriate object.
• DDS\_RETCODE\_BAD\_PARAMETER - instance\_handle is not a valid handle or instance\_data is not a valid sample.
• DDS\_RETCODE\_ALREADY\_DELETED - the SPACE\_FooDataWriter has already been deleted.
• DDS\_RETCODE\_OUT\_OF\_RESOURCES - the Data Distribution Service ran out of resources to complete this operation.
• DDS\_RETCODE\_NOT\_ENABLED - the SPACE\_FooDataWriter is not enabled.

• DDS\_RETCODE\_PRECONDITION\_NOT\_MET - the instance\_handle has not been registered with this SPACE\_FooDataWriter.
• DDS\_RETCODE\_TIMEOUT - either the current action overflowed the available resources as specified by the combination of the DDS\_ReliabilityQosPolicy, DDS\_HistoryQosPolicy and DDS\_ResourceLimitsQosPolicy, or the current action was waiting for data delivery acknowledgement by synchronous DataReaders. This caused blocking of the SPACE\_FooDataWriter\_writedispose operation, which could not be resolved before max\_blocking\_time of the DDS\_ReliabilityQosPolicy elapsed.

# 3.4.2.60 SPACE\_FooDataWriter\_writedispose\_w\_timestamp

# Synopsis

```c
#include &lt;Space.h&gt;
DDS_ReturnCode_t
SPACE_FooDataWriter_writedispose_w_timestamp
(SPACE_FooDataWriter _this,
const Foo *instance_data,
const DDS_InstanceHandle_t handle,
const DDS_Time_t *source_timestamp);
```

# Description

This operation requests the Data Distribution Service to modify the instance and mark it for deletion, and provides a value for the source\_timestamp explicitly.

# Parameters

```txt
in SPACE_FooDataWriter _this - the SPACE_FooDataWriter object on which the operation is operated.
in const Foo *instance_data - the data to be written and disposed.
in const DDS_InstanceHandle_t handle - the handle to the instance as supplied by SPACE_FooDataWriter_register_instance.
in const DDS_Time_t *source_timestamp - the timestamp used.
```

# Return Value

```txt
DDS_ReturnCode_t - Possible return codes of the operation are: DDS_RETCODE_OK, DDS_RETCODE_ERROR, DDS_RETCODE_ILLEGAL_OPERATION, DDS_RETCODE_BAD_PARAMETER, DDS_RETCODE_ALREADY_DELETED, DDS_RETCODE_OUT_OF_RESOURCES, DDS_RETCODE_NOT_ENABLED, DDS_RETCODE_PRECONDITION_NOT_MET or DDS_RETCODE_TIMEOUT.
```

# Detailed Description

T h i s o p e r a t i o n p e r f o r m s t h e s a m e f u n c t i o n s a s SPACE\_FooDataWriter\_writedispose except that the application provides the value for the source\_timestamp that is made available to connected DDS\_DataReader objects. This timestamp is important for the interpretation of the DDS\_DestinationOrderQosPolicy.

# Return Code

When the operation returns:

• DDS\_RETCODE\_OK - the Data Distribution Service has modified the instance and marked it for deletion.
• DDS\_RETCODE\_ERROR - an internal error has occurred.
• DDS\_RETCODE\_ILLEGAL\_OPERATION - the operation is invoked on an inappropriate object.
• DDS\_RETCODE\_BAD\_PARAMETER - handle is not a valid handle or instance\_data is not a valid sample.
• DDS\_RETCODE\_ALREADY\_DELETED - the SPACE\_FooDataWriter has already been deleted.
• DDS\_RETCODE\_OUT\_OF\_RESOURCES - the Data Distribution Service ran out of resources to complete this operation.
• DDS\_RETCODE\_NOT\_ENABLED - the SPACE\_FooDataWriter is not enabled.
• DDS\_RETCODE\_PRECONDITION\_NOT\_MET - the handle has not been registered with this SPACE\_FooDataWriter.
DDS\_RETCODE\_TIMEOUT - either the current action overflowed the available resources as specified by the combination of the DDS\_ReliabilityQosPolicy, DDS\_HistoryQosPolicy and DDS\_ResourceLimitsQosPolicy, or the current action was waiting for data delivery acknowledgement by synchronous DataReaders. This caused blocking of the SPACE\_FooDataWriter\_writedispose\_w\_timestamp operation, which could not be resolved before max\_blocking\_time of the DDS\_ReliabilityQosPolicy elapsed.

# 3.4.3 DDS\_PublisherListener interface

Since a DDS\_Publisher is a DDS\_Entity, it has the ability to have a Listener associated with it. In this case, the associated Listener should be of type DDS\_PublisherListener. This interface must be implemented by the application. A user-defined class must be provided by the application which must extend from the DDS\_PublisherListener class. All DDS\_PublisherListener operations must be implemented in the user-defined class, it is up to the application whether an operation is empty or contains some functionality.

![The image displays a triangular warning sign with a thick red border and a white background. Inside the triangle is a black exclamation mark (!) with a downward-pointing arrow at the bottom of its vertical line.](.vortex-opensplice-c-reference-guide/336acefd8a43dc3c1bc2962d06ace616bb067a797f8f7a30f30eed8f2c20e52d.jpg)

All operations for this interface must be implemented in the user-defined class, it is up to the application whether an operation is empty or contains some functionality.

The DDS\_PublisherListener provides a generic mechanism (actually a callback function) for the Data Distribution Service to notify the application of relevant asynchronous status change events, such as a missed deadline, violation of a QosPolicy setting, etc. The DDS\_PublisherListener is related to changes in communication status.

The interface description of this class is as follows:

```c
/*
 * interface DDS_PublisherListener
 */
/*
 * inherited from DDS_DataWriterListener
 */
/* void
 *    DDS_PublisherListener_on_offered_deadline_missed
 *    (void *listener_data,
 *    DDS_DataWriter writer,
 *    const DDS_OfferedDeadlineMissedStatus *status);
 */
/* void
 *    DDS_PublisherListener_on_offered_incompatible_qos
 *    (void *listener_data,
 *    DDS_DataWriter writer,
 *    const DDS_OfferedIncompatibleQosStatus *status);
 */
/* void
 *    DDS_PublisherListener_on_liveliness_lost
 *    (void *listener_data,
 *    DDS_DataWriter writer,
 *    const DDS_LivelinessLostStatus *status);
 */
/* void
 *    DDS_PublisherListener_on_publication_matched
 *    (void *listener_data,
 *    DDS_DataWriter writer,
 *    const DDS_PublicationMatchedStatus *status);
 */
/*
 * implemented API operations
```

```c
*/
struct DDS_PublisherListener *
DDS_PublisherListener_alloc
(void);
```

The next paragraphs list all DDS\_PublisherListener operations. Since these operations are all inherited, they are listed but not fully described because they are not implemented in this class. The full description of these operations is given in the classes from which they are inherited.

# 3.4.3.1 DDS\_PublisherListener\_\_alloc

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
struct DDS_PublisherListener *
DDS_PublisherListener_alloc
(void);
```

# Description

This operation creates a new DDS\_PublisherListener.

# Parameters

```txt
&lt;none&gt;
```

# Return Value

struct DDS\_PublisherListener \* - the handle to the newly-created DDS\_PublisherListener. In case of an error, a DDS\_OBJECT\_NIL pointer is returned.

# Detailed Description

T h i s o p e r a t i o n c r e a t e s a n e w D D S\_ P u b l i s he r L i s t en e r. Th e DDS\_PublisherListener must be created using this operation. In other words, t h e a p p l i c a t i o n i s n o t a l l o w e d t o d e c l a r e a n o b j e c t o f t y p e DDS\_PublisherListener. When the application wants to release the DDS\_PublisherListener it must be released using DDS\_free.

I n c a s e t h e r e a r e i n s u f f i c i e n t r e s o u r c e s a v a i l a b l e t o a l l o c a t e t h e DDS\_PublisherListener, a DDS\_OBJECT\_NIL pointer is returned instead.

# 3.4.3.2 DDS\_PublisherListener\_on\_liveliness\_lost (inherited, abstract)

This operation is inherited and therefore not described here. See the class DDS\_DataWriterListener for further explanation.

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
```

```c
void
DDS_PublisherListener_on_liveliness_lost
(void *listener_data,
DDS_DataWriter writer,
const DDS_LivelinessLostStatus *status);
```

# 3.4.3.3 DDS\_PublisherListener\_on\_offered\_deadline\_missed (inherited, abstract)

This operation is inherited and therefore not described here. See the class DDS\_DataWriterListener for further explanation.

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
void
DDS_PublisherListener_on_offered_deadline_missed
(void *listener_data,
DDS_DataWriter writer,
const DDS_OfferedDeadlineMissedStatus *status);
```

# 3.4.3.4 DDS\_PublisherListener\_on\_offered\_incompatible\_qos (inherited, abstract)

This operation is inherited and therefore not described here. See the class DDS\_DataWriterListener for further explanation.

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
void
DDS_PublisherListener_on_offered_incompatible_qos
(void *listener_data,
DDS_DataWriter writer,
const DDS_OfferedIncompatibleQosStatus *status);
```

# 3.4.3.5 DDS\_PublisherListener\_on\_publication\_matched (inherited, abstract)

This operation is inherited and therefore not described here. See the class DDS\_DataWriterListener for further explanation.

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
void
DDS_PublisherListener_on_publication_matched
(void *listener_data,
DDS_DataWriter writer,
const DDS_PublicationMatchedStatus *status);
```

# 3.4.4 DDS\_DataWriterListener interface

Since a DDS\_DataWriter is a DDS\_Entity, it has the ability to have a Listener associated with it. In this case, the associated Listener should be of type DDS\_DataWriterListener. This interface must be implemented by the application. A user-defined class must be provided by the application which must e x t e n d f r o m t h e D D S \_D a t a W r i te r L i s t en e r c l a s s . A l l DDS\_DataWriterListener operations must be implemented in the user-defined class, it is up to the application whether an operation is empty or contains some functionality.

![The image displays a triangular warning sign with a red border and a white background. Inside the triangle, there is a black exclamation point (!) positioned above a black downward-pointing arrow (↓).](.vortex-opensplice-c-reference-guide/ea18eb7498f114e032fc3c04c575a417ab51e820e57819a5420b4d8eb90b6a7c.jpg)

NOTE: All operations for this interface must be implemented in the user-defined class; it is up to the application whether an operation is empty or contains some functionality.

The DDS\_DataWriterListener provides a generic mechanism (actually a callback function) for the Data Distribution Service to notify the application of relevant asynchronous status change events, such as a missed deadline, violation of a QosPolicy setting, etc. The DDS\_DataWriterListener is related to changes in communication status.

The interface description of this class is as follows:

```c
/*
 * interface DDS_DataWriterListener
 */
/*
 * abstract external operations
 */
void
    DDS_DataWriterListener_on_offered_deadline_missed
    (void *listener_data,
    DDS_DataWriter writer,
    const DDS_OfferedDeadlineMissedStatus *status);

void
    DDS_DataWriterListener_on_offered_incompatible_qos
    (void *listener_data,
    DDS_DataWriter writer,
    const DDS_OfferedIncompatibleQosStatus *status);

void
    DDS_DataWriterListener_on_liveliness_lost
    (void *listener_data,
    DDS_DataWriter writer,
    const DDS_LivelinessLostStatus *status);

void
```

```c
DDS_DataWriterListener_on_publication_matched
(void *listener_data,
DDS_DataWriter writer,
const DDS_PublicationMatchedStatus *status);
/*
* implemented API operations
*/
struct DDS_DataWriterListener *
DDS_DataWriterListener__alloc
(void);
```

The next paragraphs describe the usage of all DDS\_DataWriterListener operations. These abstract operations are fully described because they must be implemented by the application.

# 3.4.4.1 DDS\_DataWriterListener\_\_alloc

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
struct DDS_DataWriterListener *
DDS_DataWriterListener__alloc
(void);
```

# Description

This operation creates a new DDS\_DataWriterListener.

# Parameters

```txt
&lt;none&gt;
```

# Return Value

struct DDS\_DataWriterListener \* - the handle to the newly-created DDS\_DataWriterListener. In case of an error, a DDS\_OBJECT\_NIL pointer is returned.

# Detailed Description

This ope ra t ion creates a new D D S \_ D a t aW r i t e r Li s t e n e r. T h e DDS\_DataWriterListener must be created using this operation. In other words, t h e a p p l i c a t i o n i s n o t a l l o w e d t o d e c l a r e a n o b j e c t o f t y p e DDS\_DataWriterListener. When the application wants to release the DDS\_DataWriterListener it must be released using DDS\_free.

I n c a s e t h e r e a r e i n s u f f i c i e n t r e s o u r c e s a v a i l a b l e t o a l l o c a t e t h e DDS\_DataWriterListener, a DDS\_OBJECT\_NIL pointer is returned instead.

# 3.4.4.2 DDS\_DataWriterListener\_on\_liveliness\_lost (abstract)

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
void
DDS_DataWriterListener_on_liveliness_lost
(void *listener_data,
DDS_DataWriter writer,
const DDS_LivelinessLostStatus *status);
```

# Description

This operation must be implemented by the application and is called by the Data Distribution Service when the DDS\_LivelinessLostStatus changes.

# Parameters

inout void \*listener\_data - a pointer to a user-defined object which may be used for identification of the Listener.

in DDS\_DataWriter writer - contain a pointer to the DDS\_DataWriter on which the DDS\_LivelinessLostStatus has changed (this is an input to the application).

in const DDS\_LivelinessLostStatus \*status - contain the DDS\_LivelinessLostStatus struct (this is an input to the application).

# Return Value

```txt
&lt;none&gt;
```

# Detailed Description

This operation is the external operation (interface, which must be implemented by the application) that is called by the Data Distribution Service when the DDS\_LivelinessLostStatus changes. The implementation may be left empty when this functionality is not needed. This operation will only be called when the relevant DDS\_DataWriterListener is installed and enabled for the liveliness lost status. The liveliness lost status will change when the liveliness that the DDS\_DataWriter has committed through its DDS\_LivelinessQosPolicy was not respected. In other words, the DDS\_DataWriter failed to actively signal its liveliness within the offered liveliness period. As a result, the DDS\_DataReader objects will consider the DDS\_DataWriter as no longer “alive”.

The Data Distribution Service will call the DDS\_DataWriterListener operation with a parameter writer, which will contain a pointer to the DDS\_DataWriter on which the conflict occurred and a parameter status, which will contain the DDS\_LivelinessLostStatus struct.

# 3.4.4.3 DDS\_DataWriterListener\_on\_offered\_deadline\_missed (abstract)

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
void
DDS_DataWriterListener_on_offered_deadline_missed
(void *listener_data,
DDS_DataWriter writer,
const DDS_OfferedDeadlineMissedStatus *status);
```

# Description

This operation must be implemented by the application and is called by the Data Distribution Service when the DDS\_OfferedDeadlineMissedStatus changes.

# Parameters

inout void \*listener\_data - a pointer to a user-defined object which may be used for identification of the Listener.

in DDS\_DataWriter writer - contains a pointer to the DDS\_DataWriter on which the DDS\_OfferedDeadlineMissedStatus has changed (this is an input to the application).

in const DDS\_OfferedDeadlineMissedStatus \*status - contains the DDS\_OfferedDeadlineMissedStatus struct (this is an input to the application).

# Return Value

```txt
&lt;none&gt;
```

# Detailed Description

This operation is the external operation (interface, which must be implemented by the application) that is called by the Data Distribution Service when the DDS\_OfferedDeadlineMissedStatus changes. The implementation may be left empty when this functionality is not needed. This operation will only be called when the relevant DDS\_DataWriterListener is installed and enabled for the offered deadline missed status. The offered deadline missed status will change when the d e a d l i n e t h a t t h e D D S \_ D a t a W r i t e r h a s c o m m i t t e d t h r o u g h i t s DDS\_DeadlineQosPolicy was not respected for a specific instance.

The Data Distribution Service will call the DDS\_DataWriterListener operation with a parameter writer, which will contain a pointer to the DDS\_DataWriter on which the conflict occurred and a parameter status, which will contain the DDS\_OfferedDeadlineMissedStatus struct.

# 3.4.4.4 DDS\_DataWriterListener\_on\_offered\_incompatible\_qos (abstract)

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
void
DDS_DataWriterListener_on_offered_incompatible_qos
(void *listener_data,
DDS_DataWriter writer,
const DDS_OfferedIncompatibleQosStatus *status);
```

# Description

This operation must be implemented by the application and is called by the Data Distribution Service when the DDS\_OFFERED\_INCOMPATIBLE\_QOS\_STATUS changes.

# Parameters

inout void \*listener\_data - a pointer to a user-defined object which may be used for identification of the Listener.

in DDS\_DataWriter writer - contain a pointer to the DDS\_DataWriter on which the DDS\_OFFERED\_INCOMPATIBLE\_QOS\_STATUS has changed (this is an input to the application).

in const DDS\_OfferedIncompatibleQosStatus \*status - contain the DDS\_OfferedIncompatibleQosStatus struct (this is an input to the application).

# Return Value

```txt
&lt;none&gt;
```

# Detailed Description

This operation is the external operation (interface, which must be implemented by the application) that is called by the Data Distribution Service when the DDS\_OFFERED\_INCOMPATIBLE\_QOS\_STATUS changes. The implementation may be left empty when this functionality is not needed. This operation will only be called when the relevant DDS\_DataWriterListener is installed and enabled for the DDS\_OFFERED\_INCOMPATIBLE\_QOS\_STATUS. The incompatible Qos status will change when a DDS\_DataReader object has been discovered by the D D S\_ D a t a W r it e r w i t h t h e s a m e D DS \_ T o p i c an d a requ est e d DDS\_DataReaderQos that was incompatible with the one offered by the DDS\_DataWriter.

The Data Distribution Service will call the DDS\_DataWriterListener operation with a parameter writer, which will contain a pointer to the DDS\_DataWriter on which the conflict occurred and a parameter status, which will contain the DDS\_OfferedIncompatibleQosStatus struct.

# 3.4.4.5 DDS\_DataWriterListener\_on\_publication\_matched (abstract)

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
void
DDS_DataWriterListener_on_publication_matched
(DDS_DataWritervoid *listener_data,
DDS_DataWriter writer,
const DDS_PublicationMatchedStatus *status);
```

# Description

This operation must be implemented by the application and is called by the Data Distribution Service when a new match has been discovered for the current publication, or when an existing match has ceased to exist.

# Parameters

inout void \*listener\_data - a pointer to a user-defined object which may be used for identification of the Listener.

in DDS\_DataWriter writer - contains a pointer to the DDS\_DataWriter for which a match has been discovered (this is an input to the application provided by the Data Distribution Service).

in const DDS\_PublicationMatchedStatus \*status - contains the DDS\_PublicationMatchedStatus struct (this is an input to the application provided by the Data Distribution Service).

# Return Value

```txt
&lt;none&gt;
```

# Detailed Description

This operation must be implemented by the application and is called by the Data Distribution Service when a new match has been discovered for the current publication, or when an existing match has ceased to exist. Usually this means that a new DataReader that matches the Topic and that has compatible Qos as the current DDS\_DataWriter has either been discovered, or that a previously discovered DataReader has ceased to be matched to the current DDS\_DataWriter. A DataReader may cease to match when it gets deleted, when it changes its Qos to a value that is incompatible with the current DDS\_DataWriter or when either the

DDS\_DataWriter or the DataReader has chosen to put its matching counterpart on its ignore-list using the DDS\_DomainParticipant\_ignore\_subcription or DDS\_DomainParticipant\_ignore\_publication operations.

The implementation of this Listener operation may be left empty when this functionality is not needed: it will only be called when the relevant D D S\_ D a t a W r it e r L i s te n e r i s i n s t a ll e d a n d e n a b le d f o r t h e DDS\_PUBLICATION\_MATCHED\_STATUS.

The Data Distribution Service will provide a pointer to the DDS\_DataWriter in the parameter writer and the DDS\_PublicationMatchedStatus struct in the parameter status for use by the application.

# 3.5 Subscription Module

![Here is an accurate and concise description of the flowchart/block diagram, listing all labeled blocks and their connections.\n\n**Blocks:**\n*   **DataSample**\n*   **SampleInfo**: Contains attributes: `sample_state`, `view_state`, `instance_state`, `source_timestamp`, `instance_handle`, `disposed_generation_count`, `no_writers_generation_count`, `sample_rank`, `generation_rank`, `absolute_generation_rank`.\n*   **DataReader**: Contains methods including `create_querycondition()`, `create_readcondition()`, `delete_contained_entities()`, `delete_readcondition()`, `((abstract)) get_key_value()`, `get_listener()`, `get_liveliness_changed_status()`, `get_matched_publication_data()`, `get_matched_publications()`, `get_qos()`, `get_requested_deadline_missed_status()`, `get_requested_incompatible_qos_status()`, `get_sample_lost_status()`, `get_sample_rejected_status()`, `get_subscription()`, `get_subscription_match_status()`, `get_topicdescription()`, `((abstract)) lookup_instance()`, `((abstract)) read()`, `((abstract)) read_instance()`, `((abstract)) read_next_instance()`, `((abstract)) read_next_instance_w_condition()`, `((abstract)) read_next_sample()`, `((abstract)) return_loan()`, `set_listener()`, `set_qos()`, `((abstract)) take()`, `((abstract)) take_instance()`, `((abstract)) take_next_instance()`, `((abstract)) take_next_instance_w_condition()`, `((abstract)) take_sample()`, `((abstract)) take_w_condition()`.\n*   **DomainParticipant**: Contains `(from Domain Module)`.\n*   **Subscriber**: Contains methods including `begin_access()`, `copy_from_topic_qos()`, `create_datareader()`, `delete_contained_entities()`, `delete_datareader()`, `end_access()`, `get_datareaders()`, `get_default_datareader_qos()`, `get_listener()`, `get_participant()`, `get_qos()`, `get_subscription()`, `lookup_datareader()`, `notify_datareaders()`, `set_default_datareader_qos()`, `set_listener()`, `set_qos()`.\n*   **QosPolicy**: Contains `name : string`.\n*   **TopicDescription**: Contains `(from Topic-Definition Module)`.\n*   **Topic**: Contains `(from Topic-Definition Module)`.\n*   **WaitSet**: Contains `(from Infrastructure Module)`.\n*   **StatusCondition**: Contains `(from Infrastructure Module)`.\n*   **ReadCondition**: Contains methods `get_datareader()`, `get_instance_state_mask()`, `get_sample_state_mask()`, `get_view_state_mask()`.\n*   **QueryCondition**: Contains methods `get_query_parameters()`, `get_query_expression()`, `set_query_parameters()`.\n*   **((Interface)) DataReaderListener**: Contains methods `on_data_available()`, `on_liveliness_changed()`, `on_requested_deadline_missed()`, `on_requested_incompatible_qos()`, `on_sample_lost()`, `on_sample_rejected()`, `on_subscription_match()`.\n*   **((Interface)) SubscriberListener**: Contains method `on_data_on_readers()`.\n\n**Connections:**\n*   **DataReader** to **DataSample**: Solid line with `*` at DataSample end.\n*   **DataSample** to **SampleInfo**: Solid line with `1` at SampleInfo end.\n*   **DataSample** to **DataReaderListener**: Solid line with hollow triangle pointing to DataReaderListener.\n*   **DataReader** to **DataReaderListener**: Dashed arrow with `0..1` at DataReaderListener end.\n*   **DomainParticipant** to **Subscriber**: Dashed arrow with `((create))` label.\n*   **Subscriber** to **QosPolicy**: Solid line with `*` at QosPolicy end. Labels `qos` and `default_datareader_qos` are near the line.\n*   **Subscriber** to **TopicDescription**: Solid line with `*` at TopicDescription end. Label `((implicit))` is near the line.\n*   **Subscriber** to **Topic**: Solid line with `1` at Topic end. Label `((implicit))` is near the line.\n*   **Subscriber** to **StatusCondition**: Dashed arrow with `0..1` at StatusCondition end.\n*   **Subscriber** to **SubscriberListener**: Dashed arrow with `0..1` at SubscriberListener end. Label `((implicit))` is near the line.\n*   **TopicDescription** to **Topic**: Solid line with hollow triangle pointing to Topic.\n*   **TopicDescription** to **QosPolicy**: Solid line with `*` at QosPolicy end.\n*   **Topic** to **QosPolicy**: Solid line with `*` at QosPolicy end.\n*   **DataReader** to **TopicDescription**: Solid line with `*` at TopicDescription end. Label `((implicit))` is near the line.\n*   **DataReader** to **Topic**: Solid line with `1` at Topic end. Label `((implicit))` is near the line.\n*   **DataReader** to **ReadCondition**: Dashed arrow with `((create))` label.\n*   **DataReader** to **QueryCondition**: Dashed arrow with `((create))` label.\n*   **ReadCondition** to **WaitSet**: Dashed arrow with `((create))` label.\n*   **ReadCondition** to **QueryCondition**: Solid line with hollow triangle pointing to QueryCondition.\n*   **WaitSet** to **StatusCondition**: Solid line with `*` at both ends. Label `((implicit))` is near the line.](.vortex-opensplice-c-reference-guide/b8d86678024de7ffbca3f1d0843d612b4c5111b81a3d29d534990723a83aeade.jpg)

Figure 19: The DCPS Subscription Module’s Class Model

This module contains the following classes:

• DDS\_Subscriber
• Subscription type specific classes
• DDS\_DataSample
• DDS\_SampleInfo (struct)
• DDS\_SubscriberListener (interface)
• DDS\_DataReaderListener (interface)
• DDS\_ReadCondition
• DDS\_QueryCondition

“Subscription type specific classes” contains the generic class and the generated data type specific classes. For each data type, a data type specific class &lt;NameSpace&gt;\_&lt;type&gt;DataReader is generated (based on IDL) by calling the pre-processor.

For instance, for the fictional data type Foo (this also applies to other types), defined in the module SPACE; “Subscription type specific classes” contains the following classes:

• DDS\_DataReader (abstract)
• SPACE\_FooDataReader
• DDS\_DataReaderView (abstract)
• SPACE\_FooDataReaderView

A DDS\_Subscriber is an object responsible for receiving published data and making it available (according to the DDS\_SubscriberQos) to the application. It may receive and dispatch DDS\_Topic with data of different specified data types. To access the received data, the application must use a typed DDS\_DataReader attached to the DDS\_Subscriber. Thus, a subscription is defined by the association of a DDS\_DataReader with a DDS\_Subscriber. This association expresses the intent of the application to subscribe to the data described by the DDS\_DataReader in the context provided by the DDS\_Subscriber.

# 3.5.1 Class DDS\_Subscriber

A DDS\_Subscriber is the object responsible for the actual reception of the data resulting from its subscriptions.

A DDS\_Subscriber acts on behalf of one or more DDS\_DataReader objects that are related to it. When it receives data (from the other parts of the system), it i n d i c a t e s t o t h e a p p l i c a t i o n t h a t d a t a i s a v a i l a b l e t h r o u g h i t s DDS\_DataReaderListener and by enabling related DDS\_Conditions. The application can access the list of concerned DDS\_DataReader objects through the operation DDS\_Subscriber\_get\_datareaders and then access the data available through operations on the DDS\_DataReader.

The interface description of this class is as follows:
```c
/*
 * interface DDS_Subscriber
 */
/*
 * inherited from class DDS_Entity
 */
/* DDS_StatusCondition
 *    DDS_Subscriber_get_statuscondition
 *    (DDS_Subscriber _this)
 */
/* DDS_StatusMask
 *    DDS_Subscriber_get_status_changes
 *    (DDS_Subscriber _this);
 */
/* DDS_ReturnCode_t
 *    DDS_Subscriber_enable
 *    (DDS_Subscriber _this);
 */
/*
 * implemented API operations
 */
DDS_DataReader
DDS_Subscriber_create_datareader
(DDS_Subscriber _this,
    const DDS_TopicDescription a_topic,
    const DDS_DataReaderQos *qos,
    const struct DDS_DataReaderListener *a_listener,
    const DDS_StatusMask mask);

DDS_ReturnCode_t
DDS_Subscriber_delete_datareader
(DDS_Subscriber _this,
    const DDS_DataReader a_datareader);

DDS_ReturnCode_t
DDS_Subscriber_delete_contained_entities
(DDS_Subscriber _this);

DDS_DataReader
DDS_Subscriber_lookup_datareader
(DDS_Subscriber _this,
    const DDS_char *topic_name);

DDS_ReturnCode_t
```

```c
DDS_Subscriber_get_datareaders
(DDS_Subscriber _this,
DDS_DataReaderSeq *readers,
const DDS_SampleStateMask sample_states,
const DDS_ViewStateMask view_states,
const DDS_InstanceStateMask instance_states);

DDS_ReturnCode_t
DDS_Subscriber_notify_datareaders
(DDS_Subscriber _this);

DDS_ReturnCode_t
DDS_Subscriber_set_qos
(DDS_Subscriber _this,
const DDS_SubscriberQos *qos);

DDS_ReturnCode_t
DDS_Subscriber_get_qos
(DDS_Subscriber _this,
DDS_SubscriberQos *qos);

DDS_ReturnCode_t
DDS_Subscriber_set_listener
(DDS_Subscriber _this,
const struct DDS_SubscriberListener *a_listener,
const DDS_StatusMask mask);

struct DDS_SubscriberListener
DDS_Subscriber_get_listener
(DDS_Subscriber _this);

DDS_ReturnCode_t
DDS_Subscriber_begin_access
(DDS_Subscriber _this);

DDS_ReturnCode_t
DDS_Subscriber_end_access
(DDS_Subscriber _this);

DDS_DomainParticipant
DDS_Subscriber_get_participant
(DDS_Subscriber _this);

DDS_ReturnCode_t
DDS_Subscriber_set_default_datareader_qos
(DDS_Subscriber _this,
const DDS_DataReaderQos *qos);

DDS_ReturnCode_t
DDS_Subscriber_get_default_datareader_qos
(DDS_Subscriber _this,
```

```c
DDS_DataReaderQos *qos);
DDS_ReturnCode_t
DDS_Subscriber_copy_from_topic_qos
(DDS_Subscriber _this,
DDS_DataReaderQos *a_datareader_qos,
const DDS_TopicQos *a_topic_qos);
```

The next paragraphs describe the usage of all DDS\_Subscriber operations. The inherited operations are listed but not fully described because they are not implemented in this class. The full description of these operations is given in the classes from which they are inherited.

# 3.5.1.1 DDS\_Subscriber\_begin\_access

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
DDS_ReturnCode_t
DDS_Subscriber_begin_access
(DDS_Subscriber _this);
```

# Description

This operation indicates that the application will begin accessing a coherent and/or ordered set of modifications that spans multiple DataReaders attached to this S u b s c r i b e r. T h e a c c e s s w i l l b e c o m p l e t e d b y a m a t c h i n g c a l l t o DDS\_Subscriber\_end\_access.

# Parameters

in DDS\_Subscriber \_this - the DDS\_Subscriber object on which the operation is operated.

# Return Value

```txt
DDS_ReturnCode_t - Possible return codes of the operation are: DDS_RETCODE_OK, DDS_RETCODE_ERROR, DDS_RETCODE_ILLEGAL_OPERATION, DDS_RETCODE_BAD_PARAMETER or DDS_RETCODE_ALREADY_DELETED.
```

# Detailed Description

This operation indicates that the application is about to access a set of coherent and/or ordered samples in any of the DataReader objects attached to the Subscriber. The operation will effectively lock all of the Subscriber’s DataReader objects for any incoming modifications, so that the state of their history remains consistent for the duration of the access. Note that a coherent subscriber should first be enabled, otherwise this operation will return DDS\_RETCODE\_ERROR. See Section 3.5.1.6, DDS\_Subscriber\_enable (inherited), for additional information.

The application is required to use this operation only if the PresentationQosPolicy of the Subscriber to which the DataReader belongs has the access\_scope set to ‘ G R O U P ’ . I n t h e a f o r e m e n t i o n e d c a s e , t h e o p e r a t i o n DDS\_Subscriber\_begin\_access must be called prior to calling any of the sample-accessing operations, namely: get\_datareaders on the Subscriber and read, take, and all their variants on any DataReader. Otherwise the s a m p l e - a c c e s s i n g o p e r a t i o n s w i l l r e t u r n t h e e r r o r DDS\_RETCODE\_PRECONDITION\_NOT\_MET. Once the application has finished accessing the data samples it must call DDS\_Subscriber\_end\_access.

It is not required for the application to call begin\_access/end\_access if the PresentationQosPolicy has the access\_scope set to something other than ‘GROUP’. Calling begin\_access/end\_access in this case is not considered an error and has no effect.

The calls to begin\_access/end\_access may be nested. In that case, the application must call end\_access as many times as it called begin\_access.

# Return Code

When the operation returns:

• DDS\_RETCODE\_OK - access to coherent/ordered data has successfully started.
• DDS\_RETCODE\_ERROR - an internal error has occurred.
• DDS\_RETCODE\_ILLEGAL\_OPERATION - the operation is invoked on an inappropriate object.
• DDS\_RETCODE\_BAD\_PARAMETER - the parameter passed to the operation is NULL, or is not pointing to any valid object.
• DDS\_RETCODE\_ALREADY\_DELETED - the DDS\_Subscriber has already been deleted.

# 3.5.1.2 DDS\_Subscriber\_copy\_from\_topic\_qos

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
DDS_ReturnCode_t
DDS_Subscriber_copy_from_topic_qos
(DDS_Subscriber _this,
DDS_DataReaderQos *a_datareader_qos,
const DDS_TopicQos *a_topic_qos);
```

# Description

This operation will copy the policies in a\_topic\_qos to the corresponding policies in a\_datareader\_qos.

# Parameters

in DDS\_Subscriber \_this - the DDS\_Subscriber object on which the operation is operated.

inout DDS\_DataReaderQos \*a\_datareader\_qos - the destination DDS\_DataReaderQos struct to which the QosPolicy settings will be copied.

in const DDS\_TopicQos \*a\_topic\_qos - the source DDS\_TopicQos, which will be copied.

# Return Value

D D S \_ R e t u r n C o d e \_ t - P o s s i b l e r e t u r n c o d e s o f t h e o p e r a t i o n a r e : DDS\_RETCODE\_OK, DDS\_RETCODE\_ERROR, DDS\_RETCODE\_ILLEGAL\_ OPERATION, DDS\_RETCODE\_ALREADY\_DELETED or DDS\_RETCODE\_ OUT\_OF\_RESOURCES.

# Detailed Description

This operation will copy the QosPolicy settings in a\_topic\_qos to the corresponding QosPolicy settings in a\_datareader\_qos (replacing the values in a\_datareader\_qos, if present).

This is a “convenience” operation, useful in combination with the operations DDS\_Publisher\_get\_default\_datawriter\_qos and DDS\_Topic\_get\_qos. The operation DDS\_Subscriber\_copy\_from\_topic\_qos can be used to merge the DDS\_DataReader default QosPolicy settings with the corresponding ones on the DDS\_Topic. The resulting DDS\_DataReaderQos can then be used to create a new DDS\_DataReader, or set its DDS\_DataReaderQos.

This operation does not check the resulting a\_datareader\_qos for self consistency. This is because the “merged” a\_datareader\_qos may not be the final one, as the application can still modify some QosPolicy settings prior to applying the DDS\_DataReaderQos to the DDS\_DataReader.

# Return Code

When the operation returns:

• DDS\_RETCODE\_OK - the QosPolicy settings have successfully been copied from the DDS\_TopicQos to the DDS\_DataReaderQos.

• DDS\_RETCODE\_ERROR - an internal error has occurred.

• DDS\_RETCODE\_ILLEGAL\_OPERATION - the operation is invoked on an inappropriate object.
• DDS\_RETCODE\_ALREADY\_DELETED - the DDS\_Subscriber has already been deleted.
• DDS\_RETCODE\_OUT\_OF\_RESOURCES - the Data Distribution Service ran out of resources to complete this operation.

# 3.5.1.3 DDS\_Subscriber\_create\_datareader

```c
Synopsis
#include &lt;dds_dcps.h&gt;
DDS_DataReader
DDS_Subscriber_create_datareader
(DDS_Subscriber _this,
const DDS_TopicDescription a_topic,
const DDS_DataReaderQos *qos,
const struct DDS_DataReaderListener *a_listener,
const DDS_StatusMask mask);
```

# Description

This operation creates a DDS\_DataReader with the desired QosPolicy settings, for the desired DDS\_TopicDescription and attaches the optionally specified DDS\_DataWriterListener to it.

# Parameters

in DDS\_Subscriber \_this - the DDS\_Subscriber object on which the operation is operated.
in const DDS\_TopicDescription a\_topic - a pointer to the DDS\_TopicDescription for which the DDS\_DataReader is created. This may be a DDS\_Topic, DDS\_MultiTopic or DDS\_ContentFilteredTopic.
in const DDS\_DataReaderQos \*qos - the struct with the QosPolicy settings for the new DDS\_DataReader, when these QosPolicy settings are not self consistent, no DDS\_DataReader is created.
in const struct DDS\_DataReaderListener \*a\_listener - a pointer to the DDS\_DataReaderListener instance which will be attached to the new DDS\_DataReader. It is permitted to use DDS\_OBJECT\_NIL as the value of the listener: this behaves as a DDS\_DataWriterListener whose operations perform no action.
in const DDS\_StatusMask mask - a bit-mask in which each bit enables the invocation of the DDS\_DataReaderListener for a certain status.

# Return Value

DD S \_D at aR ea d er - Return value is a pointer to the newly-created DDS\_DataReader. In case of an error, the DDS\_OBJECT\_NIL pointer is returned.

# Detailed Description

This operation creates a DDS\_DataReader with the desired QosPolicy settings, for the desired DDS\_TopicDescription and attaches the optionally specified DDS\_DataReaderListener to it. The DDS\_TopicDescription may be a DDS\_Topic, DDS\_MultiTopic or DDS\_ContentFilteredTopic. The returned DDS\_DataReader is attached (and belongs) to the DDS\_Subscriber. To delete the DDS\_DataReader the operation DDS\_Subscriber\_delete\_datareader or DDS\_Subscriber\_delete\_contained\_entities must be used. If no read rights are defined for the specific topic then the creation of the DataReader will fail.

# Application Data Type

The DDS\_DataReader returned by this operation is an object of a derived class, specific to the data type associated with the DDS\_TopicDescription. For each a p p l i c a t i o n - d e f i n e d d a t a t y p e &lt; t y p e &gt; t h e r e i s a c l a s s &lt;NameSpace&gt;\_&lt;type&gt;DataReader generated by calling the pre-processor. This data type specific class extends DDS\_DataReader and contains the operations to read data of data type &lt;type&gt;.

Because the DDS\_DataReader may read a DDS\_Topic, DDS\_ContentFilteredTopic or DDS\_MultiTopic, the DDS\_DataReader is associated with the DDS\_TopicDescription. The DDS\_DataWriter can only write a DDS\_Topic, not a DDS\_ContentFilteredTopic or DDS\_MultiTopic, because these two are constructed at the DDS\_Subscriber side.

# QosPolicy

The common application pattern to construct the QosPolicy settings for the DDS\_DataReader is to:

• Retrieve the QosPolicy settings on the associated DDS\_TopicDescription by means of the DDS\_Topic\_get\_qos operation on the DDS\_TopicDescription
• Retrieve the default DDS\_DataReaderQos by means of the DDS\_Subscriber\_get\_default\_datareader\_qos operation on the DDS\_Subscriber
• Combine those two QosPolicy settings and selectively modify policies as desired (DDS\_Subscriber\_copy\_from\_topic\_qos)

• Use the resulting QosPolicy settings to construct the DDS\_DataReader.
• In case the specified QosPolicy settings are not self consistent, no DDS\_DataReader is created and the DDS\_OBJECT\_NIL pointer is returned.

# Default QoS

The constant DDS\_DATAREADER\_QOS\_DEFAULT can be used as parameter qos to create a DDS\_DataReader with the default DDS\_DataReaderQos as set in the DDS\_Subscriber. The effect of using DDS\_DATAREADER\_QOS\_DEFAULT is the s a m e a s c a l l i n g t h e o p e r a t i o n DDS\_Subscriber\_get\_default\_datareader\_qos and using the resulting DDS\_DataReaderQos to create the DDS\_DataReader.

The special DDS\_DATAREADER\_QOS\_USE\_TOPIC\_QOS can be used to create a DDS\_DataReader with a combination of the default DDS\_DataReaderQos and t h e DDS\_TopicQos. T h e e f f e c t o f u s i n g DDS\_DATAREADER\_QOS\_USE\_TOPIC\_QOS is the same as calling the operation DDS\_Subscriber\_get\_default\_datareader\_qos and retrieving the DDS\_TopicQos (by means of the operation DDS\_Topic\_get\_qos) and then c o m b i n i n g t h e s e t w o Q o s P o l i c y s e t t i n g s u s i n g t h e o p e r a t i o n DDS\_Subscriber\_copy\_from\_topic\_qos, whereby any common policy that is set on the DDS\_TopicQos “overrides” the corresponding policy on the default DDS\_DataReaderQos. The resulting DDS\_DataReaderQos is then applied to create the DDS\_DataReader.

# Communication Status

For each communication status, the StatusChangedFlag flag is initially set to FALSE. It becomes TRUE whenever that communication status changes. For each c o m m u n i c a t i o n s t a t u s a c t i v a t e d i n t h e m a s k , t h e a s s o c i a t e d DDS\_DataReaderListener operation is invoked and the communication status is reset to FALSE, as the listener implicitly accesses the status which is passed as a parameter to that operation. The fact that the status is reset prior to calling the listener means that if the application calls the get\_&lt;status\_name&gt;\_status from inside the listener it will see the status already reset.

The following statuses are applicable to the DDS\_DataReaderListener:

```pickle
DDS_REQUESTED_DEADLINE_MISSED_STATUS
DDS_REQUESTED_INCOMPATIBLE_QOS_STATUS
DDS_SAMPLE_LOST_STATUS
DDS_SAMPLE_REJECTED_STATUS
DDS_DATA_AVAILABLE_STATUS
DDS_LIVELINESS_CHANGED_STATUS
DDS_SUBSCRIPTION_MATCHED_STATUS.
```

![The image displays a standard warning sign, specifically an equilateral triangle with a red border and a white interior. Centered inside the triangle is a black exclamation point.](.vortex-opensplice-c-reference-guide/6e306dd236c5030030dbb6dc4cffecf1b5f375de8697bede3efd784804735d91.jpg)

Be aware that the DDS\_SUBSCRIPTION\_MATCHED\_STATUS is not applicable when the infrastructure does not have the information available to determine connectivity. This is the case when OpenSplice is configured not to maintain discovery information in the Networking Service. (See also the description of the NetworkService/Discovery[@enabled] attribute in section 4.4.1.6.1 on page 244 of the Deployment Guide.) In this case the operation will return DDS\_OBJECT\_NIL.

Status bits are declared as a constant and can be used by the application in an OR operation to create a tailored mask. The special constant DDS\_STATUS\_MASK\_NONE can be used to indicate that the created entity should not respond to any of its available statuses. The DDS will therefore attempt to propagate these statuses to its factory. The special constant STATUS\_MASK\_ANY\_V1\_2 can be used to select all applicable statuses specified in the “Data Distribution Service for Real-time Systems Version 1.2” specification.

# Status Propagation

In case a communication status is not activated in the m a sk of the DDS\_DataReaderListener, the DDS\_SubscriberListener of the containing DDS\_Subscriber is invoked (if attached and activated for the status that occurred). T h i s a l l o w s t h e a p p l i c a t i o n t o s e t a d e f a u l t b e h a v i o u r i n t h e DDS\_SubscriberListener of the containing DDS\_Subscriber and a DDS\_DataReader specific behaviour when needed. In case the communication status is not activated in the mask of the DDS\_SubscriberListener as well, the c o m m u n i c a t i o n s t a t u s w i l l b e p r o p a g a t e d t o t h e DDS\_DomainParticipantListener o f t h e c o n t a i n i n g DDS\_DomainParticipant. In case the DDS\_DomainParticipantListener is also not attached or the communication status is not activated in its mask, the application is not notified of the change.

# 3.5.1.4 DDS\_Subscriber\_delete\_contained\_entities

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
DDS_ReturnCode_t
DDS_Subscriber_delete_contained_entities
(DDS_Subscriber _this);
```

# Description

This operation deletes all the DDS\_DataReader objects that were created by means of the DDS\_Subscriber\_create\_datareader operation on the DDS\_Subscriber.

# Parameters

in DDS\_Subscriber \_this - the DDS\_Subscriber object on which the operation is operated.

# Return Value

D D S \_ R e t u r n C o d e \_ t - P o s s i b l e r e t u r n c o d e s o f t h e o p e r a t i o n a r e : DDS\_RETCODE\_OK, DDS\_RETCODE\_ERROR, DDS\_RETCODE\_ILLEGAL\_ OPERATION, DDS\_RETCODE\_ALREADY\_DELETED, DDS\_RETCODE\_ OUT\_OF\_RESOURCES or DDS\_RETCODE\_PRECONDITION\_NOT\_MET.

# Detailed Description

This operation deletes all the DDS\_DataReader objects that were created by means of the DDS\_Subscriber\_create\_datareader operation on the DDS\_Subscriber. In other words, it deletes all contained DDS\_DataReader objects. Prior to deleting each DDS\_DataReader, this operation recursively calls the corresponding DDS\_DataReader\_delete\_contained\_entities operation on each DDS\_DataReader. In other words, all DDS\_DataReader objects in the DDS\_Subscriber are deleted, including the DDS\_QueryCondition and DDS\_ReadCondition objects contained by the DDS\_DataReader.

![The image displays a red triangle with rounded corners. Inside the triangle is a black exclamation mark. Below the exclamation mark is a small downward arrow.](.vortex-opensplice-c-reference-guide/0b7b8b758fa89a108c90a507387617d157661b37a570e1bd4ba694f1d7074216.jpg)

NOTE: The operation will return DDS\_PRECONDITION\_NOT\_MET if the any of the contained entities is in a state where it cannot be deleted. This will occur, for example, if a contained DDS\_DataReader cannot be deleted because the application has called a read or take operation and has not called the corresponding return\_loan operation to return the loaned samples. In such cases, the operation does not roll back any entity deletions performed prior to the detection of the problem.

# Return Code

When the operation returns:

• DDS\_RETCODE\_OK - the contained DDS\_Entity objects are deleted and the application may delete the DDS\_Subscriber.
• DDS\_RETCODE\_ERROR - an internal error has occurred.
• DDS\_RETCODE\_ILLEGAL\_OPERATION - the operation is invoked on an inappropriate object.
• DDS\_RETCODE\_ALREADY\_DELETED - the DDS\_Subscriber has already been deleted.
• DDS\_RETCODE\_OUT\_OF\_RESOURCES - the Data Distribution Service ran out of resources to complete this operation.

• DDS\_RETCODE\_PRECONDITION\_NOT\_MET - one or more of the contained entities are in a state where they cannot be deleted.

# 3.5.1.5 DDS\_Subscriber\_delete\_datareader

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
DDS_ReturnCode_t
DDS_Subscriber_delete_datareader
(DDS_Subscriber _this,
const DDS_DataReader a_datareader);
```

# Description

This operation deletes a DDS\_DataReader that belongs to the DDS\_Subscriber.

# Parameters

in DDS\_Subscriber \_this - the DDS\_Subscriber object on which the operation is operated.

in const DDS\_DataReader a\_datareader - a pointer to the DDS\_DataReader, which is to be deleted.

# Return Value

```txt
DDS_ReturnCode_t - Possible return codes of the operation are: DDS_RETCODE_OK, DDS_RETCODE_ERROR, DDS_RETCODE_ILLEGAL_OPERATION, DDS_RETCODE_BAD_PARAMETER, DDS_RETCODE_ALREADY_DELETED, DDS_RETCODE_OUT_OF_RESOURCES or DDS_RETCODE_PRECONDITION_NOT_MET.
```

# Detailed Description

This operation deletes a DDS\_DataReader that belongs to the DDS\_Subscriber. When the operation is called on a different DDS\_Subscriber as used when the DDS\_DataReader was created, the operation has no effect and returns DDS\_RETCODE\_PRECONDITION\_NOT\_MET. The deletion of the DDS\_DataReader is not allowed if there are any DDS\_ReadCondition or DDS\_QueryCondition objects that are attached to the DDS\_DataReader, or when the DDS\_DataReader still contains unreturned loans. In those cases the operation also returns DDS\_RETCODE\_PRECONDITION\_NOT\_MET.

# Return Code

When the operation returns:

• DDS\_RETCODE\_OK - the DDS\_DataReader is deleted.
• DDS\_RETCODE\_ERROR - an internal error has occurred.

• DDS\_RETCODE\_ILLEGAL\_OPERATION - the operation is invoked on an inappropriate object.
• DDS\_RETCODE\_BAD\_PARAMETER - the parameter a\_datareader is not a valid DDS\_DataReader.
• DDS\_RETCODE\_ALREADY\_DELETED - the DDS\_Subscriber has already been deleted.
• DDS\_RETCODE\_OUT\_OF\_RESOURCES - the Data Distribution Service ran out of resources to complete this operation.
• DDS\_RETCODE\_PRECONDITION\_NOT\_MET - the operation is called on a different DDS\_Subscriber as used when the DDS\_DataReader was created, the DDS\_DataReader contains one or more DDS\_ReadCondition or DDS\_QueryCondition objects or the DDS\_DataReader still contains unreturned loans.

# 3.5.1.6 DDS\_Subscriber\_enable (inherited)

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
DDS_ReturnCode_t
DDS_Subscriber_enable
(DDS_Subscriber _this);
```

# Description

This operation is inherited. See the Section 3.1.1, Class DDS\_Entity (abstract), for a general description.

Behaviour when used in combination with group-scope coherent access

In addition to the general description, the enable operation on a Subscriber has special meaning in specific use cases. This applies only to Subscribers with PresentationQoSPolicy coherent\_access set to true with access\_scope set to group.

In this case the subscriber is always created in a disabled state, regardless of the factory’s autoenable\_created\_entities setting. While the subscriber remains disabled, DataReaders can be created that will participate in coherent transactions of the subscriber (See Section 3.5.1.1, DDS\_Subscriber\_begin\_access, and Section 3.5.1.7, DDS\_Subscriber\_end\_access, for more information).

All DataReaders will also be created in a disabled state. Coherency with an access\_scope of group requires data to be delivered as a transaction, atomically, to all eligible readers. Therefore data should not be delivered to any single DataReader immediately after it is created, as usual, but only after the application has finished creating all DataReaders for a given Subscriber. At this point, the application should enable the Subscriber which in turn enables all of its DataReaders.

# 3.5.1.7 DDS\_Subscriber\_end\_access

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
DDS_ReturnCode_t
DDS_Subscriber_end_access
(DDS_Subscriber _this);
```

# Description

This operation indicates that the application will stop accessing a coherent and/or ordered set of modifications that spans multiple DataReaders attached to this DDS\_Subscriber. This access must have been started by a matching call to DDS\_Subscriber\_begin\_access.

# Parameters

in DDS\_Subscriber \_this - the DDS\_Subscriber object on which the operation is operated.

# Return Value

```txt
DDS_ReturnCode_t - Possible return codes of the operation are: DDS_RETCODE_OK, DDS_RETCODE_ERROR, DDS_RETCODE_ILLEGAL_OPERATION, DDS_RETCODE_BAD_PARAMETER, DDS_RETCODE_ALREADY_DELETED or DDS_RETCODE_PRECONDITION_NOT_MET.
```

# Detailed Description

Indicates that the application has finished accessing the data samples in DataReader objects managed by the Subscriber. This operation must be used to ‘close’ a corresponding begin\_access. The operation will effectively unlock all of the Subscriber’s DataReader objects for incoming modifications, so it is important to invoke it as quickly as possible to avoid an ever increasing backlog of modifications. After calling end\_access the application should no longer access any of the Data or SampleInfo elements returned from the sample-accessing operations. Section 3.5.1.6, DDS\_Subscriber\_enable (inherited), contains additional information about coherent access.

This call must close a previous call to begin\_access otherwise the operation will return the error PRECONDITION\_NOT\_MET.

# Return Code

When the operation returns:

• DDS\_RETCODE\_OK - access to coherent/ordered data has successfully started.
• DDS\_RETCODE\_ERROR - an internal error has occurred.
• DDS\_RETCODE\_ILLEGAL\_OPERATION - the operation is invoked on an inappropriate object.
• DDS\_RETCODE\_BAD\_PARAMETER - the parameter passed to the operation is NULL, or is not pointing to any valid object.
• DDS\_RETCODE\_ALREADY\_DELETED - the DDS\_Subscriber has already been deleted.
• DDS\_RETCODE\_PRECONDITION\_NOT\_MET - no matching call to begin\_access has been detected.

# 3.5.1.8 DDS\_Subscriber\_get\_datareaders

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
DDS_ReturnCode_t
DDS_Subscriber_get_datareaders
(DDS_Subscriber _this,
DDS_DataReaderSeq *readers,
const DDS_SampleStateMask sample_states,
const DDS_ViewStateMask view_states,
const DDS_InstanceStateMask instance_states);
```

# Description

This operation allows the application to access the DataReader objects that contain samples with the specified s am p le \_ st at e s, vi e w\_ s ta t es , a n d instance\_states.

# Parameters

in DDS\_Subscriber \_this - the DDS\_Subscriber object on which the operation is operated.

inout DDS\_DataReaderSeq \*readers - a sequence which is used to pass the list of all DataReaders that contain samples of the specified sample\_states, view\_states, and instance\_states.

in const DDS\_SampleStateMask sample\_states - a mask, which selects only those readers that have samples with the desired sample states.

in const DDS\_ViewStateMask view\_states - a mask, which selects only those readers that have samples with the desired view states.

in const DDS\_InstanceStateMask instance\_states - a mask, which selects only those readers that have samples with the desired instance states.

# Return Value

DDS\_ReturnCode\_t - Possible return codes of the operation are: DDS\_RETCODE\_OK, DDS\_RETCODE\_ERROR, DDS\_RETCODE\_ILLEGAL OPERATION, DDS\_RETCODE\_ALREADY\_DELETED, DDS\_RETCODE OUT\_OF\_RESOURCES, DDS\_RETCODE\_NOT\_ENABLED or DDS\_RETCODE\_ PRECONDITION\_NOT\_MET.

# Detailed Description

This operation allows the application to access the DataReader objects that contain samples with the specified s am p le \_ st at e s, vi e w\_ s ta t es , a n d instance\_states.

If the PresentationQosPolicy of the Subscriber to which the DataReader belongs has the access\_scope set to ‘GROUP’, this operation should only be invoked inside a begin\_access/end\_access block. Otherwise it will return the error DDS\_RETCODE\_PRECONDITION\_NOT\_MET.

Depending on the setting of the PresentationQoSPolicy (see Section 3.1.3.14 on page 92), the returned collection of DataReader objects may be:

• a ‘set’ containing each DataReader at most once in no specified order,
• a ‘list’ containing each DataReader one or more times in a specific order.

This difference is due to the fact that, in the second situation it is required to access samples belonging to different DataReader objects in a particular order. In this case, the application should process each DataReader in the same order it appears in the ‘list’ and read or take exactly one sample from each DataReader. The patterns that an application should use to access data is fully described in Section 3.1.3.14, DDS\_PresentationQosPolicy.

It is allowed to pre-allocate the DataReader sequence prior to invoking this function:

• if the PresentationQosPolicy has access\_scope set to ‘GROUP’ and ordered\_access set to TRUE, the ReaderList will never contain more than the pre-allocated number of elements. Pre-allocating ‘n’ Reader elements this way is convenient in scenario’s where the application only intends to access the first ‘n’ ordered samples. Otherwise the middleware would waste precious CPU cycles composing a list that will only partially be accessed.

• In all other cases, the ReaderList will re-allocated when it is not big enough to accommodate a list describing all DataReaders that have matching samples.

# Return Code

When the operation returns:

• DDS\_RETCODE\_OK - a list of DataReaders matching your description has successfully been composed.
• DDS\_RETCODE\_ERROR - an internal error has occurred.
• DDS\_RETCODE\_ILLEGAL\_OPERATION - the operation is invoked on an inappropriate object.
• DDS\_RETCODE\_ALREADY\_DELETED - the DDS\_Subscriber has already been deleted.
• DDS\_RETCODE\_OUT\_OF\_RESOURCES - the Data Distribution Service ran out of resources to complete this operation.
• DDS\_RETCODE\_NOT\_ENABLED - the DDS\_Subscriber is not enabled.
• DDS\_RETCODE\_PRECONDITION\_NOT\_MET - the operation is not invoked inside a begin\_access/end\_access block as required by its QosPolicy settings.

# 3.5.1.9 DDS\_Subscriber\_get\_default\_datareader\_qos

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
DDS_ReturnCode_t
DDS_Subscriber_get_default_datareader_qos
(DDS_Subscriber_this,
DDS_DataReaderQos *qos);
```

# Description

This operation gets the default QosPolicy settings of the DDS\_DataReader.

# Parameters

in DDS\_Subscriber \_this - the DDS\_Subscriber object on which the operation is operated.

inout DDS\_DataReaderQos \*qos - a pointer to the DDS\_DataReaderQos struct (provided by the application) in which the default QosPolicy settings for the DDS\_DataReader are written.

# Return Value

DDS\_ReturnCode\_t - Possible return codes of the operation are: DDS\_RETCODE\_OK, DDS\_RETCODE\_ERROR, DDS\_RETCODE\_ILLEGAL\_ OPERATION, DDS\_RETCODE\_ALREADY\_DELETED or DDS\_RETCODE\_ OUT\_OF\_RESOURCES.

# Detailed Description

This operation gets the default QosPolicy settings of the DDS\_DataReader (that is the DDS\_DataReaderQos) which is used for newly-created DDS\_DataReader objects, in case the constant DDS\_DATAREADER\_QOS\_DEFAULT is used. The default DDS\_DataReaderQos is only used when the constant is supplied as parameter qos t o s p e c i f y t h e DDS\_DataReaderQos i n t h e DDS\_Subscriber\_create\_datareader operation. The application must provide the DDS\_DataReaderQos struct in which the QosPolicy settings can be stored and pass the qos pointer to the operation. The operation writes the default QosPolicy settings to the struct pointed to by qos. Any settings in the struct are overwritten.

The values retrieved by this operation match the values specified on the last successful call to DDS\_Subscriber\_set\_default\_datareader\_qos, or, if the call was never made, the default values as specified for each QosPolicy setting as defined in Table 5: on page 65.

# Return Code

When the operation returns:

• DDS\_RETCODE\_OK - the default DDS\_DataReader QosPolicy settings of this DDS\_Subscriber have successfully been copied into the specified DDS\_DataReaderQos parameter.
• DDS\_RETCODE\_ERROR - an internal error has occurred.
• DDS\_RETCODE\_ILLEGAL\_OPERATION - the operation is invoked on an inappropriate object.
• DDS\_RETCODE\_ALREADY\_DELETED - the DDS\_Subscriber has already been deleted.
• DDS\_RETCODE\_OUT\_OF\_RESOURCES - the Data Distribution Service ran out of resources to complete this operation.

# 3.5.1.10 DDS\_Subscriber\_get\_listener

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
struct DDS_SubscriberListener
DDS_Subscriber_get_listener
(DDS_Subscriber _this);
```

# Description

This operation allows access to a DDS\_SubscriberListener.

# Parameters

in DDS\_Subscriber \_this - the DDS\_Subscriber object on which the operation is operated.

# Return Value

s t ru c t D D S \_ S ub s c r i b er L i s t e n er - re s u l t i s a p o in t e r t o t h e DDS\_SubscriberListener attached to the DDS\_Subscriber.

# Detailed Description

This operation allows access to a DDS\_SubscriberListener attached to the DDS\_Subscriber. When no DDS\_SubscriberListener was attached to the DDS\_Subscriber, the DDS\_OBJECT\_NIL pointer is returned.

# 3.5.1.11 DDS\_Subscriber\_get\_participant

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
DDS_DomainParticipant
DDS_Subscriber_get_participant
(DDS_Subscriber_this);
```

# Description

This operation returns the DDS\_DomainParticipant associated with the DDS\_Subscriber or the DDS\_OBJECT\_NIL pointer.

# Parameters

in DDS\_Subscriber \_this - the DDS\_Subscriber object on which the operation is operated.

# Return Value

DDS\_DomainParticipant - a pointer to the DDS\_DomainParticipant associated with the DDS\_Subscriber or the DDS\_OBJECT\_NIL pointer.

# Detailed Description

This operation returns the DDS\_DomainParticipant associated with the DDS\_Subscriber. Note that there is exactly one DDS\_DomainParticipant associated with each DDS\_Subscriber. When the DDS\_Subscriber was already deleted (there is no associated DDS\_DomainParticipant any more), the DDS\_OBJECT\_NIL pointer is returned.

# 3.5.1.12 DDS\_Subscriber\_get\_qos

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
DDS_ReturnCode_t
DDS_Subscriber_get_qos
(DDS_Subscriber_this,
DDS_SubscriberQos *qos);
```

# Description

This operation allows access to the existing set of QoS policies for a DDS\_Subscriber.

# Parameters

in DDS\_Subscriber \_this - the DDS\_Subscriber object on which the operation is operated.

inout DDS\_SubscriberQos \*qos - a pointer to the destination DDS\_SubscriberQos struct in which the QosPolicy settings will be copied.

# Return Value

```txt
DDS_ReturnCode_t - Possible return codes of the operation are: DDS_RETCODE_OK, DDS_RETCODE_ERROR, DDS_RETCODE_ILLEGAL_OPERATION, DDS_RETCODE_ALREADY_DELETED or DDS_RETCODE_OUT_OF_RESOURCES.
```

# Detailed Description

This operation allows access to the existing set of QoS policies of a DDS\_Subscriber on which this operation is used. This DDS\_SubscriberQos is stored at the location pointed to by the qos parameter.

# Return Code

When the operation returns:

• DDS\_RETCODE\_OK - the existing set of QoS policy values applied to this DDS\_Subscriber has successfully been copied into the specified DDS\_SubscriberQos parameter.
• DDS\_RETCODE\_ERROR - an internal error has occurred.
• DDS\_RETCODE\_ILLEGAL\_OPERATION - the operation is invoked on an inappropriate object.
• DDS\_RETCODE\_ALREADY\_DELETED - the DDS\_Subscriber has already been deleted.

• DDS\_RETCODE\_OUT\_OF\_RESOURCES - the Data Distribution Service ran out of resources to complete this operation.

# 3.5.1.13 DDS\_Subscriber\_get\_status\_changes (inherited)

This operation is inherited and therefore not described here. See the class DDS\_Entity for further explanation.

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
DDS_StatusMask
DDS_Subscriber_get_status_changes
(DDS_Subscriber _this);
```

# 3.5.1.14 DDS\_Subscriber\_get\_statuscondition (inherited)

This operation is inherited and therefore not described here. See the class DDS\_Entity for further explanation.

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
DDS_StatusCondition
DDS_Subscriber_get_statuscondition
(DDS_Subscriber_this);
```

# 3.5.1.15 DDS\_Subscriber\_lookup\_datareader

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
DDS_DataReader
DDS_Subscriber_lookup_datareader
(DDS_Subscriber _this,
const DDS_char *topic_name);
```

# Description

This operation returns a previously created DDS\_DataReader belonging to the DDS\_Subscriber which is attached to a DDS\_Topic with the matching topic\_name.

# Parameters

in DDS\_Subscriber \_this - the DDS\_Subscriber object on which the operation is operated.

in const DDS\_char \*topic\_name - the name of the DDS\_Topic, which is attached to the DDS\_DataReader to look for.

# Return Value

DDS\_DataReader - Return value is a pointer to the DDS\_DataReader found. When no such DDS\_DataReader is found, the DDS\_OBJECT\_NIL pointer is returned.

# Detailed Description

This operation returns a previously created DDS\_DataReader belonging to the DDS\_Subscriber which is attached to a DDS\_Topic with the matching topic\_name. When multiple DDS\_DataReader objects (which satisfy the same condition) exist, this operation will return one of them. It is not specified which one.

This operation may be used on the built-in DDS\_Subscriber, which returns the built-in DDS\_DataReader objects for the built-in DDS\_Topics.

# 3.5.1.16 DDS\_Subscriber\_notify\_datareaders

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
DDS_ReturnCode_t
DDS_Subscriber_notify_datareaders
(DDS_Subscriber _this);
```

# Description

This operation invokes the DDS\_DataReaderListener\_on\_data\_available operation on DDS\_DataReaderListener objects which are attached to the contained DDS\_DataReader entities having new, available data.

# Parameters

in DDS\_Subscriber \_this - the DDS\_Subscriber object on which the operation is operated.

# Return Value

```txt
DDS_ReturnCode_t - Possible return codes of the operation are:
DDS_RETCODE_OK, DDS_RETCODE_ERROR,
DDS_RETCODE_ILLEGAL_OPERATION, DDS_RETCODE_ALREADY_DELETED
or DDS_RETCODE_OUT_OF_RESOURCES.
```

# Detailed Description

This operation invokes the DDS\_DataReaderListener\_on\_data\_available operation on the DDS\_DataReaderListener objects attached to contained DDS\_DataReader entities that have received information, but which have not yet been processed by those DDS\_DataReaders.

The DDS\_Subscriber\_notify\_datareaders operation ignores the bit mask value of the individual DDS\_DataReaderListener objects, even when the DDS\_DATA\_AVAILABLE\_STATUS bit has not been set on a DDS\_DataReader that w h i c h h a s n e w, a v a i l a b l e d a t a . T h e DDS\_DataReaderListener\_on\_data\_available operation will still be invoked, when the DATA\_AVAILABLE\_STATUS bit has not been set on a DataReader, b u t w i l l n o t p r o p a g a t e t o t h e DDS\_DomainParticipantListener.

When the DDS\_DataReader has attached a NULL listener, the event will be consumed and will not propagate to the DDS\_DomainParticipantListener. (Remember that a NULL listener is regarded as a listener that handles all its events as a NOOP).

# Return Code

When the operation returns:

• DDS\_RETCODE\_OK - all appropriate listeners have been invoked
• DDS\_RETCODE\_ERROR - an internal error has occurred
• DDS\_RETCODE\_ILLEGAL\_OPERATION - the operation is invoked on an inappropriate object
• DDS\_RETCODE\_ALREADY\_DELETED - the DDS\_Subscriber has already been deleted
• DDS\_RETCODE\_OUT\_OF\_RESOURCES - there are insufficient Data Distribution Service resources to complete this operation

# 3.5.1.17 DDS\_Subscriber\_set\_default\_datareader\_qos

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
DDS_ReturnCode_t
DDS_Subscriber_set_default_datareader_qos
(DDS_Subscriber _this,
const DDS_DataReaderQos *qos);
```

# Description

This operation sets the default DDS\_DataReaderQos of the DDS\_DataReader.

# Parameters

in DDS\_Subscriber \_this - the DDS\_Subscriber object on which the operation is operated.

in const DDS\_DataReaderQos \*qos - the DDS\_DataReaderQos struct, which contains the new default QosPolicy settings for the newly-created DDS\_DataReaders.

# Return Value

D D S \_ R e t u r n C o d e \_ t - P o s s i b l e r e t u r n c o d e s o f t h e o p e r a t i o n a r e : DDS\_RETCODE\_OK, DDS\_RETCODE\_ERROR, DDS\_RETCODE\_ILLEGAL\_ OPERATION, DDS\_RETCODE\_BAD\_PARAMETER, DDS\_RETCODE\_ UNSUPPORTED, DDS\_RETCODE\_ALREADY\_DELETED, DDS\_RETCODE\_ OUT\_OF\_RESOURCES or DDS\_RETCODE\_INCONSISTENT\_POLICY.

# Detailed Description

This operation sets the default DDS\_DataReaderQos of the DDS\_DataReader (that is the struct with the QosPolicy settings). This QosPolicy is used for n e w l y - c r e a t e d D D S \_ D a t a R e a d e r o b j e c t s i n c a s e t h e c o n s t a n t DDS\_DATAREADER\_QOS\_DEFAULT is used as parameter qos to specify the DDS\_DataReaderQos in the DDS\_Subscriber\_create\_datareader operation. This operation checks if the DDS\_DataReaderQos is self consistent. If it i s n o t , t h e o p e r a t i o n h a s n o e ff e c t a n d r e t u r n s DDS\_RETCODE\_INCONSISTENT\_POLICY.

T h e v a l u e s s e t b y t h i s o p e r a t i o n a r e r e t u r n e d b y DDS\_Subscriber\_get\_default\_datareader\_qos.

# Return Code

When the operation returns:

• DDS\_RETCODE\_OK - the new default DDS\_DataReaderQos is set.

• DDS\_RETCODE\_ERROR - an internal error has occurred.

• DDS\_RETCODE\_ILLEGAL\_OPERATION - the operation is invoked on an inappropriate object.

• DDS\_RETCODE\_BAD\_PARAMETER - the parameter qos is not a valid DDS\_DataReaderQos. It contains a QosPolicy setting with an invalid DDS\_Duration\_t value, an enum value that is outside its legal boundaries or a sequence that has inconsistent memory settings.

• DDS\_RETCODE\_UNSUPPORTED - one or more of the selected QosPolicy values are currently not supported by OpenSplice.

• DDS\_RETCODE\_ALREADY\_DELETED - the DDS\_Subscriber has already been deleted.

• DDS\_RETCODE\_OUT\_OF\_RESOURCES - the Data Distribution Service ran out of resources to complete this operation.

• DDS\_RETCODE\_INCONSISTENT\_POLICY - the parameter qos contains conflicting QosPolicy settings, e.g. a history depth that is higher than the specified resource limits.

# 3.5.1.18 DDS\_Subscriber\_set\_listener

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
DDS_ReturnCode_t
DDS_Subscriber_set_listener
(DDS_Subscriber _this,
const struct DDS_SubscriberListener *a_listener,
const DDS_StatusMask mask);
```

# Description

This operation attaches a DDS\_SubscriberListener to the DDS\_Subscriber.

# Parameters

in DDS\_Subscriber \_this - the DDS\_Subscriber object on which the operation is operated.
in const struct DDS\_SubscriberListener \*a\_listener - a pointer to the DDS\_SubscriberListener instance, which will be attached to the DDS\_Subscriber.
in const DDS\_StatusMask mask - a bit-mask in which each bit enables the invocation of the DDS\_SubscriberListener for a certain status.

# Return Value

```txt
DDS_ReturnCode_t - Possible return codes of the operation are: DDS_RETCODE_OK, DDS_RETCODE_ERROR, DDS_RETCODE_ILLEGAL_OPERATION, DDS_RETCODE_UNSUPPORTED, DDS_RETCODE_ALREADY_DELETED or DDS_RETCODE_OUT_OF_RESOURCES.
```

# Detailed Description

This operation attaches a DDS\_SubscriberListener to the DDS\_Subscriber. Only one DDS\_SubscriberListener can be attached to each DDS\_Subscriber. If a DDS\_SubscriberListener was already attached, the operation will replace it with the new one. When a\_listener is the DDS\_OBJECT\_NIL pointer, it represents a listener that is treated as a NOOP1 for all statuses activated in the bitmask.

# Communication Status

For each communication status, the StatusChangedFlag flag is initially set to FALSE. It becomes TRUE whenever that communication status changes. For each c o m m u n i c a t i o n s t a t u s a c t i v a t e d i n t h e m a s k , t h e a s s o c i a t e d DDS\_SubscriberListener operation is invoked and the communication status is reset to FALSE, as the listener implicitly accesses the status which is passed as a parameter to that operation. The status is reset prior to calling the listener, so if the application calls the get\_&lt;status\_name&gt;\_status from inside the listener it will see the status already reset. An exception to this rule is the DDS\_OBJECT\_NIL listener, which does not reset the communication statuses for which it is invoked.

The following statuses are applicable to the DDS\_SubscriberListener:

• DDS\_REQUESTED\_DEADLINE\_MISSED\_STATUS (propagated)
• DDS\_REQUESTED\_INCOMPATIBLE\_QOS\_STATUS (propagated)
• DDS\_SAMPLE\_LOST\_STATUS (propagated)
• DDS\_SAMPLE\_REJECTED\_STATUS (propagated)
• DDS\_DATA\_AVAILABLE\_STATUS (propagated)
• DDS\_LIVELINESS\_CHANGED\_STATUS (propagated)
• DDS\_SUBSCRIPTION\_MATCHED\_STATUS (propagated).
• DDS\_DATA\_ON\_READERS\_STATUS.

![The image displays a red triangular warning sign with a black exclamation point centered on a white background.](.vortex-opensplice-c-reference-guide/786669d9e17d3f50c32e27b12de39c03f744ee5ca79fafda47c2473050c23378.jpg)

Be aware that the DDS\_SUBSCRIPTION\_MATCHED\_STATUS is not applicable when the infrastructure does not have the information available to determine connectivity. This is the case when OpenSplice is configured not to maintain discovery information in the Networking Service. (See also the description of the NetworkService/Discovery[@enabled] attribute in section 4.4.1.6.1 on page 244 of the Deployment Guide.) In this case the operation will return DDS\_RETCODE\_UNSUPPORTED.

Status bits are declared as a constant and can be used by the application in an OR operation to create a tailored mask. The special constant DDS\_STATUS\_MASK\_NONE can be used to indicate that the created entity should not respond to any of its available statuses. The DDS will therefore attempt to propagate these statuses to its factory. The special constant STATUS\_MASK\_ANY\_V1\_2 can be used to select all applicable statuses specified in the “Data Distribution Service for Real-time Systems Version 1.2” specification.

# Status Propagation

The Data Distribution Service will trigger the most specific and relevant Listener. In other words, in case a communication status is also activated on the DDS\_DataReaderListener of a contained DDS\_DataReader, the

DDS\_DataReaderListener on that contained DDS\_DataReader is invoked instead of the DDS\_SubscriberListener. This means that a status change on a contained DDS\_DataReader only invokes the DDS\_SubscriberListener if the contained DDS\_DataReader itself does not handle the trigger event generated by the status change.

In case a communication status is not activated in the m as k of th e DDS\_SubscriberListener, the DDS\_DomainParticipantListener of the containing DDS\_DomainParticipant is invoked (if attached and activated for the status that occurred). This allows the application to set a default behaviour in the DDS\_DomainParticipantListener o f t h e c o n t a i n i n g DDS\_DomainParticipant and a DDS\_Subscriber specific behaviour when needed. In case the DDS\_DomainParticipantListener is also not attached or the communication status is not activated in its mask, the application is not notified of the change.

The statuses DDS\_DATA\_ON\_READERS\_STATUS and DDS\_DATA AVAILABLE\_STATUS are “Read Communication Statuses” and are an exception to all other plain communication statuses: they have no corresponding status structure that can be obtained with a get\_&lt;status\_name&gt;\_status operation and they are mutually exclusive. When new information becomes available to a DataReader, the Data Distribution Service will first look in an attached and activated DDS\_SubscriberListener or DDS\_DomainParticipantListener (in that o r d e r ) f o r t h e D DS \_ D A T A \_ ON \_ R E A D ER S \_ S T A T US . I n c a s e t h e DDS\_DATA\_ON\_READERS\_STATUS can not be handled, the Data Distribution Service will look in an attached and activated DDS\_DataReaderListener, DDS\_SubscriberListener or DDS\_DomainParticipantListener for the DDS\_DATA\_AVAILABLE\_STATUS (in that order).

# Return Code

When the operation returns:

• DDS\_RETCODE\_OK - the DDS\_SubscriberListener is attached.
• DDS\_RETCODE\_ERROR - an internal error has occurred.
• DDS\_RETCODE\_ILLEGAL\_OPERATION - the operation is invoked on an inappropriate object.
• DDS\_RETCODE\_UNSUPPORTED - a status was selected that cannot be supported because the infrastructure does not maintain the required connectivity information.
• DDS\_RETCODE\_ALREADY\_DELETED - the DDS\_Subscriber has already been deleted.

• DDS\_RETCODE\_OUT\_OF\_RESOURCES - the Data Distribution Service ran out of resources to complete this operation.

# 3.5.1.19 DDS\_Subscriber\_set\_qos

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
DDS_ReturnCode_t
DDS_Subscriber_set_qos
(DDS_Subscriber_this,
const DDS_SubscriberQos *qos);
```

# Description

This operation replaces the existing set of QosPolicy settings for a DDS\_Subscriber.

# Parameters

in DDS\_Subscriber \_this - the DDS\_Subscriber object on which the operation is operated.

in const DDS\_SubscriberQos \*qos - contain the new set of QosPolicy settings for the DDS\_Subscriber.

# Return Value

```txt
DDS_ReturnCode_t - Possible return codes of the operation are: DDS_RETCODE_OK, DDS_RETCODE_ERROR, DDS_RETCODE_ILLEGAL_OPERATION, DDS_RETCODE_BAD_PARAMETER, DDS_RETCODE_UNSUPPORTED, DDS_RETCODE_ALREADY_DELETED, DDS_RETCODE_OUT_OF_RESOURCES, DDS_RETCODE_IMMUTABLE_POLICY or DDS_RETCODE_PRECONDITION_NOT_MET.
```

# Detailed Description

This operation replaces the existing set of QosPolicy settings for a DDS\_Subscriber. The parameter qos must contain the QosPolicy settings which is checked for self-consistency and mutability. When the application tries to change a QosPolicy setting for an enabled DDS\_Subscriber, which can only be set before the DDS\_Subscriber is enabled, the operation will fail and a DDS\_RETCODE\_IMMUTABLE\_POLICY is returned. In other words, the application must provide the presently set QosPolicy settings in case of the immutable QosPolicy settings. Only the mutable QosPolicy settings can be changed. When qos contains conflicting QosPolicy settings (not self-consistent), the operation will fail and a RETCODE\_INCONSISTENT\_POLICY is returned.

The set of QosPolicy settings specified by the qos parameter are applied on top of the existing QoS, replacing the values of any policies previously set (provided, the operation returned DDS\_RETCODE\_OK). If one or more of the partitions in the QoS structure have insufficient access rights configured then the set\_qos function will fail with a DDS\_RETCODE\_PRECONDITION\_NOT\_MET error code.

# Return Code

When the operation returns:

• DDS\_RETCODE\_OK - the new DDS\_SubscriberQos is set.
• DDS\_RETCODE\_ERROR - an internal error has occurred.
• DDS\_RETCODE\_ILLEGAL\_OPERATION - the operation is invoked on an inappropriate object.
• DDS\_RETCODE\_BAD\_PARAMETER - the parameter qos is not a valid DDS\_SubscriberQos. It contains a QosPolicy setting with an enum value that is outside its legal boundaries or a sequence that has inconsistent memory settings.
• DDS\_RETCODE\_UNSUPPORTED - one or more of the selected QosPolicy values are currently not supported by OpenSplice.
• DDS\_RETCODE\_ALREADY\_DELETED - the DDS\_Subscriber has already been deleted.
• DDS\_RETCODE\_OUT\_OF\_RESOURCES - the Data Distribution Service ran out of resources to complete this operation.
• DDS\_RETCODE\_IMMUTABLE\_POLICY - the parameter qos contains an immutable QosPolicy setting with a different value than set during enabling of the DDS\_Subscriber.
• DDS\_RETCODE\_PRECONDITION\_NOT\_MET - returned when insufficient access rights exist for the partition(s) listed in the QoS structure.

# 3.5.2 Subscription Type Specific Classes

“Subscription type specific classes” contains the generic class and the generated data type specific classes. For each data type, a data type specific class &lt;NameSpace&gt;\_&lt;type&gt;DataReader is generated (based on IDL) by calling the pre-processor. In case of data type Foo (this also applies to other types), defined in the module SPACE; “Subscription type specific classes” contains the following classes:

This paragraph describes the generic DDS\_DataReader class and the derived application type specific &lt;NameSpace&gt;\_&lt;type&gt;DataReader classes which together implement the application subscription interface. For each application type, u s e d a s D D S \_ T o p i c d a t a t y p e , t h e p r e - p r o c e s s o r g e n e r a t e s a &lt;NameSpace&gt;\_&lt;type&gt;DataReader class from an IDL type description. The SPACE\_FooDataReader class that would be generated by the pre-processor for a f i c t i o n a l t y p e F o o ( d e f i n e d i n t h e m o d u l e S P A C E ) d e s c r i b e s t h e &lt;NameSpace&gt;\_&lt;type&gt;DataReader classes.

# 3.5.2.1 Class DDS\_DataReader (abstract)

A DDS\_DataReader allows the application:

• to declare data it wishes to receive (i.e., make a subscription)
• to access data received by the associated DDS\_Subscriber.

A DDS\_DataReader refers to exactly one DDS\_TopicDescription (either a DDS\_Topic, a DDS\_ContentFilteredTopic or a DDS\_MultiTopic) that identifies the samples to be read. The DDS\_DataReader may give access to several instances of the data type, which are distinguished from each other by their key.

DDS\_DataReader is an abstract class. It is specialized for each particular application data type. For a fictional application data type “Foo” the specialized class would be SPACE\_FooDataReader.

The interface description of this class is as follows:

```c
/*
 * interface DDS_DataReader
 */
/*
 * inherited from class DDS_Entity
 */
/* DDS_StatusCondition
 *    DDS_DataReader_get_statuscondition
 *    (DDS_DataReader _this);
 */
/* DDS_StatusMask
 *    DDS_DataReader_get_status_changes
 *    (DDS_DataReader _this);
 */
/* DDS_ReturnCode_t
 *    DDS_DataReader_enable
 *    (DDS_DataReader _this);
 */
/*
 * abstract operations
 * (implemented in the data type specific DDS_DataReader)
 */
/* DDS_ReturnCode_t
 *    DDS_DataReader_read
 *    (DDS_DataReader _this,
 *    DDS_sequence_&lt;data&gt; *data_values,
 *    DDS_SampleInfoSeq *info_seq,
```

```c
* const DDS_long max_samples,
* const DDS_SampleStateMask sample_states,
* const DDS_ViewStateMask view_states,
* const DDS_InstanceStateMask instance_states);
*/
/* DDS_ReturnCode_t
* DDS_DataReader_take
* (DDS_DataReader _this,
* DDS_sequence_&lt;data&gt; *data_values,
* DDS_SampleInfoSeq *info_seq,
* const DDS_long max_samples,
* const DDS_SampleStateMask sample_states,
* const DDS_ViewStateMask view_states,
* const DDS_InstanceStateMask instance_states);
*/
/* DDS_ReturnCode_t
* DDS_DataReader_read_w_condition
* (DDS_DataReader _this,
* DDS_sequence_&lt;data&gt; *data_values,
* DDS_SampleInfoSeq *info_seq,
* const DDS_long max_samples,
* const DDS_ReadCondition a_condition);
*/
/* DDS_ReturnCode_t
* DDS_DataReader_take_w_condition
* (DDS_DataReader _this,
* DDS_sequence_&lt;data&gt; *data_values,
* DDS_SampleInfoSeq *info_seq,
* const DDS_long max_samples,
* const DDS_ReadCondition a_condition);
*/
/* DDS_ReturnCode_t
* DDS_DataReader_read_next_sample
* (DDS_DataReader _this,
* &lt;data&gt; *data_values,
* DDS_SampleInfo *sample_info);
*/
/* DDS_ReturnCode_t
* DDS_DataReader_take_next_sample
* (DDS_DataReader _this,
* &lt;data&gt; *data_values,
* DDS_SampleInfo *sample_info);
*/
/* DDS_ReturnCode_t
* DDS_DataReader_read_instance
* (DDS_DataReader _this,
* DDS_sequence_&lt;data&gt; *data_values,
* DDS_SampleInfoSeq *info_seq,
* const DDS_long max_samples,
* const DDS_InstanceHandle_t a_handle,
```

```c
* const DDS_SampleStateMask sample_states,
* const DDS_ViewStateMask view_states,
* const DDS_InstanceStateMask instance_states);
*/
/* DDS_ReturnCode_t
* DDS_DataReader_take_instance
* (DDS_DataReader _this,
* DDS_sequence_&lt;data&gt; *data_values,
* DDS_SampleInfoSeq *info_seq,
* const DDS_long max_samples,
* const DDS_InstanceHandle_t a_handle,
* const DDS_SampleStateMask sample_states,
* const DDS_ViewStateMask view_states,
* const DDS_InstanceStateMask instance_states);
*/
/* DDS_ReturnCode_t
* DDS_DataReader_read_next_instance
* (DDS_DataReader _this,
* DDS_sequence_&lt;data&gt; *data_values,
* DDS_SampleInfoSeq *info_seq,
* const DDS_long max_samples,
* const DDS_InstanceHandle_t a_handle,
* const DDS_SampleStateMask sample_states,
* const DDS_ViewStateMask view_states,
* const DDS_InstanceStateMask instance_states);
*/
/* DDS_ReturnCode_t
* DDS_DataReader_take_next_instance
* (DDS_DataReader _this,
* DDS_sequence_&lt;data&gt; *data_values,
* DDS_SampleInfoSeq *info_seq,
* const DDS_long max_samples,
* const DDS_InstanceHandle_t a_handle,
* const DDS_SampleStateMask sample_states,
* const DDS_ViewStateMask view_states,
* const DDS_InstanceStateMask instance_states);
*/
/* DDS_ReturnCode_t
* DDS_DataReader_read_next_instance_w_condition
* (DDS_DataReader _this,
* DDS_sequence_&lt;data&gt; *data_values,
* DDS_SampleInfoSeq *info_seq,
* const DDS_long max_samples,
* const DDS_InstanceHandle_t a_handle,
* const DDS_ReadCondition a_condition);
*/
/* DDS_ReturnCode_t
* DDS_DataReader_take_next_instance_w_condition
* (DDS_DataReader _this,
* DDS_sequence_&lt;data&gt; *data_values,
```

```c
* DDS_SampleInfoSeq *info_seq,
* const DDS_long max_samples,
* const DDS_InstanceHandle_t a_handle,
* const DDS_ReadCondition a_condition);
*/
/* DDS_ReturnCode_t
* DDS_DataReader_return_loan
* (DDS_DataReader _this,
* DDS_sequence_&lt;data&gt; *data_values,
* DDS_SampleInfoSeq *info_seq);
*/
/* DDS_ReturnCode_t
* DDS_DataReader_get_key_value
* (DDS_DataReader _this,
* &lt;data&gt; *key_holder,
* const DDS_InstanceHandle_t handle);
*/
/* DDS_InstanceHandle_t
* DDS_DataReader_lookup_instance
*/ (DDS_DataReader _this,
* &lt;data&gt; *instance_data);
/*
* implemented API operations
*/
DDS_ReadCondition
DDS_DataReader_create_readcondition
(DDS_DataReader _this,
const DDS_SampleStateMask sample_states,
const DDS_ViewStateMask view_states,
const DDS_InstanceStateMask instance_states);

DDS_QueryCondition
DDS_DataReader_create_querycondition
(DDS_DataReader _this,
const DDS_SampleStateMask sample_states,
const DDS_ViewStateMask view_states,
const DDS_InstanceStateMask instance_states,
const DDS_char *query_expression,
const DDS_StringSeq *query_parameters);

DDS_ReturnCode_t
DDS_DataReader_delete_readcondition
(DDS_DataReader _this,
const DDS_ReadCondition a_condition);

DDS_ReturnCode_t
DDS_DataReader_delete_contained_entities
(DDS_DataReader _this);

DDS_ReturnCode_t
```

```c
DDS_DataReader_set_qos
(DDS_DataReader _this,
const DDS_DataReaderQos *qos);

DDS_ReturnCode_t
DDS_DataReader_get_qos
(DDS_DataReader _this,
DDS_DataReaderQos *qos);

DDS_ReturnCode_t
DDS_DataReader_set_listener
(DDS_DataReader _this,
const struct DDS_DataReaderListener *a_listener,
const DDS_StatusMask mask);

struct DDS_DataReaderListener
DDS_DataReader_get_listener
(DDS_DataReader _this);

DDS_TopicDescription
DDS_DataReader_get_topicdescription
(DDS_DataReader _this);

DDS_Subscriber
DDS_DataReader_get_subscriber
(DDS_DataReader _this);

DDS_ReturnCode_t
DDS_DataReader_get_sample_rejected_status
(DDS_DataReader _this,
DDS_SampleRejectedStatus *status);

DDS_ReturnCode_t
DDS_DataReader_get_liveliness_changed_status
(DDS_DataReader _this,
DDS_LivelinessChangedStatus *status);

DDS_ReturnCode_t
DDS_DataReader_get_requested_deadline_missed_status
(DDS_DataReader _this,
DDS_RequestedDeadlineMissedStatus *status);

DDS_ReturnCode_t
DDS_DataReader_get_requested_incompatible_qos_status
(DDS_DataReader _this,
DDS_RequestedIncompatibleQosStatus *status);

DDS_ReturnCode_t
DDS_DataReader_get_subscription_matched_status
(DDS_DataReader _this,
```

```c
DDS_SubscriptionMatchedStatus *status);

DDS_ReturnCode_t
DDS_DataReader_get_sample_lost_status
(DDS_DataReader _this,
DDS_SampleLostStatus *status);

DDS_ReturnCode_t
DDS_DataReader_wait_for_historical_data
(DDS_DataReader _this,
const DDS_Duration_t *max_wait);

DDS_ReturnCode_t
DDS_DataReader_get_matched_publications
(DDS_DataReader _this,
DDS_InstanceHandleSeq *publication_handles);

DDS_ReturnCode_t
DDS_DataReader_get_matched_publication_data
(DDS_DataReader _this,
DDS_PublicationBuiltinTopicData *publication_data,
const DDS_InstanceHandle_t publication_handle);

DDS_DataReaderView
DDS_DataReader_create_view
(DDS_DataReader _this
const DDS_DataReaderViewQos* qos);

DDS_ReturnCode_t
DDS_DataReader_delete_view
(DDS_DataReader _this,
const DDS_DataReaderView a_view);

DDS_ReturnCode_t
DDS_DataReader_get_default_datareaderview_qos
(DDS_DataReader _this,
DDS_DataReaderViewQos* qos);

DDS_ReturnCode_t
DDS_DataReader_set_default_datareaderview_qos
(DDS_DataReader _this,
DDS_DataReaderViewQos* qos);
```

The following paragraphs describe the usage of all DDS\_DataReader operations. The inherited operations are listed but not fully described because they are not implemented in this class. The full description of these operations is given in the classes from which they are inherited. The abstract operations are listed but not fully described because they are not implemented in this specific class. The full description of these operations is located in the subclasses that contain the data type specific implementation of these operations.

# 3.5.2.2 DDS\_DataReader\_create\_querycondition

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
DDS_QueryCondition
DDS_DataReader_create_querycondition
(DDS_DataReader _this,
const DDS_SampleStateMask sample_states,
const DDS_ViewStateMask view_states,
const DDS_InstanceStateMask instance_states,
const DDS_char *query_expression,
const DDS_StringSeq *query_parameters);
```

# Description

This operation creates a new DDS\_QueryCondition for the DDS\_DataReader.

# Parameters

in DDS\_DataReader \_this - the DDS\_DataReader object on which the operation is operated.
in const DDS\_SampleStateMask sample\_states - a mask, which selects only those samples with the desired sample states.
in const DDS\_ViewStateMask view\_states - a mask, which selects only those samples with the desired view states.
in const DDS\_InstanceStateMask instance\_states - a mask, which selects only those samples with the desired instance states.
in const DDS\_char \*query\_expression - the query string, which must be a subset of the SQL query language as specified in Appendix H, DCPS Queries and Filters.
in const DDS\_StringSeq \*query\_parameters - a sequence of strings which are the parameters used in the SQL query string (i.e., the “%n” tokens in the expression). The number of values in query\_parameters must be equal or greater than the highest referenced %n token in the query\_expression (e.g. if %1 and %8 are used as parameter in the query\_expression, the query\_parameters should at least contain n+1 = 9 values).

# Return Value

DDS\_QueryCondition - Result value is a pointer to the DDS\_QueryCondition.

When the operation fails, the DDS\_OBJECT\_NIL pointer is returned.

# Detailed Description

This operation creates a new DDS\_QueryCondition for the DDS\_DataReader. The returned DDS\_QueryCondition is attached (and belongs) to the DDS\_DataReader. When the operation fails, the DDS\_OBJECT\_NIL pointer is r e t u r n e d . To d e l e t e t h e DD S \_ Q u e r yC o n d i t io n t h e o p e r a t i o n DDS\_DataReader\_delete\_readcondition or DDS\_DataReader\_delete\_ contained\_entities must be used.

# State Masks

The result of the DDS\_QueryCondition also depends on the selection of samples determined by three masks:

• sample\_states is the mask, which selects only those samples with the desired sample states DDS\_READ\_SAMPLE\_STATE, DDS\_NOT\_READ\_SAMPLE\_STATE or both
• view\_states is the mask, which selects only those samples with the desired view states DDS\_NEW\_VIEW\_STATE, DDS\_NOT\_NEW\_VIEW\_STATE or both
• instance\_states is the mask, which selects only those samples with the desired instance states DDS\_ALIVE\_INSTANCE\_STATE, DDS\_NOT\_ALIVE\_ DISPOSED\_INSTANCE\_STATE, DDS\_NOT\_ALIVE\_NO\_WRITERS\_INSTANCE\_ STATE or a combination of these.

# SQL expression

The SQL query string is set by query\_expression which must be a subset of the SQL query language. In this query expression, parameters may be used, which must be set in the sequence of strings defined by the parameter query\_parameters. A parameter is a string which can define an integer, float, string or enumeration. The number of values in query\_parameters must be equal or greater than the highest referenced %n token in the query\_expression (e.g. if %1 and %8 are used as parameter in the query\_expression, the query\_parameters should at least contain n+1 = 9 values).

# 3.5.2.3 DDS\_DataReader\_create\_readcondition

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
DDS_ReadCondition
DDS_DataReader_create_readcondition
(DDS_DataReader _this,
const DDS_SampleStateMask sample_states,
const DDS_ViewStateMask view_states,
const DDS_InstanceStateMask instance_states);
```

# Description

This operation creates a new DDS\_ReadCondition for the DDS\_DataReader.

# Parameters

in DDS\_DataReader \_this - the DDS\_DataReader object on which the operation is operated.
in const DDS\_SampleStateMask sample\_states - a mask, which selects only those samples with the desired sample states.
in const DDS\_ViewStateMask view\_states - a mask, which selects only those samples with the desired view states.
in const DDS\_InstanceStateMask instance\_states - a mask, which selects only those samples with the desired instance states.

# Return Value

DDS\_ReadCondition - Result value is a pointer to the DDS\_ReadCondition. When the operation fails, the DDS\_OBJECT\_NIL pointer is returned.

# Detailed Description

This operation creates a new DDS\_ReadCondition for the DDS\_DataReader. The returned DDS\_ReadCondition is attached (and belongs) to the DDS\_DataReader. When the operation fails, the DDS\_OBJECT\_NIL pointer is returned. To delete the DDS\_ReadCondition the operation DDS\_DataReader\_delete readcondition or DDS\_DataReader\_delete\_contained\_entities must be used.

# State Masks

The result of the DDS\_ReadCondition depends on the selection of samples determined by three masks:

• sample\_states is the mask, which selects only those samples with the desired sample states DDS\_READ\_SAMPLE\_STATE, DDS\_NOT\_READ\_SAMPLE\_STATE or both
• view\_states is the mask, which selects only those samples with the desired view states DDS\_NEW\_VIEW\_STATE, DDS\_NOT\_NEW\_VIEW\_STATE or both
• instance\_states is the mask, which selects only those samples with the desired instance states DDS\_ALIVE\_INSTANCE\_STATE, DDS\_NOT\_ALIVE\_ DISPOSED\_INSTANCE\_STATE, DDS\_NOT\_ALIVE\_NO\_WRITERS\_INSTANCE\_ STATE or a combination of these.

# 3.5.2.4 DDS\_DataReader\_create\_view

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
DDS_DataReaderView
DDS_DataReader_create_view
(DDS_DataReader _this,
const DDS_DataReaderViewQos* qos);
```

# Description

This operation creates a DataReaderView with the desired QosPolicy settings.

# Parameters

```txt
in DDS_DataReader _this - the DDS_DataReader object on which the operation is operated.
in const DDS_DataReaderViewQos* qos - the QosPolicy settings for the DataReaderView.
```

# Return Value

DDS\_DataReaderView - Pointer to the newly-created DataReaderView. In case of error, the NULL pointer is returned.

# Detailed Description

This operation creates a DataReaderView with the desired QosPolicy settings. In case the QosPolicy is invalid, a NULL pointer is returned. The convenience macro DDS\_DATAREADERVIEW\_QOS\_DEFAULT can be used as parameter qos, to create a DataReaderView with the default DataReaderViewQos as set in the DataReader.

# Application Data Type

The DataReaderView returned by this operation is an object of a derived class, specific to the data type associated with the Topic. For each application-defined data type &lt;type&gt; there is a class &lt;type&gt;DataReaderView generated by calling the pre-processor. This data type specific class extends DataReaderView and contains the operations to read and take data of data type &lt;type&gt;.

The typed operations of a DataReaderView exactly mimic those of the DataReader from which it is created.

# 3.5.2.5 DDS\_DataReader\_delete\_contained\_entities

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
DDS_ReturnCode_t
```

DDS\_DataReader\_delete\_contained\_entities (DDS\_DataReader \_this);

# Description

This operation deletes all the DDS\_Entity objects that were created by means of one of the “create\_” operations on the DDS\_DataReader.

# Parameters

in DDS\_DataReader \_this - the DDS\_DataReader object on which the operation is operated.

# Return Value

D D S \_ R e t u r n C o d e \_ t - P o s s i b l e r e t u r n c o d e s o f t h e o p e r a t i o n a r e : DDS\_RETCODE\_OK, DDS\_RETCODE\_ERROR, DDS\_RETCODE\_ILLEGAL\_ OPERATION, DDS\_RETCODE\_ALREADY\_DELETED, DDS\_RETCODE\_ OUT\_OF\_RESOURCES or DDS\_RETCODE\_PRECONDITION\_NOT\_MET.

# Detailed Description

This operation deletes all the DDS\_Entity objects that were created by means of one of the “create\_” operations on the DDS\_DataReader. In other words, it deletes all DDS\_QueryCondition and DDS\_ReadCondition objects contained by the DDS\_DataReader.

![The image displays a standard warning symbol consisting of a red triangle with a thick border. Inside the triangle, on a white background, is a black exclamation mark.](.vortex-opensplice-c-reference-guide/290c4330a0da607cd42e9b7d20759e2b195a524e00266ec179b5aa685f485375.jpg)

NOTE: The operation will return DDS\_PRECONDITION\_NOT\_MET if the any of the contained entities is in a state where it cannot be deleted. In such cases, the operation does not roll back any entity deletions performed prior to the detection of the problem.

# Return Code

When the operation returns:

• DDS\_RETCODE\_OK - the contained DDS\_Entity objects are deleted and the application may delete the DDS\_DataReader.
• DDS\_RETCODE\_ERROR - an internal error has occurred.
• DDS\_RETCODE\_ILLEGAL\_OPERATION - the operation is invoked on an inappropriate object.
• DDS\_RETCODE\_ALREADY\_DELETED - the DDS\_DataReader has already been deleted.
• DDS\_RETCODE\_OUT\_OF\_RESOURCES - the Data Distribution Service ran out of resources to complete this operation.

• DDS\_RETCODE\_PRECONDITION\_NOT\_MET - one or more of the contained entities are in a state where they cannot be deleted.

# 3.5.2.6 DDS\_DataReader\_delete\_readcondition

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
DDS_ReturnCode_t
DDS_DataReader_delete_readcondition
(DDS_DataReader _this,
const DDS_ReadCondition a_condition);
```

# Description

This operation deletes a DDS\_ReadCondition or DDS\_QueryCondition which is attached to the DDS\_DataReader.

# Parameters

in DDS\_DataReader \_this - the DDS\_DataReader object on which the operation is operated.

in const DDS\_ReadCondition a\_condition - a pointer to the DDS\_ReadCondition or DDS\_QueryCondition which is to be deleted.

# Return Value

```txt
DDS_ReturnCode_t - Possible return codes of the operation are: DDS_RETCODE_OK, DDS_RETCODE_ERROR, DDS_RETCODE_ILLEGAL_OPERATION, DDS_RETCODE_BAD_PARAMETER, DDS_RETCODE_ALREADY_DELETED, DDS_RETCODE_OUT_OF_RESOURCES or DDS_RETCODE_PRECONDITION_NOT_MET.
```

# Detailed Description

This operation deletes a DDS\_ReadCondition or DDS\_QueryCondition which is attached to the DDS\_DataReader. Since a DDS\_QueryCondition is a specialized DDS\_ReadCondition, the operation can also be used to delete a DDS\_QueryCondition. A DDS\_ReadCondition or DDS\_QueryCondition cannot be deleted when it is not attached to this DDS\_DataReader. When the operation is called on a DDS\_ReadCondition or DDS\_QueryCondition which w a s n o t a t t a c h e d t o t h i s D D S \_ D a t a R e a d e r, t h e o p e r a t i o n r e t u r n s DDS\_RETCODE\_PRECONDITION\_NOT\_MET.

# Return Code

When the operation returns:

• DDS\_RETCODE\_OK - the DDS\_ReadCondition or DDS\_QueryCondition is deleted.
• DDS\_RETCODE\_ERROR - an internal error has occurred.
• DDS\_RETCODE\_ILLEGAL\_OPERATION - the operation is invoked on an inappropriate object.
• DDS\_RETCODE\_BAD\_PARAMETER - the parameter a\_condition is not a valid DDS\_ReadCondition.
• DDS\_RETCODE\_ALREADY\_DELETED - the DDS\_DataReader has already been deleted.
• DDS\_RETCODE\_OUT\_OF\_RESOURCES - the Data Distribution Service ran out of resources to complete this operation.
• DDS\_RETCODE\_PRECONDITION\_NOT\_MET - the operation is called on a different DDS\_DataReader, as used when the DDS\_ReadCondition or DDS\_QueryCondition was created.

# 3.5.2.7 DDS\_DataReader\_delete\_view

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
DDS_ReturnCode_t
DDS_DataReader_delete_view
(DDS_DataReader_this,
DDS_DataReaderView a_view);
```

# Description

This operation deletes a DataReaderView that belongs to the DataReader.

# Parameters

in DDS\_DataReader \_this - the DDS\_DataReader object on which the operation is operated.

in DDS\_DataReaderView a\_view - a pointer to the DataReaderView which is to be deleted.

# Return Value

DDS\_ReturnCode\_t - Possible return codes of the operation are: DDS\_RETCODE\_OK, DDS\_RETCODE\_ERROR, DDS\_RETCODE\_BAD\_PARAMETER, DDS\_RETCODE\_ALREADY\_DELETED, DDS\_RETCODE\_OUT\_OF\_RESOURCES, DDS\_RETCODE\_PRECONDITION\_NOT\_MET.

# Detailed Description

This operation deletes the DataReaderView from the DataReader.

# Return Code

When the operation returns:

• DDS\_RETCODE\_OK - the DataReaderView is deleted.
• DDS\_RETCODE\_ERROR - an internal error occurred.
• DDS\_RETCODE\_BAD\_PARAMETER - the DataReaderView parameter is invalid.
• DDS\_RETCODE\_ALREADY\_DELETED - the DataReader has already been deleted.
• DDS\_RETCODE\_OUT\_OF\_RESOURCES - the data distribution service ran out of resources to complete this operation.
• DDS\_RETCODE\_PRECONDITION\_NOT\_MET - the DataReaderView is not associated with this DataReader, or the DataReaderView still contains one or more ReadCondition or QueryCondition objects or an unreturned loan.

# 3.5.2.8 DDS\_DataReader\_enable (inherited)

This operation is inherited and therefore not described here. See the class DDS\_Entity for further explanation.

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
DDS_ReturnCode_t
DDS_DataReader_enable
(DDS_DataReader _this);
```

# 3.5.2.9 DDS\_DataReader\_get\_default\_datareaderview\_qos

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
DDS_ReturnCode_t
DDS_DataReader_get_default_datareaderview_qos
(DDS_DataReader _this,
DDS_DataReaderViewQos* qos);
```

# Description

This operation gets the default QosPolicy settings of the DataReaderView.

# Parameters

in DDS\_DataReader \_this - the DDS\_DataReader object on which the operation is operated.

inout DataReaderViewQos\* qos - a r e f e r e n c e t o t h e DDS\_DataReaderViewQos struct in which the default QosPolicy settings will be stored.

# Return Value

DDS\_ReturnCode\_t - Possible return codes of the operation are:

DDS\_RETCODE\_OK, DDS\_RETCODE\_ERROR,

DDS\_RETCODE\_ALREADY\_DELETED, DDS\_RETCODE\_OUT\_OF\_RESOURCES.

# Detailed Description

This operation gets the default QosPolicy settings of the DDS\_DataReaderView, which are used for newly-created DDS\_DataReaderView objects in case the constant DDS\_DATAREADERVIEW\_QOS\_DEFAULT is used.

The values retrieved by this call match the values specified on the last successful call to DDS\_DataReader\_set\_default\_datareaderview\_qos, or, if this call was never made, the default values as specified in Table 5: on page 65.

# Return Code

When the operation returns:

• DDS\_RETCODE\_OK - the default DDS\_DataReaderViewQosPolicy settings of this DDS\_DataReader have successfully been copied into the provided DDS\_DataReaderViewQos parameter.
• DDS\_RETCODE\_ERROR - an internal error has occurred.
• DDS\_RETCODE\_ALREADY\_DELETED - the DDS\_DataReader has already been deleted.
• DDS\_RETCODE\_OUT\_OF\_RESOURCES - the data distribution service ran out of resources to complete this operation.

# 3.5.2.10 DDS\_DataReader\_get\_key\_value (abstract)

This abstract operation is defined as a generic operation, which is implemented by the &lt;NameSpace&gt;\_&lt;type&gt;DataReader class. Therefore, to use this operation, the data type specific implementation of this operation in its respective derived class must be used. For further explanation see the description for the fictional data type Foo (defined in the module SPACE) derived SPACE\_FooDataReader class.

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
DDS_ReturnCode_t
DDS_DataReader_get_key_value
(DDS_DataReader_this,
&lt;data&gt; *key_holder,
```

const DDS\_InstanceHandle\_t handle);

# 3.5.2.11 DDS\_DataReader\_get\_listener

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
struct DDS_DataReaderListener
DDS_DataReader_get_listener
(DDS_DataReader _this);
```

# Description

This operation allows access to a DDS\_DataReaderListener.

# Parameters

in DDS\_DataReader \_this - the DDS\_DataReader object on which the operation is operated.

# Return Value

s t ru c t D D S \_ D at a R e a d er L i s t e n er - re s u l t i s a p o in t e r t o t h e DDS\_DataReaderListener attached to the DDS\_DataReader.

# Detailed Description

This operation allows access to a DDS\_DataReaderListener attached to the DDS\_DataReader. When no DDS\_DataReaderListener was attached to the DDS\_DataReader, the DDS\_OBJECT\_NIL pointer is returned.

# 3.5.2.12 DDS\_DataReader\_get\_liveliness\_changed\_status

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
DDS_ReturnCode_t
DDS_DataReader_get_liveliness_changed_status
(DDS_DataReader_this,
DDS_LivelinessChangedStatus *status);
```

# Description

This operation obtains the DDS\_LivelinessChangedStatus struct of the DDS\_DataReader.

# Parameters

in DDS\_DataReader \_this - the DDS\_DataReader object on which the operation is operated.

inout DDS\_LivelinessChangedStatus \*status - the contents of the DDS\_LivelinessChangedStatus struct of the DDS\_DataReader will be copied into the location specified by status.

# Return Value

DDS\_ReturnCode\_t - Possible return codes of the operation are: DDS\_RETCODE\_OK, DDS\_RETCODE\_ERROR, DDS\_RETCODE\_ILLEGAL OPERATION, DDS\_RETCODE\_ALREADY\_DELETED or DDS\_RETCODE\_ OUT\_OF\_RESOURCES.

# Detailed Description

This operation obtains the DDS\_LivelinessChangedStatus struct of the DDS\_DataReader. This struct contains the information whether the liveliness of one or more DDS\_DataWriter objects that were writing instances read by the DDS\_DataReader has changed. In other words, some DDS\_DataWriter have become “alive” or “not alive”.

The DDS\_LivelinessChangedStatus can also be monitored using a DDS\_DataReaderListener or by using the associated DDS\_StatusCondition.

# Return Code

When the operation returns:

• DDS\_RETCODE\_OK - the current DDS\_LivelinessChangedStatus of this DDS\_DataReader has successfully been copied into the specified status parameter.
• DDS\_RETCODE\_ERROR - an internal error has occurred.
• DDS\_RETCODE\_ILLEGAL\_OPERATION - the operation is invoked on an inappropriate object.
• DDS\_RETCODE\_ALREADY\_DELETED - the DDS\_DataReader has already been deleted.
• DDS\_RETCODE\_OUT\_OF\_RESOURCES - the Data Distribution Service ran out of resources to complete this operation.

# 3.5.2.13 DDS\_DataReader\_get\_matched\_publication\_data

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
DDS_ReturnCode_t
DDS_DataReader_get_matched_publication_data
(DDS_DataReader _this,
DDS_PublicationBuiltinTopicData *publication_data,
const DDS_InstanceHandle_t publication_handle);
```

# Description

This operation retrieves information on the specified publication that is currently “associated” with the DDS\_DataReader.

# Parameters

in DDS\_DataReader \_this - the DDS\_DataReader object on which the operation is operated.

inout DDS\_PublicationBuiltinTopicData \*publication\_data - a pointer to the sample in which the information about the specified publication is to be stored.

in const DDS\_InstanceHandle\_t publication\_handle - a handle to the publication whose information needs to be retrieved.

# Return Value

DDS\_ReturnCode\_t - Possible return codes of the operation are: DDS\_RETCODE\_OK, DDS\_RETCODE\_ERROR, DDS\_RETCODE\_ILLEGAL OPERATION, DDS\_RETCODE\_UNSUPPORTED, DDS\_RETCODE\_ALREADY\_DELETED, DDS\_RETCODE\_OUT\_OF\_RESOURCES or DDS\_RETCODE\_NOT\_ENABLED.

# Detailed Description

This operation retrieves information on the specified publication that is currently “associated” with the DDS\_DataReader. That is, a publication with a matching Topic and compatible QoS that the application has not indicated should be “ignored” by means of the DDS\_DomainParticipant\_ignore\_publication operation.

The publication\_handle must correspond to a publication currently associated with the DDS\_DataReader, otherwise the operation will fail and return DDS\_RETCODE\_BAD\_PARAMETER. The operation DDS\_DataReader\_ get\_matched\_publications can be used to find the publications that are currently matched with the DDS\_DataReader.

The operation may also fail if the infrastructure does not hold the information necessary to fill in the publication\_data. This is the case when OpenSplice is configured not to maintain discovery information in the Networking Service. (See also the description of the NetworkService/Discovery[@enabled] attribute in section 4.4.1.6.1 on page 244 of the Deployment Guide.) In this case the operation will return DDS\_RETCODE\_UNSUPPORTED.

# Return Code

When the operation returns:

• DDS\_RETCODE\_OK - the information on the specified publication has successfully been retrieved.
• DDS\_RETCODE\_ERROR - an internal error has occurred.
• DDS\_RETCODE\_ILLEGAL\_OPERATION - the operation is invoked on an inappropriate object.
• DDS\_RETCODE\_UNSUPPORTED - OpenSplice is configured not to maintain the information about “associated” publications.
• DDS\_RETCODE\_ALREADY\_DELETED - the DDS\_DataReader has already been deleted.
• DDS\_RETCODE\_OUT\_OF\_RESOURCES - the Data Distribution Service ran out of resources to complete this operation.
• DDS\_RETCODE\_NOT\_ENABLED - the DDS\_DataReader is not enabled.

# 3.5.2.14 DDS\_DataReader\_get\_matched\_publications

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
DDS_ReturnCode_t
DDS_DataReader_get_matched_publications
(DDS_DataReader _this,
DDS_InstanceHandleSeq *publication_handles);
```

# Description

This operation retrieves the list of publications currently "associated" with the DDS\_DataReader.

# Parameters

in DDS\_DataReader \_this - the DDS\_DataReader object on which the operation is operated.

inout DDS\_InstanceHandleSeq \*publication\_handles - a sequence which is used to pass the list of all associated publications.

# Return Value

DDS\_ReturnCode\_t - Possible return codes of the operation are: DDS\_RETCODE\_OK, DDS\_RETCODE\_ERROR, DDS\_RETCODE\_ILLEGAL OPERATION, DDS\_RETCODE\_UNSUPPORTED, DDS\_RETCODE\_ALREADY\_DELETED, DDS\_RETCODE\_OUT\_OF\_RESOURCES or DDS\_RETCODE\_NOT\_ENABLED.

# Detailed Description

This operation retrieves the list of publications currently "associated" with the DDS\_DataReader. That is, subscriptions that have a matching Topic and compatible QoS that the application has not indicated should be “ignored” by means of the DDS\_DomainParticipant\_ignore\_publication operation.

The publication\_handles sequence and its buffer may be pre-allocated by the application and therefore must either be re-used in a subsequent invocation of the DDS\_DataReader\_get\_matched\_publications operation or be released by calling DDS\_free on the returned publication\_handles. If the pre-allocated sequence is not big enough to hold the number of associated publications, the sequence will automatically be (re-)allocated to fit the required size.

The handles returned in the publication\_handles sequence are the ones that are used by the DDS implementation to locally identify the corresponding matched DataWriter entities. You can access more detailed information about a particular p u b l i c a t i o n b y p a s s i n g i t s p u b l ic a t i o n \_ ha n d l e t o e it h e r t h e DDS\_DataReader\_get\_matched\_publication\_data operation or to the DDS\_PublicationBuiltinTopicDataDataReader\_read\_instance operation on the built-in reader for the “DCPSPublication” topic.

![The image displays a standard warning symbol consisting of a red triangular border surrounding a white interior. Centered within the triangle is a black exclamation mark.](.vortex-opensplice-c-reference-guide/dbbf56aa2a1c8ace5edaf459e6eb0ccddae7c5ed9aa5c335934d89014a401ff1.jpg)

Be aware that since DDS\_InstanceHandle\_t is an opaque datatype, it does not necessarily mean that the handles obtained from the DDS\_DataReader get\_matched\_publications operation have the same value as the ones that appear in the instance\_handle field of the DDS\_SampleInfo when retrieving the publication info through corresponding "DCPSPublication" built-in reader. You can’t just compare two handles to determine whether they represent the same publication. If you want to know whether two handles actually do represent the same publication, us e both handles to retrieve their corresponding DDS\_PublicationBuiltinTopicData samples and then compare the key field of both samples.

The operation may fail if the infrastructure does not locally maintain the connectivity information. This is the case when OpenSplice is configured not to maintain discovery information in the Networking Service. (See also the description of the NetworkService/Discovery[@enabled] attribute in section 4.4.1.6.1 on page 244 of the Deployment Guide.) In this case the operation will return DDS\_RETCODE\_UNSUPPORTED.

# Return Code

When the operation returns:

• DDS\_RETCODE\_OK - the list of associated publications has successfully been obtained.
• DDS\_RETCODE\_ERROR - an internal error has occurred.

• DDS\_RETCODE\_ILLEGAL\_OPERATION - the operation is invoked on an inappropriate object.
• DDS\_RETCODE\_UNSUPPORTED - OpenSplice is configured not to maintain the information about “associated” publications.
• DDS\_RETCODE\_ALREADY\_DELETED - the DDS\_DataReader has already been deleted.
• DDS\_RETCODE\_OUT\_OF\_RESOURCES - the Data Distribution Service ran out of resources to complete this operation.
• DDS\_RETCODE\_NOT\_ENABLED - the DDS\_DataReader is not enabled.

# 3.5.2.15 DDS\_DataReader\_get\_qos

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
DDS_ReturnCode_t
DDS_DataReader_get_qos
(DDS_DataReader_this,
DDS_DataReaderQos *qos);
```

# Description

This operation allows access to the existing set of QoS policies for a DDS\_DataReader.

# Parameters

in DDS\_DataReader \_this - the DDS\_DataReader object on which the operation is operated.

inout DDS\_DataReaderQos \*qos - a reference to the destination DDS\_DataReaderQos struct in which the QosPolicy settings will be copied.

# Return Value

DDS\_ReturnCode\_t - Possible return codes of the operation are: DDS\_RETCODE\_OK, DDS\_RETCODE\_ERROR, DDS\_RETCODE\_ILLEGAL OPERATION, DDS\_RETCODE\_ALREADY\_DELETED or DDS\_RETCODE OUT\_OF\_RESOURCES.

# Detailed Description

This operation allows access to the existing set of QoS policies of a DDS\_DataReader on which this operation is used. This DDS\_DataReaderQos is stored at the location pointed to by the qos parameter.

# Return Code

When the operation returns:

• DDS\_RETCODE\_OK - the existing set of QoS policy values applied to this DDS\_DataReader has successfully been copied into the specified DDS\_DataReaderQos parameter.
• DDS\_RETCODE\_ERROR - an internal error has occurred.
• DDS\_RETCODE\_ILLEGAL\_OPERATION - the operation is invoked on an inappropriate object.
• DDS\_RETCODE\_ALREADY\_DELETED - the DDS\_DataReader has already been deleted.
• DDS\_RETCODE\_OUT\_OF\_RESOURCES - the Data Distribution Service ran out of resources to complete this operation.

# 3.5.2.16 DDS\_DataReader\_get\_requested\_deadline\_missed\_status

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
DDS_ReturnCode_t
DDS_DataReader_get_requested_deadline_missed_status
(DDS_DataReader _this,
DDS_RequestedDeadlineMissedStatus *status);
```

# Description

This operation obtains the DDS\_RequestedDeadlineMissedStatus struct of the DDS\_DataReader.

# Parameters

in DDS\_DataReader \_this - the DDS\_DataReader object on which the operation is operated.

inout DDS\_RequestedDeadlineMissedStatus \*status - the contents of the DDS\_RequestedDeadlineMissedStatus struct of the DDS\_DataReader will be copied into the location specified by status.

# Return Value

DDS\_ReturnCode\_t - Possible return codes of the operation are: DDS\_RETCODE\_OK, DDS\_RETCODE\_ERROR, DDS\_RETCODE\_ILLEGAL\_ OPERATION, DDS\_RETCODE\_ALREADY\_DELETED or DDS\_RETCODE\_ OUT\_OF\_RESOURCES.

# Detailed Description

This operation obtains the DDS\_RequestedDeadlineMissedStatus struct of the DDS\_DataReader. This struct contains the information whether the deadline that the DDS\_DataReader was expecting through its DDS\_DeadlineQosPolicy was not respected for a specific instance.

The DDS\_RequestedDeadlineMissedStatus can also be monitored using a DDS\_DataReaderListener or by using the associated DDS\_StatusCondition.

# Return Code

When the operation returns:

• DDS\_RETCODE\_OK - the current DDS\_RequestedDeadlineMissedStatus of this DDS\_DataReader has successfully been copied into the specified status parameter.
• DDS\_RETCODE\_ERROR - an internal error has occurred.
• DDS\_RETCODE\_ILLEGAL\_OPERATION - the operation is invoked on an inappropriate object.
• DDS\_RETCODE\_ALREADY\_DELETED - the DDS\_DataReader has already been deleted.
• DDS\_RETCODE\_OUT\_OF\_RESOURCES - the Data Distribution Service ran out of resources to complete this operation.

# 3.5.2.17 DDS\_DataReader\_get\_requested\_incompatible\_qos\_status

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
DDS_ReturnCode_t
DDS_DataReader_get_requested_incompatible_qos_status
(DDS_DataReader _this,
DDS_RequestedIncompatibleQosStatus *status);
```

# Description

This operation obtains the DDS\_RequestedIncompatibleQosStatus struct of the DDS\_DataReader.

# Parameters

in DDS\_DataReader \_this - the DDS\_DataReader object on which the operation is operated.

inout DDS\_RequestedIncompatibleQosStatus \*status - the contents of the DDS\_RequestedIncompatibleQosStatus struct of the DDS\_DataReader will be copied into the location specified by status.

# Return Value

DDS\_ReturnCode\_t - Possible return codes of the operation are: DDS\_RETCODE\_OK, DDS\_RETCODE\_ERROR, DDS\_RETCODE\_ILLEGAL OPERATION, DDS\_RETCODE\_ALREADY\_DELETED or DDS\_RETCODE\_ OUT\_OF\_RESOURCES.

# Detailed Description

This operation obtains the DDS\_RequestedIncompatibleQosStatus struct of the DDS\_DataReader. This struct contains the information whether a QosPolicy setting was incompatible with the offered QosPolicy setting.

The Request/Offering mechanism is applicable between the DDS\_DataWriter and the DDS\_DataReader. If the QosPolicy settings between DDS\_DataWriter and DDS\_DataReader are inconsistent, no communication between them is established. In addition the DDS\_DataWriter will be informed via a DDS\_REQUESTED\_INCOMPATIBLE\_QOS status change and the DDS\_DataReader will be informed via an DDS\_OFFERED\_INCOMPATIBLE\_QOS status change.

The DDS\_RequestedIncompatibleQosStatus can also be monitored using a DDS\_DataReaderListener or by using the associated DDS\_StatusCondition.

# Return Code

When the operation returns:

• DDS\_RETCODE\_OK - the current DDS\_RequestedIncompatibleQosStatus of this DDS\_DataReader has successfully been copied into the specified status parameter.
• DDS\_RETCODE\_ERROR - an internal error has occurred.
• DDS\_RETCODE\_ILLEGAL\_OPERATION - the operation is invoked on an inappropriate object.
• DDS\_RETCODE\_ALREADY\_DELETED - the DDS\_DataReader has already been deleted.
• DDS\_RETCODE\_OUT\_OF\_RESOURCES - the Data Distribution Service ran out of resources to complete this operation.

# 3.5.2.18 DDS\_DataReader\_get\_sample\_lost\_status

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
DDS_ReturnCode_t
DDS_DataReader_get_sample_lost_status
(DDS_DataReader _this,
DDS_SampleLostStatus *status);
```

# Description

This operation obtains the DDS\_SampleLostStatus struct of the DDS\_DataReader.

# Parameters

in DDS\_DataReader \_this - the DDS\_DataReader object on which the operation is operated.

inout DDS\_SampleLostStatus \*status - the contents of the DDS\_SampleLostStatus struct of the DDS\_DataReader will be copied into the location specified by status.

# Return Value

DDS\_ReturnCode\_t - Possible return codes of the operation are: DDS\_RETCODE\_OK, DDS\_RETCODE\_ERROR, DDS\_RETCODE\_ILLEGAL OPERATION, DDS\_RETCODE\_ALREADY\_DELETED or DDS\_RETCODE OUT\_OF\_RESOURCES.

# Detailed Description

This operation obtains the DDS\_SampleLostStatus struct of the DDS\_DataReader. This struct contains the information whether a sample have been lost. This only applies when the DDS\_ReliabilityQosPolicy is set to DDS\_RELIABLE. If the DDS\_ReliabilityQosPolicy is set to DDS\_BEST\_EFFORT the Data Distribution Service will not report the loss of samples.

The D D S \_ Sa m p l e L o st S t a t u s c a n a l s o b e m o n i t o r e d u s i n g a DDS\_DataReaderListener or by using the associated DDS\_StatusCondition.

# Return Code

When the operation returns:

• DDS\_RETCODE\_OK - the current DDS\_SampleLostStatus of this DDS\_DataReader has successfully been copied into the specified status parameter.
• DDS\_RETCODE\_ERROR - an internal error has occurred.
• DDS\_RETCODE\_ILLEGAL\_OPERATION - the operation is invoked on an inappropriate object.
• DDS\_RETCODE\_ALREADY\_DELETED - the DDS\_DataReader has already been deleted.
• DDS\_RETCODE\_OUT\_OF\_RESOURCES - the Data Distribution Service ran out of resources to complete this operation.

# 3.5.2.19 DDS\_DataReader\_get\_sample\_rejected\_status

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
DDS_ReturnCode_t
DDS_DataReader_get_sample_rejected_status
(DDS_DataReader _this,
DDS_SampleRejectedStatus *status);
```

# Detailed Description

This operation obtains the DDS\_SampleRejectedStatus struct of the DDS\_DataReader.

# Parameters

in DDS\_DataReader \_this - the DDS\_DataReader object on which the operation is operated.

inout DDS\_SampleRejectedStatus \*status - the contents of the DDS\_SampleRejectedStatus struct of the DDS\_DataReader will be copied into the location specified by status.

# Return Value

DDS\_ReturnCode\_t - Possible return codes of the operation are: DDS\_RETCODE\_OK, DDS\_RETCODE\_ERROR, DDS\_RETCODE\_ILLEGAL OPERATION, DDS\_RETCODE\_ALREADY\_DELETED or DDS\_RETCODE\_ OUT\_OF\_RESOURCES.

# Detailed Description

This operation obtains the DDS\_SampleRejectedStatus struct of the DDS\_DataReader. This struct contains the information whether a received sample has been rejected. Samples may be rejected by the DDS\_DataReader when it runs out of resource\_limits to store incoming samples. Ususally this means that old samples need to be ‘consumed’ (for example by ‘taking’ them instead of ‘reading’ them) to make room for newly incoming samples.

The DDS\_SampleRejectedStatus can also be monitored using a DDS\_DataReaderListener or by using the associated DDS\_StatusCondition.

# Return Code

When the operation returns:

• DDS\_RETCODE\_OK - the current DDS\_SampleRejectedStatus of this DDS\_DataReader has successfully been copied into the specified status parameter.

• DDS\_RETCODE\_ERROR - an internal error has occurred.
• DDS\_RETCODE\_ILLEGAL\_OPERATION - the operation is invoked on an inappropriate object.
• DDS\_RETCODE\_ALREADY\_DELETED - the DDS\_DataReader has already been deleted.
• DDS\_RETCODE\_OUT\_OF\_RESOURCES - the Data Distribution Service ran out of resources to complete this operation.

# 3.5.2.20 DDS\_DataReader\_get\_status\_changes (inherited)

This operation is inherited and therefore not described here. See the class DDS\_Entity for further explanation.

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
DDS_StatusMask
DDS_DataReader_get_status_changes
(DDS_DataReader _this);
```

# 3.5.2.21 DDS\_DataReader\_get\_statuscondition (inherited)

This operation is inherited and therefore not described here. See the class DDS\_Entity for further explanation.

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
DDS_StatusCondition
DDS_DataReader_get_statuscondition
(DDS_DataReader_this);
```

# 3.5.2.22 DDS\_DataReader\_get\_subscriber

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
DDS_Subscriber
DDS_DataReader_get_subscriber
(DDS_DataReader _this);
```

# Description

This operation returns the DDS\_Subscriber to which the DDS\_DataReader belongs.

# Parameters

in DDS\_DataReader \_this - the DDS\_DataReader object on which the operation is operated.

# Return Value

DDS\_Subscriber - Return value is a pointer to the DDS\_Subscriber to which the DDS\_DataReader belongs.

# Detailed Description

This operation returns the DDS\_Subscriber to which the DDS\_DataReader belongs, thus the DDS\_Subscriber that has created the DDS\_DataReader. If the DDS\_DataReader is already deleted, the DDS\_OBJECT\_NIL pointer is returned.

# 3.5.2.23 DDS\_DataReader\_get\_subscription\_matched\_status

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
DDS_ReturnCode_t
DDS_DataReader_get Subscription_matched_status
(DDS_DataReader _this,
DDS_SubscriptionMatchedStatus *status);
```

# Description

This operation obtains the DDS\_SubscriptionMatchedStatus struct of the DDS\_DataReader.

# Parameters

in DDS\_DataReader \_this - the DDS\_DataReader object on which the operation is operated.

inout DDS\_SubscriptionMatchedStatus \*status - the contents of the DDS\_SubscriptionMatchedStatus struct of the DDS\_DataReader will be copied into the location specified by status.

# Return Value

DDS\_ReturnCode\_t - Possible return codes of the operation are: DDS\_RETCODE\_OK, DDS\_RETCODE\_ERROR, DDS\_RETCODE\_ILLEGAL OPERATION, RETCODE\_UNSUPPORTED, DDS\_RETCODE\_ALREADY\_DELETED or DDS\_RETCODE\_OUT\_OF\_RESOURCES.

# Detailed Description

This operation obtains the DDS\_SubscriptionMatchedStatus struct of the DDS\_DataReader. This struct contains the information whether a new match has been discovered for the current subscription, or whether an existing match has ceased to exist.

This means that the status represents that either a DataWriter object has been discovered by the DDS\_DataReader with the same Topic and a compatible Qos, or that a previously-discovered DataWriter has ceased to be matched to the current DDS\_DataReader. A DataWriter may cease to match when it gets deleted, when it changes its Qos to a value that is incompatible with the current DDS\_DataReader or when either the DDS\_DataReader or the DataWriter has chosen to put its matching counterpart on its ignore-list using the DDS\_DomainParticipant\_ ignore\_publication or DDS\_DomainParticipant\_ignore\_subscription operations.

The operation may fail if the infrastructure does not hold the information necessary to fill in the DDS\_SubscriptionMatchedStatus. This is the case when OpenSplice is configured not to maintain discovery information in the Networking S e r v i c e . ( S e e t h e d e s c r i p t i o n f o r t h e N e t w o r k i n g S e r v i c e / Discovery/enabled property in the Deployment Manual for more information a b o u t t h i s s u b j e c t . ) I n t h i s c a s e t h e o p e r a t i o n w i l l r e t u r n DDS\_RETCODE\_UNSUPPORTED.

The DDS\_SubscriptionMatchedStatus can also be monitored using a DDS\_DataReaderListener or by using the associated DDS\_StatusCondition.

# Return Code

When the operation returns:

• DDS\_RETCODE\_OK - the current DDS\_SubscriptionMatchedStatus of this DDS\_DataReader has successfully been copied into the specified status parameter.
• DDS\_RETCODE\_ERROR - an internal error has occurred.
• DDS\_RETCODE\_ILLEGAL\_OPERATION - the operation is invoked on an inappropriate object.
• DDS\_RETCODE\_UNSUPPORTED - OpenSplice is configured not to maintain the information about “associated” publications.
• DDS\_RETCODE\_ALREADY\_DELETED - the DDS\_DataReader has already been deleted.
• DDS\_RETCODE\_OUT\_OF\_RESOURCES - the Data Distribution Service ran out of resources to complete this operation.

# 3.5.2.24 DDS\_DataReader\_get\_topicdescription

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
DDS_TopicDescription
DDS_DataReader_get_topicdescription
```

(DDS\_DataReader \_this);

# Description

This operation returns the DDS\_TopicDescription which is associated with the DDS\_DataReader.

# Parameters

in DDS\_DataReader \_this - the DDS\_DataReader object on which the operation is operated.

# Return Value

DDS\_TopicDescription - a pointer to the DDS\_TopicDescription which is associated with the DDS\_DataReader.

# Detailed Description

This operation returns the DDS\_TopicDescription which is associated with the DDS\_DataReader, thus the DDS\_TopicDescription with which the DDS\_DataReader is created. If the DDS\_DataReader is already deleted, the DDS\_OBJECT\_NIL pointer is returned.

# 3.5.2.25 DDS\_DataReader\_lookup\_instance (abstract)

This abstract operation is defined as a generic operation, which is implemented by the &lt;NameSpace&gt;\_&lt;type&gt;DataReader class. Therefore, to use this operation, the data type specific implementation of this operation in its respective derived class must be used. For further explanation see the description for the fictional data type Foo (defined in the module SPACE) derived SPACE\_FooDataReader class.

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
DDS_InstanceHandle_t
DDS_DataReader_lookup_instance
(DDS_DataReader _this,
&lt;data&gt; *instance_data);
```

# 3.5.2.26 DDS\_DataReader\_read (abstract)

This abstract operation is defined as a generic operation, which is implemented by the &lt;NameSpace&gt;\_&lt;type&gt;DataReader class. Therefore, to use this operation, the data type specific implementation of this operation in its respective derived class must be used. For further explanation see the description for the fictional data type Foo (defined in the module SPACE) derived SPACE\_FooDataReader class.

# Synopsis

#include &lt;dds\_dcps.h&gt;

```c
DDS_ReturnCode_t
DDS_DataReader_read
(DDS_DataReader _this,
DDS_sequence_&lt;data&gt; *data_values,
DDS_SampleInfoSeq *info_seq,
const DDS_long max_samples,
const DDS_SampleStateMask sample_states,
const DDS_ViewStateMask view_states,
const DDS_InstanceStateMask instance_states);
```

# 3.5.2.27 DDS\_DataReader\_read\_instance (abstract)

This abstract operation is defined as a generic operation, which is implemented by the &lt;NameSpace&gt;\_&lt;type&gt;DataReader class. Therefore, to use this operation, the data type specific implementation of this operation in its respective derived class must be used. For further explanation see the description for the fictional data type Foo (defined in the module SPACE) derived SPACE\_FooDataReader class.

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
DDS_ReturnCode_t
DDS_DataReader_read_instance
(DDS_DataReader _this,
DDS_sequence_&lt;data&gt; *data_values,
DDS_SampleInfoSeq *info_seq,
const DDS_long max_samples,
const DDS_InstanceHandle_t a_handle,
const DDS_SampleStateMask sample_states,
const DDS_ViewStateMask view_states,
const DDS_InstanceStateMask instance_states);
```

# 3.5.2.28 DDS\_DataReader\_read\_next\_instance (abstract)

This abstract operation is defined as a generic operation, which is implemented by the &lt;NameSpace&gt;\_&lt;type&gt;DataReader class. Therefore, to use this operation, the data type specific implementation of this operation in its respective derived class must be used. For further explanation see the description for the fictional data type Foo (defined in the module SPACE) derived SPACE\_FooDataReader class.

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
DDS_ReturnCode_t
DDS_DataReader_read_next_instance
(DDS_DataReader _this,
DDS_sequence_&lt;data&gt; *data_values,
DDS_SampleInfoSeq *info_seq,
const DDS_long max_samples,
const DDS_InstanceHandle_t a_handle,
```

```dart
const DDS_SampleStateMask sample_states,
const DDS_ViewStateMask view_states,
const DDS_InstanceStateMask instance_states);
```

# 3.5.2.29 DDS\_DataReader\_read\_next\_instance\_w\_condition (abstract)

This abstract operation is defined as a generic operation, which is implemented by the &lt;NameSpace&gt;\_&lt;type&gt;DataReader class. Therefore, to use this operation, the data type specific implementation of this operation in its respective derived class must be used. For further explanation see the description for the fictional data type Foo (defined in the module SPACE) derived SPACE\_FooDataReader class.

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
DDS_ReturnCode_t
DDS_DataReader_read_next_instance_w_condition
(DDS_DataReader _this,
DDS_sequence_&lt;data&gt; *data_values,
DDS_SampleInfoSeq *info_seq,
const DDS_long max_samples,
const DDS_InstanceHandle_t a_handle,
const DDS_ReadCondition a_condition);
```

# 3.5.2.30 DDS\_DataReader\_read\_next\_sample (abstract)

This abstract operation is defined as a generic operation, which is implemented by the &lt;NameSpace&gt;\_&lt;type&gt;DataReader class. Therefore, to use this operation, the data type specific implementation of this operation in its respective derived class must be used. For further explanation see the description for the fictional data type Foo (defined in the module SPACE) derived SPACE\_FooDataReader class.

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
DDS_ReturnCode_t
DDS_DataReader_read_next_sample
(DDS_DataReader _this,
    &lt;data&gt; *data_values,
    DDS_SampleInfo *sample_info);
```

NOTE: This operation is not yet implemented. It is scheduled for a future release.

# 3.5.2.31 DDS\_DataReader\_read\_w\_condition (abstract)

This abstract operation is defined as a generic operation, which is implemented by the &lt;NameSpace&gt;\_&lt;type&gt;DataReader class. Therefore, to use this operation, the data type specific implementation of this operation in its respective derived class must be used. For further explanation see the description for the fictional data type Foo (defined in the module SPACE) derived SPACE\_FooDataReader class.

Synopsis
```c
#include &lt;dds_dcps.h&gt;
DDS_ReturnCode_t
DDS_DataReader_read_w_condition
(DDS_DataReader _this,
DDS_sequence_&lt;data&gt; *data_values,
DDS_SampleInfoSeq *info_seq,
const DDS_long max_samples,
const DDS_ReadCondition a_condition);
```

# 3.5.2.32 DDS\_DataReader\_return\_loan (abstract)

This abstract operation is defined as a generic operation, which is implemented by the &lt;NameSpace&gt;\_&lt;type&gt;DataReader class. Therefore, to use this operation, the data type specific implementation of this operation in its respective derived class must be used. For further explanation see the description for the fictional data type Foo (defined in the module SPACE) derived SPACE\_FooDataReader class.

Synopsis
```c
#include &lt;dds_dcps.h&gt;
DDS_ReturnCode_t
DDS_DataReader_return_loan
(DDS_DataReader _this,
DDS_sequence_&lt;data&gt; *data_values,
DDS_SampleInfoSeq *info_seq);
```

# 3.5.2.33 DDS\_DataReader\_set\_default\_datareaderview\_qos

Synopsis
```c
#include &lt;dds_dcps.h&gt;
DDS_ReturnCode_t
DDS_DataReader_set_default_datareaderview_qos
(DDS_DataReader _this,
DDS_DataReaderViewQos* qos);
```

# Description

This operation sets the default DDS\_DataReaderViewQos of the DDS\_DataReader.

# Parameters

in DDS\_DataReader \_this - the DDS\_DataReader object on which the operation is operated.

in const DDS\_DataReaderViewQos\* qos - the DDS\_DataReaderViewQos struct which contains the default QosPolicy settings for newly-created DDS\_DataReaderView objects.

# Return Value

```txt
DDS_ReturnCode_t - Possible return codes of the operation are:
DDS_RETCODE_OK, DDS_RETCODE_ERROR, DDS_RETCODE_BAD_PARAMETER,
DDS_RETCODE_OUT_OF_RESOURCES.
```

# Detailed Description

# Return Code

When the operation returns:

• DDS\_RETCODE\_OK - the new default DataReaderViewQos is set.
• DDS\_RETCODE\_ERROR - an internal error has occurred.
• DDS\_RETCODE\_BAD\_PARAMETER - the DataReaderViewQos parameter is invalid.
• DDS\_RETCODE\_OUT\_OF\_RESOURCES - the data distribution service ran out of resources to complete this operation.

# 3.5.2.34 DDS\_DataReader\_set\_listener

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
DDS_ReturnCode_t
DDS_DataReader_set_listener
(DDS_DataReader_this,
const struct DDS_DataReaderListener *a_listener,
const DDS_StatusMask mask);
```

# Description

This operation attaches a DDS\_DataReaderListener to the DDS\_DataReader.

# Parameters

in DDS\_DataReader \_this - the DDS\_DataReader object on which the operation is operated.
in const struct DDS\_DataReaderListener \*a\_listener - a pointer to the DDS\_DataReaderListener instance, which will be attached to the DDS\_DataReader.
in const DDS\_StatusMask mask - a bit-mask in which each bit enables the invocation of the DDS\_DataReaderListener for a certain status.

# Return Value

D D S \_ R e t u r n C o d e \_ t - P o s s i b l e r e t u r n c o d e s o f t h e o p e r a t i o n a r e : DDS\_RETCODE\_OK, DDS\_RETCODE\_ERROR, DDS\_RETCODE\_ILLEGAL\_ OPERATION, DDS\_RETCODE\_UNSUPPORTED, DDS\_RETCODE\_ ALREADY\_DELETED or DDS\_RETCODE\_OUT\_OF\_RESOURCES.

# Detailed Description

This operation attaches a DDS\_DataReaderListener to the DDS\_DataReader. Only one DDS\_DataReaderListener can be attached to each DDS\_DataReader. If a DDS\_DataReaderListener was already attached, the operation will replace it with the new one. When a\_listener is the DDS\_OBJECT\_NIL pointer, it represents a listener that is treated as a NOOP1 for all statuses activated in the bitmask.

# Communication Status

For each communication status, the StatusChangedFlag flag is initially set to FALSE. It becomes TRUE whenever that communication status changes. For each c o m m u n i c a t i o n s t a t u s a c t i v a t e d i n t h e m a s k , t h e a s s o c i a t e d DDS\_DataReaderListener operation is invoked and the communication status is reset to FALSE, as the listener implicitly accesses the status which is passed as a parameter to that operation. The status is reset prior to calling the listener, so if the application calls the get\_&lt;status\_name&gt;\_status from inside the listener it will see the status already reset. An exception to this rule is the DDS\_OBJECT\_NIL listener, which does not reset the communication statuses for which it is invoked.

The following statuses are applicable to the DDS\_DataReaderListener:

```pickle
DDS_REQUESTED_DEADLINE_MISSED_STATUS
DDS_REQUESTED_INCOMPATIBLE_QOS_STATUS
DDS_SAMPLE_LOST_STATUS
DDS_SAMPLE_REJECTED_STATUS
DDS_DATA_AVAILABLE_STATUS
DDS_LIVELINESS_CHANGED_STATUS
DDS_SUBSCRIPTION_MATCHED_STATUS.
```

![The image shows a triangular warning sign with a thick red border and a white background. In the center is a black exclamation point, where the dot at the bottom is shaped like a diamond.](.vortex-opensplice-c-reference-guide/a76aa9d6d498103e17397d85ecb49878443b8893e0b53b4aea92aa6bb37597bc.jpg)

Be aware that the DDS\_SUBSCRIPTION\_MATCHED\_STATUS is not applicable when the infrastructure does not have the information available to determine connectivity. This is the case when OpenSplice is configured not to maintain discovery information in the Networking Service. (See also the description of the NetworkService/Discovery[@enabled] attribute in section 4.4.1.6.1 on page 244 of the Deployment Guide.) In this case the operation will return DDS\_RETCODE\_UNSUPPORTED.

Status bits are declared as a constant and can be used by the application in an OR operation to create a tailored mask. The special constant DDS\_STATUS\_MASK\_NONE can be used to indicate that the created entity should not respond to any of its available statuses. The DDS will therefore attempt to propagate these statuses to its factory. The special constant STATUS\_MASK\_ANY\_V1\_2 can be used to select all applicable statuses specified in the “Data Distribution Service for Real-time Systems Version 1.2” specification.

# Status Propagation

In case a communication status is not activated in the m as k of th e DDS\_DataReaderListener, the DDS\_SubscriberListener of the containing DDS\_Subscriber is invoked (if attached and activated for the status that occurred). T h i s a l l o w s t h e a p p l i c a t i o n t o s e t a d e f a u l t b e h a v i o u r i n t h e DDS\_SubscriberListener of the containing DDS\_Subscriber and a DDS\_DataReader specific behaviour when needed. In case the communication status is not activated in the mask of the DDS\_SubscriberListener as well, the c o m m u n i c a t i o n s t a t u s w i l l b e p r o p a g a t e d t o t h e DDS\_DomainParticipantListener o f t h e c o n t a i n i n g DDS\_DomainParticipant. In case the DDS\_DomainParticipantListener is also not attached or the communication status is not activated in its mask, the application is not notified of the change.

The statuses DDS\_DATA\_ON\_READERS\_STATUS and DDS\_DATA AVAILABLE\_STATUS are “Read Communication Statuses” and are an exception to all other plain communication statuses: they have no corresponding status structure that can be obtained with a get\_&lt;status\_name&gt;\_status operation and they are mutually exclusive. When new information becomes available to a DataReader, the Data Distribution Service will first look in an attached and activated DDS\_SubscriberListener or DDS\_DomainParticipantListener (in that o r d e r ) f o r t h e D DS \_ D A T A \_ ON \_ R E A D ER S \_ S T A T US . I n c a s e t h e DDS\_DATA\_ON\_READERS\_STATUS can not be handled, the Data Distribution Service will look in an attached and activated DDS\_DataReaderListener, DDS\_SubscriberListener or DDS\_DomainParticipantListener for the DDS\_DATA\_AVAILABLE\_STATUS (in that order).

# Return Code

When the operation returns:

• DDS\_RETCODE\_OK - the DDS\_DataReaderListener is attached.
• DDS\_RETCODE\_ERROR - an internal error has occurred.
• DDS\_RETCODE\_ILLEGAL\_OPERATION - the operation is invoked on an inappropriate object.

• DDS\_RETCODE\_UNSUPPORTED - a status was selected that cannot be supported because the infrastructure does not maintain the required connectivity information.
• DDS\_RETCODE\_ALREADY\_DELETED - the DDS\_DataReader has already been deleted.
• DDS\_RETCODE\_OUT\_OF\_RESOURCES - the Data Distribution Service ran out of resources to complete this operation.

# 3.5.2.35 DDS\_DataReader\_set\_qos

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
DDS_ReturnCode_t
DDS_DataReader_set_qos
(DDS_DataReader _this,
const DDS_DataReaderQos *qos);
```

# Description

This operation replaces the existing set of QosPolicy settings for a DDS\_DataReader.

# Parameters

in DDS\_DataReader \_this - the DDS\_DataReader object on which the operation is operated.

in const DDS\_DataReaderQos \*qos - the new set of QosPolicy settings for the DDS\_DataReader.

# Return Value

```txt
DDS_ReturnCode_t - Possible return codes of the operation are: DDS_RETCODE_OK, DDS_RETCODE_ERROR, DDS_RETCODE_ILLEGAL_OPERATION, DDS_RETCODE_BAD_PARAMETER, DDS_RETCODE_UNSUPPORTED, DDS_RETCODE_ALREADY_DELETED, DDS_RETCODE_OUT_OF_RESOURCES, DDS_RETCODE_IMMUTABLE_POLICY or DDS_RETCODE_INCONSISTENT_POLICY.
```

# Detailed Description

This operation replaces the existing set of QosPolicy settings for a DDS\_DataReader. The parameter qos contains the QosPolicy settings which is checked for self-consistency and mutability. When the application tries to change a QosPolicy setting for an enabled DDS\_DataReader, which can only be set before t h e D D S \_ D a t a R e a d e r i s e n a b l e d , t h e o p e r a t i o n w i l l f a i l a n d a DDS\_RETCODE\_IMMUTABLE\_POLICY is returned. In other words, the application must provide the presently set QosPolicy settings in case of the immutable QosPolicy settings. Only the mutable QosPolicy settings can be changed. When qos contains conflicting QosPolicy settings (not self-consistent), the operation will fail and a DDS\_RETCODE\_INCONSISTENT\_POLICY is returned.

The set of QosPolicy settings specified by the qos parameter are applied on top of the existing QoS, replacing the values of any policies previously set (provided, the operation returned DDS\_RETCODE\_OK).

# Return Code

When the operation returns:

• DDS\_RETCODE\_OK - the new DDS\_DataReaderQos is set.
• DDS\_RETCODE\_ERROR - an internal error has occurred.
• DDS\_RETCODE\_ILLEGAL\_OPERATION - the operation is invoked on an inappropriate object.
• DDS\_RETCODE\_BAD\_PARAMETER - the parameter qos is not a valid DDS\_DataReaderQos. It contains a QosPolicy setting with an invalid DDS\_Duration\_t value, an enum value that is outside its legal boundaries or a sequence that has inconsistent memory settings.
• DDS\_RETCODE\_UNSUPPORTED - one or more of the selected QosPolicy values are currently not supported by OpenSplice.
• DDS\_RETCODE\_ALREADY\_DELETED - the DDS\_DataReader has already been deleted.
• DDS\_RETCODE\_OUT\_OF\_RESOURCES - the Data Distribution Service ran out of resources to complete this operation.
• DDS\_RETCODE\_IMMUTABLE\_POLICY - the parameter qos contains an immutable QosPolicy setting with a different value than set during enabling of the DDS\_DataReader.
• DDS\_RETCODE\_INCONSISTENT\_POLICY - the parameter qos contains conflicting QosPolicy settings, e.g. a history depth that is higher than the specified resource limits.

# 3.5.2.36 DDS\_DataReader\_take (abstract)

This abstract operation is defined as a generic operation, which is implemented by the &lt;NameSpace&gt;\_&lt;type&gt;DataReader class. Therefore, to use this operation, the data type specific implementation of this operation in its respective derived class must be used. For further explanation see the description for the fictional data type Foo (defined in the module SPACE) derived SPACE\_FooDataReader class.

Synopsis
```c
#include &lt;dds_dcps.h&gt;
DDS_ReturnCode_t
DDS_DataReader_take
(DDS_DataReader _this,
DDS_sequence_&lt;data&gt; *data_values,
DDS_SampleInfoSeq *info_seq,
const DDS_long max_samples,
const DDS_SampleStateMask sample_states,
const DDS_ViewStateMask view_states,
const DDS_InstanceStateMask instance_states);
```

# 3.5.2.37 DDS\_DataReader\_take\_instance (abstract)

This abstract operation is defined as a generic operation, which is implemented by the &lt;NameSpace&gt;\_&lt;type&gt;DataReader class. Therefore, to use this operation, the data type specific implementation of this operation in its respective derived class must be used. For further explanation see the description for the fictional data type Foo (defined in the module SPACE) derived SPACE\_FooDataReader class.

Synopsis
```c
#include &lt;dds_dcps.h&gt;
DDS_ReturnCode_t
DDS_DataReader_take_instance
(DDS_DataReader _this,
DDS_sequence_&lt;data&gt; *data_values,
DDS_SampleInfoSeq *info_seq,
const DDS_long max_samples,
const DDS_InstanceHandle_t a_handle,
const DDS_SampleStateMask sample_states,
const DDS_ViewStateMask view_states,
const DDS_InstanceStateMask instance_states);
```

# 3.5.2.38 DDS\_DataReader\_take\_next\_instance (abstract)

This abstract operation is defined as a generic operation, which is implemented by the &lt;NameSpace&gt;\_&lt;type&gt;DataReader class. Therefore, to use this operation, the data type specific implementation of this operation in its respective derived class must be used. For further explanation see the description for the fictional data type Foo (defined in the module SPACE) derived SPACE\_FooDataReader class.

Synopsis
```c
#include &lt;dds_dcps.h&gt;
DDS_ReturnCode_t
DDS_DataReader_take_next_instance
(DDS_DataReader _this,
DDS_sequence_&lt;data&gt; *data_values,
DDS_SampleInfoSeq *info_seq,
```

```txt
const DDS_long max_samples,
const DDS_InstanceHandle_t a_handle,
const DDS_SampleStateMask sample_states,
const DDS_ViewStateMask view_states,
const DDS_InstanceStateMask instance_states);
```

# 3.5.2.39 DDS\_DataReader\_take\_next\_instance\_w\_condition (abstract)

This abstract operation is defined as a generic operation, which is implemented by the &lt;NameSpace&gt;\_&lt;type&gt;DataReader class. Therefore, to use this operation, the data type specific implementation of this operation in its respective derived class must be used. For further explanation see the description for the fictional data type Foo (defined in the module SPACE) derived SPACE\_FooDataReader class.

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
DDS_ReturnCode_t
DDS_DataReader_take_next_instance_w_condition
(DDS_DataReader _this,
DDS_sequence_&lt;data&gt; *data_values,
DDS_SampleInfoSeq *info_seq,
const DDS_long max_samples,
const DDS_InstanceHandle_t a_handle,
const DDS_ReadCondition a_condition);
```

# 3.5.2.40 DDS\_DataReader\_take\_next\_sample (abstract)

This abstract operation is defined as a generic operation, which is implemented by the &lt;NameSpace&gt;\_&lt;type&gt;DataReader class. Therefore, to use this operation, the data type specific implementation of this operation in its respective derived class must be used. For further explanation see the description for the fictional data type Foo (defined in the module SPACE) derived SPACE\_FooDataReader class.

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
DDS_ReturnCode_t
DDS_DataReader_take_next_sample
(DDS_DataReader _this,
&lt;data&gt; *data_values,
DDS_SampleInfo *sample_info);
```

NOTE: This operation is not yet implemented. It is scheduled for a future release.

# 3.5.2.41 DDS\_DataReader\_take\_w\_condition (abstract)

This abstract operation is defined as a generic operation, which is implemented by the &lt;NameSpace&gt;\_&lt;type&gt;DataReader class. Therefore, to use this operation, the data type specific implementation of this operation in its respective derived class must be used. For further explanation see the description for the fictional data type Foo (defined in the module SPACE) derived SPACE\_FooDataReader class.

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
DDS_ReturnCode_t
DDS_DataReader_take_w_condition
(DDS_DataReader _this,
DDS_sequence_&lt;data&gt; *data_values,
DDS_SampleInfoSeq *info_seq,
const DDS_long max_samples,
const DDS_ReadCondition a_condition);
```

# 3.5.2.42 DDS\_DataReader\_wait\_for\_historical\_data

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
DDS_ReturnCode_t
DDS_DataReader_wait_for_historical_data
(DDS_DataReader _this,
const DDS_Duration_t *max_wait);
```

# Description

This operation will block the application thread until all “historical” data is received.

# Parameters

in DDS\_DataReader \_this - the DDS\_DataReader object on which the operation is operated.

in const DDS\_Duration\_t \*max\_wait - the maximum duration to block for the DDS\_DataReader\_wait\_for\_historical\_data, after which the a p p l i c a t i o n t h r e a d i s u n b l o c k e d . T h e s p e c i a l c o n s t a n t DDS\_DURATION\_INFINITE can be used when the maximum waiting time does not need to be bounded.

# Return Value

DDS\_ReturnCode\_t - Possible return codes of the operation are:

```javascript
DDS_RETCODE_OK, DDS_RETCODE_ERROR, DDS_RETCODE_ILLEGAL_OPERATION, DDS_RETCODE_ALREADY_DELETED, DDS_RETCODE_OUT_OF_RESOURCES, DDS_RETCODE_NOT_ENABLED, DDS_RETCODE_TIMEOUT or DDS_RETCODE_PRECONDITION_NOT_MET.
```

# Detailed Description

This operation behaves differently for DDS\_DataReader objects which have a non-DDS\_VOLATILE\_DURABILITY\_QOS DDS\_DurabilityQosPolicy and for DDS\_DataReader objects which have a DDS\_VOLATILE\_DURABILITY\_QOS DDS\_DurabilityQosPolicy.

As soon as an application enables a non-DDS\_VOLATILE\_DURABILITY\_QOS DDS\_DataReader it will start receiving both “historical” data, i.e. the data that was written prior to the time the DDS\_DataReader joined the domain, as well as any new data written by the DDS\_DataWriter objects. There are situations where the application logic may require the application to wait until all “historical” data is r e c e i v e d . T h i s i s t h e p u r p o s e o f t h e DDS\_DataReader\_wait\_for\_historical\_data operation.

As soon as an application enables a DDS\_VOLATILE\_DURABILITY\_QOS DataReader it will not start receiving “historical” data but only new data written by t h e DDS\_DataWriter o b j e c t s . By c a l l i n g DDS\_DataReader\_wait\_for\_historical\_data the DDS\_DataReader explicitly requests the Data Distribution Service to start receiving also the “historical” data and to wait until either all “historical” data is received, or the duration specified by the max\_wait parameter has elapsed, whichever happens first.

# Thread blocking

The operation DDS\_DataReader\_wait\_for\_historical\_data blocks the calling thread until either all “historical” data is received, or the duration specified by the max\_wait parameter elapses, whichever happens first. A return value of DDS\_RETCODE\_OK indicates that all the “historical” data was received; a return value of DDS\_RETCODE\_TIMEOUT indicates that max\_wait elapsed before all the data was received.

# Return Code

When the operation returns:

• DDS\_RETCODE\_OK - the “historical” data is received.
• DDS\_RETCODE\_ERROR - an internal error has occurred.

• DDS\_RETCODE\_ILLEGAL\_OPERATION - the operation is invoked on an inappropriate object.
• DDS\_RETCODE\_ALREADY\_DELETED - the DDS\_DataReader has already been deleted.
• DDS\_RETCODE\_OUT\_OF\_RESOURCES - the Data Distribution Service ran out of resources to complete this operation.
• DDS\_RETCODE\_NOT\_ENABLED - the DDS\_DataReader is not enabled.
• DDS\_RETCODE\_TIMEOUT - not all data is received before max\_wait elapsed.
• DDS\_RETCODE\_PRECONDITION\_NOT\_MET - can happen when requesting conditional alignment on non-volatile readers or a historical data request is already in progress or complete.

# 3.5.2.43 DDS\_DataReader\_wait\_for\_historical\_data\_w\_condition

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
DDS_ReturnCode_t
DDS_DataReader_wait_for_historical_data_w_condition
(DDS_DataReader _this
const DDS_string filter_expression,
const DDS_StringSeq* filter_parameters,
const DDS_Time_t* min_source_timestamp,
const DDS_Time_t* max_source_timestamp
const DDS_ResourceLimitsQosPolicy* resource_limits,
const DDS_Duration_t* max_wait)
```

# Description

This operation will block the application thread until all historical data that matches the supplied conditions is received.

![The image displays a triangular warning sign with a red border and a white background. Inside the triangle, there is a black exclamation mark (!) centered in the upper portion, and directly below it is a black diamond shape.](.vortex-opensplice-c-reference-guide/230d2814d3ffabe87002ac6ff5d45cd6dac299451cddfe79d47de830668deea5.jpg)

NOTE: This operation only makes sense when the receiving node has configured its durability service as an On\_Request alignee. (See also the description of the OpenSplice/DurabilityService/NameSpaces/Policy[@alignee] attribute in the Deployment Guide.) Otherwise the Durability Service will not distinguish between separate reader requests and still inject the full historical data set in each reader.

Additionally, when creating the DataReader, the DurabilityQos.kind of the DataReaderQos needs to be set to VOLATILE, to ensure that historical data that potentially is available already at creation time is not immediately delivered to the DataReader at that time.

# Parameters

in DDS\_DataReader \_this - the DDS\_DataReader object on which the operation is operated.
in const DDS\_string\* filter\_expression - the SQL expression (subset of SQL), which defines the filtering criteria (NULL when no SQL filtering is needed).
in const DDS\_StringSeq\* filter\_parameters – sequence of strings with the parameter values used in the SQL expression (i.e., the number of %n tokens in the expression). The number of values in expression\_parameters must be equal to or greater than the highest referenced %n token in the filter\_expression (e.g. if %1 and %8 are used as parameters in the filter\_expression, the expression\_parameters should contain at least n + 1 = 9 values).
in const DDS\_Time\_t\* min\_source\_timestamp - Filter out all data published before this time. The special constant DDS\_TIMESTAMP\_INVALID c a n b e u s e d w h e n n o m i n i m u m f i l t e r i s n e e d e d . T h e v a l u e o f min\_source\_timestamp.sec must be less than 0x7fffffff otherwise it will be recognized as TIMESTAMP\_INVALID\_SEC.
in const DDS\_Time\_t\* max\_source\_timestamp - Filter out all data published after this time. The special constant DDS\_TIMESTAMP\_INVALID can b e u s e d w h e n n o m a x i m u m f i l t e r i s n e e d e d . T h e v a l u e o f max\_source\_timestamp.sec must be less than 0x7fffffff otherwise it will be recognized as TIMESTAMP\_INVALID\_SEC.
in const DDS\_ResourceLimitsQosPolicy\* resource\_limits - Specifies limits on the maximum amount of historical data that may be received.
in const DDS\_Duration\_t\* max\_wait - The maximum duration the application thread is blocked during this operation.

# Return Value

DDS\_ReturnCode\_t - Possible return codes of the operation are: DDS\_RETCODE\_OK, DDS\_RETCODE\_ERROR, DDS\_RETCODE\_BAD\_PARAMETER, DDS\_RETCODE\_PRECONDITION\_NOT\_MET, DDS\_RETCODE\_ALREADY\_DELETED, DDS\_RETCODE\_NOT\_ENABLED, DDS\_RETCODE\_TIMEOUT.

# Detailed Description

T h i s o p e r a t i o n i s s i m i l a r t o t h e DDS\_DataReader\_wait\_for\_historical\_data operation, but instead of inserting all historical data into the DataReader, only data that matches the conditions expressed by the parameters to this opération is inserted. For more information about historical data please refer to section 3.5.2.42 on page 461.

By using filter\_expression and filter\_parameters, data can be selected or discarded based on content. The filter\_expression must adhere to SQL syntax of the WHERE clause as described in Appendix H, DCPS Queries and Filters. Constraints on the age of data can be set by using the min\_source\_timestamp and max\_source\_timestamp parameters. Only data published within this timeframe will be selected. Note that DDS\_TIMESTAMP\_INVALID is also accepted as a lower or upper timeframe limit. The amount of selected data can be further reduced by the resource\_limits parameter. This QosPolicy allows to set a limit on the number of samples, instances and samples per instance that are to be received.

# Return Code

When the operation returns:

• DDS\_RETCODE\_OK - the historical data is received.
• DDS\_RETCODE\_ERROR - an internal error occurred.
• DDS\_RETCODE\_BAD\_PARAMETER - any of the parameters is invalid, including resource\_limits that do not meet constraints set on the DataReader.
• RETCODE\_PRECONDITION\_NOT\_MET - No Durability service is available, or can happen when requesting conditional alignment on non-volatile readers or a historical data request is already in progress or complete.
• DDS\_RETCODE\_ALREADY\_DELETED - the DataReader is already deleted.
• DDS\_RETCODE\_NOT\_ENABLED - the DataReader is not enabled.
• DDS\_RETCODE\_TIMEOUT - not all data is received before max\_wait elapsed.

# 3.5.2.44 Class SPACE\_FooDataReader

The pre-processor generates from IDL type descriptions the application &lt;NameSpace&gt;\_&lt;type&gt;DataReader classes. For each application data type that is used as DDS\_Topic data type, a typed class &lt;NameSpace&gt;\_&lt;type&gt;DataReader is derived from the DDS\_DataReader class. In this paragraph, the class SPACE\_FooDataReader describes the operations of these derived &lt;NameSpace&gt;\_&lt;type&gt;DataReader classes as an example for the fictional application type Foo (defined in the module SPACE).

For instance, for an application, the definitions are located in the Space.idl file. The pre-processor will generate a Space.h include file.

# State masks

A SPACE\_FooDataReader refers to exactly one DDS\_TopicDescription (either a DDS\_Topic, a DDS\_ContentFilteredTopic or a DDS\_MultiTopic) that identifies the data to be read. Therefore it refers to exactly one data type. The DDS\_Topic must exist prior to the SPACE\_FooDataReader creation. The SPACE\_FooDataReader may give access to several instances of the data type, w h i c h a r e d i s t i n g u i s h e d f r o m e a c h o t h e r b y t h e i r k e y. T h e SPACE\_FooDataReader is attached to exactly one DDS\_Subscriber which acts as a factory for it.

The interface description of this class is as follows:
```c
/*
 * interface SPACE_FooDataReader
 */
/*
 * inherited from class DDS_Entity
 */
/* DDS_StatusCondition
 * SPACE_FooDataReader_get_statuscondition
 * (SPACE_FooDataReader _this);
 */
/* DDS_StatusMask
 * SPACE_FooDataReader_get_status_changes
 * (SPACE_FooDataReader _this);
 */
/* DDS_ReturnCode_t
 * SPACE_FooDataReader_enable
 * (SPACE_FooDataReader _this);
 */
/*
 * inherited from class DDS_DataReader
 */
/* DDS_ReadCondition
 * SPACE_FooDataReader_create_readcondition
 * (SPACE_FooDataReader _this,
 * const DDS_SampleStateMask sample_states,
 * const DDS_ViewStateMask view_states,
 * const DDS_InstanceStateMask instance_states);
 */
/* DDS_QueryCondition
 * SPACE_FooDataReader_create_querycondition
 * (SPACE_FooDataReader _this,
 * const DDS_SampleStateMask sample_states,
 * const DDS_ViewStateMask view_states,
```

```c
* const DDS_InstanceStateMask instance_states,
* const DDS_char *query_expression,
* const DDS_StringSeq *query_parameters);
*/

/* DDS_ReturnCode_t
* SPACE_FooDataReader_delete_readcondition
* (SPACE_FooDataReader _this,
* const DDS_ReadCondition a_condition);
*/

/* DDS_ReturnCode_t
* SPACE_FooDataReader_delete_contained_entities
* (SPACE_FooDataReader _this);
*/

/* DDS_ReturnCode_t
* SPACE_FooDataReader_set_qos
* (SPACE_FooDataReader _this,
* const DDS_DataReaderQos *qos);
*/

/* DDS_ReturnCode_t
* SPACE_FooDataReader_get_qos
* (SPACE_FooDataReader _this,
* SPACE_FooDataReaderQos *qos);
*/

/* DDS_ReturnCode_t
* SPACE_FooDataReader_set_listener
* (SPACE_FooDataReader _this,
* const struct DDS_DataReaderListener *a_listener,
* const DDS_StatusMask mask);
*/

/* struct SPACE_FooDataReaderListener
* SPACE_FooDataReader_get_listener
* (SPACE_FooDataReader _this);
*/

/* DDS_TopicDescription
* SPACE_FooDataReader_get_topicdescription
* (SPACE_FooDataReader _this);
*/

/* DDS_Subscriber
* SPACE_FooDataReader_get_subscriber
* (SPACE_FooDataReader _this);
```

```c
/* DDS_ReturnCode_t
* SPACE_FooDataReader_get_sample_rejected_status
* (SPACE_FooDataReader _this,
* DDS_SampleRejectedStatus *status);
*/

/* DDS_ReturnCode_t
* SPACE_FooDataReader_get_liveliness_changed_status
* (SPACE_FooDataReader _this,
* DDS_LivelinessChangedStatus *status);
*/

/* DDS_ReturnCode_t
* SPACE_FooDataReader_get_requested_deadline_missed_status
* (SPACE_FooDataReader _this,
* DDS_RequestedDeadlineMissedStatus *status);
*/

/* DDS_ReturnCode_t
* SPACE_FooDataReader_get_requested_incompatible_qos_status
* (SPACE_FooDataReader _this,
* DDS_RequestedIncompatibleQosStatus *status);
*/

/* DDS_ReturnCode_t
* SPACE_FooDataReader_get Subscription_matched_status
* (SPACE_FooDataReader _this,
* DDS_SubscriptionMatchedStatus *status);
*/

/* DDS_ReturnCode_t
* SPACE_FooDataReader_get_sample_lost_status
* (SPACE_FooDataReader _this,
* DDS_SampleLostStatus *status);
*/

/* DDS_ReturnCode_t
* SPACE_FooDataReader_wait_for_historical_data
* (SPACE_FooDataReader _this,
* const DDS_Duration_t *max_wait);
*/

/* DDS_ReturnCode_t
* SPACE_FooDataReader_get_matched_publications
* (SPACE_FooDataReader _this,
* DDS_InstanceHandleSeq *publication_handles);
*/

/* DDS_ReturnCode_t
* SPACE_FooDataReader_get_matched_publication_data
```

```c
* (SPACE_FooDataReader _this,
* DDS_PublicationBuiltinTopicData *publication_data,
* const DDS_InstanceHandle_t publication_handle);
*/
/*
* implemented API operations
*/
DDS_ReturnCode_t
SPACE_FooDataReader_read
(SPACE_FooDataReader _this,
DDS_sequence_Foo *data_values,
DDS_SampleInfoSeq *info_seq,
const DDS_long max_samples,
const DDS_SampleStateMask sample_states,
const DDS_ViewStateMask view_states,
const DDS_InstanceStateMask instance_states);
DDS_ReturnCode_t
SPACE_FooDataReader_take
(SPACE_FooDataReader _this,
DDS_sequence_Foo *data_values,
DDS_SampleInfoSeq *info_seq,
const DDS_long max_samples,
const DDS_SampleStateMask sample_states,
const DDS_ViewStateMask view_states,
const DDS_InstanceStateMask instance_states);
DDS_ReturnCode_t
SPACE_FooDataReader_read_w_condition
(SPACE_FooDataReader _this,
DDS_sequence_Foo *data_values,
DDS_SampleInfoSeq *info_seq,
const DDS_long max_samples,
const DDS_ReadCondition a_condition);
DDS_ReturnCode_t
SPACE_FooDataReader_take_w_condition
(SPACE_FooDataReader _this,
DDS_sequence_Foo *data_values,
DDS_SampleInfoSeq *info_seq,
const DDS_long max_samples,
const DDS_ReadCondition a_condition);
DDS_ReturnCode_t
SPACE_FooDataReader_read_next_sample
(SPACE_FooDataReader _this,
Foo *data_values,
DDS_SampleInfo *sample_info);
DDS_ReturnCode_t
SPACE_FooDataReader_take_next_sample
(SPACE_FooDataReader _this,
Foo *data_values,
DDS_SampleInfo *sample_info);
DDS_ReturnCode_t
```

```c
SPACE_FooDataReader_read_instance
(SPACE_FooDataReader _this,
DDS_sequence_Foo *data_values,
DDS_SampleInfoSeq *info_seq,
const DDS_long max_samples,
const DDS_InstanceHandle_t a_handle,
const DDS_SampleStateMask sample_states,
const DDS_ViewStateMask view_states,
const DDS_InstanceStateMask instance_states);
DDS_ReturnCode_t
SPACE_FooDataReader_take_instance
(SPACE_FooDataReader _this,
DDS_sequence_Foo *data_values,
DDS_SampleInfoSeq *info_seq,
const DDS_long max_samples,
const DDS_InstanceHandle_t a_handle,
const DDS_SampleStateMask sample_states,
const DDS_ViewStateMask view_states,
const DDS_InstanceStateMask instance_states);
DDS_ReturnCode_t
SPACE_FooDataReader_read_next_instance
(SPACE_FooDataReader _this,
DDS_sequence_Foo *data_values,
DDS_SampleInfoSeq *info_seq,
const DDS_long max_samples,
const DDS_InstanceHandle_t a_handle,
const DDS_SampleStateMask sample_states,
const DDS_ViewStateMask view_states,
const DDS_InstanceStateMask instance_states);
DDS_ReturnCode_t
SPACE_FooDataReader_take_next_instance
(SPACE_FooDataReader _this,
DDS_sequence_Foo *data_values,
DDS_SampleInfoSeq *info_seq,
const DDS_long max_samples,
const DDS_InstanceHandle_t a_handle,
const DDS_SampleStateMask sample_states,
const DDS_ViewStateMask view_states,
const DDS_InstanceStateMask instance_states);
DDS_ReturnCode_t
SPACE_FooDataReader_read_next_instance_w_condition
(SPACE_FooDataReader _this,
DDS_sequence_Foo *data_values,
DDS_SampleInfoSeq *info_seq,
const DDS_long max_samples,
const DDS_InstanceHandle_t a_handle,
const DDS_ReadCondition a_condition);
DDS_ReturnCode_t
SPACE_FooDataReader_take_next_instance_w_condition
(SPACE_FooDataReader _this,
```

```c
DDS_sequence_Foo *data_values,
DDS_SampleInfoSeq *info_seq,
const DDS_long max_samples,
const DDS_InstanceHandle_t a_handle,
const DDS_ReadCondition a_condition);
DDS_ReturnCode_t
SPACE_FoodataReader_return_loan
(SPACE_FoodataReader _this,
DDS_sequence_Foo *data_values,
DDS_SampleInfoSeq *info_seq);
DDS_ReturnCode_t
SPACE_FoodataReader_get_key_value
(SPACE_FoodataReader _this,
Foo *key_holder,
const DDS_InstanceHandle_t handle);
DDS_InstanceHandle_t
SPACE_FoodataReader_lookup_instance
(SPACE_FoodataReader _this,
Foo *instance_data);
```

The next paragraphs describe the usage of all SPACE\_FooDataReader operations. The inherited operations are listed but not fully described because they are not implemented in this class. The full description of these operations is given in the classes from which they are inherited.

# 3.5.2.45 SPACE\_FooDataReader\_create\_querycondition (inherited)

This operation is inherited and therefore not described here. See the class DDS\_DataReader for further explanation.

# Synopsis

```c
#include &lt;Space.h&gt;
DDS_QueryCondition
SPACE_FooDataReader_create_querycondition
(SPACE_FooDataReader _this,
const DDS_SampleStateMask sample_states,
const DDS_ViewStateMask view_states,
const DDS_InstanceStateMask instance_states,
const DDS_char *query_expression,
const DDS_StringSeq *query_parameters);
```

# 3.5.2.46 SPACE\_FooDataReader\_create\_readcondition (inherited)

This operation is inherited and therefore not described here. See the class DDS\_DataReader for further explanation.

# Synopsis

```c
#include &lt;Space.h&gt;
DDS_ReadCondition
```

```txt
SPACE_FooDataReader_create_readcondition
(SPACE_FooDataReader _this,
    const DDS_SampleStateMask sample_states,
    const DDS_ViewStateMask view_states,
    const DDS_InstanceStateMask instance_states);
```

# 3.5.2.47 SPACE\_FooDataReader\_delete\_contained\_entities (inherited)

This operation is inherited and therefore not described here. See the class DDS\_DataReader for further explanation.

# Synopsis

```c
#include &lt;Space.h&gt;
DDS_ReturnCode_t
SPACE_FooDataReader_delete_contained_entities
(SPACE_FooDataReader _this);
```

# 3.5.2.48 SPACE\_FooDataReader\_delete\_readcondition (inherited)

This operation is inherited and therefore not described here. See the class DDS\_DataReader for further explanation.

# Synopsis

```c
#include &lt;Space.h&gt;
DDS_ReturnCode_t
SPACE_FooDataReader_delete_readcondition
(SPACE_FooDataReader _this,
const DDS_ReadCondition a_condition);
```

# 3.5.2.49 SPACE\_FooDataReader\_enable (inherited)

This operation is inherited and therefore not described here. See the class DDS\_Entity for further explanation.

# Synopsis

```c
#include &lt;Space.h&gt;
DDS_ReturnCode_t
SPACE_FooDataReader_enable
(SPACE_FooDataReader _this);
```

# 3.5.2.50 SPACE\_FooDataReader\_get\_key\_value

# Synopsis

```c
#include &lt;Space.h&gt;
DDS_ReturnCode_t
SPACE_FooDataReader_get_key_value
(SPACE_FooDataReader _this,
Foo *key_holder,
const DDS_InstanceHandle_t handle);
```

# Description

This operation retrieves the key value of a specific instance.

# Parameters

in SPACE\_FooDataReader \_this - the SPACE\_FooDataReader object on which the operation is operated.

inout Foo \*key\_holder - the sample in which the key values are stored.

in const DDS\_InstanceHandle\_t handle - the handle to the instance from which to get the key value.

# Return Value

D D S \_ R e t u r n C o d e \_ t - P o s s i b l e r e t u r n c o d e s o f t h e o p e r a t i o n a r e : DDS\_RETCODE\_OK, DDS\_RETCODE\_ERROR, DDS\_RETCODE\_ILLEGAL\_ OPERATION, DDS\_RETCODE\_BAD\_PARAMETER, DDS\_RETCODE ALREADY\_DELETED, DDS\_RETCODE\_OUT\_OF\_RESOURCES, DDS\_RETCODE\_ NOT\_ENABLED or DDS\_RETCODE\_PRECONDITION\_NOT\_MET.

# Detailed Description

This operation retrieves the key value of the instance pointed to by instance\_handle. When the operation is called with an DDS\_HANDLE\_NIL h a n d l e v a l u e a s a n i n s t a n c e \_ h a n d l e , t h e o p e r a t i o n w i l l r e t u r n DDS\_RETCODE\_BAD\_PARAMETER. The operation will only fill the fields that form the key inside the key\_holder instance. This means that the non-key fields are not applicable and may contain garbage.

The operation must only be called on registered instances. Otherwise the operation returns the error DDS\_RETCODE\_PRECONDITION\_NOT\_MET.

# Return Code

When the operation returns:

• DDS\_RETCODE\_OK - the key\_holder instance contains the key values of the instance.
• DDS\_RETCODE\_ERROR - an internal error has occurred.
• DDS\_RETCODE\_ILLEGAL\_OPERATION - the operation is invoked on an inappropriate object.
• DDS\_RETCODE\_BAD\_PARAMETER - handle is not a valid handle or key\_holder is not a valid pointer.
• DDS\_RETCODE\_ALREADY\_DELETED - the SPACE\_FooDataReader has already been deleted.

• DDS\_RETCODE\_OUT\_OF\_RESOURCES - the Data Distribution Service ran out of resources to complete this operation.
• DDS\_RETCODE\_NOT\_ENABLED - the SPACE\_FooDataReader is not enabled.
• DDS\_RETCODE\_PRECONDITION\_NOT\_MET - this instance is not registered.

# 3.5.2.51 SPACE\_FooDataReader\_get\_listener (inherited)

This operation is inherited and therefore not described here. See the class DDS\_DataReader for further explanation.

# Synopsis

```c
#include &lt;Space.h&gt;
struct SPACE_FooDataReaderListener
SPACE_FooDataReader_get_listener
(SPACE_FooDataReader_this);
```

# 3.5.2.52 SPACE\_FooDataReader\_get\_liveliness\_changed\_status (inherited)

This operation is inherited and therefore not described here. See the class DDS\_DataReader for further explanation.

# Synopsis

```c
#include &lt;Space.h&gt;
DDS_ReturnCode_t
SPACE_FooDataReader_get_liveliness_changed_status
(SPACE_FooDataReader _this,
DDS_LivelinessChangedStatus *status);
```

# 3.5.2.53 SPACE\_FooDataReader\_get\_matched\_publication\_data (inherited)

This operation is inherited and therefore not described here. See the class DDS\_DataReader for further explanation.

# Synopsis

```c
#include &lt;Space.h&gt;
DDS_ReturnCode_t
SPACE_FooDataReader_get_matched_publication_data
(SPACE_FooDataReader_this,
DDS_PublicationBuiltinTopicData *publication_data,
const DDS_InstanceHandle_t publication_handle);
```

# 3.5.2.54 SPACE\_FooDataReader\_get\_matched\_publications (inherited)

This operation is inherited and therefore not described here. See the class DDS\_DataReader for further explanation.

# Synopsis

```c
#include &lt;Space.h&gt;
DDS_ReturnCode_t
SPACE_FooDataReader_get_matched_publications
(SPACE_FooDataReader_this,
DDS_InstanceHandleSeq *publication_handles);
```

# 3.5.2.55 SPACE\_FooDataReader\_get\_qos (inherited)

This operation is inherited and therefore not described here. See the class DDS\_DataReader for further explanation.

# Synopsis

```c
#include &lt;Space.h&gt;
DDS_ReturnCode_t
SPACE_FooDataReader_get_qos
(SPACE_FooDataReader _this,
DDS_DataReaderQos *qos);
```

# 3.5.2.56 SPACE\_FooDataReader\_get\_requested\_deadline\_missed\_status (inherited)

This operation is inherited and therefore not described here. See the class DDS\_DataReader for further explanation.

# Synopsis

```c
#include &lt;Space.h&gt;
DDS_ReturnCode_t
SPACE_FooDataReader_get_requested_deadline_missed_status
(SPACE_FooDataReader _this,
DDS_RequestedDeadlineMissedStatus *status);
```

# 3.5.2.57 SPACE\_FooDataReader\_get\_requested\_incompatible\_qos\_status (inherited)

This operation is inherited and therefore not described here. See the class DDS\_DataReader for further explanation.

# Synopsis

```c
#include &lt;Space.h&gt;
DDS_ReturnCode_t
SPACE_FooDataReader_get_requested_incompatible_qos_status
(SPACE_FooDataReader_this,
DDS_RequestedIncompatibleQosStatus *status);
```

# 3.5.2.58 SPACE\_FooDataReader\_get\_sample\_lost\_status (inherited)

This operation is inherited and therefore not described here. See the class DDS\_DataReader for further explanation.

# Synopsis

```c
#include &lt;Space.h&gt;
DDS_ReturnCode_t
SPACE_FooDataReader_get_sample_lost_status
(SPACE_FooDataReader_this,
DDS_SampleLostStatus *status);
```

# 3.5.2.59 SPACE\_FooDataReader\_get\_sample\_rejected\_status (inherited)

This operation is inherited and therefore not described here. See the class DDS\_DataReader for further explanation.

# Synopsis

```c
#include &lt;Space.h&gt;
DDS_ReturnCode_t
SPACE_FooDataReader_get_sample_rejected_status
(SPACE_FooDataReader_this,
DDS_SampleRejectedStatus *status);
```

# 3.5.2.60 SPACE\_FooDataReader\_get\_status\_changes (inherited)

This operation is inherited and therefore not described here. See the class DDS\_Entity for further explanation.

# Synopsis

```c
#include &lt;Space.h&gt;
DDS_StatusMask
SPACE_FoodataReader_get_status_changes
(SPACE_FoodataReader_this);
```

# 3.5.2.61 SPACE\_FooDataReader\_get\_statuscondition (inherited)

This operation is inherited and therefore not described here. See the class DDS\_Entity for further explanation.

# Synopsis

```c
#include &lt;Space.h&gt;
DDS_StatusCondition
SPACE_FooDataReader_get_statuscondition
(SPACE_FooDataReader _this);
```

# 3.5.2.62 SPACE\_FooDataReader\_get\_subscriber (inherited)

This operation is inherited and therefore not described here. See the class DDS\_DataReader for further explanation.

# Synopsis

```c
#include &lt;Space.h&gt;
DDS_Subscriber
SPACE_FoodDataReader_get_subscriber
(SPACE_FoodDataReader_this);
```

# 3.5.2.63 SPACE\_FooDataReader\_get\_subscription\_matched\_status (inherited)

This operation is inherited and therefore not described here. See the class DDS\_DataReader for further explanation.

# Synopsis

```c
#include &lt;Space.h&gt;
DDS_ReturnCode_t
SPACE_FooDataReader_get_subscription_matched_status
(SPACE_FooDataReader _this,
DDS_SubscriptionMatchedStatus *status);
```

# 3.5.2.64 SPACE\_FooDataReader\_get\_topicdescription (inherited)

This operation is inherited and therefore not described here. See the class DDS\_DataReader for further explanation.

# Synopsis

```c
#include &lt;Space.h&gt;
DDS_TopicDescription
SPACE_FooDataReader_get_topicdescription
(SPACE_FooDataReader_this);
```

# 3.5.2.65 SPACE\_FooDataReader\_lookup\_instance

# Synopsis

```c
#include &lt;Space.h&gt;
DDS_InstanceHandle_t
SPACE_FooDataReader_lookup_instance
(SPACE_FooDataReader _this,
Foo *instance_data);
```

# Description

This operation returns the value of the instance handle which corresponds to the instance\_data.

# Parameters

in SPACE\_FooDataReader \_this - the SPACE\_FooDataReader object on which the operation is operated.

in Foo \*instance\_data - the instance for which the corresponding instance handle needs to be looked up.

# Return Value

DDS\_InstanceHandle\_t - Result value is the instance handle which corresponds to the instance\_data.

# Detailed Description

This operation returns the value of the instance handle which corresponds to the instance\_data. The instance handle can be used in read operations that operate on a specific instance. Note that DDS\_DataReader instance handles are local, and are not interchangeable with DDS\_DataWriter instance handles nor with instance handles of an other DDS\_DataReader. If the DDS\_DataReader is already deleted, the handle value DDS\_HANDLE\_NIL is returned.

# 3.5.2.66 SPACE\_FooDataReader\_read

# Synopsis

```c
#include &lt;Space.h&gt;
DDS_ReturnCode_t
SPACE_FooDataReader_read
(SPACE_FooDataReader _this,
DDS_sequence_Foo *data_values,
DDS_SampleInfoSeq *info_seq,
const DDS_long max_samples,
const DDS_SampleStateMask sample_states,
const DDS_ViewStateMask view_states,
const DDS_InstanceStateMask instance_states);
```

# Description

This operation reads a sequence of Foo samples from the SPACE\_FooDataReader.

# Parameters

in SPACE\_FooDataReader \_this - the SPACE\_FooDataReader object on which the operation is operated.

inout DDS\_sequence\_Foo \*data\_values - the returned sample data sequence. data\_values is also used as an input to control the behaviour of this operation.

inout DDS\_SampleInfoSeq \*info\_seq - the returned DDS\_SampleInfo structure sequence. info\_seq is also used as an input to control the behaviour of this operation.

in const DDS\_long max\_samples - the maximum number of samples that is returned.

in const DDS\_SampleStateMask sample\_states - a mask, which selects only those samples with the desired sample states.

in const DDS\_ViewStateMask view\_states - a mask, which selects only those samples with the desired view states.

in const DDS\_InstanceStateMask instance\_states - a mask, which selects only those samples with the desired instance states.

# Return Value

D D S \_ R e t u r n C o d e \_ t - P o s s i b l e r e t u r n c o d e s o f t h e o p e r a t i o n a r e : DDS\_RETCODE\_OK, DDS\_RETCODE\_ERROR, DDS\_RETCODE\_ILLEGAL OPERATION, DDS\_RETCODE\_BAD\_PARAMETER, DDS\_RETCODE ALREADY\_DELETED, DDS\_RETCODE\_OUT\_OF\_RESOURCES, DDS\_RETCODE\_ NOT\_ENABLED, DDS\_RETCODE\_PRECONDITION\_NOT\_MET or DDS\_RETCODE\_NO\_DATA.

# Detailed Description

This operation reads a sequence of Foo samples from the SPACE\_FooDataReader. The data is returned by the parameters data\_values and info\_seq. The number of samples that is returned is limited by the parameter max\_samples. This operation is part of the specialized class which is generated for the particular application data type (in this case type Foo) that is being read. If the SPACE\_FooDataReader has no samples that meet the constraints, the return value is DDS\_RETCODE\_NO\_DATA.

# State masks

The SPACE\_FooDataReader\_read operation depends on a selection of the samples by using three masks:

• sample\_states is the mask, which selects only those samples with the desired sample states DDS\_READ\_SAMPLE\_STATE, DDS\_NOT\_READ\_SAMPLE\_STATE or both

• view\_states is the mask, which selects only those samples with the desired view states DDS\_NEW\_VIEW\_STATE, DDS\_NOT\_NEW\_VIEW\_STATE or both

• instance\_states is the mask, which selects only those samples with the desired instance states DDS\_ALIVE\_INSTANCE\_STATE, DDS\_NOT\_ALIVE\_ DISPOSED\_INSTANCE\_STATE, DDS\_NOT\_ALIVE\_NO\_WRITERS\_INSTANCE\_ STATE or a combination of these.

# Destination Order

In any case, the relative order between the samples of one instance is consistent with the DDS\_DestinationOrderQosPolicy of the DDS\_Subscriber.

When the DDS\_DestinationOrderQosPolicy k i n d i s DDS\_BY\_RECEPTION\_TIMESTAMP\_DESTINATIONORDER\_QOS, the samples belonging to the same instances will appear in the relative order in which they were received (FIFO)

When the DDS\_DestinationOrderQosPolicy k i n d i s DDS\_BY\_SOURCE\_TIMESTAMP\_DESTINATIONORDER\_QOS, the samples belonging to the same instances will appear in the relative order implied by the source\_timestamp.

# Data sample

In addition to the sample sequence (data\_values), the operation also returns a sequence of DDS\_SampleInfo structures with the parameter info\_seq. The info\_seq structures and data\_values also determine the behaviour of this operation.

# Resource control

The initial (input) properties of the data\_values and info\_seq sequences determine the precise behaviour of the SPACE\_FooDataReader\_read operation. The sequences are modelled as having three properties: the current-length (\_length), the maximum length (\_maximum), and whether or not the sequence container owns the memory of the elements within (\_release).

The initial (input) values of the \_length, \_maximum, and \_release properties for the data\_values and info\_seq sequences govern the behaviour of the SPACE\_FooDataReader\_read operation as specified by the following rules:

• The values of \_length, \_maximum, and \_release for the two sequences must be identical. Otherwise SPACE\_FooDataReader\_read returns DDS\_RETCODE\_PRECONDITION\_NOT\_MET
• On successful output, the values of \_length, \_maximum, and \_release are the same for both sequences
• If the input \_maximum==0, the data\_values and info\_seq sequences are filled with elements that are “loaned” by the SPACE\_FooDataReader. On output, \_release is FALSE, \_length is set to the number of values returned,

and \_maximum is set to a value verifying \_maximum>=\_length. In this case the application will need to “return the loan” to the Data Distribution Service using the SPACE\_FooDataReader\_return\_loan operation

• If the input \_maximum>0 and the input \_release==FALSE, the SPACE\_FooDataReader\_read operation will fail and returns DDS\_RETCODE\_PRECONDITION\_NOT\_MET. This avoids the potential hard-to-detect memory leaks caused by an application forgetting to “return the loan”
• If input \_maximum>0 and the input \_release==TRUE, the SPACE\_FooDataReader\_read operation will copy the Foo samples and info\_seq values into the elements already inside the sequences. On output, \_release is TRUE, \_length is set to the number of values copied, and \_maximum will remain unchanged. The application can control where the copy is placed and the application does not need to “return the loan”. The number of samples copied depends on the relative values of \_maximum and max\_samples:

\- If \_maximum==DDS\_LENGTH\_UNLIMITED, at most \_maximum values are copied. The use of this variant lets the application limit the number of samples returned to what the sequence can accommodate;

\- If max\_samples&lt;=\_maximum, at most max\_samples values are copied. The use of this variant lets the application limit the number of samples returned to fewer than what the sequence can accommodate;

\- If max\_samples&gt;\_maximum, the SPACE\_FooDataReader\_read operation will fail and returns DDS\_RETCODE\_PRECONDITION\_NOT\_MET. This avoids the potential confusion where the application expects to be able to access up to max\_samples, but that number can never be returned, even if they are available in the SPACE\_FooDataReader, because the output sequence cannot accommodate them.

# Buffer Loan

As described above, upon return the data\_values and info\_seq sequences may contain elements “loaned” from the Data Distribution Service. If this is the case, the application will need to use the SPACE\_FooDataReader\_return\_loan operation to return the “loan” once it is no longer using the data in the sequence. Upon return from SPACE\_FooDataReader\_return\_loan, the sequence has \_maximum==0 and \_release==FALSE.

The application can determine whether it is necessary to “return the loan” or not, based on the state of the sequences, when the SPACE\_FooDataReader\_read operation was called, or by accessing the “\_release” property. However, in many cases it may be simpler to always call SPACE\_FooDataReader\_return\_loan, as this operation is harmless (i.e. leaves all elements unchanged) if the sequence does not have a loan.

To avoid potential memory leaks, it is not allowed to change the length of the data\_values and info\_seq structures for which \_release==FALSE. Furthermore, deleting a sequence for which \_release==FALSE is considered to be an error except when the sequence is empty.

# Data Sequence

On output, the sequence of data values and the sequence of DDS\_SampleInfo structures are of the same length and are in an one-to-one correspondence. Each D D S \_ S a m p l e I n f o s t r u c t u r e s p r o v i d e s i n f o r m a t i o n , s u c h a s t h e source\_timestamp, the sample\_state, view\_state, and instance\_state, etc., about the matching sample.

Some elements in the returned sequence may not have valid data: the valid\_data field in the DDS\_SampleInfo indicates whether the corresponding data value contains any meaningful data. If not, the data value is just a ‘dummy’ sample for which only the keyfields have been assigned. It is used to accompany the DDS\_SampleInfo that communicates a change in the instance\_state of an instance for which there is no ‘real’ sample available.

For example, when an application always ‘takes’ all available samples of a particular instance, there is no sample available to report the disposal of that instance. In such a case the DDS\_DataReader will insert a dummy sample into the data\_values sequence to accompany the DDS\_SampleInfo element in the info\_seq sequence that communicates the disposal of the instance.

The act of reading a sample sets its sample\_state to DDS\_READ\_SAMPLE\_STATE. If the sample belongs to the most recent generation of the instance, it also sets the view\_state of the instance to DDS\_NOT\_NEW\_VIEW\_STATE. It does not affect the instance\_state of the instance.

# Return Code

When the operation returns:

• DDS\_RETCODE\_OK - a sequence of data values is available.
• DDS\_RETCODE\_ERROR - an internal error has occurred.
• DDS\_RETCODE\_ILLEGAL\_OPERATION - the operation is invoked on an inappropriate object.
• DDS\_RETCODE\_BAD\_PARAMETER - either or both of data\_values or info\_seq is an invalid pointer.

• DDS\_RETCODE\_ALREADY\_DELETED - the SPACE\_FooDataReader has already been deleted.
• DDS\_RETCODE\_OUT\_OF\_RESOURCES - the Data Distribution Service ran out of resources to complete this operation.
• DDS\_RETCODE\_NOT\_ENABLED - the SPACE\_FooDataReader is not enabled.
• DDS\_RETCODE\_PRECONDITION\_NOT\_MET - one of the following is true:

\- the max\_samples>\_maximum and max\_samples is not DDS\_LENGTH\_UNLIMITED.

\- one or more values of \_length, \_maximum, and \_release for the two sequences are not identical.

\- the \_maximum>0 and the \_release==FALSE.

• DDS\_RETCODE\_NO\_DATA - no samples that meet the constraints are available.

# 3.5.2.67 SPACE\_FooDataReader\_read\_instance

# Synopsis

```c
#include &lt;Space.h&gt;
DDS_ReturnCode_t
SPACE_FooDataReader_read_instance
(SPACE_FooDataReader _this,
DDS_sequence_Foo *data_values,
DDS_SampleInfoSeq *info_seq,
const DDS_long max_samples,
const DDS_InstanceHandle_t a_handle,
const DDS_SampleStateMask sample_states,
const DDS_ViewStateMask view_states,
const DDS_InstanceStateMask instance_states);
```

# Description

This operation reads a sequence of Foo samples of a single instance from the SPACE\_FooDataReader.

# Parameters

in SPACE\_FooDataReader \_this - the SPACE\_FooDataReader object on which the operation is operated.

inout DDS\_sequence\_Foo \*data\_values - the returned sample data sequence. data\_values is also used as an input to control the behaviour of this operation.

inout DDS\_SampleInfoSeq \*info\_seq - the returned DDS\_SampleInfo structure sequence. info\_seq is also used as an input to control the behaviour of this operation.

in const DDS\_long max\_samples - the maximum number of samples that is returned.
in const DDS\_InstanceHandle\_t a\_handle - the single instance, the samples belong to.
in const DDS\_SampleStateMask sample\_states - a mask, which selects only those samples with the desired sample states.
in const DDS\_ViewStateMask view\_states - a mask, which selects only those samples with the desired view states.
in const DDS\_InstanceStateMask instance\_states - a mask, which selects only those samples with the desired instance states.

# Return Value

```txt
DDS_ReturnCode_t - Possible return codes of the operation are: DDS_RETCODE_OK, DDS_RETCODE_ERROR, DDS_RETCODE_ILLEGAL_OPERATION, DDS_RETCODE_BAD_PARAMETER, DDS_RETCODE_ALREADY_DELETED, DDS_RETCODE_OUT_OF_RESOURCES, DDS_RETCODE_NOT_ENABLED, DDS_RETCODE_PRECONDITION_NOT_MET or DDS_RETCODE_NO_DATA.
```

# Detailed Description

This operation reads a sequence of Foo samples of a single instance from the S P AC E \_ F o o Da t a R e a d er. T h e b e h a v i o u r i s i d e n t ic a l t o SPACE\_FooDataReader\_read except for that all samples returned belong to the single specified instance whose handle is a\_handle. Upon successful return, the data collection will contain samples all belonging to the same instance. The data is returned by the parameters data\_values and info\_seq. The corresponding DDS\_SampleInfo.instance\_handle in info\_seq will have the value of a\_handle. The DDS\_DataReader will check that each sample belongs to the specified instance (indicated by a\_handle) otherwise it will not place the sample in the returned collection.

# Return Code

When the operation returns:

• DDS\_RETCODE\_OK - a sequence of data values is available.
• DDS\_RETCODE\_ERROR - an internal error has occurred.
• DDS\_RETCODE\_ILLEGAL\_OPERATION - the operation is invoked on an inappropriate object.
• DDS\_RETCODE\_BAD\_PARAMETER - either or both of data\_values or info\_seq is an invalid pointer or a\_handle is not a valid handle.

• DDS\_RETCODE\_ALREADY\_DELETED - the SPACE\_FooDataReader has already been deleted.
• DDS\_RETCODE\_OUT\_OF\_RESOURCES - the Data Distribution Service ran out of resources to complete this operation.
• DDS\_RETCODE\_NOT\_ENABLED - the SPACE\_FooDataReader is not enabled.
• DDS\_RETCODE\_PRECONDITION\_NOT\_MET - one of the following is true:

\- the max\_samples>\_maximum and max\_samples is not DDS\_LENGTH\_UNLIMITED.

\- one or more values of \_length, \_maximum, and \_release for the two sequences are not identical.

\- the \_maximum>0 and the \_release==FALSE.

\- the handle ==DDS\_HANDLE\_NIL.

\- the handle has not been registered with this DataReader.

• DDS\_RETCODE\_NO\_DATA - no samples that meet the constraints are available.

# 3.5.2.68 SPACE\_FooDataReader\_read\_next\_instance

# Synopsis

```c
#include &lt;Space.h&gt;
DDS_ReturnCode_t
SPACE_FooDataReader_read_next_instance
(SPACE_FooDataReader _this,
DDS_sequence_Foo *data_values,
DDS_SampleInfoSeq *info_seq,
const DDS_long max_samples,
const DDS_InstanceHandle_t a_handle,
const DDS_SampleStateMask sample_states,
const DDS_ViewStateMask view_states,
const DDS_InstanceStateMask instance_states);
```

# Description

This operation reads a sequence of Foo samples of the next single instance from the SPACE\_FooDataReader.

# Parameters

in SPACE\_FooDataReader \_this - the SPACE\_FooDataReader object on which the operation is operated.

inout DDS\_sequence\_Foo \*data\_values - the returned sample data sequence. data\_values is also used as an input to control the behaviour of this operation.

inout DDS\_SampleInfoSeq \*info\_seq - the returned DDS\_SampleInfo structure sequence. info\_seq is also used as an input to control the behaviour of this operation.
in const DDS\_long max\_samples - the maximum number of samples that is returned.
in const DDS\_InstanceHandle\_t a\_handle - the current single instance, the returned samples belong to the next single instance.
in const DDS\_SampleStateMask sample\_states - a mask, which selects only those samples with the desired sample states.
in const DDS\_ViewStateMask view\_states - a mask, which selects only those samples with the desired view states.
in const DDS\_InstanceStateMask instance\_states - a mask, which selects only those samples with the desired instance states.

# Return Value

```txt
DDS_ReturnCode_t - Possible return codes of the operation are: DDS_RETCODE_OK, DDS_RETCODE_ERROR, DDS_RETCODE_ILLEGAL_OPERATION, DDS_RETCODE_BAD_PARAMETER, DDS_RETCODE_ALREADY_DELETED, DDS_RETCODE_OUT_OF_RESOURCES, DDS_RETCODE_NOT_ENABLED, DDS_RETCODE_PRECONDITION_NOT_MET or DDS_RETCODE_NO_DATA.
```

# Detailed Description

This operation reads a sequence of Foo samples of a single instance from the SPACE\_FooDataReader. The behaviour i s s i m i l a r t o SPACE\_FooDataReader\_read\_instance (all samples returned belong to a single instance) except that the actual instance is not directly specified. Rather the samples will all belong to the ‘next’ instance with instance\_handle ‘greater’ (according to some internal-defined order) than a\_handle, that has available samples. The data is returned by the parameters data\_values and info\_seq. The corresponding DDS\_SampleInfo.instance\_handle in info\_seq will has the value of the next instance with respect to a\_handle.

# Instance Order

The internal-defined order is not important and is implementation specific. The important thing is that, according to the Data Distribution Service, all instances are ordered relative to each other. This ordering is between the instances, that is, it does not depend on the actual samples received. For the purposes of this explanation it is ‘as if’ each instance handle was represented as a unique integer.

The behaviour of SPACE\_FooDataReader\_read\_next\_instance is ‘as if’ the DDS\_DataReader invoked SPACE\_FooDataReader\_read\_instance passing the smallest instance\_handle among all the ones that:

• are greater than a\_handle
• have available samples (i.e. samples that meet the constraints imposed by the specified states).

The special value DDS\_HANDLE\_NIL is guaranteed to be ‘less than’ any valid i n s t a n c e \_ h a n d l e . S o t h e u s e o f t h e p a r a m e t e r v a l u e a\_handle==DDS\_HANDLE\_NIL will return the samples for the instance which has the smallest instance\_handle among all the instances that contains available samples.

# Typical use

The operation SPACE\_FooDataReader\_read\_next\_instance is intended to be used in an application-driven iteration where the application starts by passing a\_handle==DDS\_HANDLE\_NIL, examines the samples returned, and then uses the instance\_handle returned in the DDS\_SampleInfo as the value of a\_handle argument to the next call to SPACE\_FooDataReader\_read\_next\_instance. The iteration continues until SPACE\_FooDataReader\_read\_next\_instance returns the return value DDS\_RETCODE\_NO\_DATA.

# Return Code

When the operation returns:

• DDS\_RETCODE\_OK - a sequence of data values is available.
• DDS\_RETCODE\_ERROR - an internal error has occurred.
• DDS\_RETCODE\_ILLEGAL\_OPERATION - the operation is invoked on an inappropriate object.
• DDS\_RETCODE\_BAD\_PARAMETER - either or both of data\_values or info\_seq is an invalid pointer or a\_handle is not a valid handle.
• DDS\_RETCODE\_ALREADY\_DELETED - the SPACE\_FooDataReader has already been deleted.
• DDS\_RETCODE\_OUT\_OF\_RESOURCES - the Data Distribution Service ran out of resources to complete this operation.
• DDS\_RETCODE\_NOT\_ENABLED - the SPACE\_FooDataReader is not enabled.
• DDS\_RETCODE\_PRECONDITION\_NOT\_MET - one of the following is true:

\- the max\_samples>\_maximum and max\_samples is not DDS\_LENGTH\_UNLIMITED.

\- one or more values of \_length, \_maximum, and \_release for the two sequences are not identical.

\- the \_maximum>0 and the \_release==FALSE.

\- the handle has not been registered with this DataReader.

• DDS\_RETCODE\_NO\_DATA - no samples that meet the constraints are available.

# 3.5.2.69 SPACE\_FooDataReader\_read\_next\_instance\_w\_condition

# Synopsis

```c
#include &lt;Space.h&gt;
DDS_ReturnCode_t
SPACE_FooDataReader_read_next_instance_w_condition
(SPACE_FooDataReader _this,
DDS_sequence_Foo *data_values,
DDS_SampleInfoSeq *info_seq,
const DDS_long max_samples,
const DDS_InstanceHandle_t a_handle,
const DDS_ReadCondition a_condition);
```

# Description

This operation reads a sequence of Foo samples of the next single instance from the SPACE\_FooDataReader.

# Parameters

in SPACE\_FooDataReader \_this - the SPACE\_FooDataReader object on which the operation is operated.

inout DDS\_sequence\_Foo \*data\_values - the returned sample data sequence. data\_values is also used as an input to control the behaviour of this operation.

inout DDS\_SampleInfoSeq \*info\_seq - the returned DDS\_SampleInfo structure sequence. info\_seq is also used as an input to control the behaviour of this operation.

in const DDS\_long max\_samples - the maximum number of samples that is returned.

in const DDS\_InstanceHandle\_t a\_handle - the current single instance, the returned samples belong to the next single instance.

in const DDS\_ReadCondition a\_condition - a pointer to a DDS\_ReadCondition or DDS\_QueryCondition which filters the data before it is returned by the read operation.

# Return Value

D D S \_ R e t u r n C o d e \_ t - P o s s i b l e r e t u r n c o d e s o f t h e o p e r a t i o n a r e : DDS\_RETCODE\_OK, DDS\_RETCODE\_ERROR, DDS\_RETCODE\_ILLEGAL\_ OPERATION, DDS\_RETCODE\_BAD\_PARAMETER, DDS\_RETCODE\_ ALREADY\_DELETED, DDS\_RETCODE\_OUT\_OF\_RESOURCES, DDS\_RETCODE NOT\_ENABLED, DDS\_RETCODE\_PRECONDITION\_NOT\_MET or DDS\_RETCODE\_NO\_DATA.

# Detailed Description

This operation reads a sequence of Foo samples of a single instance from the SPACE\_FooDataReader, filtered by a DDS\_ReadCondition or D D S\_ Q u e r y C on d i t i o n . Th e b e h a v io u r i s i d e n t i c a l t o SPACE\_FooDataReader\_read\_next\_instance except for that the samples are filtered by a DDS\_ReadCondition or DDS\_QueryCondition. When using a D D S \_ R e a d C o n d i t i o n , t h e r e s u l t i s t h e s a m e a s t h e SPACE\_FooDataReader\_read\_next\_instance operation with the same state parameters filled in as for the DDS\_create\_readcondition. In this way, the application can avoid repeating the same parameters, specified when creating the DDS\_ReadCondition. When using a DDS\_QueryCondition, a content based filtering can be done. When either using a DDS\_ReadCondition or D D S\_ Q u e r y C on d i t i o n , t h e c o n d i t io n m u s t b e c r e a t e d b y t h i s SPACE\_FooDataReader. Otherwise the operation will fail and returns DDS\_RETCODE\_PRECONDITION\_NOT\_MET.

# Return Code

When the operation returns:

• DDS\_RETCODE\_OK - a sequence of data values is available.
• DDS\_RETCODE\_ERROR - an internal error has occurred.
• DDS\_RETCODE\_ILLEGAL\_OPERATION - the operation is invoked on an inappropriate object.
• DDS\_RETCODE\_BAD\_PARAMETER - one or more of the data\_values, or info\_seq and a\_condition parameters is an invalid pointer or a\_handle is not a valid handle.
• DDS\_RETCODE\_ALREADY\_DELETED - the SPACE\_FooDataReader has already been deleted.
• DDS\_RETCODE\_OUT\_OF\_RESOURCES - the Data Distribution Service ran out of resources to complete this operation.
• DDS\_RETCODE\_NOT\_ENABLED - the SPACE\_FooDataReader is not enabled.
• DDS\_RETCODE\_PRECONDITION\_NOT\_MET - one of the following is true:

- the DDS\_ReadCondition or DDS\_QueryCondition is not attached to this SPACE\_FooDataReader.
- the max\_samples>\_maximum and max\_samples is not DDS\_LENGTH\_UNLIMITED.
- one or more values of \_length, \_maximum, and \_release for the two sequences are not identical.
- the \_maximum>0 and the \_release==FALSE.
- the handle has not been registered with this DataReader.
• DDS\_RETCODE\_NO\_DATA - no samples that meet the constraints are available.

# 3.5.2.70 SPACE\_FooDataReader\_read\_next\_sample

# Synopsis

```c
#include &lt;Space.h&gt;
DDS_ReturnCode_t
SPACE_FooDataReader_read_next_sample
(SPACE_FooDataReader _this,
Foo *data_values,
DDS_SampleInfo *sample_info);
```

NOTE: This operation is not yet implemented. It is scheduled for a future release.

# 3.5.2.71 SPACE\_FooDataReader\_read\_w\_condition

# Synopsis

```c
#include &lt;Space.h&gt;
DDS_ReturnCode_t
SPACE_FooDataReader_read_w_condition
(SPACE_FooDataReader _this,
DDS_sequence_Foo *data_values,
DDS_SampleInfoSeq *info_seq,
const DDS_long max_samples,
const DDS_ReadCondition a_condition);
```

# Description

This operation reads a sequence of Foo samples from the SPACE\_FooDataReader, filtered by a DDS\_ReadCondition or DDS\_QueryCondition.

# Parameters

in SPACE\_FooDataReader \_this - the SPACE\_FooDataReader object on which the operation is operated.

inout DDS\_sequence\_Foo \*data\_values - the returned sample data sequence. data\_values is also used as an input to control the behaviour of this operation.

inout DDS\_SampleInfoSeq \*info\_seq - the returned DDS\_SampleInfo structure sequence. info\_seq is also used as an input to control the behaviour of this operation.

in const DDS\_long max\_samples - the maximum number of samples that is returned.

in const DDS\_ReadCondition a\_condition - a pointer to a DDS\_ReadCondition or DDS\_QueryCondition which filters the data before it is returned by the SPACE\_FooDataReader\_read operation.

# Return Value

D D S \_ R e t u r n C o d e \_ t - P o s s i b l e r e t u r n c o d e s o f t h e o p e r a t i o n a r e : DDS\_RETCODE\_OK, DDS\_RETCODE\_ERROR, DDS\_RETCODE\_ILLEGAL OPERATION, DDS\_RETCODE\_BAD\_PARAMETER, DDS\_RETCODE ALREADY\_DELETED, DDS\_RETCODE\_OUT\_OF\_RESOURCES, DDS\_RETCODE\_ NOT\_ENABLED, DDS\_RETCODE\_PRECONDITION\_NOT\_MET or DDS\_RETCODE\_NO\_DATA.

# Detailed Description

This operation reads a sequence of Foo samples from the SPACE\_FooDataReader, filtered by a DDS\_ReadCondition or DDS\_QueryCondition. The condition pointer from both SPACE\_FooDataReader\_create\_readcondition or SPACE\_FooDataReader\_create\_querycondition may be used. The behaviour is identical to SPACE\_FooDataReader\_read except for that the samples are filtered by a DDS\_ReadCondition or DDS\_QueryCondition. When u s i n g a D D S \_ R e a d C o n d i t i o n , t h e r e s u l t i s t h e s a m e a s t h e SPACE\_FooDataReader\_read operation with the same state parameters filled in as for the SPACE\_FooDataReader\_create\_readcondition. In this way, the application can avoid repeating the same parameters, specified when creating the DDS\_ReadCondition. When using a DDS\_QueryCondition, a content based filtering can be done. When either using a DDS\_ReadCondition or D D S\_ Q u e r y C on d i t i o n , t h e c o n d i t io n m u s t b e c r e a t e d b y t h i s SPACE\_FooDataReader. Otherwise the operation will fail and returns DDS\_RETCODE\_PRECONDITION\_NOT\_MET.

# Return Code

When the operation returns:

• DDS\_RETCODE\_OK - a sequence of data values is available.

• DDS\_RETCODE\_ERROR - an internal error has occurred.
• DDS\_RETCODE\_ILLEGAL\_OPERATION - the operation is invoked on an inappropriate object.
• DDS\_RETCODE\_BAD\_PARAMETER - one or more of the data\_values, or info\_seq and a\_condition parameters is an invalid pointer.
• DDS\_RETCODE\_ALREADY\_DELETED - the SPACE\_FooDataReader has already been deleted.
• DDS\_RETCODE\_OUT\_OF\_RESOURCES - the Data Distribution Service ran out of resources to complete this operation.
• DDS\_RETCODE\_NOT\_ENABLED - the SPACE\_FooDataReader is not enabled.
• DDS\_RETCODE\_PRECONDITION\_NOT\_MET - one of the following is true:

- the DDS\_ReadCondition or DDS\_QueryCondition is not attached to this SPACE\_FooDataReader.
- the max\_samples>\_maximum and max\_samples is not DDS\_LENGTH\_UNLIMITED.
- one or more values of \_length, \_maximum, and \_release for the two sequences are not identical.
- the \_maximum>0 and the \_release==FALSE.

• DDS\_RETCODE\_NO\_DATA - no samples that meet the constraints are available.

# 3.5.2.72 SPACE\_FooDataReader\_return\_loan

# Synopsis

```c
#include &lt;Space.h&gt;
DDS_ReturnCode_t
SPACE_FooDataReader_return_loan
(SPACE_FooDataReader _this,
DDS_sequence_Foo *data_values,
DDS_SampleInfoSeq *info_seq);
```

# Description

This operation indicates to the DDS\_DataReader that the application is done accessing the sequence of data\_values and info\_seq.

# Parameters

in SPACE\_FooDataReader \_this - the SPACE\_FooDataReader object on which the operation is operated.

inout DDS\_sequence\_Foo \*data\_values - the sample data sequence which was loaned from the DDS\_DataReader.

inout DDS\_SampleInfoSeq \*info\_seq - the DDS\_SampleInfo structure sequence which was loaned from the DDS\_DataReader.

# Return Value

D D S \_ R e t u r n C o d e \_ t - P o s s i b l e r e t u r n c o d e s o f t h e o p e r a t i o n a r e : DDS\_RETCODE\_OK, DDS\_RETCODE\_ERROR, DDS\_RETCODE\_ILLEGAL OPERATION, DDS\_RETCODE\_BAD\_PARAMETER, DDS\_RETCODE ALREADY\_DELETED, DDS\_RETCODE\_OUT\_OF\_RESOURCES, DDS\_RETCODE\_ NOT\_ENABLED or DDS\_RETCODE\_PRECONDITION\_NOT\_MET.

# Detailed Description

This operation indicates to the SPACE\_FooDataReader that the application is done accessing the sequence of data\_values and info\_seq obtained by some earlier i nv oc a ti o n o f t h e op e r a t i on S P AC E \_ F o o D at a R e a d er \_ r e a d or SPACE\_FooDataReader\_take (or any of the similar operations) on the SPACE\_FooDataReader.

The data\_values and info\_seq must belong to a single related pair; that is, they should correspond to a pair returned from a single call to the operation SPACE\_FooDataReader\_read or SPACE\_FooDataReader\_take. The data\_values and info\_seq must also have been obtained from the same DDS\_DataReader to which they are returned. If either of these conditions is not met the operation will fail and returns DDS\_RETCODE\_PRECONDITION\_NOT\_MET.

# Buffer Loan

The operation SPACE\_FooDataReader\_return\_loan allows implementations of the SPACE\_FooDataReader\_read and SPACE\_FooDataReader\_take operations to “loan” buffers from the Data Distribution Service to the application and in this manner provide “zero-copy” access to the data. During the loan, the Data Distribution Service will guarantee that the data\_values and info\_seq are not modified.

It is not necessary for an application to return the loans immediately after calling the operation SPACE\_FooDataReader\_read or SPACE\_FooDataReader\_take. However, as these buffers correspond to internal resources inside the DDS\_DataReader, the application should not retain them indefinitely.

# Calling SPACE\_FooDataReader\_return\_loan

The use of the SPACE\_FooDataReader\_return\_loan operation is only necessary if the call to the operation SPACE\_FooDataReader\_read or SPACE\_FooDataReader\_take “loaned” buffers to the application. This only occurs if the data\_values and info\_seq sequences had \_maximum=0 at the time the operation SPACE\_FooDataReader\_read or SPACE\_FooDataReader\_take was called. The application may also examine the ‘\_release’ property of the collection to determine where there is an outstanding loan. However, calling the operation SPACE\_FooDataReader\_return\_loan on a pair of sequences that does not have a loan is safe and has no side effects.

If the pair of sequences had a loan, upon return from the operation SPACE\_FooDataReader\_return\_loan the pair of sequences has \_maximum=0.

# Return Code

When the operation returns:

• DDS\_RETCODE\_OK - the DDS\_DataReader is informed that the sequences will not be used any more.
• DDS\_RETCODE\_ERROR - an internal error has occurred.
• DDS\_RETCODE\_ILLEGAL\_OPERATION - the operation is invoked on an inappropriate object.
• DDS\_RETCODE\_BAD\_PARAMETER - either or both of data\_values or info\_seq is an invalid pointer.
• DDS\_RETCODE\_ALREADY\_DELETED - the SPACE\_FooDataReader has already been deleted.
• DDS\_RETCODE\_OUT\_OF\_RESOURCES - the Data Distribution Service ran out of resources to complete this operation.
• DDS\_RETCODE\_NOT\_ENABLED - the SPACE\_FooDataReader is not enabled.
• DDS\_RETCODE\_PRECONDITION\_NOT\_MET - one of the following is true:
- the data\_values and info\_seq do not belong to a single related pair.
- the data\_values and info\_seq were not obtained from this SPACE\_FooDataReader.

# 3.5.2.73 SPACE\_FooDataReader\_set\_listener (inherited)

This operation is inherited and therefore not described here. See the class DDS\_DataReader for further explanation.

# Synopsis

```c
#include &lt;Space.h&gt;
DDS_ReturnCode_t
SPACE_FooDataReader_set_listener
(SPACE_FooDataReader _this,
const struct DDS_DataReaderListener *a_listener,
const DDS_StatusMask mask);
```

# 3.5.2.74 SPACE\_FooDataReader\_set\_qos (inherited)

This operation is inherited and therefore not described here. See the class DDS\_DataReader for further explanation.

# Synopsis

```c
#include &lt;Space.h&gt;
DDS_ReturnCode_t
SPACE_FooDataReader_set_qos
(SPACE_FooDataReader_this,
const DDS_DataReaderQos *qos);
```

# 3.5.2.75 SPACE\_FooDataReader\_take

# Synopsis

```c
#include &lt;Space.h&gt;
DDS_ReturnCode_t
SPACE_FooDataReader_take
(SPACE_FooDataReader _this,
DDS_sequence_Foo *data_values,
DDS_SampleInfoSeq *info_seq,
const DDS_long max_samples,
const DDS_SampleStateMask sample_states,
const DDS_ViewStateMask view_states,
const DDS_InstanceStateMask instance_states);
```

# Description

This operation reads a sequence of Foo samples from the SPACE\_FooDataReader and by doing so, removes the data from the SPACE\_FooDataReader.

# Parameters

in SPACE\_FooDataReader \_this - the SPACE\_FooDataReader object on which the operation is operated.

inout DDS\_sequence\_Foo \*data\_values - the returned sample data sequence. data\_values is also used as an input to control the behaviour of this operation.

inout DDS\_SampleInfoSeq \*info\_seq - the returned DDS\_SampleInfo structure sequence. info\_seq is also used as an input to control the behaviour of this operation.

in const DDS\_long max\_samples - the maximum number of samples that is returned.

in const DDS\_SampleStateMask sample\_states - a mask, which selects only those samples with the desired sample states.

in const DDS\_ViewStateMask view\_states - a mask, which selects only those samples with the desired view states.

in const DDS\_InstanceStateMask instance\_states - a mask, which selects only those samples with the desired instance states.

# Return Value

D D S \_ R e t u r n C o d e \_ t - P o s s i b l e r e t u r n c o d e s o f t h e o p e r a t i o n a r e : DDS\_RETCODE\_OK, DDS\_RETCODE\_ERROR, DDS\_RETCODE\_ILLEGAL OPERATION, DDS\_RETCODE\_BAD\_PARAMETER, DDS\_RETCODE ALREADY\_DELETED, DDS\_RETCODE\_OUT\_OF\_RESOURCES, DDS\_RETCODE\_ NOT\_ENABLED, DDS\_RETCODE\_PRECONDITION\_NOT\_MET or DDS\_RETCODE\_NO\_DATA.

# Detailed Description

This operation reads a sequence of Foo samples from the SPACE\_FooDataReader and by doing so, removes the data from the SPACE\_FooDataReader, so it can not b e r e a d o r t a k e n a g a i n . T h e b e h a v i o u r i s i d e n t i c a l t o SPACE\_FooDataReader\_read except for that the samples are removed from the SPACE\_FooDataReader.

# Return Code

When the operation returns:

• DDS\_RETCODE\_OK - a sequence of data values is available and removed from the SPACE\_FooDataReader.
• DDS\_RETCODE\_ERROR - an internal error has occurred.
• DDS\_RETCODE\_ILLEGAL\_OPERATION - the operation is invoked on an inappropriate object.
• DDS\_RETCODE\_BAD\_PARAMETER - either or both of data\_values or info\_seq is an invalid pointer.
• DDS\_RETCODE\_ALREADY\_DELETED - the SPACE\_FooDataReader has already been deleted.
• DDS\_RETCODE\_OUT\_OF\_RESOURCES - the Data Distribution Service ran out of resources to complete this operation.
• DDS\_RETCODE\_NOT\_ENABLED - the SPACE\_FooDataReader is not enabled.
• DDS\_RETCODE\_PRECONDITION\_NOT\_MET - one of the following is true:

\- the max\_samples>\_maximum and max\_samples is not DDS\_LENGTH\_UNLIMITED.

\- one or more values of \_length, \_maximum, and \_release for the two sequences are not identical.

\- the \_maximum>0 and the \_release==FALSE.

• DDS\_RETCODE\_NO\_DATA - no samples that meet the constraints are available.

# 3.5.2.76 SPACE\_FooDataReader\_take\_instance

# Synopsis

```c
#include &lt;Space.h&gt;
DDS_ReturnCode_t
SPACE_FooDataReader_take_instance
(SPACE_FooDataReader _this,
DDS_sequence_Foo *data_values,
DDS_SampleInfoSeq *info_seq,
const DDS_long max_samples,
const DDS_InstanceHandle_t a_handle,
const DDS_SampleStateMask sample_states,
const DDS_ViewStateMask view_states,
const DDS_InstanceStateMask instance_states);
```

# Description

This operation reads a sequence of Foo samples of a single instance from the SPACE\_FooDataReader and by doing so, removes the data from the SPACE\_FooDataReader.

# Parameters

in SPACE\_FooDataReader \_this - the SPACE\_FooDataReader object on which the operation is operated.

inout DDS\_sequence\_Foo \*data\_values - the returned sample data sequence. data\_values is also used as an input to control the behaviour of this operation.

inout DDS\_SampleInfoSeq \*info\_seq - the returned DDS\_SampleInfo structure sequence. info\_seq is also used as an input to control the behaviour of this operation.

in const DDS\_long max\_samples - the maximum number of samples that is returned.

in const DDS\_InstanceHandle\_t a\_handle - the single instance, the samples belong to.

in const DDS\_SampleStateMask sample\_states - a mask, which selects only those samples with the desired sample states.

in const DDS\_ViewStateMask view\_states - a mask, which selects only those samples with the desired view states.

in const DDS\_InstanceStateMask instance\_states - a mask, which selects only those samples with the desired instance states.

# Return Value

D D S \_ R e t u r n C o d e \_ t - P o s s i b l e r e t u r n c o d e s o f t h e o p e r a t i o n a r e : DDS\_RETCODE\_OK, DDS\_RETCODE\_ERROR, DDS\_RETCODE\_ILLEGAL OPERATION, DDS\_RETCODE\_BAD\_PARAMETER, DDS\_RETCODE ALREADY\_DELETED, DDS\_RETCODE\_OUT\_OF\_RESOURCES, DDS\_RETCODE\_ NOT\_ENABLED, DDS\_RETCODE\_PRECONDITION\_NOT\_MET or DDS\_RETCODE\_NO\_DATA.

# Detailed Description

This operation reads a sequence of Foo samples of a single instance from the SPACE\_FooDataReader and by doing so, removes the data from the SPACE\_FooDataReader, so it can not be read or taken again. The behaviour is identical to SPACE\_FooDataReader\_read\_instance except for that the samples are removed from the SPACE\_FooDataReader.

# Return Code

When the operation returns:

• DDS\_RETCODE\_OK - a sequence of data values is available and removed from the SPACE\_FooDataReader.
• DDS\_RETCODE\_ERROR - an internal error has occurred.
• DDS\_RETCODE\_ILLEGAL\_OPERATION - the operation is invoked on an inappropriate object.
• DDS\_RETCODE\_BAD\_PARAMETER - either or both of data\_values or info\_seq is an invalid pointer or a\_handle is not a valid handle.
• DDS\_RETCODE\_ALREADY\_DELETED - the SPACE\_FooDataReader has already been deleted.
• DDS\_RETCODE\_OUT\_OF\_RESOURCES - the Data Distribution Service ran out of resources to complete this operation.
• DDS\_RETCODE\_NOT\_ENABLED - the SPACE\_FooDataReader is not enabled.
• DDS\_RETCODE\_PRECONDITION\_NOT\_MET - one of the following is true:

\- the max\_samples>\_maximum and max\_samples is not DDS\_LENGTH\_UNLIMITED.

- one or more values of \_length, \_maximum, and \_release for the two sequences are not identical.
- the \_maximum>0 and the \_release==FALSE.
- the handle ==DDS\_HANDLE\_NIL.
- the handle has not been registered with this DataReader.
• DDS\_RETCODE\_NO\_DATA - no samples that meet the constraints are available.

# 3.5.2.77 SPACE\_FooDataReader\_take\_next\_instance

# Synopsis

```c
#include &lt;Space.h&gt;
DDS_ReturnCode_t
SPACE_FooDataReader_take_next_instance
(SPACE_FooDataReader _this,
DDS_sequence_Foo *data_values,
DDS_SampleInfoSeq *info_seq,
const DDS_long max_samples,
const DDS_InstanceHandle_t a_handle,
const DDS_SampleStateMask sample_states,
const DDS_ViewStateMask view_states,
const DDS_InstanceStateMask instance_states);
```

# Description

This operation reads a sequence of Foo samples of the next single instance from the SPACE\_FooDataReader and by doing so, removes the data from the SPACE\_FooDataReader.

# Parameters

in SPACE\_FooDataReader \_this - the SPACE\_FooDataReader object on which the operation is operated.

inout DDS\_sequence\_Foo \*data\_values - the returned sample data sequence. data\_values is also used as an input to control the behaviour of this operation.

inout DDS\_SampleInfoSeq \*info\_seq - the returned DDS\_SampleInfo structure sequence. info\_seq is also used as an input to control the behaviour of this operation.

in const DDS\_long max\_samples - the maximum number of samples that is returned.

in const DDS\_InstanceHandle\_t a\_handle - the current single instance, the returned samples belong to the next single instance.

in const DDS\_SampleStateMask sample\_states - a mask, which selects only those samples with the desired sample states.

in const DDS\_ViewStateMask view\_states - a mask, which selects only those samples with the desired view states.

in const DDS\_InstanceStateMask instance\_states - a mask, which selects only those samples with the desired instance states.

# Return Value

D D S \_ R e t u r n C o d e \_ t - P o s s i b l e r e t u r n c o d e s o f t h e o p e r a t i o n a r e : DDS\_RETCODE\_OK, DDS\_RETCODE\_ERROR, DDS\_RETCODE\_ILLEGAL OPERATION, DDS\_RETCODE\_BAD\_PARAMETER, DDS\_RETCODE ALREADY\_DELETED, DDS\_RETCODE\_OUT\_OF\_RESOURCES, DDS\_RETCODE\_ NOT\_ENABLED, DDS\_RETCODE\_PRECONDITION\_NOT\_MET or DDS\_RETCODE\_NO\_DATA.

# Detailed Description

This operation reads a sequence of Foo samples of a single instance from the SPACE\_FooDataReader and by doing so, removes the data from the SPACE\_FooDataReader, so it can not be read or taken again. The behaviour is identical to SPACE\_FooDataReader\_read\_next\_instance except for that the samples are removed from the SPACE\_FooDataReader.

# Return Code

When the operation returns:

• DDS\_RETCODE\_OK - a sequence of data values is available and removed from the SPACE\_FooDataReader.
• DDS\_RETCODE\_ERROR - an internal error has occurred.
• DDS\_RETCODE\_ILLEGAL\_OPERATION - the operation is invoked on an inappropriate object.
• DDS\_RETCODE\_BAD\_PARAMETER - either or both of data\_values or info\_seq is an invalid pointer or a\_handle is not a valid handle.
• DDS\_RETCODE\_ALREADY\_DELETED - the SPACE\_FooDataReader has already been deleted.
• DDS\_RETCODE\_OUT\_OF\_RESOURCES - the Data Distribution Service ran out of resources to complete this operation.
• DDS\_RETCODE\_NOT\_ENABLED - the SPACE\_FooDataReader is not enabled.
• DDS\_RETCODE\_PRECONDITION\_NOT\_MET - one of the following is true:

- the max\_samples>\_maximum and max\_samples is not DDS\_LENGTH\_UNLIMITED.
- one or more values of \_length, \_maximum, and \_release for the two sequences are not identical.
- the \_maximum>0 and the \_release==FALSE.
- the handle has not been registered with this DataReader.

• DDS\_RETCODE\_NO\_DATA - no samples that meet the constraints are available.

# 3.5.2.78 SPACE\_FooDataReader\_take\_next\_instance\_w\_condition

# Synopsis

```c
#include &lt;Space.h&gt;
DDS_ReturnCode_t
SPACE_FooDataReader_take_next_instance_w_condition
(SPACE_FooDataReader _this,
DDS_sequence_Foo *data_values,
DDS_SampleInfoSeq *info_seq,
const DDS_long max_samples,
const DDS_InstanceHandle_t a_handle,
const DDS_ReadCondition a_condition);
```

# Description

This operation reads a sequence of Foo samples of the next single instance from the SPACE\_FooDataReader and by doing so, removes the data from the SPACE\_FooDataReader.

# Parameters

in SPACE\_FooDataReader \_this - the SPACE\_FooDataReader object on which the operation is operated.

inout DDS\_sequence\_Foo \*data\_values - the returned sample data sequence. data\_values is also used as an input to control the behaviour of this operation.

inout DDS\_SampleInfoSeq \*info\_seq - the returned DDS\_SampleInfo structure sequence. info\_seq is also used as an input to control the behaviour of this operation.

in const DDS\_long max\_samples - the maximum number of samples that is returned.

in const DDS\_InstanceHandle\_t a\_handle - the current single instance, the returned samples belong to the next single instance.

in const DDS\_ReadCondition a\_condition - a pointer to a DDS\_ReadCondition or DDS\_QueryCondition which filters the data before it is returned by the read operation.

# Return Value

D D S \_ R e t u r n C o d e \_ t - P o s s i b l e r e t u r n c o d e s o f t h e o p e r a t i o n a r e : DDS\_RETCODE\_OK, DDS\_RETCODE\_ERROR, DDS\_RETCODE\_ILLEGAL\_ OPERATION, DDS\_RETCODE\_BAD\_PARAMETER, DDS\_RETCODE ALREADY\_DELETED, DDS\_RETCODE\_OUT\_OF\_RESOURCES, DDS\_RETCODE\_ NOT\_ENABLED, DDS\_RETCODE\_PRECONDITION\_NOT\_MET or DDS\_RETCODE\_NO\_DATA.

# Detailed Description

This operation reads a sequence of Foo samples of a single instance from the SPACE\_FooDataReader, filtered by a DDS\_ReadCondition or DDS\_QueryCondition and by doing so, removes the data from the SPACE\_FooDataReader, so it can not be read or taken again. The behaviour is identical to SPACE\_FooDataReader\_read\_next\_instance\_w\_condition except for that the samples are removed from the SPACE\_FooDataReader.

# Return Code

When the operation returns:

• DDS\_RETCODE\_OK - a sequence of data values is available and removed from the SPACE\_FooDataReader.
• DDS\_RETCODE\_ERROR - an internal error has occurred.
• DDS\_RETCODE\_ILLEGAL\_OPERATION - the operation is invoked on an inappropriate object.
• DDS\_RETCODE\_BAD\_PARAMETER - one or more of the data\_values, info\_seq and a\_condition parameters is an invalid pointer or a\_handle is not a valid handle.
• DDS\_RETCODE\_ALREADY\_DELETED - the SPACE\_FooDataReader has already been deleted.
• DDS\_RETCODE\_OUT\_OF\_RESOURCES - the Data Distribution Service ran out of resources to complete this operation.
• DDS\_RETCODE\_NOT\_ENABLED - the SPACE\_FooDataReader is not enabled.
• DDS\_RETCODE\_PRECONDITION\_NOT\_MET - one of the following is true:

\- the DDS\_ReadCondition or DDS\_QueryCondition is not attached to this SPACE\_FooDataReader.

- the max\_samples>\_maximum and max\_samples is not DDS\_LENGTH\_UNLIMITED.
- one or more values of \_length, \_maximum, and \_release for the two sequences are not identical.
- the \_maximum>0 and the \_release==FALSE.
- the handle has not been registered with this DataReader.

• DDS\_RETCODE\_NO\_DATA - no samples that meet the constraints are available.

# 3.5.2.79 SPACE\_FooDataReader\_take\_next\_sample

# Synopsis

```c
#include &lt;Space.h&gt;
DDS_ReturnCode_t
SPACE_FooDataReader_take_next_sample
(SPACE_FooDataReader _this,
Foo *data_values,
DDS_SampleInfo *sample_info);
```

NOTE: This operation is not yet implemented. It is scheduled for a future release.

# 3.5.2.80 SPACE\_FooDataReader\_take\_w\_condition

# Synopsis

```c
#include &lt;Space.h&gt;
DDS_ReturnCode_t
SPACE_FooDataReader_take_w_condition
(SPACE_FooDataReader _this,
DDS_sequence_Foo *data_values,
DDS_SampleInfoSeq *info_seq,
const DDS_long max_samples,
const DDS_ReadCondition a_condition);
```

# Description

This operation reads a sequence of Foo samples from the SPACE\_FooDataReader, filtered by a DDS\_ReadCondition or DDS\_QueryCondition and by doing so, removes the data from the SPACE\_FooDataReader.

# Parameters

in SPACE\_FooDataReader \_this - the SPACE\_FooDataReader object on which the operation is operated.

inout DDS\_sequence\_Foo \*data\_values - the returned sample data sequence. data\_values is also used as an input to control the behaviour of this operation.

inout DDS\_SampleInfoSeq \*info\_seq - the returned DDS\_SampleInfo structure sequence. info\_seq is also used as an input to control the behaviour of this operation.

in const DDS\_long max\_samples - the maximum number of samples that is returned.

in const DDS\_ReadCondition a\_condition - a pointer to a DDS\_ReadCondition or DDS\_QueryCondition which filters the data before it is returned by the SPACE\_FooDataReader\_read operation.

# Return Value

D D S \_ R e t u r n C o d e \_ t - P o s s i b l e r e t u r n c o d e s o f t h e o p e r a t i o n a r e : DDS\_RETCODE\_OK, DDS\_RETCODE\_ERROR, DDS\_RETCODE\_ILLEGAL\_ OPERATION, DDS\_RETCODE\_BAD\_PARAMETER, DDS\_RETCODE\_ ALREADY\_DELETED, DDS\_RETCODE\_OUT\_OF\_RESOURCES, DDS\_RETCODE\_ NOT\_ENABLED, DDS\_RETCODE\_PRECONDITION\_NOT\_MET or DDS\_RETCODE\_NO\_DATA.

# Detailed Description

This operation reads a sequence of Foo samples from the SPACE\_FooDataReader, filtered by a DDS\_ReadCondition or DDS\_QueryCondition and by doing so, removes the data from the SPACE\_FooDataReader, so it can not be read or taken a g a i n . T h e b e h a v i o u r i s i d e n t i c a l t o SPACE\_FooDataReader\_read\_w\_condition except for that the samples are removed from the SPACE\_FooDataReader.

# Return Code

When the operation returns:

• DDS\_RETCODE\_OK - a sequence of data values is available and removed from the SPACE\_FooDataReader.
• DDS\_RETCODE\_ERROR - an internal error has occurred.
• DDS\_RETCODE\_ILLEGAL\_OPERATION - the operation is invoked on an inappropriate object.
• DDS\_RETCODE\_BAD\_PARAMETER - one or more of the data\_values, or info\_seq and a\_condition parameters is an invalid pointer.
• DDS\_RETCODE\_ALREADY\_DELETED - the SPACE\_FooDataReader has already been deleted.
• DDS\_RETCODE\_OUT\_OF\_RESOURCES - the Data Distribution Service ran out of resources to complete this operation.
• DDS\_RETCODE\_NOT\_ENABLED - the SPACE\_FooDataReader is not enabled.

• DDS\_RETCODE\_PRECONDITION\_NOT\_MET - one of the following is true:

- the DDS\_ReadCondition or DDS\_QueryCondition is not attached to this SPACE\_FooDataReader.
- the max\_samples>\_maximum and max\_samples is not DDS\_LENGTH\_UNLIMITED.
- one or more values of \_length, \_maximum, and \_release for the two sequences are not identical.
- the \_maximum>0 and the \_release==FALSE.
• DDS\_RETCODE\_NO\_DATA - no samples that meet the constraints are available.

# 3.5.2.81 SPACE\_FooDataReader\_wait\_for\_historical\_data (inherited)

This operation is inherited and therefore not described here. See the class DDS\_DataReader for further explanation.

# Synopsis

```c
#include &lt;Space.h&gt;
DDS_ReturnCode_t
SPACE_FooDataReader_wait_for_historical_data
(SPACE_FooDataReader _this,
const DDS_Duration_t *max_wait);
```

# 3.5.2.82 SPACE\_FooDataReader\_wait\_for\_historical\_data\_w\_condition (inherited)

This operation is inherited and therefore not described here. See the class DataReader for further explanation.

# Synopsis

```c
#include &lt;Space.h&gt;
DDS_ReturnCode_t
SPACE_FooDataReader_wait_for_historical_data_w_condition
(Space_FooDataReader _this,
const DDS_string filter_expression,
const DDS_StringSeq* filter_parameters,
const DDS_Time_t* min_source_timestamp,
const DDS_Time_t* max_source_timestamp
const DDS_ResourceLimitsQosPolicy* resource_limits,
const DDS_Duration_t* max_wait)
```

# 3.5.3 Class DDS\_DataSample

A DDS\_DataSample represents an atom of data information (i.e. one value for an i n s t a n c e ) a s r e t u r n e d b y t h e DDS\_DataReader ’s DDS\_DataReader\_read/SPACE\_FooDataReader\_take operations. It consists of two parts: A DDS\_SampleInfo and the Data itself. The Data part is the data as produced by a DDS\_Publisher. The DDS\_SampleInfo part contains additional information related to the data provided by the Data Distribution Service.

# 3.5.4 Struct DDS\_SampleInfo

The struct DDS\_SampleInfo represents the additional information that accompanies the data in each sample that is read or taken.

The interface description of this struct is as follows:

```c
struct DDS_SampleInfo
{
    DDS_SampleStateKind sample_state;
    DDS_ViewStateKind view_state;
    DDS_InstanceStateKind instance_state;
    DDS_Time_t source_timestamp;
    DDS_InstanceHandle_t instance_handle;
    DDS_InstanceHandle_t publication_handle;
    DDS_long disposed_generation_count;
    DDS_long no_writers_generation_count;
    DDS_long sample_rank;
    DDS_long generation_rank;
    DDS_long absolute_generation_rank;
    DDS_boolean valid_data;
    DDS_Time_t reception_timestamp;
};
/*
* implemented API operations
* &lt;no operations&gt;
*/
```

The next paragraph describes the usage of the DDS\_SampleInfo struct.

# 3.5.4.1 DDS\_SampleInfo

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
struct DDS_SampleInfo
{
    DDS_SampleStateKind sample_state;
    DDS_ViewStateKind view_state;
    DDS_InstanceStateKind instance_state;
    DDS_Time_t source_timestamp;
    DDS_InstanceHandle_t instance_handle;
    DDS_InstanceHandle_t publication_handle;
    DDS_long disposed_generation_count;
    DDS_long no_writers_generation_count;
    DDS_long sample_rank;
    DDS_long generation_rank;
    DDS_long absolute_generation_rank;
```

```txt
DDS_boolean valid_data;
DDS_Time_t reception_timestamp;
};
```

# Description

The struct DDS\_SampleInfo represents the additional information that accompanies the data in each sample that is read or taken.

# Attributes

DDS\_SampleStateKind sample\_state - whether or not the corresponding data sample has already been read.
DDS\_ViewStateKind view\_state - whether the DDS\_DataReader has already seen samples of the most-current generation of the related instance.
DDS\_InstanceStateKind instance\_state - whether the instance is alive, has no writers or is disposed of.
DDS\_Time\_t source\_timestamp - the time provided by the DDS\_DataWriter when the sample was written.
DDS\_InstanceHandle\_t instance\_handle - the handle that identifies locally the corresponding instance.
DDS\_InstanceHandle\_t publication\_handle - the handle that identifies locally the DDS\_DataWriter that modified the instance. In fact it is an instance\_handle of the built-in DCPSPublication sample that describes this DDS\_DataWriter. It can be used as a parameter to the DDS\_DataReader \_get\_matched\_publication\_data operation to obtain this built-in DCPSPublication sample.
DDS\_long disposed\_generation\_count - the number of times the instance has become alive after it was disposed of explicitly by a DDS\_DataWriter.
DDS\_long no\_writers\_generation\_count - the number of times the instance has become alive after it was disposed of because there were no DDS\_DataWriter objects.
DDS\_long sample\_rank - the number of samples related to the same instance that are found in the collection returned by a DDS\_DataReader\_read or DDS\_DataReader\_take operation.
DDS\_long generation\_rank - the generation difference between the time the sample was received and the time the most recent sample in the collection was received.
DDS\_long absolute\_generation\_rank - the generation difference between the time the sample was received and the time the most recent sample was received.

DDS\_boolean valid\_data - whether the DataSample contains any meanigful data. If not, the sample is only used to communicate a change in the instance\_state of the instance.

DDS\_Time\_t reception\_timestamp - the time provided by the DataReader when the sample was received.

# Detailed Description

The struct DDS\_SampleInfo represents the additional information that accompanies the data in each sample that is read or taken.

# Sample Information

The struct DDS\_SampleInfo represents the additional information that accompanies the data in each sample that is read or taken.

# Generations

A generation is defined as: ‘the number of times an instance has become alive (with instance\_state==DDS\_ALIVE\_INSTANCE\_STATE) at the time the sample was received’. Note that the generation counters are initialized to zero when a Reader first detects a never-seen-before instance.

Two types of generations are distinguished: disposed\_generation\_count and no\_writers\_generation\_count.

A f t e r a D D S \_ D at a W r i t er d i s p o s e s a n i n s t a n c e , t h e disposed\_generation\_count for all Readers that already knew that instance will be incremented the next time the instance is written again.

If the DDS\_DataReader detects that there are no live DDS\_DataWriter entities, the i n s ta n c e \_ s t at e of the s a m p le \_ i n f o w i l l c h a n g e f r o m DDS\_ALIVE\_INSTANCE\_STATE to DDS\_NOT\_ALIVE\_NO\_WRITERS\_ I N S T A N C E \_ S T A T E . T h e n e x t t i m e t h e i n s t a n c e i s w r i t t e n , no\_writers\_generation\_count will be incremented.

# Sample Information

DDS\_SampleInfo is the additional information that accompanies the data in each sample that is read or taken. It contains the following information:

• sample\_state (DDS\_READ\_SAMPLE\_STATE or DDS\_NOT\_READ\_SAMPLE STATE) indicates whether or not the corresponding data sample has already been read
• view\_state, (DDS\_NEW\_VIEW\_STATE, or DDS\_NOT\_NEW\_VIEW\_STATE) indicates whether the DDS\_DataReader has already seen samples of the most-current generation of the related instance

• instance\_state (DDS\_ALIVE\_INSTANCE\_STATE, DDS\_NOT\_ALIVE DISPOSED\_INSTANCE\_STATE, or DDS\_NOT\_ALIVE\_NO\_WRITERS\_INSTANCE\_ STATE) indicates whether the instance is alive, has no writers or if it has been disposed of:

\- DDS\_ALIVE\_INSTANCE\_STATE if this instance is currently in existence

\- DDS\_NOT\_ALIVE\_DISPOSED\_INSTANCE\_STATE if this instance was disposed of by a DDS\_DataWriter

\- DDS\_NOT\_ALIVE\_NO\_WRITERS\_INSTANCE\_STATE none of the DDS\_DataWriter objects currently “alive” (according to the DDS\_LivelinessQosPolicy) are writing the instance.

• source\_timestamp indicates the time provided by the DDS\_DataWriter when the sample was written

• instance\_handle indicates locally the corresponding instance

• publication\_handle is used by the DDS implementation to locally identify the corresponding source DataWriter. You can access more detailed information about this particular publication by passing its publication\_handle to either the DDS\_DataReader\_get\_matched\_publication\_data operation or to the DDS\_PublicationBuiltinTopicDataDataReader\_read\_instance operation on the built-in reader for the “DCPSPublication” topic.

# A

Be aware that since DDS\_InstanceHandle\_t is an opaque datatype, it does not necessarily mean that the handle obtained from the publication\_handle has the same value as the one that appears in the instance\_handle field of the DDS\_SampleInfo when retrieving the publication info through corresponding "DCPSPublication" built-in reader. You can’t just compare two handles to determine whether they represent the same publication. If you want to know whether two handles actually do represent the same publication, use both handles to retrieve their corresponding DDS\_PublicationBuiltinTopicData samples and then compare the key field of both samples.

• disposed\_generation\_count indicates the number of times the instance has become alive after it was disposed of explicitly by a DDS\_DataWriter, at the time the sample was received

• no\_writers\_generation\_count indicates the number of times the instance has become alive after its instance\_state has been DDS\_NOT\_ALIVE\_NO\_WRITERS\_INSTANCE\_STATE, at the time the sample was received

• sample\_rank indicates the number of samples related to the same instance that follow in the collection returned by a DDS\_DataReader\_read or DDS\_DataReader\_take operation

• generation\_rank indicates the generation difference (number of times the instance was disposed of and become alive again) between the time the sample was received and the time the most recent sample in the collection (related to the same instance) was received
• absolute\_generation\_rank indicates the generation difference (number of times the instance was disposed of and become alive again) between the time the sample was received and the time the most recent sample (which may not be in the returned collection), related to the same instance, was received.
• valid\_data indicates whether the corresponding data value contains any meaningful data. If not, the data value is just a ‘dummy’ sample for which only the keyfields have been assigned. It is used to accompany the DDS\_SampleInfo that communicates a change in the instance\_state of an instance for which there is no ‘real’ sample available.
• reception\_timestamp indicates the time provided by the DDS\_DataReader when the sample was inserted.

![The image displays a triangular warning sign with a red border and a white background. Centered inside the triangle is a black exclamation mark. A thin vertical black line runs through the center of the exclamation mark and extends downward past the bottom edge of the red triangle.](.vortex-opensplice-c-reference-guide/64a61158140a4e67115aabcc43a3ed9c5d9ddcbf2517db5cd10cf3d0f47c676f.jpg)

NOTE: This is an OpenSplice-specific extension to the DDS\_SampleInfo struct and is not part of the DDS Specification.

# 3.5.5 DDS\_SubscriberListener Interface

Since a DDS\_Subscriber is a kind of DDS\_Entity, it has the ability to have a Listener associated with it. In this case, the associated Listener should be of type DDS\_SubscriberListener. This interface must be implemented by the application. A user-defined class must be provided by the application which must e x t e n d f r o m t h e D D S \_S u b s c r i be r L i s t en e r c l a s s . A l l DDS\_SubscriberListener operations must be implemented in the user-defined class, it is up to the application whether an operation is empty or contains some functionality.

![The image displays a standard warning sign, characterized by a red triangle with a black border. Inside the triangle, there is a black exclamation mark (!) positioned above a downward-pointing arrow (↓). The symbol is centered within the triangle.](.vortex-opensplice-c-reference-guide/90595ffd66244da96fc15ebc6a095098b118de0483da9bc676b85223036e1ca5.jpg)

All operations for this interface must be implemented in the user-defined class, it is up to the application whether an operation is empty or contains some functionality.

The DDS\_SubscriberListener provides a generic mechanism (actually a callback function) for the Data Distribution Service to notify the application of relevant asynchronous status change events, such as a missed deadline, violation of a QosPolicy setting, etc. The DDS\_SubscriberListener is related to changes in communication status.

The interface description of this class is as follows:

```txt
/*
 * interface DDS_SubscriberListener
 */
/*
 * inherited from class DDS_DataReaderListener
```

```c
/*
 * void
 * DDS_SubscriberListener_on_requested_deadline_missed
 * (void *listener_data,
 * DDS_DataReader reader,
 * const DDS_RequestedDeadlineMissedStatus *status);
 *
 */
 * void
 * DDS_SubscriberListener_on_requested_incompatible_qos
 * (void *listener_data,
 * DDS_DataReader reader,
 * const DDS_RequestedIncompatibleQosStatus *status);
 *
 */
 * void
 * DDS_SubscriberListener_on_sample_rejected
 * (void *listener_data,
 * DDS_DataReader reader,
 * const DDS_SampleRejectedStatus *status);
 *
 */
 * void
 * DDS_SubscriberListener_on_liveliness_changed
 * (void *listener_data,
 * DDS_DataReader reader,
 * const DDS_LivelinessChangedStatus *status);
 *
 */
 * void
 * DDS_SubscriberListener_on_data_available
 * (void *listener_data,
 * DDS_DataReader reader);
 *
 */
 * void
 * DDS_SubscriberListener_on_subscription_matched
 * (void *listener_data,
 * DDS_DataReader reader,
 * const DDS_SubscriptionMatchedStatus *status);
 *
 */
 * void
 * DDS_SubscriberListener_on_sample_lost
 * (void *listener_data,
 * DDS_DataReader reader,
 * const DDS_SampleLostStatus *status);
 *
 */
 * abstract external operations
 */
```

```c
void
DDS_SubscriberListener_on_data_on_readers
(void *listener_data,
DDS_Subscriber subs);
/*
* implemented API operations
*/
struct DDS_SubscriberListener *
DDS_SubscriberListener__alloc
(void);
```

The next paragraphs list all DDS\_SubscriberListener operations. The inherited operations are listed but not fully described because they are not implemented in this class. The full description of these operations is given in the classes from which they are inherited. The abstract operation is fully described since it must be implemented by the application.

# 3.5.5.1 DDS\_SubscriberListener\_\_alloc

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
struct DDS_SubscriberListener *
DDS_SubscriberListener__alloc
(void);
```

# Description

This operation creates a new DDS\_SubscriberListener.

# Parameters

```txt
&lt;none&gt;
```

# Return Value

struct DDS\_SubscriberListener \* - Return value is the handle to the newly-created DDS\_SubscriberListener. In case of an error, a DDS\_OBJECT\_NIL pointer is returned.

# Detailed Description

This ope ra t ion creates a new D D S \_ S u b sc r i b e r Li s t e n e r. T h e DDS\_SubscriberListener must be created using this operation. In other words, t h e a p p l i c a t i o n i s n o t a l l o w e d t o d e c l a r e a n o b j e c t o f t y p e DDS\_SubscriberListener. When the application wants to release the DDS\_SubscriberListener it must be released using DDS\_free.

I n c a s e t h e r e a r e i n s u f f i c i e n t r e s o u r c e s a v a i l a b l e t o a l l o c a t e t h e DDS\_SubscriberListener, a DDS\_OBJECT\_NIL pointer is returned instead.

# 3.5.5.2 DDS\_SubscriberListener\_on\_data\_available (inherited, abstract)

This operation is inherited and therefore not described here. See the class DDS\_DataReaderListener for further explanation.

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
void
DDS_SubscriberListener_on_data_available
(void *listener_data,
DDS_DataReader reader);
```

# 3.5.5.3 DDS\_SubscriberListener\_on\_data\_on\_readers (abstract)

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
void
DDS_SubscriberListener_on_data_on_readers
(void *listener_data,
DDS_Subscriber subs);
```

# Description

This operation must be implemented by the application and is called by the Data Distribution Service when new data is available.

# Parameters

inout void \*listener\_data - a pointer to a user-defined object which may be used for identification of the Listener.

in DDS\_Subscriber subs - contain a pointer to the DDS\_Subscriber for which data is available (this is an input to the application provided by the Data Distribution Service).

# Return Value

```txt
&lt;none&gt;
```

# Detailed Description

This operation is the external operation (interface, which must be implemented by the application) that is called by the Data Distribution Service when new data is available for this DDS\_Subscriber. The implementation may be left empty when this functionality is not needed. This operation will only be called when the relevant D D S\_ S u b s c r ib e r L i s te n e r i s i n s t a ll e d a n d e n a b le d f o r t h e DDS\_DATA\_ON\_READERS\_STATUS.

The Data Distribution Service will provide a pointer to the DDS\_Subscriber in the parameter subs for use by the application.

T h e s t a t u s e s DDS\_DATA\_ON\_READERS\_STATUS a n d DDS\_DATA\_AVAILABLE\_STATUS will occur together. In case these status changes occur, the Data Distribution Service will look for an attached and activated DDS\_SubscriberListener or DDS\_DomainParticipantListener (in that o r d e r ) f o r t h e D DS \_ D A T A \_ ON \_ R E A D ER S \_ S T A T US . I n c a s e t h e DDS\_DATA\_ON\_READERS\_STATUS can not be handled, the Data Distribution Service will look for an attached and activated DDS\_DataReaderListener, DDS\_SubscriberListener or DDS\_DomainParticipantListener for the DDS\_DATA\_AVAILABLE\_STATUS (in that order).

Note that if DDS\_SubscriberListener\_on\_data\_on\_readers is called, then t h e D a t a D i s t r i b u t i o n S e r v i c e w i l l n o t t r y t o c a l l DDS\_SubscriberListener\_on\_data\_available, however, the application can force a call to the callback function on\_data\_available of DDS\_DataReaderListener objects that have data by means of the notify\_datareaders operation.

# 3.5.5.4 DDS\_SubscriberListener\_on\_liveliness\_changed (inherited, abstract)

This operation is inherited and therefore not described here. See the class DDS\_DataReaderListener for further explanation.

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
void
DDS_SubscriberListener_on_liveliness_changed
(void *listener_data,
DDS_DataReader reader,
const DDS_LivelinessChangedStatus *status);
```

# 3.5.5.5 DDS\_SubscriberListener\_on\_requested\_deadline\_missed (inherited, abstract)

This operation is inherited and therefore not described here. See the class DDS\_DataReaderListener for further explanation.

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
void
DDS_SubscriberListener_on_requested_deadline_missed
(void *listener_data,
DDS_DataReader reader,
const DDS_RequestedDeadlineMissedStatus *status);
```

# 3.5.5.6 DDS\_SubscriberListener\_on\_requested\_incompatible\_qos (inherited, abstract)

This operation is inherited and therefore not described here. See the class DDS\_DataReaderListener for further explanation.

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
void
DDS_SubscriberListener_on_requested_incompatible_qos
(void *listener_data,
DDS_DataReader reader,
const DDS_RequestedIncompatibleQosStatus *status) =0;
```

# 3.5.5.7 DDS\_SubscriberListener\_on\_sample\_lost (inherited, abstract)

This operation is inherited and therefore not described here. See the class DDS\_DataReaderListener for further explanation.

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
void
DDS_SubscriberListener_on_sample_lost
(void *listener_data,
DDS_DataReader reader,
const DDS_SampleLostStatus *status);
```

NOTE: This operation is not yet implemented. It is scheduled for a future release.

# 3.5.5.8 DDS\_SubscriberListener\_on\_sample\_rejected (inherited, abstract)

This operation is inherited and therefore not described here. See the class DDS\_DataReaderListener for further explanation.

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
void
DDS_SubscriberListener_on_sample_rejected
(void *listener_data,
DDS_DataReader reader,
const DDS_SampleRejectedStatus *status);
```

# 3.5.5.9 DDS\_SubscriberListener\_on\_subscription\_matched (inherited, abstract)

This operation is inherited and therefore not described here. See the class DDS\_DataReaderListener for further explanation.

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
void
DDS_SubscriberListener_on_subscription_matched
(void *listener_data,
DDS_DataReader reader,
const DDS_SubscriptionMatchedStatus *status);
```

# 3.5.6 DDS\_DataReaderListener interface

Since a DDS\_DataReader is a kind of DDS\_Entity, it has the ability to have a Listener associated with it. In this case, the associated Listener should be of type DDS\_DataReaderListener. This interface must be implemented by the application. A user-defined class must be provided by the application which must e x t e n d f r o m t h e D D S \_D a t a R e a de r L i s t en e r c l a s s . A l l DDS\_DataReaderListener operations must be implemented in the user-defined class, it is up to the application whether an operation is empty or contains some functionality.

![The image displays a standard warning symbol consisting of a red triangle outline on a white background. Inside the triangle is a black exclamation mark centered vertically.](.vortex-opensplice-c-reference-guide/4373bd264e38664609816621cc2e2fb70b30ef742a6019bc9ba270cf33ebf41d.jpg)

All operations for this interface must be implemented in the user-defined class, it is up to the application whether an operation is empty or contains some functionality.

The DDS\_DataReaderListener provides a generic mechanism (actually a callback function) for the Data Distribution Service to notify the application of relevant asynchronous status change events, such as a missed deadline, violation of a QosPolicy setting, etc. The DDS\_DataReaderListener is related to changes in communication status.

The interface description of this class is as follows:

```c
/*
 * interface DDS_DataReaderListener
 */
/*
 * abstract external operations
 */
void
    DDS_DataReaderListener_on_requested_deadline_missed
    (void *listener_data,
    DDS_DataReader reader,
    const DDS_RequestedDeadlineMissedStatus *status);
void
    DDS_DataReaderListener_on_requested_incompatible_qos
    (void *listener_data,
    DDS_DataReader reader,
    const DDS_RequestedIncompatibleQosStatus *status);
void
```

```c
DDS_DataReaderListener_on_sample_rejected
(void *listener_data,
DDS_DataReader reader,
const DDS_SampleRejectedStatus *status);

void
DDS_DataReaderListener_on_liveliness_changed
(void *listener_data,
DDS_DataReader reader,
const DDS_LivelinessChangedStatus *status);

void
DDS_DataReaderListener_on_data_available
(void *listener_data,
DDS_DataReader reader);

void
DDS_DataReaderListener_on_subscription_matched
(void *listener_data,
DDS_DataReader reader,
const DDS_SubscriptionMatchedStatus *status);

void
DDS_DataReaderListener_on_sample_lost
(void *listener_data,
DDS_DataReader reader,
const DDS_SampleLostStatus *status);

/*
* implemented API operations
*/

struct DDS_DataReaderListener *
DDS_DataReaderListener_alloc
(void);
```

The next paragraphs describe the usage of all DDS\_DataReaderListener operations. These abstract operations are fully described because they must be implemented by the application.

# 3.5.6.1 DDS\_DataReaderListener\_\_alloc

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
struct DDS_DataReaderListener *
DDS_DataReaderListener__alloc
(void);
```

# Description

This operation creates a new DDS\_DataReaderListener.

# Parameters

```txt
&lt;none&gt;
```

# Return Value

struct DDS\_DataReaderListener \* - Return value is the handle to the newly-created DDS\_DataReaderListener. In case of an error, a DDS\_OBJECT\_NIL pointer is returned.

# Detailed Description

This ope ra t ion creates a new D D S \_ D a t aR e a d e r Li s t e n e r. T h e DDS\_DataReaderListener must be created using this operation. In other words, t h e a p p l i c a t i o n i s n o t a l l o w e d t o d e c l a r e a n o b j e c t o f t y p e DDS\_DataReaderListener. When the application wants to release the DDS\_DataReaderListener it must be released using DDS\_free.

I n c a s e t h e r e a r e i n s u f f i c i e n t r e s o u r c e s a v a i l a b l e t o a l l o c a t e t h e DDS\_DataReaderListener, a DDS\_OBJECT\_NIL pointer is returned instead.

# 3.5.6.2 DDS\_DataReaderListener\_on\_data\_available (abstract)

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
void
DDS_DataReaderListener_on_data_available
(void *listener_data,
DDS_DataReader reader);
```

# Description

This operation must be implemented by the application and is called by the Data Distribution Service when new data is available.

# Parameters

inout void \*listener\_data - a pointer to a user-defined object which may be used for identification of the Listener.

in DDS\_DataReader reader - contain a pointer to the DDS\_DataReader for which data is available (this is an input to the application provided by the Data Distribution Service).

# Return Value

```txt
&lt;none&gt;
```

# Detailed Description

This operation is the external operation (interface, which must be implemented by the application) that is called by the Data Distribution Service when new data is available for this DDS\_DataReader. The implementation may be left empty when this functionality is not needed. This operation will only be called when the relevant D D S\_ D a t a R e ad e r L i s te n e r i s i n s t a ll e d a n d e n a b le d f o r t h e DDS\_DATA\_AVAILABLE\_STATUS.

The Data Distribution Service will provide a pointer to the DDS\_DataReader in the parameter reader for use by the application.

T h e s t a t u s e s DDS\_DATA\_ON\_READERS\_STATUS a n d DDS\_DATA\_AVAILABLE\_STATUS will occur together. In case these status changes occur, the Data Distribution Service will look for an attached and activated DDS\_SubscriberListener or DDS\_DomainParticipantListener (in that o r d e r ) f o r t h e D D S\_ D A T A \_ ON \_ R E A D E RS \_ S T A T US . I n c a s e t h e DDS\_DATA\_ON\_READERS\_STATUS can not be handled, the Data Distribution Service will look for an attached and activated DDS\_DataReaderListener, DDS\_SubscriberListener or DDS\_DomainParticipantListener for the DDS\_DATA\_AVAILABLE\_STATUS (in that order).

Note that if DDS\_SubscriberListener\_on\_data\_on\_readers is called, then t h e D a t a D i s t r i b u t i o n S e r v i c e w i l l n o t t r y t o c a l l DDS\_DataReaderListener\_on\_data\_available, however, the application can force a call to the DDS\_DataReader objects that have data by means of the DDS\_Subscriber\_notify\_datareaders operation.

# 3.5.6.3 DDS\_DataReaderListener\_on\_liveliness\_changed (abstract)

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
void
DDS_DataReaderListener_on_liveliness_changed
(void *listener_data,
DDS_DataReader reader,
const DDS_LivelinessChangedStatus *status);
```

# Description

This operation must be implemented by the application and is called by the Data Distribution Service when the liveliness of one or more DDS\_DataWriter objects that were writing instances read through this DDS\_DataReader has changed.

# Parameters

inout void \*listener\_data - a pointer to a user-defined object which may be used for identification of the Listener.

in DDS\_DataReader reader - contain a pointer to the DDS\_DataReader for which the liveliness of one or more DDS\_DataWriter objects has changed (this is an input to the application provided by the Data Distribution Service).

in const DDS\_LivelinessChangedStatus \*status - contain the DDS\_LivelinessChangedStatus struct (this is an input to the application provided by the Data Distribution Service).

# Return Value

```txt
&lt;none&gt;
```

# Detailed Description

This operation is the external operation (interface, which must be implemented by the application) that is called by the Data Distribution Service when the liveliness of one or more DDS\_DataWriter objects that were writing instances read through this DDS\_DataReader has changed. In other words, some DDS\_DataWriter have become “alive” or “not alive”. The implementation may be left empty when this functionality is not needed. This operation will only be called when the relevant D D S\_ D a t a R ea d e r L i s te n e r i s i n s t a ll e d a n d e n a b le d f o r t h e DDS\_LIVELINESS\_CHANGED\_STATUS.

The Data Distribution Service will provide a pointer to the DDS\_DataReader in the parameter reader and the DDS\_LivelinessChangedStatus struct for use by the application.

# 3.5.6.4 DDS\_DataReaderListener\_on\_requested\_deadline\_missed (abstract)

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
void
DDS_DataReaderListener_on_requested_deadline_missed
(void *listener_data,
DDS_DataReader reader,
const DDS_RequestedDeadlineMissedStatus *status);
```

# Description

This operation must be implemented by the application and is called by the Data Distribution Service when the deadline that the DDS\_DataReader was expecting through its DDS\_DeadlineQosPolicy was not respected.

# Parameters

inout void \*listener\_data - a pointer to a user-defined object which may be used for identification of the Listener.

in DDS\_DataReader reader - contain a pointer to the DDS\_DataReader for which the deadline was missed (this is an input to the application provided by the Data Distribution Service).

in const DDS\_RequestedDeadlineMissedStatus \*status - contain the DDS\_RequestedDeadlineMissedStatus struct (this is an input to the application provided by the Data Distribution Service).

# Return Value

```txt
&lt;none&gt;
```

# Detailed Description

This operation is the external operation (interface, which must be implemented by the application) that is called by the Data Distribution Service when the deadline that the DDS\_DataReader was expecting through its DDS\_DeadlineQosPolicy was not respected for a specific instance. The implementation may be left empty when this functionality is not needed. This operation will only be called when the relevant DDS\_DataReaderListener is installed and enabled for the DDS\_REQUESTED\_DEADLINE\_MISSED\_STATUS.

The Data Distribution Service will provide a pointer to the DDS\_DataReader in the parameter reader and the DDS\_RequestedDeadlineMissedStatus struct in the parameter status for use by the application.

# 3.5.6.5 DDS\_DataReaderListener\_on\_requested\_incompatible\_qos (abstract)

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
void
DDS_DataReaderListener_on_requested_incompatible_qos
(void *listener_data,
DDS_DataReader reader,
const DDS_RequestedIncompatibleQosStatus *status);
```

# Description

This operation must be implemented by the application and is called by the Data Distribution Service when the DDS\_REQUESTED\_INCOMPATIBLE\_QOS\_STATUS changes.

# Parameters

inout void \*listener\_data - a pointer to a user-defined object which may be used for identification of the Listener.

in DDS\_DataReader reader - a pointer to the DDS\_DataReader provided by the Data Distribution Service.

in const DDS\_RequestedIncompatibleQosStatus \*status - the DDS\_REQUESTED\_INCOMPATIBLE\_QOS\_STATUS struct provided by the Data Distribution Service.

# Return Value

&lt;none&gt;

# Detailed Description

This operation is the external operation (interface, which must be implemented by the application) that is called by the Data Distribution Service when the DDS\_REQUESTED\_INCOMPATIBLE\_QOS\_STATUS changes. The implementation may be left empty when this functionality is not needed. This operation will only be called when the relevant DDS\_DataReaderListener is installed and enabled for the DDS\_REQUESTED\_INCOMPATIBLE\_QOS\_STATUS.

The Data Distribution Service will provide a pointer to the DDS\_DataReader in the parameter reader and the DDS\_REQUESTED\_INCOMPATIBLE\_QOS\_STATUS struct in the parameter status, for use by the application.

The application can use this operation as a callback function implementing a proper response to the status change. This operation is enabled by setting the DDS\_REQUESTED\_INCOMPATIBLE\_QOS\_STATUS in the mask in the call to DDS\_DataReader\_set\_listener. When the DDS\_DataReaderListener on t h e DDS\_DataReader i s n o t e n a b l e d f o r t h e DDS\_REQUESTED\_INCOMPATIBLE\_QOS\_STATUS, the status change will propagate to the DDS\_SubscriberListener of the DDS\_Subscriber (if enabled) or to the DDS\_DomainParticipantListener of the DDS\_DomainParticipant (if enabled).

# 3.5.6.6 DDS\_DataReaderListener\_on\_sample\_lost (abstract)

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
void
DDS_DataReaderListener_on_sample_lost
(void *listener_data,
DDS_DataReader reader,
const DDS_SampleLostStatus *status);
```

NOTE: This operation is not yet implemented. It is scheduled for a future release.

# 3.5.6.7 DDS\_DataReaderListener\_on\_sample\_rejected (abstract)

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
void
```

```c
DDS_DataReaderListener_on_sample_rejected
(void *listener_data,
DDS_DataReader reader,
const DDS_SampleRejectedStatus *status);
```

# Description

This operation must be implemented by the application and is called by the Data Distribution Service when a sample has been rejected.

# Parameters

inout void \*listener\_data - a pointer to a user-defined object which may be used for identification of the Listener.

in DDS\_DataReader reader - contain a pointer to the DDS\_DataReader for which a sample has been rejected (this is an input to the application provided by the Data Distribution Service).

in const DDS\_SampleRejectedStatus \*status - contain the DDS\_SampleRejectedStatus struct (this is an input to the application provided by the Data Distribution Service).

# Return Value

```txt
&lt;none&gt;
```

# Detailed Description

This operation is the external operation (interface, which must be implemented by the application) that is called by the Data Distribution Service when a (received) sample has been rejected. Samples may be rejected by the DDS\_DataReader when it runs out of resource\_limits to store incoming samples. Ususally this means that old samples need to be ‘consumed’ (for example by ‘taking’ them instead of ‘reading’ them) to make room for newly incoming samples.

The implementation may be left empty when this functionality is not needed. This operation will only be called when the relevant DDS\_DataReaderListener is installed and enabled for the DDS\_SAMPLE\_REJECTED\_STATUS.

The Data Distribution Service will provide a pointer to the DDS\_DataReader in the parameter reader and the DDS\_SampleRejectedStatus struct in the parameter status for use by the application.

# 3.5.6.8 DDS\_DataReaderListener\_on\_subscription\_matched (abstract)

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
void
DDS_DataReaderListener_on_subscription_matched
```

```c
(void *listener_data,
DDS_DataReader reader,
const DDS_SubscriptionMatchedStatus *status);
```

# Description

This operation must be implemented by the application and is called by the Data Distribution Service when a new match has been discovered for the current subscription, or when an existing match has ceased to exist.

# Parameters

inout void \*listener\_data - a pointer to a user-defined object which may be used for identification of the Listener.

in DDS\_DataReader reader - contains a pointer to the DDS\_DataReader for which a match has been discovered (this is an input to the application provided by the Data Distribution Service).

in const SubscriptionMatchedStatus \*status - contains the SubscriptionMatchedStatus struct (this is an input to the application provided by the Data Distribution Service).

# Return Value

```txt
&lt;none&gt;
```

# Detailed Description

This operation must be implemented by the application and is called by the Data Distribution Service when a new match has been discovered for the current subscription, or when an existing match has ceased to exist. Usually this means that a new DataWriter that matches the Topic and that has compatible Qos as the current DDS\_DataReader has either been discovered, or that a previously discovered DataWriter has ceased to be matched to the current DDS\_DataReader. A DataWriter may cease to match when it gets deleted, when it changes its Qos to a value that is incompatible with the current DDS\_DataReader or when either the DDS\_DataReader or the DataWriter has chosen to put its matching counterpart on its ignore-list using the DDS\_DomainParticipant\_ignore\_publication or DDS\_DomainParticipant\_ignore\_subcription operations.

The implementation of this Listener operation may be left empty when this functionality is not needed: it will only be called when the relevant D D S\_ D a t a R ea d e r L i s te n e r i s i n s t a ll e d a n d e n a b le d f o r t h e DDS\_SUBSCRIPTION\_MATCHED\_STATUS.

The Data Distribution Service will provide a pointer to the DDS\_DataReader in the parameter reader and the DDS\_SubscriptionMatchedStatus struct in the parameter status for use by the application.

# 3.5.7 Class DDS\_ReadCondition

The DDS\_DataReader objects can create a set of DDS\_ReadCondition (and DDS\_StatusCondition) objects which provide support (in conjunction with DDS\_WaitSet objects) for an alternative communication style between the Data Distribution Service and the application (i.e., wait-based rather than notification-based).

DDS\_ReadCondition objects allow an DDS\_DataReader to specify the data samples it is interested in (by specifying the desired sample-states, view-states, and instance-states); see the parameter definitions for DDS\_DataReader's DDS\_DataReader\_create\_readcondition operation. This allows the Data Distribution Service to trigger the condition only when suitable information is available. DDS\_ReadCondition objects are to be used in conjunction with a DDS\_WaitSet. More than one DDS\_ReadCondition may be attached to the same DDS\_DataReader.

The interface description of this class is as follows:

```c
/*
 * interface DDS_ReadCondition
 */
/*
 * inherited from DDS_Condition
 */
/* DDS_boolean
 *    DDS_ReadCondition_get_trigger_value
 *    (DDS_ReadCondition _this);
 */
/*
 * implemented API operations
 */
DDS_SampleStateMask
DDS_ReadCondition_get_sample_state_mask
(DDS_ReadCondition _this);

DDS_ViewStateMask
DDS_ReadCondition_get_view_state_mask
(DDS_ReadCondition _this);

DDS_InstanceStateMask
DDS_ReadCondition_get_instance_state_mask
(DDS_ReadCondition _this);

DDS_DataReader
DDS_ReadCondition_get_datareader
(DDS_ReadCondition _this);
```

The next paragraphs describe the usage of all DDS\_ReadCondition operations. The inherited operations are listed but not fully described because they are not implemented in this class. The full description of these operations is given in the classes from which they are inherited.

# 3.5.7.1 DDS\_ReadCondition\_get\_datareader

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
DDS_DataReader
DDS_ReadCondition_get_datareader
(DDS_ReadCondition _this);
```

# Description

T h i s o p e r a t i o n r e t u r n s t h e D D S \_ D a t a R e a d e r a s s o c i a t e d w i t h t h e DDS\_ReadCondition.

# Parameters

in DDS\_ReadCondition \_this - the DDS\_ReadCondition object on which the operation is operated.

# Return Value

DDS\_DataReader - Result value is a pointer to the DDS\_DataReader.

# Detailed Description

T h i s o p e r a t i o n r e t u r n s t h e D D S \_ D a t a R e a d e r a s s o c i a t e d w i t h t h e DDS\_ReadCondition. Note that there is exactly one DDS\_DataReader associated with each DDS\_ReadCondition (i.e. the DDS\_DataReader that created the DDS\_ReadCondition object).

# 3.5.7.2 DDS\_ReadCondition\_get\_instance\_state\_mask

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
DDS_InstanceStateMask
DDS_ReadCondition_get_instance_state_mask
(DDS_ReadCondition _this);
```

# Description

This operation returns the set of instance\_states that are taken into account to determine the trigger\_value of the DDS\_ReadCondition.

# Parameters

in DDS\_ReadCondition \_this - the DDS\_ReadCondition object on which the operation is operated.

# Return Value

DDS\_InstanceStateMask - Result value are the instance\_states specified when the DDS\_ReadCondition was created.

# Detailed Description

This operation returns the set of instance\_states that are taken into account to determine the trigger\_value of the DDS\_ReadCondition.

The instance\_states returned are the instance\_states specified when the DDS\_ReadCondition was created. instance\_states can be DDS\_ALIVE\_INSTANCE\_STATE,

DDS\_NOT\_ALIVE\_DISPOSED\_INSTANCE\_STATE,

DDS\_NOT\_ALIVE\_NO\_WRITERS\_INSTANCE\_STATE or a combination of these.

# 3.5.7.3 DDS\_ReadCondition\_get\_sample\_state\_mask

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
DDS_SampleStateMask
DDS_ReadCondition_get_sample_state_mask
(DDS_ReadCondition _this);
```

# Description

This operation returns the set of sample\_states that are taken into account to determine the trigger\_value of the DDS\_ReadCondition.

# Parameters

in DDS\_ReadCondition \_this - the DDS\_ReadCondition object on which the operation is operated.

# Return Value

DDS\_SampleStateMask - Result value are the sample\_states specified when the DDS\_ReadCondition was created.

# Detailed Description

This operation returns the set of sample\_states that are taken into account to determine the trigger\_value of the DDS\_ReadCondition.

The sample\_states returned are the sample\_states specified when the DDS\_ReadCondition was created. sample\_states can be DDS\_READ\_SAMPLE\_STATE, DDS\_NOT\_READ\_SAMPLE\_STATE or both.

# 3.5.7.4 DDS\_ReadCondition\_get\_trigger\_value (inherited)

This operation is inherited and therefore not described here. See the class DDS\_Condition for further explanation.

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
DDS_boolean
DDS_ReadCondition_get_trigger_value
(DDS_ReadCondition _this);
```

# 3.5.7.5 DDS\_ReadCondition\_get\_view\_state\_mask

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
DDS_ViewStateMask
DDS_ReadCondition_get_view_state_mask
(DDS_ReadCondition _this);
```

# Description

This operation returns the set of view\_states that are taken into account to determine the trigger\_value of the DDS\_ReadCondition.

# Parameters

in DDS\_ReadCondition \_this - the DDS\_ReadCondition object on which the operation is operated.

# Return Value

DDS\_ViewStateMask - Result value are the view\_states specified when the DDS\_ReadCondition was created.

# Detailed Description

This operation returns the set of view\_states that are taken into account to determine the trigger\_value of the DDS\_ReadCondition.

The view\_states returned are the view\_states specified when the DDS\_ReadCondition was created. view\_states can be DDS\_NEW\_VIEW\_STATE, DDS\_NOT\_NEW\_VIEW\_STATE or both.

# 3.5.8 Class DDS\_QueryCondition

DDS\_QueryCondition objects are specialized DDS\_ReadCondition objects that allow the application to specify a filter on the locally available data. The DDS\_DataReader objects accept a set of DDS\_QueryCondition objects for the DDS\_DataReader and provide support (in conjunction with DDS\_WaitSet objects) for an alternative communication style between the Data Distribution Service and the application (i.e., wait-based rather than notification-based).

# Query Function

DDS\_QueryCondition objects allow an application to specify the data samples it is interested in (by specifying the desired sample-states, view-states, instance-states and query expression); see the parameter definitions for DDS\_DataReader's DDS\_DataReader\_read/DDS\_DataReader\_take operations. This allows the Data Distribution Service to trigger the condition only when suitable information is available. DDS\_QueryCondition objects are to be used in conjunction with a DDS\_WaitSet. More than one DDS\_QueryCondition may be attached to the same DDS\_DataReader.

The query (query\_expression) is similar to an SQL WHERE clause and can be parameterized by arguments that are dynamically changeable with the DDS\_QueryCondition\_set\_query\_parameters operation.

The interface description of this class is as follows:

```c
/*
 * interface DDS_QueryCondition
 */
/*
 * inherited from DDS_ReadCondition
 */
/* DDS_SampleStateMask
 *    DDS_QueryCondition_get_sample_state_mask
 *    (DDS_QueryCondition _this);
 */
/* DDS_ViewStateMask
 *    DDS_QueryCondition_get_view_state_mask
 *    (DDS_QueryCondition _this);
 */
/* DDS_InstanceStateMask
 *    DDS_QueryCondition_get_instance_state_mask
 *    (DDS_QueryCondition _this);
 */
/* DDS_DataReader
 *    DDS_QueryCondition_get_datareader
 *    (DDS_QueryCondition _this);
```

```c
*/
/* DDS_boolean
*    DDS_QueryCondition_get_trigger_value
*    (DDS_QueryCondition _this);
*/
/*
* implemented API operations
*/
DDS_string
DDS_QueryCondition_get_query_expression
(DDS_QueryCondition _this);

DDS_ReturnCode_t
DDS_QueryCondition_get_query_parameters
(DDS_QueryCondition _this,
DDS_StringSeq *query_parameters);

DDS_ReturnCode_t
DDS_QueryCondition_set_query_parameters
(DDS_QueryCondition _this,
const DDS_StringSeq *query_parameters);
```

The next paragraphs describe the usage of all DDS\_QueryCondition operations. The inherited operations are listed but not fully described because they are not implemented in this class. The full description of these operations is given in the classes from which they are inherited.

# 3.5.8.1 DDS\_QueryCondition\_get\_datareader (inherited)

This operation is inherited and therefore not described here. See the class DDS\_ReadCondition for further explanation.

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
DDS_DataReader
DDS_QueryCondition_get_datareader
(DDS_QueryCondition _this);
```

# 3.5.8.2 DDS\_QueryCondition\_get\_instance\_state\_mask (inherited)

This operation is inherited and therefore not described here. See the class DDS\_ReadCondition for further explanation.

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
DDS_InstanceStateMask
DDS_QueryCondition_get_instance_state_mask
(DDS_QueryCondition _this);
```

# 3.5.8.3 DDS\_QueryCondition\_get\_query\_parameters

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
DDS_ReturnCode_t
DDS_QueryCondition_get_query_parameters
(DDS_QueryCondition _this,
DDS_StringSeq *query_parameters);
```

# Description

This operation returns the query\_parameters associated with the DDS\_QueryCondition.

# Parameters

in DDS\_QueryCondition \_this - the DDS\_QueryCondition object on which the operation is operated.

inout DDS\_StringSeq \*query\_parameters - a handle to a sequence of strings that will be used to store the parameters used in the SQL expression.

# Return Value

```txt
DDS_ReturnCode_t - Possible return codes of the operation are: DDS_RETCODE_OK, DDS_RETCODE_ERROR, DDS_RETCODE_ILLEGAL_OPERATION, DDS_RETCODE_ALREADY_DELETED or DDS_RETCODE_OUT_OF_RESOURCES.
```

# Detailed Description

This operation obtains the query\_parameters associated with the DDS\_QueryCondition. That is, the parameters specified on the last successful call t o DDS\_QueryCondition\_set\_query\_parameters or, if DDS\_QueryCondition\_set\_query\_parameters was never called, the arguments specified when the DDS\_QueryCondition were created. The resulting handle contains a sequence of strings with the parameters used in the SQL expression (i.e., the %n tokens in the expression). The number of parameters in the result sequence will exactly match the number of %n tokens in the query expression associated with the DDS\_QueryCondition.

# Return Code

When the operation returns:

• DDS\_RETCODE\_OK - the existing set of query parameters applied to this DDS\_QueryCondition has successfully been copied into the specified query\_parameters parameter.

• DDS\_RETCODE\_ERROR - an internal error has occurred.
• DDS\_RETCODE\_ILLEGAL\_OPERATION - the operation is invoked on an inappropriate object.
• DDS\_RETCODE\_ALREADY\_DELETED - the DDS\_QueryCondition has already been deleted.
• DDS\_RETCODE\_OUT\_OF\_RESOURCES - the Data Distribution Service ran out of resources to complete this operation.

# 3.5.8.4 DDS\_QueryCondition\_get\_query\_expression

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
DDS_string
DDS_QueryCondition_get_query_expression
(DDS_QueryCondition _this);
```

# Description

T h i s o p e r a t i o n r e t u r n s t h e q u e r y e x p r e s s i o n a s s o c i a t e d w i t h t h e DDS\_QueryCondition.

# Parameters

in DDS\_QueryCondition \_this - the DDS\_QueryCondition object on which the operation is operated.

# Return Value

DDS\_string - Result value is a pointer to the query expression associated with the DDS\_QueryCondition.

# Detailed Description

T h i s o p e r a t i o n r e t u r n s t h e q u e r y e x p r e s s i o n a s s o c i a t e d w i t h t h e DDS\_QueryCondition. That is, the expression specified when the DDS\_QueryCondition was created. The operation will return DDS\_OBJECT\_NIL when there was an internal error or when the DDS\_QueryCondition was already deleted. If there were no parameters, an empty sequence is returned.

It is the applications responsibility to free the allocated memory for the DDS\_StringSeq.

# 3.5.8.5 DDS\_QueryCondition\_get\_sample\_state\_mask (inherited)

This operation is inherited and therefore not described here. See the class DDS\_ReadCondition for further explanation.

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
DDS_SampleStateMask
DDS_QueryCondition_get_sample_state_mask
(DDS_QueryCondition _this);
```

# 3.5.8.6 DDS\_QueryCondition\_get\_trigger\_value (inherited)

This operation is inherited and therefore not described here. See the class DDS\_ReadCondition for further explanation.

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
DDS_boolean
DDS_QueryCondition_get_trigger_value
(DDS_QueryCondition _this);
```

# 3.5.8.7 DDS\_QueryCondition\_get\_view\_state\_mask (inherited)

This operation is inherited and therefore not described here. See the class DDS\_ReadCondition for further explanation.

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
DDS_ViewStateMask
DDS_QueryCondition_get_view_state_mask
(DDS_QueryCondition _this);
```

# 3.5.8.8 DDS\_QueryCondition\_set\_query\_parameters

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
DDS_ReturnCode_t
DDS_QueryCondition_set_query_parameters
(DDS_QueryCondition _this,
const DDS_StringSeq *query_parameters);
```

# Description

T h i s o p e r a t i o n c h a n g e s t h e q u e r y p a r a m e t e r s a s s o c i a t e d w i t h t h e DDS\_QueryCondition.

# Parameters

in DDS\_QueryCondition \_this - the DDS\_QueryCondition object on which the operation is operated.

in const DDS\_StringSeq \*query\_parameters - a sequence of strings which are the parameters used in the SQL query string (i.e., the “%n” tokens in the expression).

# Return Value

D D S \_ R e t u r n C o d e \_ t - P o s s i b l e r e t u r n c o d e s o f t h e o p e r a t i o n a r e : DDS\_RETCODE\_OK, DDS\_RETCODE\_ERROR, DDS\_RETCODE\_ILLEGAL\_ OPERATION, DDS\_RETCODE\_BAD\_PARAMETER, DDS\_RETCODE\_ ALREADY\_DELETED or DDS\_RETCODE\_OUT\_OF\_RESOURCES.

# Detailed Description

T h i s o p e r a t i o n c h a n g e s t h e q u e r y p a r a m e t e r s a s s o c i a t e d w i t h t h e DDS\_QueryCondition. The parameter query\_parameters is a sequence of strings which are the parameters values used in the SQL query string (i.e., the “%n” tokens in the expression). The number of values in query\_parameters must be equal or greater than the highest referenced %n token in the query\_expression (e.g. if %1 and %8 are used as parameter in the query\_expression, the query\_parameters should at least contain n+1 = 9 values).

# Return Code

When the operation returns:

• DDS\_RETCODE\_OK - the query parameters associated with the DDS\_QueryCondition are changed.
• DDS\_RETCODE\_ERROR - an internal error has occurred.
• DDS\_RETCODE\_ILLEGAL\_OPERATION - the operation is invoked on an inappropriate object.
• DDS\_RETCODE\_BAD\_PARAMETER - the number of parameters in query\_parameters does not match the number of “%n” tokens in the expression for this DDS\_QueryCondition or one of the parameters is an illegal parameter.
• DDS\_RETCODE\_ALREADY\_DELETED - the DDS\_QueryCondition has already been deleted.
• DDS\_RETCODE\_OUT\_OF\_RESOURCES - the Data Distribution Service ran out of resources to complete this operation.

# 3.5.9 Class DDS\_DataReaderView (abstract)

A DataReaderView allows the application to create an additional view on the dataset stored in a DataReader. The view is expressed by an (optional) alternative key list specified in the DDS\_DataReaderViewQos, which allows it to specify an alternative storage spectrum. Applications might prefer such an alternative storage spectrum (for example by adding or removing key-fields) because it may help them to process the samples in a different order/cohesion than what they will have when they use the original key-list.

A DataReaderView has the following properties:

• Any DDS\_DataReaderView belongs to exactly one DDS\_DataReader.
• A DDS\_DataReader can have zero to many DDS\_DataReaderViews attached (all with their own key\_list definitions).
• The DDS\_DataReaderView has the same interface as the DDS\_DataReader with its read and take variants, including w\_condition and next\_instance, next\_sample, etc. It also supports DDS\_ReadConditions and DDS\_QueryConditions like a DDS\_DataReader does.
• Any sample that is inserted into the DataReader will introduce a corresponding DataViewSample in all its attached DataReaderViews in a ViewInstance as defined by the keys specified in the DataReaderView Qos key\_list when the view was created.
• Like samples in a DataReader, DataViewSamples in a DataReaderView belong to exactly one ViewInstance. Instances in the dataReaderView do not have any instance state information though. The instance state information found in the SampleInfo for each DataReaderView sample is copied from the corresponding DataReader sample.
• Whenever a sample is taken from the DataReader, its corresponding samples in all attached DataReaderViews will be removed as well. The same goes for samples that are pushed out of the DataReader instance history (in case of a KEEP\_LAST HistoryQosPolicy) or for samples whose lifespan expired.
• A ViewInstance always has an infinite history depth; samples can not be pushed out of the view.
• Whenever a sample is taken from a DataReaderView, it is removed from that DataReaderView but not from the DataReader, nor from any of its other views. If all samples in a ViewInstance are taken, then that ViewInstance is destroyed.

DDS\_DataReaderView is an abstract class. It is specialized for each particular application data type. For a fictional application data type "Foo" (defined in the module SPACE) the specialized class would be SPACE\_FooDataReaderView.

The interface description of this class is as follows:

```c
/*
 * interface DDS_DataReaderView
 */
/*
 * inherited from class DDS_Entity
 */
```

```c
/* DDS_StatusCondition
* DDS_DataReaderView_get_statuscondition
* (DDS_DataReaderView _this);
*/
/*
* DDS_StatusMask
* DDS_DataReaderView_get_status_changes
* (DDS_DataReaderView _this);
*/
/*
* DDS_ReturnCode_t
* DDS_DataReaderView_enable
* (DDS_DataReaderView _this);
*/
/*
* abstract operations
* (implemented in the data type specific DDS_DataReaderView)
*/
/*
* DDS_ReturnCode_t
* DDS_DataReaderView_get_key_value
* (DDS_DataReaderView _this,
* &lt;data&gt; *key_holder,
* const DDS_InstanceHandle_t handle);
*/
/*
* DDS_InstanceHandle_t
* DDS_DataReaderView_lookup_instance
* (DDS_DataReaderView _this,
* const &lt;data&gt; *instance_data);
*/
/*
* DDS_ReturnCode_t
* DDS_DataReaderView_read
* (DDS_DataReaderView _this,
* DDS_sequence_&lt;data&gt; *data_values,
* SampleInfoSeq *info_seq,
* const DDS_long max_samples,
* const DDS_SampleStateMask sample_states,
* const DDS_ViewStateMask view_states,
* const DDS_InstanceStateMask instance_states);
*/
/*
* DDS_ReturnCode_t
* DDS_DataReaderView_read_instance
* (DDS_DataReaderView _this,
* DDS_sequence_&lt;data&gt; *data_values,
* SampleInfoSeq *info_seq,
* const DDS_long max_samples,
* const DDS_InstanceHandle_t a_handle,
```

```c
* const DDS_SampleStateMask sample_states,
* const DDS_ViewStateMask view_states,
* const DDS_InstanceStateMask instance_states);
*/
/*
 * DDS_ReturnCode_t
 * DDS_DataReaderView_read_next_instance
 * (DDS_DataReaderView _this,
 * DDS_sequence_&lt;data&gt; *data_values,
 * SampleInfoSeq *info_seq,
 * const DDS_long max_samples,
 * const DDS_InstanceHandle_t a_handle,
 * const DDS_SampleStateMask sample_states,
 * const DDS_ViewStateMask view_states,
 * const DDS_InstanceStateMask instance_states);
 */
/*
 * DDS_ReturnCode_t
 * DDS_DataReaderView_read_next_instance_w_condition
 * (DDS_DataReaderView _this,
 * DDS_sequence_&lt;data&gt; *data_values,
 * SampleInfoSeq *info_seq,
 * const DDS_long max_samples,
 * const DDS_InstanceHandle_t a_handle,
 * const DDS_ReadCondition a_condition);
 */
/*
 * DDS_ReturnCode_t
 * DDS_DataReaderView_read_next_sample
 * (DDS_DataReaderView _this,
 * &lt;data&gt; *received_data,
 * DDS_SampleInfo *sample_info);
 */
/*
 * DDS_ReturnCode_t
 * DDS_DataReaderView_read_w_condition
 * (DDS_DataReaderView _this,
 * DDS_sequence_&lt;data&gt; *data_values,
 * SampleInfoSeq *info_seq,
 * const DDS_long max_samples,
 * const DDS_ReadCondition a_condition);
 */
/*
 * DDS_ReturnCode_t
 * DDS_DataReaderView_return_loan
 * (DDS_DataReaderView _this,
 * DDS_sequence_&lt;data&gt; *data_values,
 * SampleInfoSeq *info_seq);
 */
/*
 */
```

```c
* DDS_ReturnCode_t
* DDS_DataReaderView_take
* (DDS_DataReaderView _this,
* DDS_sequence_&lt;data&gt; *data_values,
* SampleInfoSeq *info_seq,
* const DDS_long max_samples,
* const DDS_SampleStateMask sample_states,
* const DDS_ViewStateMask view_states,
* const DDS_InstanceStateMask instance_states);
*/
/*
* DDS_ReturnCode_t
* DDS_DataReaderView_take_instance
* (DDS_DataReaderView _this,
* DDS_sequence_&lt;data&gt; *data_values,
* SampleInfoSeq *info_seq,
* const DDS_long max_samples,
* const DDS_InstanceHandle_t a_handle,
* const DDS_SampleStateMask sample_states,
* const DDS_ViewStateMask view_states,
* const DDS_InstanceStateMask instance_states);
*/
/*
* DDS_ReturnCode_t
* DDS_DataReaderView_take_next_instance
* (DDS_DataReaderView _this,
* DDS_sequence_&lt;data&gt; *data_values,
* SampleInfoSeq *info_seq,
* const DDS_long max_samples,
* const DDS_InstanceHandle_t a_handle,
* const DDS_SampleStateMask sample_states,
* const DDS_ViewStateMask view_states,
* const DDS_InstanceStateMask instance_states);
*/
/*
* DDS_ReturnCode_t
* DDS_DataReaderView_take_next_instance_w_condition
* (DDS_DataReaderView _this,
* DDS_sequence_&lt;data&gt; *data_values,
* SampleInfoSeq *info_seq,
* const DDS_long max_samples,
* const DDS_InstanceHandle_t a_handle,
* const DDS_ReadCondition a_condition);
*/
/*
* DDS_ReturnCode_t
* DDS_DataReaderView_take_next_sample
* (DDS_DataReaderView _this,
* &lt;data&gt; *received_data,
* DDS_SampleInfo *sample_info);
```

```c
*/
/*
 * DDS_ReturnCode_t
 * DDS_DataReaderView_take_w_condition
 * (DDS_DataReaderView _this,
 * DDS_sequence_&lt;data&gt; *data_values,
 * SampleInfoSeq *info_seq,
 * const DDS_long max_samples,
 * const DDS_ReadCondition a_condition);
 */
/*
 * implemented API operations
 */

DDS_QueryCondition
    DDS_DataReaderView_create_querycondition
    (DDS_DataReaderView _this,
    const DDS_SampleStateMask sample_states,
    const DDS_ViewStateMask view_states,
    const DDS_InstanceStateMask instance_states,
    const DDS_char *query_expression,
    const DDS_StringSeq *query_parameters);

DDS_ReadCondition
    DDS_DataReaderView_create_readcondition
    (DDS_DataReaderView _this,
    const DDS_SampleStateMask sample_states,
    const DDS_ViewStateMask view_states,
    const DDS_InstanceStateMask instance_states);

DDS_ReturnCode_t
    DDS_DataReaderView_delete_contained_entities
    (DDS_DataReaderView _this);

DDS_ReturnCode_t
    DDS_DataReaderView_delete_readcondition
    (DDS_DataReaderView _this,
    const DDS_ReadCondition a_condition);

DDS_DataReader
    DDS_DataReaderView_get_datareader
    (DDS_DataReaderView _this);

DDS_ReturnCode_t
    DDS_DataReaderView_get_qos
    (DDS_DataReaderView _this,
    DDS_DataReaderViewQos *qos);

DDS_ReturnCode_t
    DDS_DataReaderView_set_qos
```

```javascript
(DDS_DataReaderView _this,
const DDS_DataReaderViewQos *qos);
```

The next paragraphs describe the usage of all DataReaderView operations. The inherited and abstract operations are listed but not fully described because they are not implemented in this class. The full description of these operations is given in the classes from which they are inherited and in the data type specific classes in which they are implemented.

Because the DataReaderView closely follows DataReader semantics, a lot of operations are identical. In those cases where the operation on the DataReaderView is identical to the one on the DataReader, no full description is given but the operation on the DataReader or its respective type specific class is referenced.

# 3.5.9.1 DDS\_DataReaderView\_create\_querycondition

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
DDS_QueryCondition
DDS_DataReaderView_create_querycondition
(DDS_DataReaderView _this,
const DDS_SampleStateMask sample_states,
const DDS_ViewStateMask view_states,
const DDS_InstanceStateMask instance_states,
const DDS_char *query_expression,
const DDS_StringSeq *query_parameters);
```

# Description

This operation creates a new QueryCondition for the DataReaderView. For a full d e s c r i p t i o n p l e a s e r e f e r t o S e c t i o n 3 . 5 . 2 . 2 , DDS\_DataReader\_create\_querycondition, on page 427, which describes this operation in detail for the DataReader class.

# 3.5.9.2 DDS\_DataReaderView\_create\_readcondition

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
DDS_ReadCondition
DDS_DataReaderView_create_readcondition
(DDS_DataReaderView _this,
const DDS_SampleStateMask sample_states,
const DDS_ViewStateMask view_states,
const DDS_InstanceStateMask instance_states);
```

# Description

This operation creates a new ReadCondition for the DataReaderView. For a full description please refer to Section 3.5.2.3, DDS\_DataReader\_create\_readcondition, on page 428, which describes this operation in detail for the DataReader class.

# 3.5.9.3 DDS\_DataReaderView\_delete\_contained\_entities

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
DDS_ReturnCode_t
DDS_DataReaderView_delete_contained_entities
(DDS_DataReaderView _this);
```

# Description

This operation deletes all the entities that were created by means of one of the "create\_" operations on the DataReaderView. For a full description please refer to Section 3.5.2.5, DDS\_DataReader\_delete\_contained\_entities, on page 430, which describes this operation in detail for the DataReader class.

# 3.5.9.4 DDS\_DataReaderView\_delete\_readcondition

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
DDS_ReturnCode_t
DDS_DataReaderView_delete_readcondition
(DDS_DataReaderView _this,
DDS_ReadCondition a_condition);
```

# Description

This operation deletes a ReadCondition or QueryCondition which is attached to the DataReaderView. For a full description please refer to Section 3.5.2.5, DDS\_DataReader\_delete\_contained\_entities, on page 430, which describes this operation in detail for the DataReader class.

# 3.5.9.5 DDS\_DataReaderView\_enable (inherited)

This operation is inherited and therefore not described here. See the class Entity for further explanation.

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
DDS_ReturnCode_t
DDS_DataReaderView_enable
(DDS_DataReaderView _this);
```

# 3.5.9.6 DDS\_DataReaderView\_get\_datareader

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
DDS_DataReader
DDS_DataReaderView_get_datareader
(DDS_DataReaderView _this);
```

# Description

Retrieves the DataReader to which this DataReaderView is attached.

# Parameters

in DDS\_DataReaderView - the DDS\_DataReaderView object on which the operation is operated.

# Return Value

DDS\_DataReader - Return value is a pointer to the DDS\_DataReader to which the DDS\_DataReaderView belongs.

# Detailed Description

This operation returns a pointer to the DDS\_DataReader from which the DDS\_DataReaderView was originally created. If the DDS\_DataReaderView is already deleted, the DDS\_OBJECT\_NIL pointer is returned.

# 3.5.9.7 DDS\_DataReaderView\_get\_key\_value (abstract)

This abstract operation is defined as a generic operation, which is implemented by the &lt;NameSpace&gt;\_&lt;type&gt;DataReaderView class. Therefore, to use this operation, the data type specific implementation of this operation in its respective derived class must be used. For further explanation see the description for the f i c t i o n a l d a t a t y p e F o o ( d e f i n e d i n t h e m o d u l e S P A C E ) d e r i v e d SPACE\_FooDataReaderView class.

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
DDS_ReturnCode_t
DDS_DataReaderView_get_key_value
(DDS_DataReaderView _this,
&lt;data&gt; *key_holder,
const DDS_InstanceHandle_t handle);
```

# 3.5.9.8 DDS\_DataReaderView\_get\_qos

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
DDS_ReturnCode_t
DDS_DataReaderView_get_qos
(DDS_DataReaderView_this,
DDS_DataReaderViewQos *qos);
```

# Description

This operation allows access to the existing set of QoS policies of a D D S\_ D a t a R e ad e r V i e w o n w h ic h t h i s o p e r a t i o n i s u s e d . T h i s DDS\_DataReaderViewQos is stored at the location pointed to by the qos parameter.

# Parameters

in DDS\_DataReaderView - the DDS\_DataReaderView object on which the operation is operated.

inout DataReaderViewQos \*qos - a pointer to the destination DDS\_DataReaderViewQos struct in which the QosPolicy settings will be copied.

# Return Value

```txt
DDS_ReturnCode_t - Possible return codes of the operation are: DDS_RETCODE_OK, DDS_RETCODE_ERROR, DDS_RETCODE_ILLEGAL_OPERATION, DDS_RETCODE_ALREADY_DELETED or DDS_RETCODE_OUT_OF_RESOURCES.
```

# Detailed Description

This operation allows access to the existing set of QoS policies of a D D S\_ D a t a R e ad e r V i e w o n w h ic h t h i s o p e r a t i o n i s u s e d . T h i s DDS\_DataReaderViewQos is stored at the location pointed to by the qos parameter.

# Return Code

When the operation returns:

• DDS\_RETCODE\_OK - the existing set of QoSPolicy values applied to this DDS\_DataReaderView has successfully been copied into the specified DDS\_DataReaderViewQos parameter.

• DDS\_RETCODE\_ERROR - an internal error has occurred.

• DDS\_RETCODE\_ILLEGAL\_OPERATION - the operation is invoked on an inappropriate object.
• DDS\_RETCODE\_ALREADY\_DELETED - the DDS\_DataReaderView has already been deleted.
• DDS\_RETCODE\_OUT\_OF\_RESOURCES - the Data Distribution Service ran out of resources to complete this operation.

# 3.5.9.9 DDS\_DataReaderView\_get\_status\_changes (inherited)

This operation is inherited and therefore not described here. See the class Entity for further explanation.

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
DDS_StatusMask
DDS_DataReaderView_get_status_changes
(DDS_DataReaderView _this);
```

# 3.5.9.10 DDS\_DataReaderView\_get\_statuscondition (inherited)

This operation is inherited and therefore not described here. See the class Entity for further explanation.

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
DDS_StatusCondition
DDS_DataReaderView_get_statuscondition
(DDS_DataReaderView _this);
```

# 3.5.9.11 DDS\_DataReaderView\_lookup\_instance (abstract)

This abstract operation is defined as a generic operation, which is implemented by the &lt;NameSpace&gt;\_&lt;type&gt;DataReaderView class. Therefore, to use this operation, the data type specific implementation of this operation in its respective derived class must be used. For further explanation see the description for the f i c t i o n a l d a t a t y p e F o o ( d e f i n e d i n t h e m o d u l e S P A C E ) d e r i v e d SPACE\_FooDataReaderView class.

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
DDS_InstanceHandle_t
DDS_DataReaderView_lookup_instance
(DDS_DataReaderView _this,
const &lt;data&gt; *instance_data);
```

# 3.5.9.12 DDS\_DataReaderView\_read (abstract)

This abstract operation is defined as a generic operation, which is implemented by the &lt;NameSpace&gt;\_&lt;type&gt;DataReaderView class. Therefore, to use this operation, the data type specific implementation of this operation in its respective derived class must be used. For further explanation see the description for the f i c t i o n a l d a t a t y p e F o o ( d e f i n e d i n t h e m o d u l e S P A C E ) d e r i v e d SPACE\_FooDataReaderView class.

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
DDS_ReturnCode_t
DDS_DataReaderView_read
(DDS_DataReaderView _this,
DDS_sequence_&lt;data&gt; *data_values,
SampleInfoSeq *info_seq,
const DDS_long max_samples,
const DDS_SampleStateMask sample_states,
const DDS_ViewStateMask view_states,
const DDS_InstanceStateMask instance_states);
```

# 3.5.9.13 DDS\_DataReaderView\_read\_instance (abstract)

This abstract operation is defined as a generic operation, which is implemented by the &lt;NameSpace&gt;\_&lt;type&gt;DataReaderView class. Therefore, to use this operation, the data type specific implementation of this operation in its respective derived class must be used. For further explanation see the description for the f i c t i o n a l d a t a t y p e F o o ( d e f i n e d i n t h e m o d u l e S P A C E ) d e r i v e d SPACE\_FooDataReaderView class.

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
DDS_ReturnCode_t
DDS_DataReaderView_read_instance
(DDS_DataReaderView _this,
DDS_sequence_&lt;data&gt; *data_values,
SampleInfoSeq *info_seq,
const DDS_long max_samples,
const DDS_InstanceHandle_t a_handle,
const DDS_SampleStateMask sample_states,
const DDS_ViewStateMask view_states,
const DDS_InstanceStateMask instance_states);
```

# 3.5.9.14 DDS\_DataReaderView\_read\_next\_instance (abstract)

This abstract operation is defined as a generic operation, which is implemented by the &lt;NameSpace&gt;\_&lt;type&gt;DataReaderView class. Therefore, to use this operation, the data type specific implementation of this operation in its respective derived class must be used. For further explanation see the description for the f i c t i o n a l d a t a t y p e F o o ( d e f i n e d i n t h e m o d u l e S P A C E ) d e r i v e d SPACE\_FooDataReaderView class.

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
DDS_ReturnCode_t
DDS_DataReaderView_read_next_instance
(DDS_DataReaderView _this,
DDS_sequence_&lt;data&gt; *data_values,
SampleInfoSeq *info_seq,
const DDS_long max_samples,
const DDS_InstanceHandle_t a_handle,
const DDS_SampleStateMask sample_states,
const DDS_ViewStateMask view_states,
const DDS_InstanceStateMask instance_states);
```

# 3.5.9.15 DDS\_DataReaderView\_read\_next\_instance\_w\_condition (abstract)

This abstract operation is defined as a generic operation, which is implemented by the &lt;NameSpace&gt;\_&lt;type&gt;DataReaderView class. Therefore, to use this operation, the data type specific implementation of this operation in its respective derived class must be used. For further explanation see the description for the f i c t i o n a l d a t a t y p e F o o ( d e f i n e d i n t h e m o d u l e S P A C E ) d e r i v e d SPACE\_FooDataReaderView class.

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
DDS_ReturnCode_t
DDS_DataReaderView_read_next_instance_w_condition
(DDS_DataReaderView _this,
DDS_sequence_&lt;data&gt; *data_values,
SampleInfoSeq *info_seq,
const DDS_long max_samples,
const DDS_InstanceHandle_t a_handle,
const DDS_ReadCondition a_condition);
```

# 3.5.9.16 DDS\_DataReaderView\_read\_next\_sample (abstract)

This abstract operation is defined as a generic operation, which is implemented by the &lt;NameSpace&gt;\_&lt;type&gt;DataReaderView class. Therefore, to use this operation, the data type specific implementation of this operation in its respective derived class must be used. For further explanation see the description for the f i c t i o n a l d a t a t y p e F o o ( d e f i n e d i n t h e m o d u l e S P A C E ) d e r i v e d SPACE\_FooDataReaderView class.

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
DDS_ReturnCode_t
DDS_DataReaderView_read_next_sample
(DDS_DataReaderView _this,
&lt;data&gt; *data_values,
DDS_SampleInfo *sample_info);
```

# 3.5.9.17 DDS\_DataReaderView\_read\_w\_condition (abstract)

This abstract operation is defined as a generic operation, which is implemented by the &lt;NameSpace&gt;\_&lt;type&gt;DataReaderView class. Therefore, to use this operation, the data type specific implementation of this operation in its respective derived class must be used. For further explanation see the description for the f i c t i o n a l d a t a t y p e F o o ( d e f i n e d i n t h e m o d u l e S P A C E ) d e r i v e d SPACE\_FooDataReaderView class.

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
DDS_ReturnCode_t
DDS_DataReaderView_read_w_condition
(DDS_DataReaderView _this,
DDS_sequence_&lt;data&gt; *data_values,
SampleInfoSeq *info_seq,
const DDS_long max_samples,
const DDS_ReadCondition a_condition);
```

# 3.5.9.18 DDS\_DataReaderView\_return\_loan (abstract)

This abstract operation is defined as a generic operation, which is implemented by the &lt;NameSpace&gt;\_&lt;type&gt;DataReaderView class. Therefore, to use this operation, the data type specific implementation of this operation in its respective derived class must be used. For further explanation see the description for the f i c t i o n a l d a t a t y p e F o o ( d e f i n e d i n t h e m o d u l e S P A C E ) d e r i v e d SPACE\_FooDataReaderView class.

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
DDS_ReturnCode_t
DDS_DataReaderView_return_loan
(DDS_DataReaderView _this,
DDS_sequence_&lt;data&gt; *data_values,
SampleInfoSeq *info_seq);
```

# 3.5.9.19 DDS\_DataReaderView\_set\_qos

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
DDS_ReturnCode_t
DDS_DataReaderView_set_qos
(DDS_DataReaderView _this,
const DDS_DataReaderViewQos *qos);
```

# Description

T h i s o p e r a t i o n r e p l a c e s t h e e x i s t i n g s e t o f Q o s P o l i c y s e t t i n g s f o r a DDS\_DataReaderView.

# Parameters

in DDS\_DataReaderView - the DDS\_DataReaderView object on which the operation is operated.

in const DDS\_DataReaderViewQos \*qos - the new set of QosPolicy settings for the DDS\_DataReaderView.

# Return Value

```txt
DDS_ReturnCode_t - Possible return codes of the operation are: DDS_RETCODE_OK, DDS_RETCODE_ERROR, DDS_RETCODE_ILLEGAL_OPERATION, DDS_RETCODE_BAD_PARAMETER, DDS_RETCODE_ALREADY_DELETED, DDS_RETCODE_OUT_OF_RESOURCES or DDS_RETCODE_IMMUTABLE_POLICY.
```

# Detailed Description

T h i s o p e r a t i o n r e p l a c e s t h e e x i s t i n g s e t o f Q o s P o l i c y s e t t i n g s f o r a DDS\_DataReaderView.

The parameter qos contains the QosPolicy settings which is checked for self-consistency and mutability. When the application tries to change a QosPolicy setting for an enabled DDS\_DataReaderView, which can only be set before the D D S \_ D a t a R e a d e r V i e w i s e n a b l e d , t h e o p e r a t i o n w i l l f a i l a n d a DDS\_RETCODE\_IMMUTABLE\_POLICY is returned. In other words, the application must provide the presently set QosPolicy settings in case of the immutable QosPolicy settings. Only the mutable QosPolicy settings can be changed.

The set of QosPolicy settings specified by the qos parameter are applied on top of the existing QoS, replacing the values of any policies previously set (provided that the operation returned DDS\_RETCODE\_OK).

# Return Code

When the operation returns:

• RETCODE\_OK - the new DataReaderViewQos is set.
• RETCODE\_ERROR - an internal error has occurred.
• DDS\_RETCODE\_ILLEGAL\_OPERATION - the operation is invoked on an inappropriate object.
• RETCODE\_BAD\_PARAMETER - the parameter qos is not a valid DataReaderViewQos. It contains NULL pointer strings or strings that do not represent accessible attributes of the datatype.
• RETCODE\_ALREADY\_DELETED - the DDS\_DataReaderView has already been deleted.
• RETCODE\_OUT\_OF\_RESOURCES - the Data Distribution Service ran out of resources to complete this operation.
• RETCODE\_IMMUTABLE\_POLICY - the parameter qos contains an immutable QosPolicy setting with a value different from the one set during enabling of the DataReader.

# 3.5.9.20 DDS\_DataReaderView\_take (abstract)

This abstract operation is defined as a generic operation, which is implemented by the &lt;NameSpace&gt;\_&lt;type&gt;DataReaderView class. Therefore, to use this operation, the data type specific implementation of this operation in its respective derived class must be used. For further explanation see the description for the f i c t i o n a l d a t a t y p e F o o ( d e f i n e d i n t h e m o d u l e S P A C E ) d e r i v e d SPACE\_FooDataReaderView class.

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
DDS_ReturnCode_t
DDS_DataReaderView_take
(DDS_DataReaderView _this,
DDS_sequence_&lt;data&gt; *data_values,
SampleInfoSeq *info_seq,
const DDS_long max_samples,
const DDS_SampleStateMask sample_states,
const DDS_ViewStateMask view_states,
const DDS_InstanceStateMask instance_states);
```

# 3.5.9.21 DDS\_DataReaderView\_take\_instance (abstract)

This abstract operation is defined as a generic operation, which is implemented by the &lt;NameSpace&gt;\_&lt;type&gt;DataReaderView class. Therefore, to use this operation, the data type specific implementation of this operation in its respective derived class must be used. For further explanation see the description for the f i c t i o n a l d a t a t y p e F o o ( d e f i n e d i n t h e m o d u l e S P A C E ) d e r i v e d SPACE\_FooDataReaderView class.

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
DDS_ReturnCode_t
DDS_DataReaderView_take_instance
(DDS_DataReaderView _this,
DDS_sequence_&lt;data&gt; *data_values,
SampleInfoSeq *info_seq,
const DDS_long max_samples,
const DDS_InstanceHandle_t a_handle,
const DDS_SampleStateMask sample_states,
const DDS_ViewStateMask view_states,
const DDS_InstanceStateMask instance_states);
```

# 3.5.9.22 DDS\_DataReaderView\_take\_next\_instance (abstract)

This abstract operation is defined as a generic operation, which is implemented by the &lt;NameSpace&gt;\_&lt;type&gt;DataReaderView class. Therefore, to use this operation, the data type specific implementation of this operation in its respective derived class must be used. For further explanation see the description for the f i c t i o n a l d a t a t y p e F o o ( d e f i n e d i n t h e m o d u l e S P A C E ) d e r i v e d SPACE\_FooDataReaderView class.

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
DDS_ReturnCode_t
DDS_DataReaderView_take_next_instance
(DDS_DataReaderView _this,
DDS_sequence_&lt;data&gt; *data_values,
SampleInfoSeq *info_seq,
const DDS_long max_samples,
const DDS_InstanceHandle_t a_handle,
const DDS_SampleStateMask sample_states,
const DDS_ViewStateMask view_states,
const DDS_InstanceStateMask instance_states);
```

# 3.5.9.23 DDS\_DataReaderView\_take\_next\_instance\_w\_condition (abstract)

This abstract operation is defined as a generic operation, which is implemented by the &lt;NameSpace&gt;\_&lt;type&gt;DataReaderView class. Therefore, to use this operation, the data type specific implementation of this operation in its respective derived class must be used. For further explanation see the description for the f i c t i o n a l d a t a t y p e F o o ( d e f i n e d i n t h e m o d u l e S P A C E ) d e r i v e d SPACE\_FooDataReaderView class.

Synopsis
```c
#include &lt;dds_dcps.h&gt;
DDS_ReturnCode_t
DDS_DataReaderView_take_next_instance_w_condition
(DDS_DataReaderView _this,
DDS_sequence_&lt;data&gt; *data_values,
SampleInfoSeq *info_seq,
const DDS_long max_samples,
const DDS_InstanceHandle_t a_handle,
const DDS_ReadCondition a_condition);
```

# 3.5.9.24 DDS\_DataReaderView\_take\_next\_sample (abstract)

This abstract operation is defined as a generic operation, which is implemented by the &lt;NameSpace&gt;\_&lt;type&gt;DataReaderView class. Therefore, to use this operation, the data type specific implementation of this operation in its respective derived class must be used. For further explanation see the description for the f i c t i o n a l d a t a t y p e F o o ( d e f i n e d i n t h e m o d u l e S P A C E ) d e r i v e d SPACE\_FooDataReaderView class.

Synopsis
```c
#include &lt;dds_dcps.h&gt;
DDS_ReturnCode_t
DDS_DataReaderView_take_next_sample
(DDS_DataReaderView _this,
&lt;data&gt; *data_values,
DDS_SampleInfo *sample_info);
```

# 3.5.9.25 DDS\_DataReaderView\_take\_w\_condition (abstract)

This abstract operation is defined as a generic operation, which is implemented by the &lt;NameSpace&gt;\_&lt;type&gt;DataReaderView class. Therefore, to use this operation, the data type specific implementation of this operation in its respective derived class must be used. For further explanation see the description for the f i c t i o n a l d a t a t y p e F o o ( d e f i n e d i n t h e m o d u l e S P A C E ) d e r i v e d SPACE\_FooDataReaderView class.

Synopsis
```c
#include &lt;dds_dcps.h&gt;
DDS_ReturnCode_t
DDS_DataReaderView_take_w_condition
(DDS_DataReaderView _this,
DDS_sequence_&lt;data&gt; *data_values,
SampleInfoSeq *info_seq,
const DDS_long max_samples,
const DDS_ReadCondition a_condition);
```

# 3.5.10 Class SPACE\_FooDataReaderView

T h e p r e p r o c e s s o r g e n e r a t e s f r o m I D L t y p e d e s c r i p t i o n s t h e &lt;NameSpace&gt;\_&lt;type&gt;DataReaderView classes. For each application data type w h i c h i s u s e d a s To p i c d a t a t y p e , a t y p e d c l a s s &lt;NameSpace&gt;\_&lt;type&gt;DataReaderView is derived from the D D S \_ D a t a R e a d e r V i e w c l a s s . I n t h i s p a r a g r a p h , t h e c l a s s SPACE\_FooDataReaderView describes the operations of these derived &lt;NameSpace&gt;\_&lt;type&gt;DataReaderView classes as an example for the fictional application type Foo (defined in the module SPACE).

For instance, for an application, the definitions are located in the Space.idl file.

The pre-processor will generate a Space.h include file.

The interface description of this class is as follows:

```c
/*
 * interface SPACE_FooDataReaderView
 */
/*
 * inherited from class DDS_Entity
 */
/* DDS_StatusCondition
 * SPACE_FooDataReaderView_get_statuscondition
 * (SPACE_FooDataReaderView _this);
 */
/*
 * DDS_StatusMask
 * SPACE_FooDataReaderView_get_status_changes
 * (SPACE_FooDataReaderView _this);
 */
/*
 * DDS_ReturnCode_t
 * SPACE_FooDataReaderView_enable
 * (SPACE_FooDataReaderView _this);
 */
/*
 * inherited from class DDS_DataReaderView
 */
/*
 * DDS_QueryCondition
 * SPACE_FooDataReaderView_create_querycondition
 * (SPACE_FooDataReaderView _this,
 * const DDS_SampleStateMask sample_states,
 * const DDS_ViewStateMask view_states,
 * const DDS_InstanceStateMask instance_states,
 * const DDS_char *query_expression,
 * const DDS_StringSeq *query_parameters);
 */
/*
 */
```

```c
* DDS_ReadCondition
* SPACE_FooDataReaderView_create_readcondition
* (SPACE_FooDataReaderView _this,
* const DDS_SampleStateMask sample_states,
* const DDS_ViewStateMask view_states,
* const DDS_InstanceStateMask instance_states);
*/
/*
* DDS_ReturnCode_t
* SPACE_FooDataReaderView_delete_contained_entities
* (SPACE_FooDataReaderView _this);
*/
/*
* DDS_ReturnCode_t
* SPACE_FooDataReaderView_delete_readcondition
* (SPACE_FooDataReaderView _this,
* const DDS_ReadCondition a_condition);
*/
/*
* DDS_DataReader
* SPACE_FooDataReaderView_get_datareader
* (SPACE_FooDataReaderView _this);
*/
/*
* DDS_ReturnCode_t
* SPACE_FooDataReaderView_get_qos
* (SPACE_FooDataReaderView _this,
* DDS_DataReaderViewQos *qos);
*/
/*
* DDS_ReturnCode_t
* SPACE_FooDataReaderView_set_qos
* (SPACE_FooDataReaderView _this,
* const DDS_DataReaderViewQos *qos);
*/
/*
* implemented API operations
*/
DDS_ReturnCode_t
SPACE_FooDataReaderView_get_key_value
(SPACE_FooDataReaderView _this,
Foo *key_holder,
const DDS_InstanceHandle_t handle);

DDS_InstanceHandle_t
SPACE_FooDataReaderView_lookup_instance
(SPACE_FooDataReaderView _this,
const Foo *instance_data);
```

```c
DDS_ReturnCode_t
SPACE_FooDataReaderView_read
(SPACE_FooDataReaderView _this,
DDS_sequence_Foo *data_values,
SampleInfoSeq *info_seq,
const DDS_long max_samples,
const DDS_SampleStateMask sample_states,
const DDS_ViewStateMask view_states,
const DDS_InstanceStateMask instance_states);

DDS_ReturnCode_t
SPACE_FooDataReaderView_read_instance
(SPACE_FooDataReaderView _this,
DDS_sequence_Foo *data_values,
SampleInfoSeq *info_seq,
const DDS_long max_samples,
const DDS_InstanceHandle_t a_handle,
const DDS_SampleStateMask sample_states,
const DDS_ViewStateMask view_states,
const DDS_InstanceStateMask instance_states);

DDS_ReturnCode_t
SPACE_FooDataReaderView_read_next_instance
(SPACE_FooDataReaderView _this,
DDS_sequence_Foo *data_values,
SampleInfoSeq *info_seq,
const DDS_long max_samples,
const DDS_InstanceHandle_t a_handle,
const DDS_SampleStateMask sample_states,
const DDS_ViewStateMask view_states,
const DDS_InstanceStateMask instance_states);

DDS_ReturnCode_t
SPACE_FooDataReaderView_read_next_instance_w_condition
(SPACE_FooDataReaderView _this,
DDS_sequence_Foo *data_values,
SampleInfoSeq *info_seq,
const DDS_long max_samples,
const DDS_InstanceHandle_t a_handle,
const DDS_ReadCondition a_condition);

DDS_ReturnCode_t
SPACE_FooDataReaderView_read_next_sample
(SPACE_FooDataReaderView _this,
Foo *received_data,
DDS_SampleInfo *sample_info);

DDS_ReturnCode_t
SPACE_FooDataReaderView_read_w_condition
(SPACE_FooDataReaderView _this,
```

```c
DDS_sequence_Foo *data_values,
SampleInfoSeq *info_seq,
const DDS_long max_samples,
const DDS_ReadCondition a_condition);

DDS_ReturnCode_t
SPACE_FooDataReaderView_return_loan
(SPACE_FooDataReaderView _this,
DDS_sequence_Foo *data_values,
SampleInfoSeq *info_seq);

DDS_ReturnCode_t
SPACE_FooDataReaderView_take
(SPACE_FooDataReaderView _this,
DDS_sequence_Foo *data_values,
SampleInfoSeq *info_seq,
const DDS_long max_samples,
const DDS_SampleStateMask sample_states,
const DDS_ViewStateMask view_states,
const DDS_InstanceStateMask instance_states);

DDS_ReturnCode_t
SPACE_FooDataReaderView_take_instance
(SPACE_FooDataReaderView _this,
DDS_sequence_Foo *data_values,
SampleInfoSeq *info_seq,
const DDS_long max_samples,
const DDS_InstanceHandle_t a_handle,
const DDS_SampleStateMask sample_states,
const DDS_ViewStateMask view_states,
const DDS_InstanceStateMask instance_states);

DDS_ReturnCode_t
SPACE_FooDataReaderView_take_next_instance
(SPACE_FooDataReaderView _this,
DDS_sequence_Foo *data_values,
SampleInfoSeq *info_seq,
const DDS_long max_samples,
const DDS_InstanceHandle_t a_handle,
const DDS_SampleStateMask sample_states,
const DDS_ViewStateMask view_states,
const DDS_InstanceStateMask instance_states);

DDS_ReturnCode_t
SPACE_FooDataReaderView_take_next_instance_w_condition
(SPACE_FooDataReaderView _this,
DDS_sequence_Foo *data_values,
SampleInfoSeq *info_seq,
const DDS_long max_samples,
const DDS_InstanceHandle_t a_handle,
```

```c
const DDS_ReadCondition a_condition);
DDS_ReturnCode_t
SPACE_FooDataReaderView_take_next_sample
(SPACE_FooDataReaderView _this,
Foo *received_data,
DDS_SampleInfo *sample_info);
DDS_ReturnCode_t
SPACE_FooDataReaderView_take_w_condition
(SPACE_FooDataReaderView _this,
DDS_sequence_Foo *data_values,
SampleInfoSeq *info_seq,
const DDS_long max_samples,
const DDS_ReadCondition a_condition);
```

The next paragraphs describe the usage of all SPACE\_FooDataReaderView operations. The inherited operations are listed but not fully described because they are not implemented in this class. The full description of these operations is given in the classes from which they are inherited.

# 3.5.10.1 SPACE\_FooDataReaderView\_create\_querycondition (inherited)

This operation is inherited and therefore not described here. See the class DDS\_DataReaderView for further explanation.

# Synopsis

```c
#include &lt;Space.h&gt;
DDS_QueryCondition
SPACE_FooDataReaderView_create_querycondition
(SPACE_FooDataReaderView _this,
const DDS_SampleStateMask sample_states,
const DDS_ViewStateMask view_states,
const DDS_InstanceStateMask instance_states,
const DDS_char *query_expression,
const DDS_StringSeq *query_parameters);
```

# 3.5.10.2 SPACE\_FooDataReaderView\_create\_readcondition (inherited)

This operation is inherited and therefore not described here. See the class DDS\_DataReaderView for further explanation.

# Synopsis

```c
#include &lt;Space.h&gt;
DDS_ReadCondition
SPACE_FooDataReaderView_create_readcondition
(SPACE_FooDataReaderView _this,
const DDS_SampleStateMask sample_states,
const DDS_ViewStateMask view_states,
const DDS_InstanceStateMask instance_states);
```

# 3.5.10.3 SPACE\_FooDataReaderView\_delete\_contained\_entities

This operation is inherited and therefore not described here. See the class DDS\_DataReaderView for further explanation.

# Synopsis

```c
#include &lt;Space.h&gt;
DDS_ReturnCode_t
SPACE_FooDataReaderView_delete_contained_entities
(SPACE_FooDataReaderView _this);
```

# 3.5.10.4 SPACE\_FooDataReaderView\_delete\_readcondition (inherited)

This operation is inherited and therefore not described here. See the class DDS\_DataReaderView for further explanation.

# Synopsis

```c
#include &lt;Space.h&gt;
DDS_ReturnCode_t
SPACE_FooDataReaderView_delete_readcondition
(SPACE_FooDataReaderView _this,
const DDS_ReadCondition a_condition);
```

# 3.5.10.5 SPACE\_FooDataReaderView\_enable (inherited)

This operation is inherited and therefore not described here. See the class DDS\_Entity for further explanation.

# Synopsis

```c
#include &lt;Space.h&gt;
DDS_ReturnCode_t
SPACE_FooDataReaderView_enable
(SPACE_FooDataReaderView _this);
```

# 3.5.10.6 SPACE\_FooDataReaderView\_get\_datareader (inherited)

This operation is inherited and therefore not described here. See the class DDS\_DataReaderView for further explanation

# Synopsis

```c
#include &lt;Space.h&gt;
DDS_DataReader
SPACE_FooDataReaderView_get_datareader(SPACE_FooDataReaderView _this);
```

# 3.5.10.7 SPACE\_FooDataReaderView\_get\_key\_value

# Synopsis

```c
#include &lt;Space.h&gt;
DDS_ReturnCode_t
SPACE_FooDataReaderView_get_key_value
(SPACE_FooDataReaderView _this,
Foo *key_holder,
const DDS_InstanceHandle_t handle);
```

NOTE: This operation is not yet implemented. It is scheduled for a future release.

# 3.5.10.8 SPACE\_FooDataReaderView\_get\_qos (inherited)

This operation is inherited and therefore not described here. See the class DDS\_DataReaderView for further explanation.

# Synopsis

```c
#include &lt;Space.h&gt;
DDS_ReturnCode_t
SPACE_FooDataReaderView_get_qos
(SPACE_FooDataReaderView _this,
DDS_DataReaderViewQos *qos);
```

# 3.5.10.9 SPACE\_FooDataReaderView\_get\_status\_changes (inherited)

This operation is inherited and therefore not described here. See the class DDS\_Entity for further explanation.

# Synopsis

```c
#include &lt;Space.h&gt;
DDS_StatusMask
SPACE_FoodDataReaderView_get_status_changes
(SPACE_FoodDataReaderView _this);
```

# 3.5.10.10 SPACE\_FooDataReaderView\_get\_statuscondition (inherited)

This operation is inherited and therefore not described here. See the class DDS\_Entity for further explanation.

# Synopsis

```c
#include &lt;Space.h&gt;
DDS_StatusCondition
SPACE_FooDataReaderView_get_statuscondition
(SPACE_FooDataReaderView _this);
```

# 3.5.10.11 SPACE\_FooDataReaderView\_lookup\_instance

# Synopsis

```c
#include &lt;Space.h&gt;
DDS_InstanceHandle_t
SPACE_FooDataReaderView_lookup_instance
(SPACE_FooDataReaderView _this,
const Foo* instance_data)
```

# Description

This operation returns the value of the instance handle which corresponds to the instance\_data. For a full description please refer to paragraph '3.5.2.60 l o o k u p \_ i n s t a n c e ' w h i c h d e s c r i b e s t h i s o p e r a t i o n i n d e t a i l f o r t h e S P A C E \_ F o o D a t a R e a d e r c l a s s . N o t e t h a t i n s t a n c e s i n t h e S P AC E \_ F o o D at a R e a d er V i e w are no t de fin ed by th e k eys of th e DDS\_TopicDescription but by the key list in the DDS\_DataReaderView QosPolicy.

# 3.5.10.12 SPACE\_FooDataReaderView\_read

# Synopsis

```c
#include &lt;Space.h&gt;
DDS_ReturnCode_t
SPACE_FooDataReaderView_read
(SPACE_FooDataReaderView _this,
DDS_sequence_Foo *data_values,
SampleInfoSeq *info_seq,
const DDS_long max_samples,
const DDS_SampleStateMask sample_states,
const DDS_ViewStateMask view_states,
const DDS_InstanceStateMask instance_states);
```

# Description

T h i s o p e r a t i o n r e a d s a s e q u e n c e o f F o o s a m p l e s f r o m t h e SPACE\_FooDataReaderView. For a full description please refer to Section 3.5.2.66, SPACE\_FooDataReader\_read, on page 478, which describes this operation in detail for the SPACE\_FooDataReader class.

# 3.5.10.13 SPACE\_FooDataReaderView\_read\_instance

# Synopsis

```c
#include &lt;Space.h&gt;
DDS_ReturnCode_t
SPACE_FooDataReaderView_read_instance
(SPACE_FooDataReaderView _this,
```

```txt
DDS_sequence_Foo *data_values,
SampleInfoSeq *info_seq,
const DDS_long max_samples,
const DDS_InstanceHandle_t a_handle,
const DDS_SampleStateMask sample_states,
const DDS_ViewStateMask view_states,
const DDS_InstanceStateMask instance_states);
```

# Description

This operation reads a sequence of Foo samples of a single instance from the SPACE\_FooDataReaderView. For a full description please refer to Section 3.5.2.67, SPACE\_FooDataReader\_read\_instance, on page 483, which describes this operation in detail for the SPACE\_FooDataReader class.

# 3.5.10.14 SPACE\_FooDataReaderView\_read\_next\_instance

# Synopsis

```c
#include &lt;Space.h&gt;
DDS_ReturnCode_t
SPACE_FooDataReaderView_read_next_instance
(SPACE_FooDataReaderView _this,
DDS_sequence_Foo *data_values,
SampleInfoSeq *info_seq,
const DDS_long max_samples,
const DDS_InstanceHandle_t a_handle,
const DDS_SampleStateMask sample_states,
const DDS_ViewStateMask view_states,
const DDS_InstanceStateMask instance_states);
```

# Description

This operation reads a sequence of Foo samples of the next single instance from the SPACE\_FooDataReaderView. For a full description please refer to Section 3.5.2.68, SPACE\_FooDataReader\_read\_next\_instance, on page 485, which describes this operation in detail for the SPACE\_FooDataReader class.

# 3.5.10.15 SPACE\_FooDataReaderView\_read\_next\_instance\_w\_condition

# Synopsis

```c
#include &lt;Space.h&gt;
DDS_ReturnCode_t
SPACE_FooDataReaderView_read_next_instance_w_condition
(SPACE_FooDataReaderView _this,
DDS_sequence_Foo *data_values,
SampleInfoSeq *info_seq,
const DDS_long max_samples,
const DDS_InstanceHandle_t a_handle,
```

const DDS\_ReadCondition a\_condition);

# Description

This operation reads a sequence of Foo samples of the next single instance from the SPACE\_FooDataReaderView, filtered by a DDS\_ReadCondition or DDS\_QueryCondition. For a full description please refer to Section 3.5.2.69, SPACE\_FooDataReader\_read\_next\_instance\_w\_condition, on page 488, which describes this operation in detail for the SPACE\_FooDataReader class.

# 3.5.10.16 SPACE\_FooDataReaderView\_read\_next\_sample

# Synopsis

```c
#include &lt;Space.h&gt;
DDS_ReturnCode_t
SPACE_FooDataReaderView_read_next_sample
(SPACE_FooDataReaderView _this,
Foo *data_values,
DDS_SampleInfo *sample_info);
```

NOTE: This operation is not yet implemented. It is scheduled for a future release.

# 3.5.10.17 SPACE\_FooDataReaderView\_read\_w\_condition

# Synopsis

```c
#include &lt;Space.h&gt;
DDS_ReturnCode_t
SPACE_FooDataReaderView_read_w_condition
(SPACE_FooDataReaderView _this,
DDS_sequence_Foo *data_values,
SampleInfoSeq *info_seq,
const DDS_long max_samples,
const DDS_ReadCondition a_condition);
```

# Description

T h i s o p e r a t i o n r e a d s a s e q u e n c e o f F o o s a m p l e s f r o m t h e SPACE\_FooDataReaderView, filtered by a DDS\_ReadCondition or DDS\_QueryCondition. For a full description please refer to Section 3.5.2.71, SPACE\_FooDataReader\_read\_w\_condition, on page 490, which describes this operation in detail for the SPACE\_FooDataReader class.

# 3.5.10.18 SPACE\_FooDataReaderView\_return\_loan

# Synopsis

```c
#include &lt;Space.h&gt;
DDS_ReturnCode_t
SPACE_FoodDataReaderView_return_loan
```

```txt
(SPACE_FooDataReaderView _this,
DDS_sequence_Foo *data_values,
SampleInfoSeq *info_seq);
```

# Description

This operation indicates to the SPACE\_FooDataReaderView that the application is done accessing the sequence of data\_values and info\_seq. For a full description please refer to Section 3.5.2.72, SPACE\_FooDataReader\_return\_loan, o n p a g e 4 9 2 , w h i c h d e s c r i b e s t h i s o p e r a t i o n i n d e t a i l f o r t h e SPACE\_FooDataReader class.

# 3.5.10.19 SPACE\_FooDataReaderView\_set\_qos (inherited)

This operation is inherited and therefore not described here. See the class DDS\_DataReaderView for further explanation.

# Synopsis

```c
#include &lt;Space.h&gt;
DDS_ReturnCode_t
SPACE_FooDataReaderView_set_qos
(SPACE_FooDataReaderView _this,
const DDS_DataReaderViewQos *qos);
```

# 3.5.10.20 SPACE\_FooDataReaderView\_take

# Synopsis

```c
#include &lt;Space.h&gt;
DDS_ReturnCode_t
SPACE_FooDataReaderView_take
(SPACE_FooDataReaderView _this,
DDS_sequence_Foo *data_values,
SampleInfoSeq *info_seq,
const DDS_long max_samples,
const DDS_SampleStateMask sample_states,
const DDS_ViewStateMask view_states,
const DDS_InstanceStateMask instance_states);
```

# Description

T h i s o p e r a t i o n r e a d s a s e q u e n c e o f F o o s a m p l e s f r o m t h e SPACE\_FooDataReaderView and by doing so, removes the data from the SPACE\_FooDataReaderView, but not from the SPACE\_FooDataReader that it b e l o n g s t o . F o r a f u l l d e s c r i p t i o n p l e a s e r e f e r t o S e c t i o n 3 . 5 . 2 . 7 5 , SPACE\_FooDataReader\_take, on page 495, which describes this operation in detail for the SPACE\_FooDataReader class.

# 3.5.10.21 SPACE\_FooDataReaderView\_take\_instance

# Synopsis

```c
#include &lt;Space.h&gt;
DDS_ReturnCode_t
SPACE_FooDataReaderView_take_instance
(SPACE_FooDataReaderView _this,
DDS_sequence_Foo *data_values,
SampleInfoSeq *info_seq,
const DDS_long max_samples,
const DDS_InstanceHandle_t a_handle,
const DDS_SampleStateMask sample_states,
const DDS_ViewStateMask view_states,
const DDS_InstanceStateMask instance_states);
```

# Description

This operation reads a sequence of Foo samples of a single instance from the SPACE\_FooDataReaderView and by doing so, removes the data from the SPACE\_FooDataReaderView, but not from the SPACE\_FooDataReader that it b e l o n g s t o . F o r a f u l l d e s c r i p t i o n p l e a s e r e f e r t o S e c t i o n 3 . 5 . 2 . 7 6 , SPACE\_FooDataReader\_take\_instance, on page 497, which describes this operation in detail for the SPACE\_FooDataReader class.

# 3.5.10.22 SPACE\_FooDataReaderView\_take\_next\_instance

# Synopsis

```c
#include &lt;Space.h&gt;
ReturnCode_t
take_next_instance
(FooSeq *data_values,
SampleInfoSeq *info_seq,
DDS_long max_samples,
InstanceHandle_t a_handle,
SampleStateMask sample_states,
ViewStateMask view_states,
InstanceStateMask instance_states);
```

# Description

This operation reads a sequence of Foo samples of the next single instance from the SPACE\_FooDataReaderView and by doing so, removes the data from the SPACE\_FooDataReaderView, but not from the SPACE\_FooDataReader that it b e l o n g s t o . F o r a f u l l d e s c r i p t i o n p l e a s e r e f e r t o S e c t i o n 3 . 5 . 2 . 7 7 , SPACE\_FooDataReader\_take\_next\_instance, on page 499, which describes this operation in detail for the SPACE\_FooDataReader class.

# 3.5.10.23 SPACE\_FooDataReaderView\_take\_next\_instance\_w\_condition

# Synopsis

```c
#include &lt;Space.h&gt;
DDS_ReturnCode_t
SPACE_FooDataReaderView_take_next_instance_w_condition
(SPACE_FooDataReaderView _this,
DDS_sequence_Foo *data_values,
SampleInfoSeq *info_seq,
const DDS_long max_samples,
const DDS_InstanceHandle_t a_handle,
const DDS_ReadCondition a_condition);
```

# Description

This operation reads a sequence of Foo samples of the next single instance from the SPACE\_FooDataReaderView, filtered by a DDS\_ReadCondition or DDS\_QueryCondition and by doing so, removes the data from the SPACE\_FooDataReaderView, but not from the SPACE\_FooDataReader that it b e l o n g s t o . F o r a f u l l d e s c r i p t i o n p l e a s e r e f e r t o S e c t i o n 3 . 5 . 2 . 7 8 , SPACE\_FooDataReader\_take\_next\_instance\_w\_condition, on page 501, which describes this operation in detail for the SPACE\_FooDataReader class.

# 3.5.10.24 SPACE\_FooDataReaderView\_take\_next\_sample

# Synopsis

```c
#include &lt;Space.h&gt;
DDS_ReturnCode_t
SPACE_FooDataReaderView_take_next_sample
(SPACE_FooDataReaderView _this,
Foo *data_values,
DDS_SampleInfo *sample_info);
```

NOTE: This operation is not yet implemented. It is scheduled for a future release.

# 3.5.10.25 SPACE\_FooDataReaderView\_take\_w\_condition

# Synopsis

```c
#include &lt;Space.h&gt;
DDS_ReturnCode_t
SPACE_FooDataReaderView_take_w_condition
(SPACE_FooDataReaderView _this,
DDS_sequence_Foo *data_values,
SampleInfoSeq *info_seq,
const DDS_long max_samples,
const DDS_ReadCondition a_condition);
```

# Description

T h i s o p e r a t i o n r e a d s a s e q u e n c e o f F o o s a m p l e s f r o m t h e SPACE\_FooDataReaderView, filtered by a DDS\_ReadCondition or DDS\_QueryCondition and by doing so, removes the data from the SPACE\_FooDataReaderView, but not from the SPACE\_FooDataReader that it b e l o n g s t o . F o r a f u l l d e s c r i p t i o n p l e a s e r e f e r t o S e c t i o n 3 . 5 . 2 . 8 0 , SPACE\_FooDataReader\_take\_w\_condition, on page 503, which describes this operation in detail for the SPACE\_FooDataReader class.

# 3.6 QosProvider

The QosProvider API allows users to specify the QoS settings of their DCPS entities outside of application code in XML. The QosProvider is delivered as part of the DCPS API of OpenSplice and has no factory. It is not associated with a DDS\_DomainParticipant, so it can be be obtained by a normal allocation.

# 3.6.1 Class DDS\_QosProvider

The DDS\_QosProvider class provides access to the QoS settings that are specified in an XML file. The interface is as follows:

```c
/* Allocator */
DDS_QosProvider
    DDS_QosProvider_alloc (
    const char *uri,
    const char *profile);

/* API operations */
DDS_ReturnCode_t
    DDS_QosProvider_get_participant_qos(
    DDS_QosProvider_this,
    DDS_DomainParticipantQos *qos,
    const char *id);

DDS_ReturnCode_t
    DDS_QosProvider_get_topic_qos(
    DDS_QosProvider_this,
    DDS_TopicQos *qos,
    const char *id);

DDS_ReturnCode_t
    DDS_QosProvider_get_subscriber_qos(
    DDS_QosProvider_this,
    DDS_SubscriberQos *qos,
    const char *id);

DDS_ReturnCode_t
    DDS_QosProvider_get_datareader_qos(
```

```c
DDS_QosProvider _this,
DDS_DataReaderQos *qos,
const char *id);

DDS_ReturnCode_t
DDS_QosProvider_get_publisher_qos(
DDS_QosProvider _this,
DDS_PublisherQos *qos,
const char *id);

DDS_ReturnCode_t
DDS_QosProvider_get_datawriter_qos(
DDS_QosProvider _this,
DDS_DataWriterQos *qos,
const char *id);
```

# 3.6.1.1 DDS\_QosProvider\_\_alloc

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
DDS_QosProvider
DDS_QosProvider__alloc (
    const char *uri,
    const char *profile);
```

# Description

Constructs a new DDS\_QosProvider based on the provided uri and profile.

# Parameters

in char \* uri - A Uniform Resource Identifier (URI) that points to the location where the QoS profile needs to be loaded from. Currently only URI’s with a ‘file’ scheme that point to an XML file are supported. If profiles and/or QoS settings are not uniquely identifiable by name within the resource pointed to by uri, a random one of them will be stored.

in char \* profile - The name of the QoS profile that serves as the default QoS profile for the DDS\_QosProvider\_get\_\*\_qos(...) operations.

# Return Value

A DDS\_QosProvider instance that is instantiated with all profiles and/or QoS’s loaded from the location specified by the provided uri.

Construction of the DDS\_QosProvider will fail under the following conditions:

— No uri is provided.
— The resource pointed to by uri cannot be found.

— The content of the resource pointed to by uri is malformed (e.g., malformed XML).

# 3.6.1.2 DDS\_QosProvider\_get\_participant\_qos

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
DDS_ReturnCode_t
DDS_QosProvider_get_participant_qos(
DDS_QosProvider _this,
DDS_DomainParticipantQos *qos,
const char *id);
```

# Description

Resolves the DDS\_DomainParticipantQos identified by the id from the uri the DDS\_QosProvider \_this is associated with.

# Parameters

in DDS\_QosProvider \_this - The DDS\_QosProvider on which the operation is performed.

inout DDS\_DomainParticipantQos \* qos - A pointer to the destination DDS\_DomainParticipantQos in which the QoS policy settings will be copied.

in char \* id - The fully-qualified name that identifies a QoS within the uri associated with the DDS\_QosProvider or a name that identifies a QoS within the uri associated with the DDS\_QosProvider instance relative to its default QoS profile. Id’s starting with ‘::’ are interpreted as fully-qualified names and all others are interpreted as names relative to the default QoS profile of the DDS\_QosProvider instance. When id is NULL it is interpreted as a non-named QoS within the default QoS profile associated with the DDS\_QosProvider.

# Return Value

The operation may return:

• DDS\_RETCODE\_OK - If qos has been initialized successfully.
• DDS\_RETCODE\_NO\_DATA - If no DDS\_DomainParticipantQos that matches the provided id can be found within the uri associated with the DDS\_QosProvider.
• DDS\_RETCODE\_BAD\_PARAMETER - If \_this and/or qos is NULL.
• DDS\_RETCODE\_PRECONDITION\_NOT\_MET - If the DDS\_QosProvider instance is not properly initialized.

• DDS\_RETCODE\_OUT\_OF\_RESOURCES - If not enough memory is available to perform the operation.
• DDS\_RETCODE\_ERROR - If an internal error occurred.

# 3.6.1.3 DDS\_QosProvider\_get\_topic\_qos

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
DDS_ReturnCode_t
DDS_QosProvider_get_topic_qos(
DDS_QosProvider _this,
DDS_TopicQos *qos,
const char *id);
```

# Description

Resolves the DDS\_TopicQos identified by the id from the uri the DDS\_QosProvider \_this is associated with.

# Parameters

in DDS\_QosProvider \_this - The DDS\_QosProvider on which the operation is performed.

inout DDS\_TopicQos \* qos - A pointer to the destination DDS\_TopicQos in which the QoS policy settings will be copied.

in char \* id - The fully-qualified name that identifies a QoS within the uri associated with the DDS\_QosProvider or a name that identifies a QoS within the uri associated with the DDS\_QosProvider instance relative to its default QoS profile. Id’s starting with ‘::’ are interpreted as fully-qualified names and all others are interpreted as names relative to the default QoS profile of the DDS\_QosProvider instance. When id is NULL it is interpreted as a non-named QoS within the default QoS profile associated with the DDS\_QosProvider.

# Return Value

The operation may return:

• DDS\_RETCODE\_OK - If qos has been initialized successfully.
• DDS\_RETCODE\_NO\_DATA - If no DDS\_TopicQos that matches the provided id can be found within the uri associated with the DDS\_QosProvider.
• DDS\_RETCODE\_BAD\_PARAMETER - If \_this and/or qos is NULL.
• DDS\_RETCODE\_PRECONDITION\_NOT\_MET - If the DDS\_QosProvider instance is not properly initialized.

• DDS\_RETCODE\_OUT\_OF\_RESOURCES - If not enough memory is available to perform the operation.
• DDS\_RETCODE\_ERROR - If an internal error occurred.

# 3.6.1.4 DDS\_QosProvider\_get\_subscriber\_qos

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
DDS_ReturnCode_t
DDS_QosProvider_get_subscriber_qos(
DDS_QosProvider _this,
DDS_SubscriberQos *qos,
const char *id);
```

# Description

Resolves the DDS\_SubscriberQos identified by the id from the uri the DDS\_QosProvider \_this is associated with.

# Parameters

in DDS\_QosProvider \_this - The DDS\_QosProvider on which the operation is performed.

inout DDS\_SubscriberQos \* qos - A pointer to the destination DDS\_SubscriberQos in which the QoS policy settings will be copied.

in char \* id - The fully-qualified name that identifies a QoS within the uri associated with the DDS\_QosProvider or a name that identifies a QoS within the uri associated with the DDS\_QosProvider instance relative to its default QoS profile. Id’s starting with ‘::’ are interpreted as fully-qualified names and all others are interpreted as names relative to the default QoS profile of the DDS\_QosProvider instance. When id is NULL it is interpreted as a non-named QoS within the default QoS profile associated with the DDS\_QosProvider.

# Return Value

The operation may return:

• DDS\_RETCODE\_OK - If qos has been initialized successfully.
• DDS\_RETCODE\_NO\_DATA - If no DDS\_SubscriberQos that matches the provided id can be found within the uri associated with the DDS\_QosProvider.
• DDS\_RETCODE\_BAD\_PARAMETER - If \_this and/or qos is NULL.
• DDS\_RETCODE\_PRECONDITION\_NOT\_MET - If the DDS\_QosProvider instance is not properly initialized.

• DDS\_RETCODE\_OUT\_OF\_RESOURCES - If not enough memory is available to perform the operation.
• DDS\_RETCODE\_ERROR - If an internal error occurred.

# 3.6.1.5 DDS\_QosProvider\_get\_datareader\_qos

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
DDS_ReturnCode_t
DDS_QosProvider_get_datareader_qos(
DDS_QosProvider _this,
DDS_DataReaderQos *qos,
const char *id);
```

# Description

Resolves the DDS\_DataReaderQos identified by the id from the uri the DDS\_QosProvider \_this is associated with.

# Parameters

in DDS\_QosProvider \_this - The DDS\_QosProvider on which the operation is performed.

inout DDS\_DataReaderQos \* qos - A pointer to the destination DDS\_DataReaderQos in which the QoS policy settings will be copied.

in char \* id - The fully-qualified name that identifies a QoS within the uri associated with the DDS\_QosProvider or a name that identifies a QoS within the uri associated with the DDS\_QosProvider instance relative to its default QoS profile. Id’s starting with ‘::’ are interpreted as fully-qualified names and all others are interpreted as names relative to the default QoS profile of the DDS\_QosProvider instance. When id is NULL it is interpreted as a non-named QoS within the default QoS profile associated with the DDS\_QosProvider.

# Return Value

The operation may return:

• DDS\_RETCODE\_OK - If qos has been initialized successfully.
• DDS\_RETCODE\_NO\_DATA - If no DDS\_DataReaderQos that matches the provided id can be found within the uri associated with the DDS\_QosProvider.
• DDS\_RETCODE\_BAD\_PARAMETER - If \_this and/or qos is NULL.
• DDS\_RETCODE\_PRECONDITION\_NOT\_MET - If the DDS\_QosProvider instance is not properly initialized.

• DDS\_RETCODE\_OUT\_OF\_RESOURCES - If not enough memory is available to perform the operation.
• DDS\_RETCODE\_ERROR - If an internal error occurred.

# 3.6.1.6 DDS\_QosProvider\_get\_publisher\_qos

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
DDS_ReturnCode_t
DDS_QosProvider_get_publisher_qos(
DDS_QosProvider _this,
DDS_PublisherQos *qos,
const char *id);
```

# Description

Resolves the DDS\_PublisherQos identified by the id from the uri the DDS\_QosProvider \_this is associated with.

# Parameters

in DDS\_QosProvider \_this - The DDS\_QosProvider on which the operation is performed.

inout DDS\_PublisherQos \* qos - A pointer to the destination DDS\_PublisherQos in which the QoS policy settings will be copied.

in char \* id - The fully-qualified name that identifies a QoS within the uri associated with the DDS\_QosProvider or a name that identifies a QoS within the uri associated with the DDS\_QosProvider instance relative to its default QoS profile. Id’s starting with ‘::’ are interpreted as fully-qualified names and all others are interpreted as names relative to the default QoS profile of the DDS\_QosProvider instance. When id is NULL it is interpreted as a non-named QoS within the default QoS profile associated with the DDS\_QosProvider.

# Return Value

The operation may return:

• DDS\_RETCODE\_OK - If qos has been initialized successfully.
• DDS\_RETCODE\_NO\_DATA - If no DDS\_PublisherQos that matches the provided id can be found within the uri associated with the DDS\_QosProvider.
• DDS\_RETCODE\_BAD\_PARAMETER - If \_this and/or qos is NULL.
• DDS\_RETCODE\_PRECONDITION\_NOT\_MET - If the DDS\_QosProvider instance is not properly initialized.

• DDS\_RETCODE\_OUT\_OF\_RESOURCES - If not enough memory is available to perform the operation.
• DDS\_RETCODE\_ERROR - If an internal error occurred.

# 3.6.1.7 DDS\_QosProvider\_get\_datawriter\_qos

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
DDS_ReturnCode_t
DDS_QosProvider_get_datawriter_qos(
DDS_QosProvider _this,
DDS_DataWriterQos *qos,
const char *id);
```

# Description

Resolves the DDS\_DataWriterQos identified by the id from the uri the DDS\_QosProvider \_this is associated with.

# Parameters

in DDS\_QosProvider \_this - The DDS\_QosProvider on which the operation is performed.

inout DDS\_DataWriterQos \* qos - A pointer to the destination DDS\_DataWriterQos in which the QoS policy settings will be copied.

in char \* id - The fully-qualified name that identifies a QoS within the uri associated with the DDS\_QosProvider or a name that identifies a QoS within the uri associated with the DDS\_QosProvider instance relative to its default QoS profile. Id’s starting with ‘::’ are interpreted as fully-qualified names and all others are interpreted as names relative to the default QoS profile of the DDS\_QosProvider instance. When id is NULL it is interpreted as a non-named QoS within the default QoS profile associated with the DDS\_QosProvider.

# Return Value

The operation may return:

• DDS\_RETCODE\_OK - If qos has been initialized successfully.
• DDS\_RETCODE\_NO\_DATA - If no DDS\_DataWriterQos that matches the provided id can be found within the uri associated with the DDS\_QosProvider.
• DDS\_RETCODE\_BAD\_PARAMETER - If \_this and/or qos is NULL.
• DDS\_RETCODE\_PRECONDITION\_NOT\_MET - If the DDS\_QosProvider instance is not properly initialized.

• DDS\_RETCODE\_OUT\_OF\_RESOURCES - If not enough memory is available to perform the operation.
• DDS\_RETCODE\_ERROR - If an internal error occurred.

# APPENDICES

# Appendix

# A

# Quality Of Service

Each DDS\_Entity is accompanied by an &lt;DDS\_Entity&gt;Qos structure that implements the basic mechanism for an application to specify Quality of Service attributes. This structure consists of DDS\_Entity specific QosPolicy attributes. QosPolicy attributes are structured types where each type specifies the information that controls an DDS\_Entity related (configurable) attribute of the Data Distribution Service.

# Affected Entities

Each DDS\_Entity can be configured with a set of QosPolicy settings. However, any DDS\_Entity cannot support any QosPolicy. For instance, a DDS\_DomainParticipant supports different QosPolicy settings than a DDS\_Topic or a DDS\_Publisher. The set of QosPolicy settings is implemented as a struct of QosPolicy structs, identified as &lt;DDS\_Entity&gt;Qos. Each &lt;DDS\_Entity&gt;Qos struct only contains those QosPolicy structs relevant to the specific DDS\_Entity. The &lt;DDS\_Entity&gt;Qos struct serves as the parameter to operations which require a Qos. &lt;DDS\_Entity&gt;Qos struct is the API implementation of the QoS. Depending on the specific &lt;DDS\_Entity&gt;Qos, it controls the behaviour of a DDS\_Topic, DDS\_DataWriter, DDS\_DataReader, DDS\_Publisher, DDS\_Subscriber, DDS\_DomainParticipant or DDS\_DomainParticipantFactory1.

# Basic Usage

The basic way to modify or set the &lt;DDS\_Entity&gt;Qos is by using an DDS\_&lt;Entity&gt;\_get\_qos operation to get all QosPolicy settings from this DDS\_Entity (that is the &lt;DDS\_Entity&gt;Qos), modify several specific QosPolicy settings and put them back using an DDS\_&lt;DDS\_Entity&gt;\_set\_qos operation to set all QosPolicy settings on this DDS\_Entity (that is the &lt;DDS\_Entity&gt;Qos). A n e x a m p l e o f t h e s e o p e r a t i o n s f o r t h e D D S \_ D a t a W r i t e r Q o s a r e

DDS\_Publisher\_get\_default\_datawriter\_qos and DDS\_Publisher\_ set\_default\_datawriter\_qos, which take the DDS\_DataWriterQos as a parameter.

The interface description of this struct is as follows:
```c
/*
 * struct &lt;name&gt;QosPolicy
 *    see appendix
 */
 * struct &lt;DDS_Entity&gt;Qos
 */
struct DDS_DomainParticipantFactoryQos
{ DDS_EntityFactoryQosPolicy    entity_factory; };
struct DDS_DomainParticipantQos
{ DDS_UserDataQosPolicy    user_data;
DDS_EntityFactoryQosPolicy    entity_factory;
DDS_SchedulingQosPolicy    watchdog_scheduling;
DDS_SchedulingQosPolicy    listener_scheduling; };
struct DDS_TopicQos
{ DDS_TopicDataQosPolicy    topic_data;
DDS_DurabilityQosPolicy    durability;
DDS_DurabilityServiceQosPolicy    durability_service;
DDS_DeadlineQosPolicy    deadline;
DDS_LatencyBudgetQosPolicy    latency_budget;
DDS_LivelinessQosPolicy    liveliness;
DDS_ReliabilityQosPolicy    reliability;
DDS_DestinationOrderQosPolicy    destination_order;
DDS_HistoryQosPolicy    history;
DDS_ResourceLimitsQosPolicy    resource_limits;
DDS_TransportPriorityQosPolicy    transport_priority;
DDS_LifespanQosPolicy    lifespan;
DDS_OwnershipQosPolicy    ownership; };
struct DDS_DataWriterQos
{ DDS_DurabilityQosPolicy    durability;
DDS_DeadlineQosPolicy    deadline;
DDS_LatencyBudgetQosPolicy    latency_budget;
DDS_LivelinessQosPolicy    liveliness;
DDS_ReliabilityQosPolicy    reliability;
DDS_DestinationOrderQosPolicy    destination_order;
DDS_HistoryQosPolicy    history;
DDS_ResourceLimitsQosPolicy    resource_limits;
DDS_TransportPriorityQosPolicy    transport_priority;
DDS_LifespanQosPolicy    lifespan;
DDS_UserDataQosPolicy    user_data;
DDS_OwnershipQosPolicy    ownership;
DDS_OwnershipStrengthQosPolicy    ownership_strength;
DDS_WriteDataLifecycleQosPolicy    writer_data_lifecycle; };
struct DDS_PublisherQos
```

```c
{ DDS_PresentationQosPolicy presentation;
DDS_PartitionQosPolicy partition;
DDS_GroupDataQosPolicy group_data;
DDS_EntityFactoryQosPolicy entity_factory; };
struct DDS_DataReaderQos
{ DDS_DurabilityQosPolicy durability;
DDS_DeadlineQosPolicy deadline;
DDS_LatencyBudgetQosPolicy latency_budget;
DDS_LivelinessQosPolicy liveliness;
DDS_ReliabilityQosPolicy reliability;
DDS_DestinationOrderQosPolicy destination_order;
DDS_HistoryQosPolicy history;
DDS_ResourceLimitsQosPolicy resource_limits;
DDS_UserDataQosPolicy user_data;
DDS_OwnershipQosPolicy ownership;
DDS_TimeBasedFilterQosPolicy time_based_filter;
DDS_ReaderDataLifecycleQosPolicy reader_data_lifetime;};
struct DDS_SubscriberQos
{ DDS_PresentationQosPolicy presentation;
DDS_PartitionQosPolicy partition;
DDS_GroupDataQosPolicy group_data;
DDS_EntityFactoryQosPolicy entity_factory; };

/*
* define &lt;DDS_Entity&gt;_QOS_DEFAULT
*/
#define DDS_PARTICIPANT_QOS_DEFAULT
#define DDS_TOPIC_QOS_DEFAULT
#define DDS_DATAWRITER_QOS_DEFAULT
#define DDS_PUBLISHER_QOS_DEFAULT
#define DDS_DATAREADER_QOS_DEFAULT
#define DDS_SUBSCRIBER_QOS_DEFAULT
#define DDS_DATAWRITER_QOS_USE_TOPIC_QOS
#define DDS_DATAREADER_QOS_USE_TOPIC_QOS

/*
* implemented API operations
* &lt;no operations&gt;
*/
```

The next paragraphs describe the usage of each &lt;DDS\_Entity&gt;Qos struct.

# DDS\_DataReaderQos

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
struct DDS_DataReaderQos
{ DDS_DurabilityQosPolicy durability;
DDS_DeadlineQosPolicy deadline;
DDS_LatencyBudgetQosPolicy latency_budget;
```

```txt
DDS_LivelinessQosPolicy liveliness;
DDS_ReliabilityQosPolicy reliability;
DDS_DestinationOrderQosPolicy destination_order;
DDS_HistoryQosPolicy history;
DDS_ResourceLimitsQosPolicy resource_limits;
DDS_UserDataQosPolicy user_data;
DDS_OwnershipQosPolicy ownership;
DDS_TimeBasedFilterQosPolicy time_based_filter;
DDS_ReaderDataLifecycleQosPolicy reader_data_lifecycle;};
```

# Description

This struct provides the basic mechanism for an application to specify Quality of Service attributes for a DDS\_DataReader.

# Attributes

DDS\_DurabilityQosPolicy durability - whether the data should be stored for late joining readers. See Section 3.1.3.3 on page 73 for more detailed information about these settings.
DDS\_DeadlineQosPolicy deadline - the period within which a new sample is expected. See Section 3.1.3.1 on page 69 for more detailed information about these settings.
DDS\_LatencyBudgetQosPolicy latency\_budget - used by the Data Distribution Service for optimization. See Section 3.1.3.8 on page 83 for more detailed information about these settings.
DDS\_LivelinessQosPolicy liveliness - the way the liveliness of the DDS\_DataReader is asserted to the Data Distribution Service. See Section 3.1.3.10 on page 85 for more detailed information about these settings.
DDS\_ReliabilityQosPolicy reliability - the reliability of the data distribution. See Section 3.1.3.16 on page 102 for more detailed information about these settings.
DDS\_DestinationOrderQosPolicy destination\_order - the order in which the DDS\_DataReader timely orders the data. See Section 3.1.3.2 on page 71 for more detailed information about these settings.
DDS\_HistoryQosPolicy history - how samples should be stored. See Section 3.1.3.7 on page 80 for more detailed information about these settings.
DDS\_ResourceLimitsQosPolicy resource\_limits - the maximum amount of resources to be used. See Section 3.1.3.17 on page 104 for more detailed information about these settings.
DDS\_UserDataQosPolicy user\_data - used to attach additional information to the DDS\_DataReader. See Section 3.1.3.22 on page 110 for more detailed information about these settings.

DDS\_OwnershipQosPolicy ownership - whether a DataWriter exclusively owns an instance. See Section 3.1.3.11 on page 87 for more detailed information about these settings.

DDS\_TimeBasedFilterQosPolicy time\_based\_filter - the maximum data rate at which the DDS\_DataReader will receive changes. See Section 3.1.3.19 on page 107 for more detailed information about these settings.

DDS\_ReaderDataLifecycleQosPolicy reader\_data\_lifecycle - d e t e r m i n e s w h e t h e r i n s t a n c e s t a t e c h a n g e s ( e i t h e r DDS\_NOT\_ALIVE\_NO\_WRITERS\_INSTANCE\_STATE o r DDS\_NOT\_ALIVE\_DISPOSED\_INSTANCE\_STATE) are presented to the user when no corresponding samples are available to communicate them. Also it determines how long an instance state change remains available to a user that does not explicitly consume them. See Section 3.1.3.15 on page 99 for more detailed information about these settings.

# Detailed Description

A QosPolicy can be set when the DDS\_DataReader is created with the DDS\_Subscriber\_create\_datareader operation (or modified with the DDS\_DataReader\_set\_qos operation). Both operations take the DDS\_DataReaderQos struct as a parameter. There may be cases where several policies are in conflict. Consistency checking is performed each time the policies are modified when they are being created and, in case they are already enabled, via the DDS\_DataReader\_set\_qos operation.

Some QosPolicy have “immutable” semantics meaning that they can only be specified either at DDS\_DataReader creation time or prior to calling the DDS\_DataReader\_enable operation on the DDS\_DataReader.

See Struct QosPolicy on page 59 for a list of all &lt;name&gt;QosPolicy settings, their meaning, characteristics and possible values, as well as if it applies to a DDS\_DataReader.

The initial value of the default DDS\_DataReaderQos in the DDS\_Subscriber are given in the following table:

Table 19: DDS\_DATAREADER\_QOS\_DEFAULT

<table><tr><td>QosPolicy</td><td>Attribute</td><td>Value</td></tr><tr><td>durability</td><td>kind</td><td>DDS_VOLATILE_DURABILITY_QOS</td></tr><tr><td>deadline</td><td>period</td><td>DDS_DURATION_INFINITE</td></tr><tr><td>latency_budget</td><td>duration</td><td>0</td></tr></table>

Table 19: DDS\_DATAREADER\_QOS\_DEFAULT

<table><tr><td>QosPolicy</td><td>Attribute</td><td>Value</td></tr><tr><td rowspan="2">liveliness</td><td>kind</td><td>DDS_AUTOMATIC_LIVELINESS_QOS</td></tr><tr><td>lease_duration</td><td>DDS_DURATION_INFINITE</td></tr><tr><td rowspan="3">reliability</td><td>kind</td><td>DDS_BEST_EFFORT_RELIABILITY_QOS</td></tr><tr><td>max_blocking_time</td><td>100 ms</td></tr><tr><td>synchronous</td><td>FALSE</td></tr><tr><td>destination_order</td><td>kind</td><td>DDS_BY_RECEPTION_TIMESTAMP_DESTINATIONORDER_QOS</td></tr><tr><td rowspan="2">history</td><td>kind</td><td>DDS_KEEP_LAST_HISTORY_QOS</td></tr><tr><td>depth</td><td>1</td></tr><tr><td rowspan="3">resource_limits</td><td>max_samples</td><td>DDS_LENGTH_UNLIMITED</td></tr><tr><td>max_instances</td><td>DDS_LENGTH_UNLIMITED</td></tr><tr><td>max_samples_per_instance</td><td>DDS_LENGTH_UNLIMITED</td></tr><tr><td>user_data</td><td>value.length</td><td>0</td></tr><tr><td>ownership</td><td>kind</td><td>DDS_SHARED_OWNERSHIP_QOS</td></tr><tr><td>time_based_filter</td><td>minimum_separation</td><td>0</td></tr><tr><td rowspan="5">reader_data_lifecycle</td><td>autopurge_nowriter_samples_delay</td><td>DDS_DURATION_INFINITE</td></tr><tr><td>autopurge_disposed_samples_delay</td><td>DDS_DURATION_INFINITE</td></tr><tr><td>autopurge_dispose_all</td><td>FALSE</td></tr><tr><td>enable_invalid_samples</td><td>TRUE</td></tr><tr><td>invalid_sample_visibility.kind</td><td>DDS_MINIMUM_INVALID_SAMPLES</td></tr></table>

# DDS\_DataWriterQos

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
struct DDS_DataWriterQos
{ DDS_DurabilityQosPolicy durability;
DDS_DeadlineQosPolicy deadline;
DDS_LatencyBudgetQosPolicy latency_budget;
DDS_LivelinessQosPolicy liveliness;
DDS_ReliabilityQosPolicy reliability;
DDS_DestinationOrderQosPolicy destination_order;
DDS_HistoryQosPolicy history;
DDS_ResourceLimitsQosPolicy resource_limits;
DDS_TransportPriorityQosPolicy transport_priority;
```

```txt
DDS_LifespanQosPolicy lifespan;
DDS_UserDataQosPolicy user_data;
DDS_OwnershipQosPolicy ownership;
DDS_OwnershipStrengthQosPolicy ownership_strength;
DDS_WriterDataLifecycleQosPolicy writer_data_lifecycle;};
```

# Description

This struct provides the basic mechanism for an application to specify Quality of Service attributes for a DDS\_DataWriter.

# Attributes

DDS\_DurabilityQosPolicy durability - whether the data should be stored for late joining readers. See Section 3.1.3.3 on page 73 for more detailed information about these settings.
DDS\_DeadlineQosPolicy deadline - the period within which a new sample is written. See Section 3.1.3.1 on page 69 for more detailed information about these settings.
DDS\_LatencyBudgetQosPolicy latency\_budget - used by the Data Distribution Service for optimization. See Section 3.1.3.8 on page 83 for more detailed information about these settings.
DDS\_LivelinessQosPolicy liveliness - the way the liveliness of the DDS\_DataWriter is asserted to the Data Distribution Service. See Section 3.1.3.10 on page 85 for more detailed information about these settings.
DDS\_ReliabilityQosPolicy reliability - the reliability of the data distribution. See Section 3.1.3.16 on page 102 for more detailed information about these settings.
DDS\_DestinationOrderQosPolicy destination\_order - the order in which the DDS\_DataReader timely orders the data. See Section 3.1.3.2 on page 71 for more detailed information about these settings.
DDS\_HistoryQosPolicy history - how samples should be stored. See Section 3.1.3.7 on page 80 for more detailed information about these settings.
DDS\_ResourceLimitsQosPolicy resource\_limits - the maximum amount of resources to be used. See Section 3.1.3.17 on page 104 for more detailed information about these settings.
DDS\_TransportPriorityQosPolicy transport\_priority - a priority hint for the underlying transport layer. See Section 3.1.3.21 on page 109 for more detailed information about these settings.
DDS\_LifespanQosPolicy lifespan - the maximum duration of validity of the data written by the DDS\_DataWriter. See Section 3.1.3.9 on page 84 for more detailed information about these settings.

DDS\_UserDataQosPolicy user\_data - used to attach additional information to the DDS\_DataWriter. See Section 3.1.3.22 on page 110 for more detailed information about these settings.

DDS\_OwnershipQosPolicy ownership - whether a DataWriter exclusively owns an instance. See Section 3.1.3.11 on page 87 for more detailed information about these settings.

DDS\_OwnershipStrengthQosPolicy ownership\_strength - the strength to determine the ownership. See Section 3.1.3.12 on page 90 for more detailed information about these settings.

DDS\_WriterDataLifecycleQosPolicy writer\_data\_lifecycle - whether unregistered instances are disposed of automatically or not. See Section 3.1.3.23 on page 110 for more detailed information about these settings.

# Detailed Description

A QosPolicy can be set when the DDS\_DataWriter is created with the DDS\_Publisher\_create\_datawriter operation (or modified with the DDS\_DataWriter\_set\_qos operation). Both operations take the DDS\_DataWriterQos struct as a parameter. There may be cases where several policies are in conflict. Consistency checking is performed each time the policies are modified when they are being created and, in case they are already enabled, via the DDS\_DataWriter\_set\_qos operation.

Some QosPolicy have “immutable” semantics meaning that they can only be specified either at DDS\_DataWriter creation time or prior to calling the DDS\_DataWriter\_enable operation on the DDS\_DataWriter.

The Struct QosPolicy provides the list of all &lt;name&gt;QosPolicy settings, their meaning, characteristics and possible values, as well as if it applies to a DDS\_DataWriter.

The initial value of the default DDS\_DataWriterQos in the DDS\_Publisher are given in the following table:

Table 20: DDS\_DATAWRITER\_QOS\_DEFAULT

<table><tr><td>QosPolicy</td><td>Attribute</td><td>Value</td></tr><tr><td>durability</td><td>kind</td><td>DDS_VOLATILE_DURABILITY_QOS</td></tr><tr><td>deadline</td><td>period</td><td>DDS_DURATION_INFINITE</td></tr><tr><td>latency_budget</td><td>duration</td><td>0</td></tr><tr><td rowspan="2">liveliness</td><td>kind</td><td>DDS_AUTOMATIC_LIVELINESS_QOS</td></tr><tr><td>lease_duration</td><td>DDS_DURATION_INFINITE</td></tr><tr><td rowspan="3">reliability</td><td>kind</td><td>DDS_BEST_EFFORT_RELIABILITY_QOS</td></tr><tr><td>max_blocking_time</td><td>100 ms</td></tr><tr><td>synchronous</td><td>FALSE</td></tr><tr><td>destination_order</td><td>kind</td><td>DDS_BY_RECEPTION_TIMESTAMP_DESTINATIONORDER_QOS</td></tr><tr><td rowspan="2">history</td><td>kind</td><td>DDS_KEEP_LAST_HISTORY_QOS</td></tr><tr><td>depth</td><td>1</td></tr><tr><td rowspan="3">resource_limits</td><td>max_samples</td><td>DDS_LENGTH_UNLIMITED</td></tr><tr><td>max_instances</td><td>DDS_LENGTH_UNLIMITED</td></tr><tr><td>max_samples_per_instance</td><td>DDS_LENGTH_UNLIMITED</td></tr><tr><td>transport_priority</td><td>value</td><td>0</td></tr><tr><td>lifespan</td><td>duration</td><td>DDS_DURATION_INFINITE</td></tr><tr><td>user_data</td><td>value.length</td><td>0</td></tr><tr><td>ownership</td><td>kind</td><td>DDS_SHARED_OWNERSHIP_QOS</td></tr><tr><td>ownership_strength</td><td>value</td><td>0</td></tr><tr><td>writer_data_lifecycle</td><td>autodispose_unregistered_instances</td><td>TRUE</td></tr></table>

# DDS\_DomainParticipantFactoryQos

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
struct DDS_DomainParticipantFactoryQos
{ DDS_EntityFactoryQosPolicy entity_factory; };
```

# Description

This struct provides the basic mechanism for an application to specify Quality of Service attributes for a DDS\_DomainParticipantFactory.

# Attributes

DDS\_EntityFactoryQosPolicy entity\_factory - whether a just created DomainParticipant should be enabled. See Section 3.1.3.5 on page 79 for more detailed information about these settings.

# Detailed Description

T h e Q o s P o l i c y c a n n o t b e s e t a t c r e a t i o n t i m e , s i n c e t h e DDS\_DomainParticipantFactory is a pre-existing object that can only be obtained with the DDS\_DomainParticipantFactory\_get\_instance operation or its alias DDS\_TheParticipantFactory. Therefore its QosPolicy is initialized to a default value according to Table 21::

Table 21: Default Values for DDS\_DomainParticipantFactoryQos

<table><tr><td>QosPolicy</td><td>Attribute</td><td>Value</td></tr><tr><td>entity_factory</td><td>autoenable_created_entities</td><td>TRUE</td></tr></table>

A f t e r c r e a t i o n t h e Q o s P o l i c y c a n b e m o d i f i e d w i t h t h e DDS\_DomainParticipantFactory\_set\_qos operation, which takes the DDS\_DomainParticipantFactoryQos struct as a parameter.

# DDS\_DomainParticipantQos

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
struct DDS_DomainParticipantQos
{ DDS_UserDataQosPolicy user_data;
DDS_EntityFactoryQosPolicy entity_factory;
DDS_SchedulingQosPolicy watchdog_scheduling;
DDS_SchedulingQosPolicy listener_scheduling; };
```

# Description

This struct provides the basic mechanism for an application to specify Quality of Service attributes for a DDS\_DomainParticipant.

# Attributes

DDS\_UserDataQosPolicy user\_data - used to attach additional information to the DDS\_DomainParticipant. See Section 3.1.3.22 on page 110 for more detailed information about these settings.

DDS\_EntityFactoryQosPolicy entity\_factory - whether a just created DDS\_Entity should be enabled. See Section 3.1.3.5 on page 79 for more detailed information about these settings.

DDS\_SchedulingQosPolicy watchdog\_scheduling - the scheduling parameters used to create the watchdog thread. See Section 3.1.3.18 on page 106 for more detailed information about these settings.

DDS\_SchedulingQosPolicy listener\_scheduling - the scheduling parameters used to create the listener thread. See Section 3.1.3.18 on page 106 for more detailed information about these settings.

# Detailed Description

A DDS\_DomainParticipant will spawn different threads for different purposes:

• A listener thread is spawned to perform the callbacks to all DDS\_Listener objects attached to the various DDS\_Entities contained in the DDS\_DomainParticipant. The scheduling parameters for this thread can be specified in the listener\_scheduling field of the DDS\_DomainParticipantQos.
• A watchdog thread is spawned to report the the Liveliness of all DDS\_Entities contained in the DDS\_DomainParticipant whose DDS\_LivelinessQosPolicyKind in their DDS\_LivelinessQosPolicy is set to DDS\_AUTOMATIC\_LIVELINESS\_QOS. The scheduling parameters for this thread can be specified in the watchdog\_scheduling field of the DDS\_DomainParticipantQos.

A QosPolicy can be set when the DDS\_DomainParticipant is created with the DDS\_DomainParticipantFactory\_create\_participant operation (or modified with the DDS\_DomainParticipant\_set\_qos operation). Both operations take the DDS\_DomainParticipantQos struct as a parameter. There may be cases where several policies are in conflict. Consistency checking is performed each time the policies are modified when they are being created and, in case they are already enabled, via the DDS\_DomainParticipant\_set\_qos operation.

Some QosPolicy have “immutable” semantics meaning that they can only be specified either at DDS\_DomainParticipant creation time or prior to calling the DDS\_DomainParticipant\_enable o p e r a t i o n o n t h e DDS\_DomainParticipant.

The initial value of the default DDS\_DomainParticipantQos in the DDS\_DomainParticipantFactory are given in the following table:

Table 22: DDS\_PARTICIPANT\_QOS\_DEFAULT

<table><tr><td>QosPolicy</td><td>Attribute</td><td>Value</td></tr><tr><td>user_data</td><td>value.length</td><td>0</td></tr><tr><td>entity_factory</td><td>autoenable_created_entities</td><td>TRUE</td></tr><tr><td rowspan="3">watchdog_scheduling</td><td>scheduling_class.kind</td><td>SCHEDULE_DEFAULT</td></tr><tr><td>scheduling_priority_kind.kind</td><td>PRIORITY_RELATIVE</td></tr><tr><td>scheduling_priority</td><td>0</td></tr></table>

Table 22: DDS\_PARTICIPANT\_QOS\_DEFAULT

<table><tr><td>QosPolicy</td><td>Attribute</td><td>Value</td></tr><tr><td rowspan="3">listener_scheduling</td><td>scheduling_class.kind</td><td>SCHEDULE_DEFAULT</td></tr><tr><td>scheduling_priority_kind.kind</td><td>PRIORITY_RELATIVE</td></tr><tr><td>scheduling_priority</td><td>0</td></tr></table>

# DDS\_PublisherQos

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
struct DDS_PublisherQos
{ DDS_PresentationQosPolicy presentation;
DDS_PartitionQosPolicy partition;
DDS_GroupDataQosPolicy group_data;
DDS_EntityFactoryQosPolicy entity_factory; };
```

# Description

This struct provides the basic mechanism for an application to specify Quality of Service attributes for a DDS\_Publisher.

# Attributes

DDS\_PresentationQosPolicy presentation - the dependency of changes to data-instances. See Section 3.1.3.14 on page 92 for more detailed information about these settings.

DDS\_PartitionQosPolicy partition - the partitions in which the DDS\_Publisher is active. See Section 3.1.3.13 on page 91 for more detailed information about these settings.

DDS\_GroupDataQosPolicy group\_data - used to attach additional information to the DDS\_Publisher. See Section 3.1.3.6 on page 80 for more detailed information about these settings.

DDS\_EntityFactoryQosPolicy entity\_factory - whether a just created DDS\_DataWriter should be enabled. See Section 3.1.3.5 on page 79 for more detailed information about these settings.

# Detailed Description

A QosPolicy can be set when the DDS\_Publisher is created with the DDS\_DomainParticipant\_create\_publisher operation (or modified with the D D S\_ P u b l i sh e r \_ s e t \_q o s o p e r a t i o n ). B o t h o p e ra ti o n s t a k e t h e DDS\_PublisherQos struct as a parameter. There may be cases where several policies are in conflict. Consistency checking is performed each time the policies are modified when they are being created and, in case they are already enabled, via the DDS\_Publisher\_set\_qos operation.

Some QosPolicy have “immutable” semantics meaning that they can only be specified either at DDS\_Publisher creation time or prior to calling the DDS\_Publisher\_enable operation on the DDS\_Publisher.

T h e i n i t i a l v a l u e o f t h e d e f a u l t D D S \_ P u b l i s h e r Q o s i n t h e DDS\_DomainParticipant are given in the following table:

Table 23: DDS\_PUBLISHER\_QOS\_DEFAULT

<table><tr><td>QosPolicy</td><td>Attribute</td><td>Value</td></tr><tr><td rowspan="3">presentation</td><td>access_scope</td><td>DDS_INSTANCE_PRESENTATION_QOS</td></tr><tr><td>coherent_access</td><td>FALSE</td></tr><tr><td>ordered_access</td><td>FALSE</td></tr><tr><td>partition</td><td>name.length</td><td>0</td></tr><tr><td>group_data</td><td>value.length</td><td>0</td></tr><tr><td>entity_factory</td><td>autoenable_created_entities</td><td>TRUE</td></tr></table>

# DDS\_SubscriberQos

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
struct DDS_SubscriberQos
{ DDS_PresentationQosPolicy presentation;
DDS_PartitionQosPolicy partition;
DDS_GroupDataQosPolicy group_data;
DDS_EntityFactoryQosPolicy entity_factory; };
```

# Description

This struct provides the basic mechanism for an application to specify Quality of Service attributes for a DDS\_Subscriber.

# Attributes

DDS\_PresentationQosPolicy presentation - the dependency of changes to data-instances. See Section 3.1.3.14 on page 92 for more detailed information about these settings.

DDS\_PartitionQosPolicy partition - the partitions in which the DDS\_Subscriber is active. See Section 3.1.3.13 on page 91 for more detailed information about these settings.

DDS\_GroupDataQosPolicy group\_data - used to attach additional information to the DDS\_Subscriber. See Section 3.1.3.6 on page 80 for more detailed information about these settings.

DDS\_EntityFactoryQosPolicy entity\_factory - whether a just created DDS\_DataReader should be enabled. See Section 3.1.3.5 on page 79 for more detailed information about these settings.

# Detailed Description

A QosPolicy can be set when the DDS\_Subscriber is created with the DDS\_DomainParticipant\_create\_subscriber operation (or modified with the DDS\_Subscriber\_set\_qos operation). Both operations take the DDS\_SubscriberQos struct as a parameter. There may be cases where several policies are in conflict. Consistency checking is performed each time the policies are modified when they are being created and, in case they are already enabled, via the DDS\_Subscriber\_set\_qos operation.

Some QosPolicy have “immutable” semantics meaning that they can only be specified either at DDS\_Subscriber creation time or prior to calling the DDS\_Subscriber\_enable operation on the DDS\_Subscriber.

T h e i n i t i a l v a l u e o f t h e d e f a u l t D D S \_ S u b s c r i b e r Q o s i n t h e DDS\_DomainParticipant are given in the following table:

Table 24: DDS\_SUBSCRIBER\_QOS\_DEFAULT

<table><tr><td>QosPolicy</td><td>Attribute</td><td>Value</td></tr><tr><td rowspan="3">presentation</td><td>access_scope</td><td>DDS_INSTANCE_PRESENTATION_QOS</td></tr><tr><td>coherent_access</td><td>FALSE</td></tr><tr><td>ordered_access</td><td>FALSE</td></tr><tr><td>partition</td><td>name.length</td><td>0</td></tr><tr><td>group_data</td><td>value.length</td><td>0</td></tr><tr><td>entity_factory</td><td>autoenable_created_entities</td><td>TRUE</td></tr></table>

# DDS\_TopicQos

# Synopsis

```c
#include &lt;dds_dcps.h&gt;
struct DDS_TopicQos
{ DDS_TopicDataQosPolicy topic_data;
DDS_DurabilityQosPolicy durability;
DDS_DurabilityServiceQosPolicy durability_service;
```

```txt
DDS_DeadlineQosPolicy deadline;
DDS_LatencyBudgetQosPolicy latency_budget;
DDS_LivelinessQosPolicy liveliness;
DDS_ReliabilityQosPolicy reliability;
DDS_DestinationOrderQosPolicy destination_order;
DDS_HistoryQosPolicy history;
DDS_ResourceLimitsQosPolicy resource_limits;
DDS_TransportPriorityQosPolicy transport_priority;
DDS_LifespanQosPolicy lifespan;
DDS_OwnershipQosPolicy ownership; };
```

# Description

This struct provides the basic mechanism for an application to specify Quality of Service attributes for a DDS\_Topic.

# Attributes

DDS\_TopicDataQosPolicy topic\_data - used to attach additional information to the DDS\_Topic. See Section 3.1.3.20 on page 108 for more detailed information about these settings.
DDS\_DurabilityQosPolicy durability - whether the data should be stored for late joining readers. See Section 3.1.3.3 on page 73 for more detailed information about these settings.
DDS\_DurabilityServiceQosPolicy durability\_service - the behaviour of the “transient/persistent service” of the Data Distribution System regarding Transient and Persistent DDS\_Topic instances. See Section 3.1.3.4 on page 76 for more detailed information about these settings.
DDS\_DeadlineQosPolicy deadline - the period within which a new sample is expected or written. See Section 3.1.3.1 on page 69 for more detailed information about these settings.
DDS\_LatencyBudgetQosPolicy latency\_budget - used by the Data Distribution Service for optimization. See Section 3.1.3.8 on page 83 for more detailed information about these settings.
DDS\_LivelinessQosPolicy liveliness - the way the liveliness of the DDS\_Topic is asserted to the Data Distribution Service. See Section 3.1.3.10 on page 85 for more detailed information about these settings.
DDS\_ReliabilityQosPolicy reliability - the reliability of the data distribution. See Section 3.1.3.16 on page 102 for more detailed information about these settings.
DDS\_DestinationOrderQosPolicy destination\_order - the order in which the DDS\_DataReader timely orders the data. See Section 3.1.3.2 on page 71 for more detailed information about these settings.

DDS\_HistoryQosPolicy history - how samples should be stored. See Section 3.1.3.7 on page 80 for more detailed information about these settings.
DDS\_ResourceLimitsQosPolicy resource\_limits - the maximum amount of resources to be used. See Section 3.1.3.17 on page 104 for more detailed information about these settings.
DDS\_TransportPriorityQosPolicy transport\_priority - a priority hint for the underlying transport layer. See Section 3.1.3.21 on page 109 for more detailed information about these settings.
DDS\_LifespanQosPolicy lifespan - the maximum duration of validity of the data written by a DDS\_DataWriter. See Section 3.1.3.9 on page 84 for more detailed information about these settings.
DDS\_OwnershipQosPolicy ownership - whether a DDS\_DataWriter exclusively owns an instance. See Section 3.1.3.11 on page 87 for more detailed information about these settings.

# Detailed Description

A Q o s P o l i c y c an be s et w he n t h e D D S \_ T o p i c is created with the DDS\_DomainParticipant\_create\_topic operation (or modified with the DDS\_Topic\_set\_qos operation). Both operations take the DDS\_TopicQos struct as a parameter. There may be cases where several policies are in conflict. Consistency checking is performed each time the policies are modified when they a r e b e i n g c r e a t e d a n d , i n c a s e t h e y a r e a l r e a d y e n a b l e d , v i a t h e DDS\_Topic\_set\_qos operation.

Some QosPolicy have “immutable” semantics meaning that they can only be specified either at DDS\_Topic creation time or prior to calling the DDS\_Topic\_enable operation on the DDS\_Topic.

The initial value of the default DDS\_TopicQos in the DDS\_DomainParticipant are given in the following table:

Table 25: DDS\_TOPIC\_QOS\_DEFAULT

<table><tr><td>QosPolicy</td><td>Attribute</td><td>Value</td></tr><tr><td>topic_data</td><td>value.length</td><td>0</td></tr><tr><td>durability</td><td>kind</td><td>DDS_VOLATILE_DURABILITY_QOS</td></tr><tr><td rowspan="6">durability_service</td><td>service_cleanup_delay</td><td>0</td></tr><tr><td>history_kind</td><td>DDS_KEEP_LAST_HISTORY_QOS</td></tr><tr><td>history_depth</td><td>1</td></tr><tr><td>max_samples</td><td>DDS_LENGTH_UNLIMITED</td></tr><tr><td>max_instances</td><td>DDS_LENGTH_UNLIMITED</td></tr><tr><td>max_samples_per_instance</td><td>DDS_LENGTH_UNLIMITED</td></tr><tr><td>deadline</td><td>period</td><td>DDS_DURATION_INFINITE</td></tr><tr><td>latency_budget</td><td>duration</td><td>0</td></tr><tr><td rowspan="2">liveliness</td><td>kind</td><td>DDS_AUTOMATIC_LIVELINESS_QOS</td></tr><tr><td>lease_duration</td><td>DDS_DURATION_INFINITE</td></tr><tr><td rowspan="3">reliability</td><td>kind</td><td>DDS_BEST_EFFORT_RELIABILITY_QOS</td></tr><tr><td>max_blocking_time</td><td>100 ms</td></tr><tr><td>synchronous</td><td>FALSE</td></tr><tr><td>destination_order</td><td>kind</td><td>DDS_BY_RECEPTION_TIMESTAMP_DESTINATIONORDER_QOS</td></tr><tr><td rowspan="2">history</td><td>kind</td><td>DDS_KEEP_LAST_HISTORY_QOS</td></tr><tr><td>depth</td><td>1</td></tr><tr><td rowspan="3">resource_limits</td><td>max_samples</td><td>DDS_LENGTH_UNLIMITED</td></tr><tr><td>max_instances</td><td>DDS_LENGTH_UNLIMITED</td></tr><tr><td>max_samples_per_instance</td><td>DDS_LENGTH_UNLIMITED</td></tr><tr><td>transport_priority</td><td>value</td><td>0</td></tr><tr><td>lifespan</td><td>duration</td><td>DDS_DURATION_INFINITE</td></tr><tr><td>ownership</td><td>kind</td><td>DDS_SHARED_OWNERSHIP_QOS</td></tr></table>

Appendices

# Appendix

# B

# API Constants and Types

These constants and types are taken from the dds\_dcps.h include file.
```c
/* Duration and Time
*/
struct DDS_Duration_t
{
    DDS_long sec;
    DDS_unsigned_long nanosec;
};

#define DDS_DURATION_INFINITE_SEC 0x7fffffff
#define DDS_DURATION_INFINITE_NSEC 0x7ffffffffU
#define DDS_DURATION_ZERO_SEC 0
#define DDS_DURATION_ZERO_NSEC 0U
#define DDS_DURATION_INFINITE
DDS_DURATION_INFINITE_SEC,
DDS_DURATION_INFINITE_NSEC }
#define DDS_DURATION_ZERO
DDS_DURATION_ZERO_SEC,
DDS_DURATION_ZERO_NSEC }

struct DDS_Time_t
{
    DDS_long sec;
    DDS_unsigned_long nanosec;
};

/*
* Pre-defined values
*/

#define DDS_HANDLE NIL  DDS_HANDLE NIL NATIVE
#define DDS_LENGTH_UNLIMITED -1
#define DDS_TIMESTAMP_INVALID_SEC -1
#define DDS_TIMESTAMP_INVALID_NSEC 4294967295U
#define DDS_TIMESTAMP_INVALID
DDS_TIMESTAMP_INVALID_SEC,
DDS_TIMESTAMP_INVALID_NSEC }

/*
* Return codes
* ---- */
#define DDS_RETCODE_OK 0
```

```c
#define DDS_RETCODE_ERROR 1
#define DDS_RETCODE_UNSUPPORTED 2
#define DDS_RETCODE_BAD_PARAMETER 3
#define DDS_RETCODE_PRECONDITION_NOT_MET 4
#define DDS_RETCODE_OUT_OF_RESOURCES 5
#define DDS_RETCODE_NOT_ENABLED 6
#define DDS_RETCODE_IMMUTABLE_POLICY 7
#define DDS_RETCODE_INCONSISTENT_POLICY 8
#define DDS_RETCODE_ALREADY_DELETED 9
#define DDS_RETCODE_TIMEOUT 10
#define DDS_RETCODE_NO_DATA 11
#define DDS_RETCODE_ILLEGAL_OPERATION 12
```

```c
/* ----
* DDS_Status to support listeners and conditions
* ---- */
#define DDS_INCONSISTENT_TOPIC_STATUS 1U
#define DDS_OFFERED_DEADLINE_MISSED_STATUS 2U
#define DDS_REQUESTED_DEADLINE_MISSED_STATUS 4U
#define DDS_OFFERED_INCOMPATIBLE_QOS_STATUS 32U
#define DDS_REQUESTED_INCOMPATIBLE_QOS_STATUS 64U
#define DDS_SAMPLE_LOST_STATUS 128U
#define DDS_SAMPLE_REJECTED_STATUS 256U
#define DDS_DATA_ON_READERS_STATUS 512U
#define DDS_DATA_AVAILABLE_STATUS 1024U
#define DDS_LIVELINESS_LOST_STATUS 2048U
#define DDS_LIVELINESS_CHANGED_STATUS 4096U
#define DDS_PUBLICATION_MATCHED_STATUS 8192U
#define DDS_SUBSCRIPTION_MATCHED_STATUS 16384U

#define DDS_ANY_STATUS 0x7FE7
#define DDS_STATUS_MASK_ANY_V1_2 0x7FE7
#define DDS_STATUS_MASK_NONE 0x0

/*
* States
* */
/*
* Sample states to support reads
*/
#define DDS_READ_SAMPLE_STATE 1U
#define DDS_NOT_READ_SAMPLE_STATE 2U

/*
* This is a bit-mask DDS_SampleStateKind
*/
#define DDS_ANY_SAMPLE_STATE 65535U

/*
```

```c
* View states to support reads
*/
#define DDS_NEW_VIEW_STATE 1U
#define DDS_NOT_NEW_VIEW_STATE 2U
/*
* This is a bit-mask DDS_ViewStateKind
*/
#define DDS_ANY_VIEW_STATE 65535U

/*
* Instance states to support reads
*/
#define DDS_ALIVE_INSTANCE_STATE 1U
#define DDS_NOT_ALIVE_DISPOSED_INSTANCE_STATE 2U
#define DDS_NOT_ALIVE_NO_WRITERS_INSTANCE_STATE 4U

/*
* This is a bit-mask DDS_InstanceStateKind
*/
#define DDS_ANY_INSTANCE_STATE 65535U
#define DDS_NOT_ALIVE_INSTANCE_STATE 6U

/*
* Participant Factory define
*/
#define TheParticipantFactory
(DDS_DomainParticipantFactory_get_instance())

/*
* Qos defines
* */
#define DDS_PARTICIPANT_QOS_DEFAULT NULL
#define DDS_TOPIC_QOS_DEFAULT NULL
#define DDS_PUBLISHER_QOS_DEFAULT NULL
#define DDS_SUBSCRIBER_QOS_DEFAULT NULL
#define DDS_DATAREADER_QOS_DEFAULT NULL
#define DDS_DATAWRITER_QOS_DEFAULT NULL
#define DDS_DATAWRITER_QOS_USE_TOPIC_QOS ((DDS_DataWriterQos *)-1)
#define DDS_DATAREADER_QOS_USE_TOPIC_QOS ((DDS_DataReaderQos *)-1)

/* QosPolicy
* /
#define DDS_USERDATA_QOS_POLICY_NAME "UserData"
#define DDS_DURABILITY_QOS_POLICY_NAME "Durability"
#define DDS_PRESENTATION_QOS_POLICY_NAME "Presentation"
#define DDS_DEADLINE_QOS_POLICY_NAME "Deadline"
#define DDS_LATENCYBUDGET_QOS_POLICY_NAME "LatencyBudget"
#define DDS_OWNERSHIP_QOS_POLICY_NAME "Ownership"
#define DDS_OWNERSHIPSTRENGTH_QOS_POLICY_NAME "OwnershipStrength"
```

```c
#define DDS_LIVELINESS_QOS_POLICY_NAME "Liveliness"
#define DDS_TIMEBASEDFILTER_QOS_POLICY_NAME "TimeBasedFilter"
#define DDS_PARTITION_QOS_POLICY_NAME "Partition"
#define DDS_RELIABILITY_QOS_POLICY_NAME "Reliability"
#define DDS_DESTINATIONORDER_QOS_POLICY_NAME "DestinationOrder"
#define DDS_HISTORY_QOS_POLICY_NAME "History"
#define DDS_RESOURCELIMITS_QOS_POLICY_NAME "ResourceLimits"
#define DDS_ENTITYFACTORY_QOS_POLICY_NAME "EntityFactory"
#define DDS_WRITERDATALIFECYCLE_QOS_POLICY_NAME
"WriterDataLifecycle"
#define DDS_READERDATALIFECYCLE_QOS_POLICY_NAME
"ReaderDataLifecycle"
#define DDS_TOPICDATA_QOS_POLICY_NAME "TopicData"
#define DDS_GROUPDATA_QOS_POLICY_NAME "GroupData"
#define DDS_TRANSPORTPRIORITY_QOS_POLICY_NAME "TransportPriority"
#define DDS_LIFESPAN_QOS_POLICY_NAME "Lifespan"
#define DDS_DURABILITIESERVICE_QOS_POLICY_NAME "DurabilityService"

#define DDS_INVALID_QOS_POLICY_ID 0
#define DDS_USERDATA_QOS_POLICY_ID 1
#define DDS_DURABILITY_QOS_POLICY_ID 2
#define DDS_PRESENTATION_QOS_POLICY_ID 3
#define DDS_DEADLINE_QOS_POLICY_ID 4
#define DDS_LATENCYBUDGET_QOS_POLICY_ID 5
#define DDS_OWNERSHIP_QOS_POLICY_ID 6
#define DDS_OWNERSHIPSTRENGTH_QOS_POLICY_ID 7
#define DDS_LIVELINESS_QOS_POLICY_ID 8
#define DDS_TIMEBASEDFILTER_QOS_POLICY_ID 9
#define DDS_PARTITION_QOS_POLICY_ID 10
#define DDS_RELIABILITY_QOS_POLICY_ID 11
#define DDS_DESTINATIONORDER_QOS_POLICY_ID 12
#define DDS_HISTORY_QOS_POLICY_ID 13
#define DDS_RESOURCELIMITS_QOS_POLICY_ID 14
#define DDS_ENTITYFACTORY_QOS_POLICY_ID 15
#define DDS_WRITERDATALIFECYCLE_QOS_POLICY_ID 16
#define DDS_READERDATALIFECYCLE_QOS_POLICY_ID 17
#define DDS_TOPICDATA_QOS_POLICY_ID 18
#define DDS_GROUPDATA_QOS_POLICY_ID 19
#define DDS_TRANSPORTPRIORITY_QOS_POLICY_ID 20
#define DDS_LIFESPAN_QOS_POLICY_ID 21
#define DDS_DURABILITYSERVICE_QOS_POLICY_ID 22
```

# Appendix

# C

# Platform Specific IDL Interface

The IDL code in the next paragraphs are taken from the OMG C Language Mapping Specification.

# dds\_dcps.idl

```c
#define DOMAINID_TYPE_NATIVE long
#define HANDLE_TYPE_NATIVELong long
#define HANDLE_NIL_NATIVE0
#define BUILTIN_TOPIC_KEY_TYPE_NATIVELong
#define TheParticipantFactory
#define PARTICIPANT_QOS_DEFAULT
#define TOPIC_QOS_DEFAULT
#define PUBLISHER_QOS_DEFAULT
#define SUBSCRIBER_QOS_DEFAULT
#define DATAWRITER_QOS_DEFAULT
#define DATAREADER_QOS_DEFAULT
#define DATAWRITER_QOS_USE_TOPIC_QOS
#define DATAREADER_QOS_USE_TOPIC_QOS

module DDS {
    typedef DOMAINID_TYPE_NATIVE DomainId_t;
    typedef HANDLE_TYPE_NATIVE InstanceHandle_t;
    typedef BUILTIN_TOPIC_KEY_TYPE_NATIVE BuiltinTopicKey_t[3];
    typedef sequence&lt;InstanceHandle_t&gt; InstanceHandleSeq;
    typedef long ReturnCode_t;
    typedef long QosPolicyId_t;
    typedef sequence&lt;string&gt; StringSeq;
    struct Duration_t {
    long sec;
    unsigned long nanosec;
    };
    struct Time_t {
    long sec;
    unsigned long nanosec;
    };

    // Pre-defined values
    //
    const InstanceHandle_t HANDLE_NIL= HANDLE_NIL_NATIVE;
    const long LENGTH_UNLIMITED=-1;
    const long DURATION_INFINITE_SEC= 0x7fffffff;
    const unsigned long DURATION_INFINITE_NSEC= 0x7ffffff;
    const long DURATION_ZERO_SEC= 0;
```

```c
const unsigned long DURATION_ZERO_NSEC= 0;
const long TIMESTAMP_INVALID_SEC= -1;
const unsigned long TIMESTAMP_INVALID_NSEC= 0xffffff;
const DomainId_t DOMAIN_ID_DEFAULT= 0x7fffffff;
//
// Return codes
//
const ReturnCode_t RETCODE_OK = 0;
const ReturnCode_t RETCODE_ERROR = 1;
const ReturnCode_t RETCODE_UNSUPPORTED = 2;
const ReturnCode_t RETCODE_BAD_PARAMETER = 3;
const ReturnCode_t RETCODE_PRECONDITION_NOT_MET = 4;
const ReturnCode_t RETCODE_OUT_OF_RESOURCES = 5;
const ReturnCode_t RETCODE_NOT_ENABLED = 6;
const ReturnCode_t RETCODE_IMMUTABLE_POLICY = 7;
const ReturnCode_t RETCODE_INCONSISTENT_POLICY = 8;
const ReturnCode_t RETCODE_ALREADY_DELETED = 9;
const ReturnCode_t RETCODE_TIMEOUT = 10;
const ReturnCode_t RETCODE_NO_DATA = 11;
const ReturnCode_t RETCODE_ILLEGAL_OPERATION = 12;

//
// Status to support listeners and conditions
//
typedef unsigned long StatusKind;
typedef unsigned long StatusMask; // bit-mask StatusKind
const StatusKind INCONSISTENT_TOPIC_STATUS = 0x0001 &lt;&lt; 0;
const StatusKind OFFERED_DEADLINE_MISSED_STATUS = 0x0001 &lt;&lt; 1;
const StatusKind REQUESTED_DEADLINE_MISSED_STATUS = 0x0001 &lt;&lt; 2;
const StatusKind OFFERED_INCOMPATIBLE_QOS_STATUS = 0x0001 &lt;&lt; 5;
const StatusKind REQUESTED_INCOMPATIBLE_QOS_STATUS= 0x0001 &lt;&lt; 6;
const StatusKind SAMPLE_LOST_STATUS = 0x0001 &lt;&lt; 7;
const StatusKind SAMPLE_REJECTED_STATUS = 0x0001 &lt;&lt; 8;
const StatusKind DATA_ON_READERS_STATUS = 0x0001 &lt;&lt; 9;
const StatusKind DATA_AVAILABLE_STATUS = 0x0001 &lt;&lt; 10;
const StatusKind LIVELINESS_LOST_STATUS = 0x0001 &lt;&lt; 11;
const StatusKind LIVELINESS_CHANGED_STATUS = 0x0001 &lt;&lt; 12;
const StatusKind PUBLICATION_MATCHED_STATUS = 0x0001 &lt;&lt; 13;
const StatusKind SUBSCRIPTION_MATCHED_STATUS = 0x0001 &lt;&lt; 14;
struct InconsistentTopicStatus {
    long total_count;
    long total_count_change;
};
struct SampleLostStatus {
    long total_count;
    long total_count_change;
};
enum SampleRejectedStatusKind {
    NOT_REJECTED,
    REJECTED_BY_INSTANCE_LIMIT,
```

```txt
REJECTED_BY_SAMPLES_LIMIT,
REJECTED_BY_SAMPLES_PER_INSTANCE_LIMIT
};
struct SampleRejectedStatus {
    long total_count;
    long total_count_change;
    SampleRejectedStatusKind last_reason;
    InstanceHandle_t last_instance_handle;
};
struct LivelinessLostStatus {
    long total_count;
    long total_count_change;
};
struct LivelinessChangedStatus {
    long alive_count;
    long not_alive_count;
    long alive_count_change;
    long not_alive_count_change;
    InstanceHandle_t last_publication_handle;
};
struct OfferedDeadlineMissedStatus {
    long total_count;
    long total_count_change;
    InstanceHandle_t last_instance_handle;
};
struct RequestedDeadlineMissedStatus {
    long total_count;
    long total_count_change;
    InstanceHandle_t last_instance_handle;
};
struct QosPolicyCount {
    QosPolicyId_t policy_id;
    long count;
};
typedef sequence&lt;QosPolicyCount&gt; QosPolicyCountSeq;
struct OfferedIncompatibleQosStatus {
    long total_count;
    long total_count_change;
    QosPolicyId_t last_policy_id;
    QosPolicyCountSeq policies;
};
struct RequestedIncompatibleQosStatus {
    long total_count;
    long total_count_change;
    QosPolicyId_t last_policy_id;
    QosPolicyCountSeq policies;
};
struct PublicationMatchedStatus {
    long total_count;
    long total_count_change;
```

```txt
long current_count;
long current_count_change;
InstanceHandle_t last_subscription_handle;
};
struct SubscriptionMatchedStatus {
    long total_count;
    long total_count_change;
    long current_count;
    long current_count_change;
    InstanceHandle_t last_publication_handle;
};
//
// Listeners
//
interface Listener;
interface Entity;
interface TopicDescription;
interface Topic;
interface ContentFilteredTopic;
interface MultiTopic;
interface DataWriter;
interface DataReader;
interface Subscriber;
interface Publisher;
typedef sequence&lt;Topic&gt; TopicSeq;
typedef sequence&lt;DataReader&gt; DataReaderSeq;
interface Listener {
};
interface TopicListener : Listener {
void
    on_inconsistent_topic(
    in Topic the_topic,
    in InconsistentTopicStatus status);
};
interface DataWriterListener : Listener {
void
    on_offered_deadline_missed(
    in DataWriter writer,
    in OfferedDeadlineMissedStatus status);
void
    on_offered_incompatible_qos(
    in DataWriter writer,
    in OfferedIncompatibleQosStatus status);
void
    on_liveliness_lost(
    in DataWriter writer,
    in LivelinessLostStatus status);
void
    on_publication_matched(
    in DataWriter writer,
```

```c
in PublicationMatchedStatus status);
};
interface PublisherListener : DataWriterListener {
};
interface DataReaderListener : Listener {
void
    on_requested_deadline_missed(
    in DataReader reader,
    in RequestedDeadlineMissedStatus status);
void
    on_requested_incompatible_qos(
    in DataReader reader,
    in RequestedIncompatibleQosStatus status);
void
    on_sample_rejected(
    in DataReader reader,
    in SampleRejectedStatus status);
void
    on_liveliness_changed(
    in DataReader reader,
    in LivelinessChangedStatus status);
void
    on_data_available(
    in DataReader reader);
void
    on_subscription_matched(
    in DataReader reader,
    in SubscriptionMatchedStatus status);
void
    on_sample_lost(
    in DataReader reader,
    in SampleLostStatus status);
};
interface SubscriberListener : DataReaderListener {
void
    on_data_on_readers(
    in Subscriber subs);
};
interface DomainParticipantListener : TopicListener,
PublisherListener,
SubscriberListener {
};
//
// Conditions
//
interface Condition {
boolean
get_trigger_value();
};
typedef sequence&lt;Condition&gt; ConditionSeq;
```

```c
interface WaitSet {
ReturnCode_t
wait(
    inout ConditionSeq active_conditions,
    in Duration_t timeout);
ReturnCode_t
attach_condition(
    in Condition cond);
ReturnCode_t
detach_condition(
    in Condition cond);
ReturnCode_t
get_conditions(
    inout ConditionSeq attached_conditions);
};
interface GuardCondition : Condition {
ReturnCode_t
set_trigger_value(
    in boolean value);
};
interface StatusCondition : Condition {
StatusMask
get_enabled statuses();
ReturnCode_t
set_enabled statuses(
    in StatusMask mask);
Entity
get_entity();
};
// Sample states to support reads
typedef unsigned long SampleStateKind;
typedef sequence &lt;SampleStateKind&gt; SampleStateSeq;
const SampleStateKind READ_SAMPLE_STATE = 0x0001 &lt;&lt; 0;
const SampleStateKind NOT_READ_SAMPLE_STATE = 0x0001 &lt;&lt; 1;
// This is a bit-mask SampleStateKind
typedef unsigned long SampleStateMask;
const SampleStateMask ANY_SAMPLE_STATE = 0xffff;
// View states to support reads
typedef unsigned long ViewStateKind;
typedef sequence&lt;ViewStateKind&gt; ViewStateSeq;
const ViewStateKind NEW_VIEW_STATE = 0x0001 &lt;&lt; 0;
const ViewStateKind NOT_NEW_VIEW_STATE = 0x0001 &lt;&lt; 1;
// This is a bit-mask ViewStateKind
typedef unsigned long ViewStateMask;
const ViewStateMask ANY_VIEW_STATE = 0xffff;
// Instance states to support reads
typedef unsigned long InstanceStateKind;
typedef sequence&lt;InstanceStateKind&gt; InstanceStateSeq;
const InstanceStateKind ALIVE_INSTANCE_STATE = 0x0001 &lt;&lt; 0;
```

```c
const InstanceStateKind NOT_ALIVE_DISPOSED_INSTANCE_STATE = 0x0001
&lt;&lt; 1;
const InstanceStateKind NOT_ALIVE_NO_WRITERS_INSTANCE_STATE = 0x0001 &lt;&lt; 2;
// This is a bit-mask InstanceStateKind
typedef unsigned long InstanceStateMask;
const InstanceStateMask ANY_INSTANCE_STATE = 0xffff;
const InstanceStateMask NOT_ALIVE_INSTANCE_STATE = 0x006;
interface ReadCondition : Condition {
SampleStateMask
get_sample_state_mask();
ViewStateMask
get_view_state_mask();
InstanceStateMask
get_instance_state_mask();
DataReader
get_datareader();
};
interface QueryCondition : ReadCondition {
string
get_query_expression();
ReturnCode_t
get_query_parameters(
    inout StringSeq query_parameters);
ReturnCode_t
set_query_parameters(
    in StringSeq query_parameters);
};
//
// Qos
//
const string USERDATA_QOS_POLICY_NAME = "UserData";
const string DURABILITY_QOS_POLICY_NAME = "Durability";
const string PRESENTATION_QOS_POLICY_NAME = "Presentation";
const string DEADLINE_QOS_POLICY_NAME = "Deadline";
const string LATENCYBUDGET_QOS_POLICY_NAME = "LatencyBudget";
const string OWNERSHIP_QOS_POLICY_NAME = "Ownership";
const string OWNERSHIPSTRENGTH_QOS_POLICY_NAME = "OwnershipStrength";
const string LIVELINESS_QOS_POLICY_NAME = "Liveliness";
const string TIMEBASEDFILTER_QOS_POLICY_NAME = "TimeBasedFilter";
const string PARTITION_QOS_POLICY_NAME = "Partition";
const string RELIABILITY_QOS_POLICY_NAME = "Reliability";
const string DESTINATIONORDER_QOS_POLICY_NAME = "DestinationOrder";
const string HISTORY_QOS_POLICY_NAME = "History";
const string RESOURCELIMITS_QOS_POLICY_NAME = "ResourceLimits";
const string ENTITYFACTORY_QOS_POLICY_NAME = "EntityFactory";
const string WRITERDATALIFECYCLE_QOS_POLICY_NAM = "WriterDataLifecycle";
```

```c
const string READERDATALIFECYCLE_QOS_POLICY_NAM=
    "ReaderDataLifecycle";

const string TOPICDATA_QOS_POLICY_NAME = "TopicData";
const string GROUPDATA_QOS_POLICY_NAME = "GroupData";
const string TRANSPORTPRIORITY_QOS_POLICY_NAME=
    "TransportPriority";
const string LIFESPAN_QOS_POLICY_NAME = "Lifespan";
const string DURABILITYSERVICE_QOS_POLICY_NAME=
    "DurabilityService";

const QosPolicyId_t INVALID_QOS_POLICY_ID = 0;
const QosPolicyId_t USERDATA_QOS_POLICY_ID = 1;
const QosPolicyId_t DURABILITY_QOS_POLICY_ID = 2;
const QosPolicyId_t PRESENTATION_QOS_POLICY_ID = 3;
const QosPolicyId_t DEADLINE_QOS_POLICY_ID = 4;
const QosPolicyId_t LATENCYBUDGET_QOS_POLICY_ID = 5;
const QosPolicyId_t OWNERSHIP_QOS_POLICY_ID = 6;
const QosPolicyId_t OWNERSHIPSTRENGTH_QOS_POLICY_ID = 7;
const QosPolicyId_t LIVELINESS_QOS_POLICY_ID = 8;
const QosPolicyId_t TIMEBASEDFILTER_QOS_POLICY_ID = 9;
const QosPolicyId_t PARTITION_QOS_POLICY_ID = 10;
const QosPolicyId_t RELIABILITY_QOS_POLICY_ID = 11;
const QosPolicyId_t DESTINATIONORDER_QOS_POLICY_ID = 12;
const QosPolicyId_t HISTORY_QOS_POLICY_ID = 13;
const QosPolicyId_t RESOURCESLIMITS_QOS_POLICY_ID = 14;
const QosPolicyId_t ENTITYFACTORY_QOS_POLICY_ID = 15;
const QosPolicyId_t WRITERDATALIFECYCLE_QOS_POLICY_ID= 16;
const QosPolicyId_t READERDATALIFECYCLE_QOS_POLICY_ID= 17;
const QosPolicyId_t TOPICDATA_QOS_POLICY_ID = 18;
const QosPolicyId_t GROUPDATA_QOS_POLICY_ID = 19;
const QosPolicyId_t TRANSPORTPRIORITY_QOS_POLICY_ID = 20;
const QosPolicyId_t LIFESPAN_QOS_POLICY_ID = 21;
const QosPolicyId_t DURABILITYSERVICE_QOS_POLICY_ID = 22;

struct UsersDataQosPolicy {
sequence&lt;octet&gt; value;
};

struct TopicDataQosPolicy {
sequence&lt;octet&gt; value;
};

struct GroupDataQosPolicy {
sequence&lt;octet&gt; value;
};

struct TransportPriorityQosPolicy {
long value;
};

struct LifespanQosPolicy {
Duration_t duration;
};

enum DurabilityQosPolicyKind {
VOLATILE_DURABILITY_QOS,
TRANSIENT_LOCAL_DURABILITY_QOS,
```

```c
TRANSIENT_DURABILITY_QOS,
PERSISTENT_DURABILITY_QOS
};
struct DurabilityQosPolicy {
DurabilityQosPolicyKind kind;
};
enum PresentationQosPolicyAccessScopeKind {
INSTANCE_PRESENTATION_QOS,
TOPIC_PRESENTATION_QOS,
GROUP_PRESENTATION_QOS
};
struct PresentationQosPolicy {
PresentationQosPolicyAccessScopeKind access_scope;
boolean coherent_access;
boolean ordered_access;
};
struct DeadlineQosPolicy {
Duration_t period;
};
struct LatencyBudgetQosPolicy {
Duration_t duration;
};
enum OwnershipQosPolicyKind {
SHARED_OWNERSHIP_QOS,
EXCLUSIVE_OWNERSHIP_QOS
};
struct OwnershipQosPolicy {
OwnershipQosPolicyKind kind;
};
struct OwnershipStrengthQosPolicy {
long value;
};
enum LivelinessQosPolicyKind {
AUTOMATIC_LIVELINESS_QOS,
MANUAL_BY_PARTICIPANT_LIVELINESS_QOS,
MANUAL_BY_TOPIC_LIVELINESS_QOS
};
struct LivelinessQosPolicy {
LivelinessQosPolicyKind kind;
Duration_t lease_duration;
};
struct TimeBasedFilterQosPolicy {
Duration_t minimum_separation;
};
struct PartitionQosPolicy {
StringSeq name;
};
enum ReliabilityQosPolicyKind {
BEST_EFFORT_RELIABILITY_QOS,
RELIABLE_RELIABILITY_QOS
```

```c
};
struct ReliabilityQosPolicy {
    ReliabilityQosPolicyKind kind;
    Duration_t max_blocking_time;
    boolean synchronous;
};
enum DestinationOrderQosPolicyKind {
    BY_RECEPTION_TIMESTAMP_DESTINATIONORDER_QOS,
    BY_SOURCE_TIMESTAMP_DESTINATIONORDER_QOS
};
struct DestinationOrderQosPolicy {
    DestinationOrderQosPolicyKind kind;
};
enum HistoryQosPolicyKind {
    KEEP_LAST_HISTORY_QOS,
    KEEP_ALL_HISTORY_QOS
};
struct HistoryQosPolicy {
    HistoryQosPolicyKind kind;
    long depth;
};
struct ResourceLimitsQosPolicy {
    long max_samples;
    long max_instances;
    long max_samples_per_instance;
};
struct EntityFactoryQosPolicy {
    boolean autoenable_created_entities;
};
struct WriterDataLifecycleQosPolicy {
    boolean autodispose_unregistered_instances;
};
enum DDS_InvalidSampleVisibilityQosPolicyKind {
    DDS_NO_INVALID_SAMPLES,
    DDS_MINIMUM_INVALID_SAMPLES,
    DDS_ALL_INVALID_SAMPLES
}
struct DDS_InvalidSampleVisibilityQosPolicy {
    DDS_InvalidSampleVisibilityQosPolicyKind kind;
}
struct DDS_ReaderDataLifecycleQosPolicy {
    DDS_Duration_t autopurge_nowriter_samples_delay;
    DDS_Duration_t autopurge_disposed_samples_delay;
    DDS_boolean autopurge_dispose_all;
    DDS_boolean enable_invalid_samples; /* deprecated */
    DDS_InvalidSampleVisibilityQosPolicy invalid_sample_visibility;
}
struct DurabilityServiceQosPolicy {
    Duration_t service_cleanup_delay;
    HistoryQosPolicyKind history_kind;
```

```c
long history_depth;
long max_samples;
long max_instances;
long max_samples_per_instance;
};
struct DomainParticipantFactoryQos {
    EntityFactoryQosPolicy entity_factory;
};
struct DomainParticipantQos {
    UserDataQosPolicy user_data;
    EntityFactoryQosPolicy entity_factory;
};
struct TopicQos {
    TopicDataQosPolicy topic_data;
    DurabilityQosPolicy durability;
    DurabilityServiceQosPolicy durability_service;
    DeadlineQosPolicy deadline;
    LatencyBudgetQosPolicy latency_budget;
    LivelinessQosPolicy liveliness;
    ReliabilityQosPolicy reliability;
    DestinationOrderQosPolicy destination_order;
    HistoryQosPolicy history;
    ResourceLimitsQosPolicy resource_limits;
    TransportPriorityQosPolicy transport_priority;
    LifespanQosPolicy lifespan;
    OwnershipQosPolicy ownership;
};
struct DataWriterQos {
    DurabilityQosPolicy durability;
    DeadlineQosPolicy deadline;
    LatencyBudgetQosPolicy latency_budget;
    LivelinessQosPolicy liveliness;
    ReliabilityQosPolicy reliability;
    DestinationOrderQosPolicy destination_order;
    HistoryQosPolicy history;
    ResourceLimitsQosPolicy resource_limits;
    TransportPriorityQosPolicy transport_priority;
    LifespanQosPolicy lifespan;
    UserDataQosPolicy user_data;
    DDS_OwnershipQosPolicy ownership;
    OwnershipStrengthQosPolicy ownership_strength;
    WriterDataLifecycleQosPolicy writer_data_lifetime;
};
struct PublisherQos {
    PresentationQosPolicy presentation;
    PartitionQosPolicy partition;
    GroupDataQosPolicy group_data;
    EntityFactoryQosPolicy entity_factory;
};
struct DataReaderQos {
```

```c
DurabilityQosPolicy durability;
DeadlineQosPolicy deadline;
LatencyBudgetQosPolicy latency_budget;
LivelinessQosPolicy liveliness;
ReliabilityQosPolicy reliability;
DestinationOrderQosPolicy destination_order;
HistoryQosPolicy history;
ResourceLimitsQosPolicy resource_limits;
UserDataQosPolicy user_data;
DDS_OwnershipQosPolicy ownership;
TimeBasedFilterQosPolicy time_based_filter;
ReaderDataLifecycleQosPolicy reader_data_lifetime;
};
struct SubscriberQos {
PresentationQosPolicy presentation;
PartitionQosPolicy partition;
GroupDataQosPolicy group_data;
EntityFactoryQosPolicy entity_factory;
};
//
struct ParticipantBuiltinTopicData {
BuiltinTopicKey_t key;
UserDataQosPolicy user_data;
};
struct TopicBuiltinTopicData {
BuiltinTopicKey_t key;
string name;
string type_name;
DurabilityQosPolicy durability;
DeadlineQosPolicy deadline;
LatencyBudgetQosPolicy latency_budget;
LivelinessQosPolicy liveliness;
ReliabilityQosPolicy reliability;
TransportPriorityQosPolicy transport_priority;
LifespanQosPolicy lifespan;
DestinationOrderQosPolicy destination_order;
HistoryQosPolicy history;
ResourceLimitsQosPolicy resource_limits;
OwnershipQosPolicy ownership;
TopicDataQosPolicy topic_data;
};
struct PublicationBuiltinTopicData {
BuiltinTopicKey_t key;
BuiltinTopicKey_t participant_key;
string topic_name;
string type_name;
DurabilityQosPolicy durability;
DeadlineQosPolicy deadline;
LatencyBudgetQosPolicy latency_budget;
LivelinessQosPolicy liveliness;
```

```c
ReliabilityQosPolicy reliability;
LifespanQosPolicy lifespan;
UserDataQosPolicy user_data;
OwnershipStrengthQosPolicy ownership_strength;
PresentationQosPolicy presentation;
PartitionQosPolicy partition;
TopicDataQosPolicy topic_data;
GroupDataQosPolicy group_data;
};
struct SubscriptionBuiltinTopicData {
    BuiltinTopicKey_t key;
    BuiltinTopicKey_t participant_key;
    string topic_name;
    string type_name;
    DurabilityQosPolicy durability;
    DeadlineQosPolicy deadline;
    LatencyBudgetQosPolicy latency_budget;
    LivelinessQosPolicy liveliness;
    ReliabilityQosPolicy reliability;
    DestinationOrderQosPolicy destination_order;
    UserDataQosPolicy user_data;
    TimeBasedFilterQosPolicy time_based_filter;
    PresentationQosPolicy presentation;
    PartitionQosPolicy partition;
    TopicDataQosPolicy topic_data;
    GroupDataQosPolicy group_data;
};
// interface Entity {
// ReturnCode_t
// set_qos(
// in EntityQos qos);
//
// ReturnCode_t
// get_qos(
// inout EntityQos qos);
//
// ReturnCode_t
// set_listener(
// in Listener l,
// in StatusMask mask);
//
// Listener
// get_listener();
ReturnCode_t
enable();
StatusCondition
get_statuscondition();
StatusMask
get_status_changes();
```

```c
};
// interface DomainParticipant : Entity {
    // Factory interfaces
Publisher
create_publisher(
    in PublisherQos qos,
    in PublisherListener a_listener,
    in StatusMask mask);
ReturnCode_t
delete_publisher(
    in Publisher p);
Subscriber
create_writer(
    in SubscriberQos qos,
    in SubscriberListener a_listener,
    in StatusMask mask);
ReturnCode_t
delete_publisher(
    in Subscriber s);
Subscriber
get_builtin_subscriber();
Topic
create_topic(
    in string topic_name,
    in string type_name,
    in TopicQos qos,
    in TopicListener a_listener,
    in StatusMask mask);
ReturnCode_t
delete_topic(
    in Topic a_topic);
Topic
find_topic(
    in string topic_name,
    in Duration_t timeout);
TopicDescription
lookup_topicdescription(
    in string name);
ContentFilteredTopic
create_contentfilteredtopic(
    in string name,
    in Topic related_topic,
    in string filter_expression,
    in StringSeq expression_parameters);
ReturnCode_t
delete_contentfilteredtopic(
    in ContentFilteredTopic a_contentfilteredtopic);
MultiTopic
create_multitopic(
```

```c
in string name,
    in string type_name,
    in string subscription_expression,
    in StringSeq expression_parameters);
ReturnCode_t
delete_multitopic(
    in MultiTopic a_multitopic);
ReturnCode_t
delete_contained_entities();
ReturnCode_t
set_qos(
    in DomainParticipantQos qos);
ReturnCode_t
get_qos(
    inout DomainParticipantQos qos);
ReturnCode_t
set_listener(
    in DomainParticipantListener a_listener,
    in StatusMask mask);
DomainParticipantListener
get_listener();
ReturnCode_t
ignore_participant(
    in InstanceHandle_t handle);
ReturnCode_t
ignore_topic(
    in InstanceHandle_t handle);
ReturnCode_t
ignore_publication(
    in InstanceHandle_t handle);
ReturnCode_t
ignore_subscription(
    in InstanceHandle_t handle);
DomainId_t
get_domain_id();
ReturnCode_t
assert_liveliness();
ReturnCode_t
set_default_publisher_qos(
    in PublisherQos qos);
ReturnCode_t
get_default_publisher_qos(
    inout PublisherQos qos);
ReturnCode_t
set_default_subscriber_qos(
    in SubscriberQos qos);
ReturnCode_t
get_default_subscriber_qos(
    inout SubscriberQos qos);
ReturnCode_t
```

```c
set_default_topic_qos(
    in TopicQos qos);
ReturnCode_t
get_default_topic_qos(
    inout TopicQos qos);
boolean
contains_entity(
    in InstanceHandle_t a_handle);
ReturnCode_t
get_current_time(
    inout Time_t current_time);
};
interface DomainParticipantFactory {
    //
    // DomainParticipantFactory
    // get_instance();
    //
DomainParticipant
create_participant(
    in DomainId_t domainId,
    in DomainParticipantQos qos,
    in DomainParticipantListener a_listener,
    in StatusMask mask);
ReturnCode_t
delete_participant(
    in DomainParticipant a_participant);
DomainParticipant
lookup_participant(
    in DomainId_t domainId);
ReturnCode_t
set_default_participant_qos(
    in DomainParticipantQos qos);
ReturnCode_t
get_default_participant_qos(
    inout DomainParticipantQos qos);

ReturnCode_t
set_qos(
    in DomainParticipantFactoryQos qos);
ReturnCode_t
get_qos(
    inout DomainParticipantFactoryQos qos);
ReturnCode_t
delete_domain
(in Domain a_domain);
Domain
lookup_domain
(in DomainId_t domainId);
ReturnCode_t
create_persistent_snapshot(
```

```c
in string partition_expression,
    in string topic_expression,
    in string URI);

ReturnCode_t
    delete_contained_entities();
};

interface TypeSupport {
    // ReturnCode_t
    // register_type(
    //    in DomainParticipant domain,
    //    in string type_name);
    //
    // string
    // get_type_name();
};

// interface TopicDescription {
string
    get_type_name();
string
    get_name();
DomainParticipant
    get_participant();
};

interface Topic : Entity, TopicDescription {
ReturnCode_t
set_qos(
    in TopicQos qos);
ReturnCode_t
    get_qos(
    inout TopicQos qos);
ReturnCode_t
    set_listener(
    in TopicListener a_listener,
    in StatusMask mask);
TopicListener_ptr
get_listener();
// Access the status
ReturnCode_t
get_inconsistent_topic_status(
    inout InconsistentTopicStatus a_status);
};

interface ContentFilteredTopic : TopicDescription {
string
get_filter_expression();
ReturnCode_t
get_expression_parameters(
    inout StringSeq expression_parameters);
ReturnCode_t
set_expression_parameters(
```

```c
in StringSeq expression_parameters);
Topic
get_related_topic();
};
interface MultiTopic : TopicDescription {
string
get Subscription_expression();
ReturnCode_t
get_expression_parameters(
    inout StringSeq expression_parameters);
ReturnCode_t
set_expression_parameters(
    in StringSeq expression_parameters);
};
// interface Publisher : Entity {
DataWriter
create_datawriter(
    in Topic a_topic,
    in DataWriterQos qos,
    in DataWriterListener a_listener,
    in StatusMask mask);
ReturnCode_t
delete_datawriter(
    in DataWriter a_datawriter);
DataWriter
lookup_datawriter(
    in string topic_name);
ReturnCode_t
delete_contained_entities();
ReturnCode_t
set_qos(
    in PublisherQos qos);
ReturnCode_t
get_qos(
    inout PublisherQos qos);
ReturnCode_t
set_listener(
    in SubscriberListener a_listener,
    in StatusMask mask);
PublisherListener
get_listener();
ReturnCode_t
suspend_publications();
ReturnCode_t
resume_publications();
ReturnCode_t
begin_coherent_changes();
ReturnCode_t
end_coherent_changes();
```

```txt
ReturnCode_t
wait_for_acknowledgments(
    in Duration_t max_wait);
DomainParticipant
get_participant();
ReturnCode_t
set_default_datawriter_qos(
    in DataWriterQos qos);
ReturnCode_t
get_default_datawriter_qos(
    inout DataWriterQos qos);
ReturnCode_t
copy_from_topic_qos(
    inout DataWriterQos a_datawriter_qos,
    in TopicQos a_topic_qos);
};
interface DataWriter : Entity {
    // InstanceHandle_t
    // register_instance(
    //    in Data instance_data);
    //
    // InstanceHandle_t
    // register_instance_w_timestamp(
    //    in Data instance_data,
    //    in Time_t source_timestamp);
    //
    // ReturnCode_t
    // unregister_instance(
    //    in Data instance_data,
    //    in InstanceHandle_t handle);
    //
    // ReturnCode_t
    // unregister_instance_w_timestamp(
    //    in Data instance_data,
    //    in InstanceHandle_t handle,
    //    in Time_t source_timestamp);
    //
    // ReturnCode_t
    // write(
    //    in Data instance_data,
    //    in InstanceHandle_t handle);
    //
    // ReturnCode_t
    // write_w_timestamp(
    //    in Data instance_data,
    //    in InstanceHandle_t handle,
    //    in Time_t source_timestamp);
    //
    // ReturnCode_t
    // dispose(
```

```txt
// in Data instance_data,
// in InstanceHandle_t instance_handle);
//
// ReturnCode_t
// dispose_w_timestamp(
// in Data instance_data,
// in InstanceHandle_t instance_handle,
// in Time_t source_timestamp);
//
// ReturnCode_t
// get_key_value(
// inout Data key_holder,
// in InstanceHandle_t handle);
//
// InstanceHandle_t lookup_instance(
// in Data instance_data);
ReturnCode_t
set_qos(
    in DataWriterQos qos);
ReturnCode_t
get_qos(
    inout DataWriterQos qos);
ReturnCode_t
set_listener(
    in DataWriterListener a_listener,
    in StatusMask mask);
DataWriterListener
get_listener();
Topic
get_topic();
Publisher
get_publisher();
ReturnCode_t
wait_for_acknowledgments(
    in Duration_t max_wait);
// Access the status
ReturnCode_t
get_liveliness_lost_status(
    inout LivelinessLostStatus status);
ReturnCode_t
get_offered_deadline_missed_status(
    inout OfferedDeadlineMissedStatus status);
ReturnCode_t
get_offered_incompatible_qos_status(
    inout OfferedIncompatibleQosStatus status);
ReturnCode_t
get_publication_matched_status(
    inout PublicationMatchedStatus status);
ReturnCode_t
assert_liveliness();
```

```verilog
ReturnCode_t
    get_matched_subscriptions(
    inout InstanceHandleSeq subscription_handles);
ReturnCode_t
    get_matched_subscription_data(
    inout SubscriptionBuiltinTopicData subscription_data,
    in InstanceHandle_t subscription_handle);
};
// interface Subscriber : Entity {
DataReader
create_datareader(
    in TopicDescription a_topic,
    in DataReaderQos qos,
    in DataReaderListener a_listener,
    in StatusMask mask);
ReturnCode_t
delete_datareader(
    in DataReader a_datareader);
ReturnCode_t
delete_contained_entities();
DataReader
lookup_datareader(
    in string topic_name);
ReturnCode_t
get_datareaders(
    inout DataReaderSeq readers,
    in SampleStateMask sample_states,
    in ViewStateMask view_states,
    in InstanceStateMask instance_states);
ReturnCode_t
notify_datareaders();
ReturnCode_t
set_qos(
    in SubscriberQos qos);
ReturnCode_t
get_qos(
    inout SubscriberQos qos);
ReturnCode_t
set_listener(
    in SubscriberListener a_listener,
    in StatusMask mask);
SubscriberListener
get_listener();
ReturnCode_t
begin_access();
ReturnCode_t
end_access();
DomainParticipant
get_participant();
```

```c
ReturnCode_t
set_default_datareader_qos(
    in DataReaderQos qos);
ReturnCode_t
get_default_datareader_qos(
    inout DataReaderQos qos);
ReturnCode_t
copy_from_topic_qos(
    inout DataReaderQos a_datareader_qos,
    in TopicQos a_topic_qos);
};
interface DataReader : Entity {
    // ReturnCode_t
    // read(
    // inout DataSeq data_values,
    // inout SampleInfoSeq info_seq,
    // in long max_samples,
    // in SampleStateMask sample_states,
    // in StateMask view_states,
    // in InstanceStateMask instance_states);
    //
    // ReturnCode_t
    // take(
    // inout DataSeq data_values,
    // inout SampleInfoSeq info_seq,
    // in long max_samples,
    // in SampleStateMask sample_states,
    // in StateMask view_states,
    // in InstanceStateMask instance_states);
    //
    // ReturnCode_t
    // read_w_condition(
    // inout DataSeq data_values,
    // inout SampleInfoSeq info_seq,
    // in long max_samples,
    // in ReadCondition a_condition);
    //
    // ReturnCode_t
    // take_w_condition(
    // inout DataSeq data_values,
    // inout SampleInfoSeq info_seq,
    // in long max_samples,
    // in ReadCondition a_condition);
    //
    // ReturnCode_t
    // read_next_sample(
    // inout Data data_values,
    // inout SampleInfo sample_info);
    //
    // ReturnCode_t
```

```c
// take_next_sample(
    // inout Data data_values,
    // inout SampleInfo sample_info);
//
// ReturnCode_t
// read_instance(
    // inout DataSeq data_values,
    // inout SampleInfoSeq info_seq,
    // in long max_samples,
    // in InstanceHandle_t a_handle,
    // in SampleStateMask sample_states,
    // in ViewStateMask view_states,
    // in InstanceStateMask instance_states);
//
// ReturnCode_t
// take_instance(
    // inout DataSeq data_values,
    // inout SampleInfoSeq info_seq,
    // in long max_samples,
    // in InstanceHandle_t a_handle,
    // in SampleStateMask sample_states,
    // in ViewStateMask view_states,
    // in InstanceStateMask instance_states);
//
// ReturnCode_t
// read_next_instance(
    // inout DataSeq data_values,
    // inout SampleInfoSeq info_seq,
    // in long max_samples,
    // in InstanceHandle_t a_handle,
    // in SampleStateMask sample_states,
    // in ViewStateMask view_states,
    // in InstanceStateMask instance_states);
//
// ReturnCode_t
// take_next_instance(
    // inout DataSeq data_values,
    // inout SampleInfoSeq info_seq,
    // in long max_samples,
    // in InstanceHandle_t a_handle,
    // in SampleStateMask sample_states,
    // in ViewStateMask view_states,
    // in InstanceStateMask instance_states);
//
// ReturnCode_t
// read_next_instance_w_condition(
    // inout DataSeq data_values,
    // inout SampleInfoSeq info_seq,
    // in long max_samples,
    // in InstanceHandle_t a_handle,
```

```c
// in ReadCondition a_condition);
//
// ReturnCode_t
// take_next_instance_w_condition(
// inout DataSeq data_values,
// inout SampleInfoSeq info_seq,
// in long max_samples,
// in InstanceHandle_t a_handle,
// in ReadCondition a_condition);
//
// ReturnCode_t
// return_loan(
// inout DataSeq data_values,
// inout SampleInfoSeq info_seq);
//
// ReturnCode_t
// get_key_value(
// inout Data key_holder,
// in InstanceHandle_t handle);
//
// InstanceHandle_t
// lookup_instance(
// in Data instance);
ReadCondition
create_readcondition(
    in SampleStateMask sample_states,
    in ViewStateMask view_states,
    in InstanceStateMask instance_states);
QueryCondition
create_querycondition(
    in SampleStateMask sample_states,
    in ViewStateMask view_states,
    in InstanceStateMask instance_states,
    in string query_expression,
    in StringSeq query_parameters);
ReturnCode_t
delete_readcondition(
    in ReadCondition a_condition);
ReturnCode_t
delete_contained_entities();
ReturnCode_t
set_qos(
    in DataReaderQos qos);
ReturnCode_t
get_qos(
    inout DataReaderQos qos);
ReturnCode_t
set_listener(
    in DataReaderListener a_listener,
    in StatusMask mask);
```

```txt
DataReaderListener
get_listener();
TopicDescription
get_topicdescription();
Subscriber
get_subscriber();
ReturnCode_t
get_sample_rejected_status(
    inout SampleRejectedStatus status);
ReturnCode_t
get_liveliness_changed_status(
    inout LivelinessChangedStatus status);
ReturnCode_t
get_requested_deadline_missed_status(
    inout RequestedDeadlineMissedStatus status);
ReturnCode_t
get_requested_incompatible_qos_status(
    inout RequestedIncompatibleQosStatus status);
ReturnCode_t
get_subscription_matched_status(
    inout SubscriptionMatchedStatus status);
ReturnCode_t
get_sample_lost_status(
    inout SampleLostStatus status);
ReturnCode_t
wait_for_historical_data(
    in Duration_t max_wait);
ReturnCode_t
get_matched_publications(
    inout InstanceHandleSeq publication_handles);
ReturnCode_t
get_matched_publication_data(
    inout PublicationBuiltinTopicData publication_data,
    in InstanceHandle_t publication_handle);
};
struct SampleInfo {
SampleStateKind sample_state;
ViewStateKind view_state;
InstanceStateKind instance_state;
Time_t source_timestamp;
InstanceHandle_t instance_handle;
BuiltinTopicKey_t publication_handle;
long disposed_generation_count;
long no_writers_generation_count;
long sample_rank;
long generation_rank;
long absolute_generation_rank;
boolean valid_data;
};
typedef sequence&lt;SampleInfo&gt; SampleInfoSeq;
```

```cpp
};
Foo.idl
    // Implied IDL for type "Foo"
    // Example user defined structure
    struct Foo {
    long dummy;
    };
    typedef sequence&lt;Foo&gt; FooSeq;
    #include "dds_dcps.idl"
    interface FooTypeSupport : DDS::TypeSupport {
    DDS::ReturnCode_t
    register_type(
    in DDS::DomainParticipant participant,
    in string type_name);
    string
    get_type_name();
    };
    interface FooDataWriter : DDS::DataWriter {
    DDS::InstanceHandle_t
    register_instance(
    in Foo instance_data);
    DDS::InstanceHandle_t
    register_instance_w_timestamp(
    in Foo instance_data,
    in DDS::InstanceHandle_t handle,
    in DDS::Time_t source_timestamp);
    DDS::ReturnCode_t
    unregister_instance(
    in Foo instance_data,
    in DDS::InstanceHandle_t handle);
    DDS::ReturnCode_t
    unregister_instance_w_timestamp(
    in Foo instance_data,
    in DDS::InstanceHandle_t handle,
    in DDS::Time_t source_timestamp);
    DDS::ReturnCode_t
    write(
    in Foo instance_data,
    in DDS::InstanceHandle_t handle);
    DDS::ReturnCode_t
    write_w_timestamp(
    in Foo instance_data,
    in DDS::InstanceHandle_t handle,
    in DDS::Time_t source_timestamp);
    DDS::ReturnCode_t
    dispose(
    in Foo instance_data,
    in DDS::InstanceHandle_t instance_handle);
    DDS::ReturnCode_t
    dispose_w_timestamp(
```

```c
in Foo instance_data,
    in DDS::InstanceHandle_t instance_handle,
    in DDS::Time_t source_timestamp);
DDS::ReturnCode_t
get_key_value(
    inout Foo key_holder,
    in DDS::InstanceHandle_t handle);
DDS::InstanceHandle_t
lookup_instance(
    in Foo instance_data);
};
interface FooDataReader : DDS::DataReader {
DDS::ReturnCode_t
read(
    inout FooSeq data_values,
    inout DDS::SampleInfoSeq info_seq,
    in long max_samples,
    in DDS::SampleStateMask sample_states,
    in DDS::ViewStateMask view_states,
    in DDS::InstanceStateMask instance_states);
DDS::ReturnCode_t
take(
    inout FooSeq data_values,
    inout DDS::SampleInfoSeq info_seq,
    in long max_samples,
    in DDS::SampleStateMask sample_states,
    in DDS::ViewStateMask view_states,
    in DDS::InstanceStateMask instance_states);
DDS::ReturnCode_t
read_w_condition(
    inout FooSeq data_values,
    inout DDS::SampleInfoSeq info_seq,
    in long max_samples,
    in DDS::ReadCondition a_condition);
DDS::ReturnCode_t
take_w_condition(
    inout FooSeq data_values,
    inout DDS::SampleInfoSeq info_seq,
    in long max_samples,
    in DDS::ReadCondition a_condition);
DDS::ReturnCode_t
read_next_sample(
    inout Foo data_values,
    inout DDS::SampleInfo sample_info);
DDS::ReturnCode_t
take_next_sample(
    inout Foo data_values,
    inout DDS::SampleInfo sample_info);
DDS::ReturnCode_t
read_instance(
```

```cpp
inout FooSeq data_values,
    inout DDS::SampleInfoSeq info_seq,
    in long max_samples,
    in DDS::InstanceHandle_t a_handle,
    in DDS::SampleStateMask sample_states,
    in DDS::ViewStateMask view_states,
    in DDS::InstanceStateMask instance_states);
DDS::ReturnCode_t
take_instance(
    inout FooSeq data_values,
    inout DDS::SampleInfoSeq info_seq,
    in long max_samples,
    in DDS::InstanceHandle_t a_handle,
    in DDS::SampleStateMask sample_states,
    in DDS::ViewStateMask view_states,
    in DDS::InstanceStateMask instance_states);
DDS::ReturnCode_t
read_next_instance(
    inout FooSeq data_values,
    inout DDS::SampleInfoSeq info_seq,
    in long max_samples,
    in DDS::InstanceHandle_t a_handle,
    in DDS::SampleStateMask sample_states,
    in DDS::ViewStateMask view_states,
    in DDS::InstanceStateMask instance_states);
DDS::ReturnCode_t
take_next_instance(
    inout FooSeq data_values,
    inout DDS::SampleInfoSeq info_seq,
    in long max_samples,
    in DDS::InstanceHandle_t a_handle,
    in DDS::SampleStateMask sample_states,
    in DDS::ViewStateMask view_states,
    in DDS::InstanceStateMask instance_states);
DDS::ReturnCode_t
read_next_instance_w_condition(
    inout FooSeq data_values,
    inout DDS::SampleInfoSeq info_seq,
    in long max_samples,
    in DDS::InstanceHandle_t a_handle,
    in DDS::ReadCondition a_condition);
DDS::ReturnCode_t
take_next_instance_w_condition(
    inout FooSeq data_values,
    inout DDS::SampleInfoSeq info_seq,
    in long max_samples,
    in DDS::InstanceHandle_t a_handle,
    in DDS::ReadCondition a_condition);
DDS::ReturnCode_t
return_loan(
```

Appendices
```cpp
inout FooSeq data_values,
    inout DDS::SampleInfoSeq info_seq);
DDS::ReturnCode_t
get_key_value(
    inout Foo key_holder,
    in DDS::InstanceHandle_t handle);
DDS::InstanceHandle_t
lookup_instance(
    in Foo instance);
};
```

Appendices

# Appendix

# D SampleStates, ViewStates and InstanceStates

Data is made available to the application by the following operations on DDS\_DataReader o b j e c t s : DDS\_DataReader\_read a n d DDS\_DataReader\_take operations. The general semantics of the DDS\_DataReader\_read operations is that the application only gets access to the matching data; the data remain available in the Data Distribution Services and can be read again. The semantics of the DDS\_DataReader\_take operations is that the data is not available in the Data Distribution Service; that data will no longer be accessible to the DDS\_DataReader. Consequently, it is possible for a DDS\_DataReader to access the same sample multiple times but only if all previous accesses were DDS\_DataReader\_read operations.

Each of these operations returns an ordered collection of Data values and associated DDS\_SampleInfo objects. Each data value represents an atom of data information (i.e., a value for one instance). This collection may contain samples related to the same or different instances (identified by the key). Multiple samples can refer to the same instance if the settings of the DDS\_HistoryQosPolicy allow for it.

# SampleInfo Class

DDS\_SampleInfo is the information that accompanies each sample that is ‘read’ or ‘taken’. It contains, among others, the following information:

• The sample\_state (DDS\_READ\_SAMPLE\_STATE or DDS\_NOT\_READ\_SAMPLE\_STATE);
• The view\_state, (DDS\_NEW\_VIEW\_STATE or DDS\_NOT\_NEW\_VIEW\_STATE);
• The instance\_state (DDS\_ALIVE\_INSTANCE\_STATE, DDS\_NOT\_ALIVE\_DISPOSED\_INSTANCE\_STATE or DDS\_NOT\_ALIVE\_NO\_WRITERS\_INSTANCE\_STATE).

# sample\_state

For each sample, the Data Distribution Service internally maintains a sample\_state specific to each DDS\_DataReader. The sample\_state can either be DDS\_READ\_SAMPLE\_STATE or DDS\_NOT\_READ\_SAMPLE\_STATE.

• DDS\_READ\_SAMPLE\_STATE indicates that the DDS\_DataReader has already accessed that sample by means of DDS\_DataReader\_read. Had the sample been accessed by DDS\_DataReader\_take it would no longer be available to the DDS\_DataReader;
• DDS\_NOT\_READ\_SAMPLE\_STATE indicates that the DDS\_DataReader has not accessed that sample before.

![The flowchart describes a process with the following labeled blocks and connections:\n\n**Blocks:**\n*   A starting black circle labeled above with: 'new sample received (first time seen)'\n*   A rounded rectangle block: 'NOT_READ_SAMPLE_STATE'\n*   A rounded rectangle block: 'READ_SAMPLE_STATE'\n*   An ending double-circle node (black center, white ring)\n\n**Connections:**\n1.  From the start circle to **NOT_READ_SAMPLE_STATE**.\n2.  From **NOT_READ_SAMPLE_STATE** to **READ_SAMPLE_STATE** (labeled: 'read').\n3.  From **NOT_READ_SAMPLE_STATE** to the ending node (labeled: 'take / sample is “overwritten”').\n4.  A self-loop on **READ_SAMPLE_STATE** (labeled: 'read').\n5.  From **READ_SAMPLE_STATE** to the ending node (labeled: 'take / sample is “overwritten”').](.vortex-opensplice-c-reference-guide/64eacf4cb99cc380deb0a5bde601471596ae2dcd340a86d4aaab6eefed8a2828.jpg)

Figure 20: State Chart of the sample\_state for a Single Sample

# State per Sample

The sample\_state available in the DDS\_SampleInfo reflect the sample\_state of each sample. The sample\_state can be different for all samples in the returned collection that refer to the same instance.

# instance\_state

For each instance the Data Distribution Service internally maintains an instance\_state. The instance\_state can be:

• DDS\_ALIVE\_INSTANCE\_STATE indicates that:

\- samples have been received for the instance

\- there are live DDS\_DataWriter objects writing the instance

\- the instance has not been explicitly disposed of (or else samples have been received after it was disposed of)

• DDS\_NOT\_ALIVE\_DISPOSED\_INSTANCE\_STATE indicates the instance was disposed of by a DDS\_DataWriter either explicitly by means of the DDS\_DataWriter\_dispose operation or implicitly in case the autodispose\_unregistered\_instances field of the WriterDataLyfecycleQosPolicy equals TRUE when the instance gets unregistered (see Section 3.1.3.23, DDS\_WriterDataLifecycleQosPolicy), and no new samples for that instance have been written afterwards.

• DDS\_NOT\_ALIVE\_NO\_WRITERS\_INSTANCE\_STATE indicates the instance has been declared as not-alive by the DDS\_DataReader because it detected that there are no live DDS\_DataWriter objects writing that instance.

# DDS\_OwnershipQosPolicy

The precise events that cause the instance\_state to change depends on the setting of the DDS\_OwnershipQosPolicy:

• If DDS\_OwnershipQosPolicy is set to DDS\_EXCLUSIVE\_OWNERSHIP\_QOS, then the instance\_state becomes DDS\_NOT\_ALIVE\_DISPOSED\_INSTANCE\_STATE only if the DDS\_DataWriter that “owns” the instance explicitly disposes of it. The instance\_state becomes DDS\_ALIVE\_INSTANCE\_STATE again only if the DDS\_DataWriter that owns the instance writes it;

• If DDS\_OwnershipQosPolicy is set to DDS\_SHARED\_OWNERSHIP\_QOS, then the instance\_state becomes DDS\_NOT\_ALIVE\_DISPOSED\_INSTANCE\_STATE if any DDS\_DataWriter explicitly disposes of the instance. The instance\_state becomes DDS\_ALIVE\_INSTANCE\_STATE as soon as any DDS\_DataWriter writes the instance again.

![**Labeled Blocks:**\n*   ALIVE_INSTANCE_STATE\n*   NOT_ALIVE_DISPOSED_INSTANCE_STATE\n*   NOT_ALIVE_NO_WRITERS_INSTANCE_STATE\n\n**Connections:**\n*   **Start Node** to **ALIVE_INSTANCE_STATE**: 'sample for 'never seen' instance received/'\n*   **ALIVE_INSTANCE_STATE** (Self-loop): 'sample received'\n*   **ALIVE_INSTANCE_STATE** to **NOT_ALIVE_DISPOSED_INSTANCE_STATE**: 'instance disposed of by DDS_DataWriter'\n*   **ALIVE_INSTANCE_STATE** to **NOT_ALIVE_NO_WRITERS_INSTANCE_STATE**: 'no 'live' DDS_DataWriters'\n*   **NOT_ALIVE_DISPOSED_INSTANCE_STATE** to **ALIVE_INSTANCE_STATE**: 'sample received/'\n*   **NOT_ALIVE_NO_WRITERS_INSTANCE_STATE** to **ALIVE_INSTANCE_STATE**: '\'live\' DDS_DataWriter detected/'\n*   **NOT_ALIVE_DISPOSED_INSTANCE_STATE** to **End Node**: '(no samples in the DDS_DataReader && no 'live' DDS_DataWriters)'\n*   **NOT_ALIVE_NO_WRITERS_INSTANCE_STATE** to **End Node**: '(no samples in the DDS_DataReader)'](.vortex-opensplice-c-reference-guide/b67dacdfe3d70ac084c842a469b15a9574209224a3ab3e330dd6fbe1971eab83.jpg)

Figure 21: State Chart of the instance\_state for a Single Instance

# Snapshot

The instance\_state available in the DDS\_SampleInfo is a snapshot of the instance\_state of the instance at the time the collection was obtained (i.e. at the time DDS\_DataReader\_read or DDS\_DataReader\_take was called). The instance\_state is therefore the same for all samples in the returned collection that refer to the same instance.

# view\_state

For each instance (identified by the key), the Data Distribution Service internally maintains a view\_state relative to each DDS\_DataReader. The view\_state can either be DDS\_NEW\_VIEW\_STATE or DDS\_NOT\_NEW\_VIEW\_STATE.

• DDS\_NEW\_VIEW\_STATE indicates that either this is the first time that the DDS\_DataReader has ever accessed samples of that instance, or else that the DDS\_DataReader has accessed previous samples of the instance, but the instance has since been reborn (i.e. becomes not-alive and then alive again);
• DDS\_NOT\_NEW\_VIEW\_STATE indicates that the DDS\_DataReader has already accessed samples of the same instance and that the instance has not been reborn since.

![The flowchart depicts a state machine process with the following components and connections:\n\n**Blocks/States:**\n*   A black circle (start node).\n*   **NEW_VIEW_STATE**\n*   **NOT_NEW_VIEW_STATE**\n*   A diamond shape (decision point).\n\n**Connections and Flow:**\n1.  **Start:** Above the black circle is the text: `sample for 'never seen' instance received/`. An arrow points downward to **NEW_VIEW_STATE**.\n2.  **NEW_VIEW_STATE to NOT_NEW_VIEW_STATE:** An arrow labeled `read/take` points downward from **NEW_VIEW_STATE** to **NOT_NEW_VIEW_STATE**.\n3.  **Self-Loop on NOT_NEW_VIEW_STATE:** An arrow loops from the right side of **NOT_NEW_VIEW_STATE** back into the left side, labeled `read/take`.\n4.  **NOT_NEW_VIEW_STATE to Decision:** An arrow labeled `sample received` points downward from **NOT_NEW_VIEW_STATE** to the diamond.\n5.  **Decision Outcomes:**\n    *   **Left Path:** An arrow goes from the left side of the diamond back to **NOT_NEW_VIEW_STATE**, labeled `(instance_state == ALIVE_INSTANCE_STATE)`.\n    *   **Right Path:** An arrow goes from the right side of the diamond upward to **NEW_VIEW_STATE**, labeled `(instance_state == NOT_ALIVE_INSTANCE_STATE)`.](.vortex-opensplice-c-reference-guide/76de580b0328290297d3a9f53ba9bf6e57bb7890f4c8fba007d21e92d4bccfd5.jpg)

Figure 22: State Chart of the view\_state for a Single Instance

# Snapshot

The view\_state available in the DDS\_SampleInfo is a snapshot of view\_state of the instance relative to the DDS\_DataReader used to access the samples at the time the collection was obtained (i.e. at the time DDS\_DataReader\_read or DDS\_DataReader\_take was called). The view\_state is therefore the same for all samples in the returned collection that refer to the same instance.

# State Masks

# State Definitions

All states are available as a constant. These convenience constants can be used to create a bit-mask (e.g. to be used as operation parameters) by performing an AND or OR operation. They can also be used for testing whether a state is set.

The sample state definitions indicates whether or not the matching data sample has already been read:

• DDS\_READ\_SAMPLE\_STATE: sample has already been read;
• DDS\_NOT\_READ\_SAMPLE\_STATE: sample has not been read.

The view state definitions indicates whether the DDS\_DataReader has already seen samples for the most-current generation of the related instance:

• DDS\_NEW\_VIEW\_STATE: all samples of this instance are new;
• DDS\_NOT\_NEW\_VIEW\_STATE: some or all samples of this instance are not new.

The instance state definitions indicates whether the instance is currently in existence or, if it has been disposed of, the reason why it was disposed of:

• DDS\_ALIVE\_INSTANCE\_STATE: this instance is currently in existence;
• DDS\_NOT\_ALIVE\_DISPOSED\_INSTANCE\_STATE: this instance was disposed of by a DDS\_DataWriter;
• DDS\_NOT\_ALIVE\_NO\_WRITERS\_INSTANCE\_STATE: the instance has been disposed of by the DDS\_DataReader because none of the DDS\_DataWriter objects currently “alive” (according to the DDS\_LivelinessQosPolicy) are writing the instance.

# Pre-defined Bit Mask Definitions

For convenience, some pre-defined bit-masks are available as a constant definition. These bit-mask constants can be used where a state bit-mask is required. They can also be used for testing whether certain bits are set.

The sample state bit-mask definition selects both sample states:

• DDS\_ANY\_SAMPLE\_STATE: either the sample has already been read or not read; The view state bit-mask definition selects both view states:
• DDS\_ANY\_VIEW\_STATE: either the sample has already been seen or not seen; The instance state bit-mask definitions selects a combination of instance states:
• DDS\_NOT\_ALIVE\_INSTANCE\_STATE: this instance was disposed of by a DDS\_DataWriter or the DDS\_DataReader;
• DDS\_ANY\_INSTANCE\_STATE: this instance is either in existence or not in existence.

# Operations Concerning States

The application accesses data by means of the operations DDS\_DataReader\_read or DDS\_DataReader\_take on the DDS\_DataReader. These operations return an ordered collection of DDS\_DataSamples consisting of a DDS\_SampleInfo part and a Data part. The way the Data Distribution Service builds this collection (i.e., the data-samples that are parts of the list as well as their order) depends on QosPolicy settings set on the DDS\_DataReader and the DDS\_Subscriber, as well as the source timestamp of the samples and the parameters passed to the DDS\_DataReader\_read/DDS\_DataReader\_take operations, namely:

• the desired sample states (i.e., DDS\_READ\_SAMPLE\_STATE, DDS\_NOT\_READ\_SAMPLE\_STATE, or DDS\_ANY\_SAMPLE\_STATE);
• the desired view states (i.e., DDS\_NEW\_VIEW\_STATE, DDS\_NOT\_NEW\_VIEW\_STATE, or DDS\_ANY\_VIEW\_STATE);
• the desired instance states (DDS\_ALIVE\_INSTANCE\_STATE, DDS\_NOT\_ALIVE\_DISPOSED\_INSTANCE\_STATE, DDS\_NOT\_ALIVE\_NO\_WRITERS\_INSTANCE\_STATE, DDS\_NOT\_ALIVE\_INSTANCE\_STATE, or DDS\_ANY\_INSTANCE\_STATE).

The DDS\_DataReader\_read and DDS\_DataReader\_take operations are non-blocking and just deliver what is currently available that matches the specified states.

On output, the collection of Data values and the collection of DDS\_SampleInfo structures are of the same length and are in a one-to-one correspondence. Each DDS\_SampleInfo provides information, such as the source\_timestamp, the sample\_state, view\_state, and instance\_state, etc., about the matching sample.

Some elements in the returned collection may not have valid data. If the instance\_state i n t h e DDS\_SampleInfo i s DDS\_NOT\_ALIVE\_DISPOSED\_INSTANCE\_STATE o r

DDS\_NOT\_ALIVE\_NO\_WRITERS\_INSTANCE\_STATE, then the last sample for that instance in the collection, that is, the one whose DDS\_SampleInfo has sample\_rank==0 does not contain valid data. Samples that contain no data do not count towards the limits imposed by the DDS\_ResourceLimitsQosPolicy.

# read

The act of reading a sample sets its sample\_state to DDS\_READ\_SAMPLE\_STATE. If the sample belongs to the most recent generation of the instance, it will also set the view\_state of the instance to DDS\_NOT\_NEW\_VIEW\_STATE. It will not affect the instance\_state of the instance.

# take

The act of taking a sample removes it from the DDS\_DataReader so it cannot be ‘read’ or ‘taken’ again. If the sample belongs to the most recent generation of the i n s t a n c e , i t w i l l a l s o s e t t h e v i e w \_ s t a t e o f t h e i n s t a n c e t o DDS\_NOT\_NEW\_VIEW\_STATE. It will not affect the instance\_state of the instance.

# read\_w\_condition

In case the DDS\_ReadCondition is a ‘plain’ DDS\_ReadCondition and not the specialized DDS\_QueryCondition, the operation is equivalent to calling DDS\_DataReader\_read and passing as sample\_states, view\_states and instance\_states the value of the corresponding attributes in the DDS\_ReadCondition. Using this operation the application can avoid repeating the same parameters specified when creating the DDS\_ReadCondition.

# take\_w\_condition

The act of taking a sample removes it from the DDS\_DataReader so it cannot be ‘read’ or ‘taken’ again. If the sample belongs to the most recent generation of the i n s t a n c e , i t w i l l a l s o s e t t h e v i e w \_ s t a t e o f t h e i n s t a n c e t o DDS\_NOT\_NEW\_VIEW\_STATE. It will not affect the instance\_state of the instance.

In case the DDS\_ReadCondition is a ‘plain’ DDS\_ReadCondition and not the specialized DDS\_QueryCondition, the operation is equivalent to calling DDS\_DataReader\_take and passing as sample\_states, view\_states and instance\_states the value of the corresponding attributes in the DDS\_ReadCondition. Using this operation the application can avoid repeating the same parameters specified when creating the DDS\_ReadCondition.

# read\_next\_sample

The DDS\_DataReader\_read\_next\_sample operation is semantically equivalent to the DDS\_DataReader\_read operation where the input Data sequence has max\_len=1, the sample\_states=DDS\_NOT\_READ\_SAMPLE\_STATE, the view\_states=DDS\_ANY\_VIEW\_STATE, and the instance\_states=DDS\_ANY\_INSTANCE\_STATE.

# take\_next\_sample

The DDS\_DataReader\_take\_next\_sample operation is semantically equivalent to the DDS\_DataReader\_take operation where the input sequence has max\_len=1, the sample\_states=DDS\_NOT\_READ\_SAMPLE\_STATE, the view\_states=DDS\_ANY\_VIEW\_STATE, and the instance\_states=DDS\_ANY\_INSTANCE\_STATE.

# read\_instance

The act of reading a sample sets its sample\_state to DDS\_READ\_SAMPLE\_STATE. If the sample belongs to the most recent generation of the instance, it will also set the view\_state of the instance to DDS\_NOT\_NEW\_VIEW\_STATE. It will not affect the instance\_state of the instance.

# take\_instance

The act of taking a sample removes it from the DDS\_DataReader so it cannot be ‘read’ or ‘taken’ again. If the sample belongs to the most recent generation of the i n s t a n c e , i t w i l l a l s o s e t t h e v i e w \_ s t a t e o f t h e i n s t a n c e t o DDS\_NOT\_NEW\_VIEW\_STATE. It will not affect the instance\_state of the instance.

Appendices

# Appendix

# E

# Class Inheritance

This appendix gives an overview of the inheritance relations of the DCPS classes.

![Based on the provided flowchart/block diagram, here are the labeled blocks and their connections:\n\n**Labeled Blocks:**\n*   Subscriber (from Subscription Module)\n*   Publisher (from Publication Module)\n*   DomainParticipant (from Domain Module)\n*   DomainParticipantFactory (from Domain Module)\n*   DomainEntity (from Infrastructure Module)\n*   Entity (from Infrastructure Module)\n*   TopicDescription (from Topic-Definition Module)\n*   DataWriter (from Publication Module)\n*   DataReader (from Subscription Module)\n*   Topic (from Topic-Definition Module)\n*   MultiTopic (from Topic-Definition Module)\n*   FooDataWriter (from Topic-Definition Module)\n*   FooDataReader (from Topic-Definition Module)\n*   ContentFilteredTopic (from Topic-Definition Module)\n*   GuardCondition (from Infrastructure Module)\n*   ((Interface)) Listener (from Infrastructure Module)\n*   ((Interface)) TypeSupport (from Topic-Definition Module)\n*   ReadCondition (from Subscription Module)\n*   Condition (from Infrastructure Module)\n*   DataReaderListener (from Subscription Module)\n*   DataWriterListener (from Publication Module)\n*   FooTypeSupport (from Topic-Definition Module)\n*   QueryCondition (from Subscription Module)\n*   StatusCondition (from Infrastructure Module)\n*   ((Interface)) TopicListener (from Topic-Definition Module)\n*   SubscriberListener (from Subscription Module)\n*   PublisherListener (from Publication Module)\n*   DomainParticipantListener (from Domain Module)\n*   Status (from Infrastructure Module)\n*   WaitSet (from Infrastructure Module)\n*   SampleInfo (from Subscription Module)\n*   QosPolicy (from Infrastructure Module)\n\n**Connections (arrows point from child to parent):**\n*   Subscriber points to DomainEntity\n*   Publisher points to DomainEntity\n*   DomainParticipant points to DomainEntity\n*   DomainEntity points to Entity\n*   DataWriter points to DomainEntity\n*   DataReader points to DomainEntity\n*   Topic points to DomainEntity\n*   Topic points to TopicDescription\n*   MultiTopic points to TopicDescription\n*   ContentFilteredTopic points to TopicDescription\n*   FooDataWriter points to DataWriter\n*   FooDataReader points to DataReader\n*   GuardCondition points to Condition\n*   ReadCondition points to Condition\n*   QueryCondition points to ReadCondition\n*   StatusCondition points to Condition\n*   FooTypeSupport points to TypeSupport\n*   DataReaderListener points to Listener\n*   DataWriterListener points to Listener\n*   TopicListener points to DataReaderListener\n*   TopicListener points to DataWriterListener\n*   SubscriberListener points to DataReaderListener\n*   PublisherListener points to DataWriterListener\n*   DomainParticipantListener points to TopicListener\n*   DomainParticipantListener points to SubscriberListener\n*   DomainParticipantListener points to PublisherListener\n\n(Note: Blocks such as DomainParticipantFactory, Status, WaitSet, SampleInfo, and QosPolicy have no connections shown in the diagram.)](.vortex-opensplice-c-reference-guide/7f7ebc9558a7aaf6ed252b015daec8f87c9680ea3e4e673ed486594f0d51416c.jpg)

Figure 23: DCPS Inheritance

Appendices

# Appendix

# F Listeners, Conditions and Waitsets

Listeners and DDS\_Conditions (DDS\_Conditions in conjunction with DDS\_WaitSets) are two mechanisms that allow the application to be made aware of changes in the communication status. Listeners provide an event-based mechanism for the Data Distribution Service to asynchronously alert the application of the occurrence of relevant status changes. DDS\_Conditions in conjunction with DDS\_WaitSets provide a state-based mechanism for the Data Distribution Service to synchronously communicate the relevant status changes to the application.

Both mechanisms are based on the communication statuses associated with an DDS\_Entity object. Not all statuses are applicable to all DDS\_Entity objects. Which status is applicable to which DDS\_Entity object is listed in the next table:

Table 26: Communication Status

<table><tr><td>DDS_Entity</td><td>Status Name</td><td>Description</td></tr><tr><td>DDS_Topic</td><td>DDS_INCONSISTENT_TOPIC_STATUS</td><td>Another DDS_Topic exists with the same name but with different characteristics.</td></tr><tr><td>DDS_Subscriber</td><td>DDS_DATA_ON_READERS_STATUS</td><td>New information is available.</td></tr><tr><td rowspan="7">DDS_DataReader</td><td>DDS_SAMPLE_REJECTED_STATUS</td><td>A (received) sample has been rejected.</td></tr><tr><td>DDS_LIVELINESS_CHANGED_STATUS</td><td>The liveliness of one or more DDS_DataWriter objects, that were writing instances read through the DDS_DataReader objects has changed. Some DDS_DataWriter object have become “alive” or “not alive”.</td></tr><tr><td>DDS_REQUESTED_DEADLINE_MISSED_STATUS</td><td>The deadline that the DDS_DataReader was expecting through its DDS_DeadlineQosPolicy was not respected for a specific instance.</td></tr><tr><td>DDS_REQUESTED_INCOMPATIBLE_QOS_STATUS</td><td>A QosPolicy setting was incompatible with what is offered.</td></tr><tr><td>DDS_DATA_AVAILABLE_STATUS</td><td>New information is available.</td></tr><tr><td>DDS_SAMPLE_LOST_STATUS</td><td>A sample has been lost (never received).</td></tr><tr><td>DDS_SUBSCRIPTION_MATCHED_STATUS</td><td>The DDS_DataReader has found a DDS_DataWriter that matches the ZWDDS_Topic and has compatible QoS.</td></tr><tr><td rowspan="4">DDS_DataWriter</td><td>DDS_LIVELINESS_LOST_STATUS</td><td>The liveliness that the DDS_DataWriter has committed through its DDS_LivelinessQosPolicy was not respected; thus DDS_DataReader objects will consider the DDS_DataWriter as no longer “alive”.</td></tr><tr><td>DDS_OFFERED_DEADLINE_MISSED_STATUS</td><td>The deadline that the DDS_DataWriter has committed through its DDS_DeadlineQosPolicy was not respected for a specific instance.</td></tr><tr><td>DDS_OFFERED_INCOMPATIBLE_QOS_STATUS</td><td>A QosPolicy setting was incompatible with what was requested.</td></tr><tr><td>DDS_PUBLICATION_MATCHED_STATUS</td><td>The DDS_DataWriter has found DDS_DataReader that matches the DDS_Topic and has compatible QoS.</td></tr></table>

The statuses may be classified in:

• read communication statuses: i.e., those that are related to arrival of data, namely DDS\_DATA\_ON\_READERS and DDS\_DATA\_AVAILABLE
• plain communication statuses: i.e., all the others.

For each plain communication status, there is a corresponding status struct. The i n f o r m a t i o n f r o m t h i s s t r u c t c a n b e r e t r i e v e d w i t h t h e o p e r a t i o n s get\_&lt;status\_name&gt;\_status. For example, to get the DDS\_INCONSISTENT\_TOPIC status (which information is stored in the DDS\_InconsistentTopicStatus struct), the application must call the operation DDS\_Topic\_get\_inconsistent\_topic\_status. A plain communication status can only be read from the DDS\_Entity on which it is applicable. For the read communication statuses there is no struct available to the application.

# Communication Status Event

Conceptually associated with each DDS\_Entity communication status is a logical StatusChangedFlag. This flag indicates whether that particular communication status has changed since the last time the status was ‘read’ by the application (there is no actual read-operation to read the StatusChangedFlag). The StatusChangedFlag is only conceptually needed to explain the behaviour of a Listener, therefore, it is not important whether this flag actually exists. A Listener will only be activated when the StatusChangedFlag changes from FALSE to TRUE (provided the Listener is attached and enabled for this particular status). The conditions which cause the StatusChangedFlag to change is slightly different for the plain communication status and the read communication status.

For the plain communication status, the StatusChangedFlag flag is initially set to FALSE. It becomes TRUE whenever the plain communication status changes and it is reset to FALSE each time the application accesses the plain communication status via the proper get\_&lt;status\_name&gt;\_status operation on the DDS\_Entity.

The communication status is also reset to FALSE whenever the associated Listener operation is called as the Listener implicitly accesses the status which is passed as a parameter to the operation. The fact that the status is reset prior to c a l l i n g t h e l i s t e n e r m e a n s t h a t i f t h e a p p l i c a t i o n c a l l s t h e get\_&lt;status\_name&gt;\_status from inside the listener it will see the status already reset.

An exception to this rule is when the associated Listener is the nil listener, in other word, a listener with value DDS\_OBJECT\_NIL. Such a listener is treated as a NOOP1 for all statuses activated in its bitmask and the act of calling this 'nil' listener does not reset the corresponding communication statuses.

![The flowchart depicts a loop between two states regarding a status flag.\n\n**Labeled Blocks:**\n*   **Start Node:** A black circle at the top.\n*   **Block 1:** 'StatusChangedFlag = FALSE'\n*   **Block 2:** 'StatusChangedFlag = TRUE'\n\n**Connections:**\n*   **Start to Block 1:** An arrow points directly from the black circle to 'StatusChangedFlag = FALSE'.\n*   **Block 1 to Block 2:** An arrow points downward from 'StatusChangedFlag = FALSE' to 'StatusChangedFlag = TRUE'. This path is labeled **'CurrentStatus != SavedStatus'**. Additionally, a zigzag arrow branches off to the right from this path, labeled **'event which can cause the activation of a Listener'**.\n*   **Block 2 to Block 1 (Loop):** An arrow loops from 'StatusChangedFlag = TRUE' back up to 'StatusChangedFlag = FALSE'. This connection is labeled on the left side: **'get_(status_name)_status OR invocation of corresponding Listener operation'**.](.vortex-opensplice-c-reference-guide/9320af809fa3ee72cd37111137060ea989f7119c59bac8943e43049292c7bb84.jpg)

Figure 24: Plain Communication Status State Chart

For example, the value of the StatusChangedFlag associated with the DDS\_RequestedDeadlineMissedStatus will become TRUE each time a new d e a d l i n e p a s s e s ( w h i c h i n c r e a s e s t h e t o t a l \_ c o u n t f i e l d w i t h i n DDS\_RequestedDeadlineMissedStatus). The value changes to FALSE when t h e a p p l i c a t i o n a c c e s s e s t h e s t a t u s v i a t h e c o r r e s p o n d i n g DDS\_DataReader\_get\_requested\_deadline\_missed\_status operation on the proper DDS\_Entity, or when the the on\_requested\_deadline\_missed operation on the Listener attached to this DDS\_Entity or one its containing entities is invoked.

For the read communication status, the StatusChangedFlag flag is initially set to FALSE. It becomes TRUE when data arrives, or when the InstanceState of a contained instance changes. This can be caused by either:

• The arrival of the notification that an instance has been disposed by:

- the DDS\_DataWriter that owns it if its OwnershipQosPolicyKind = DDS\_EXCLUSIVE\_OWNERSHIP\_QOS
- or by any DDS\_DataWriter if its OwnershipQosPolicyKind = DDS\_SHARED\_OWNERSHIP\_QOS.
• The loss of liveliness of the DDS\_DataWriter of an instance for which there is no other DDS\_DataWriter.
• The arrival of the notification that an instance has been unregistered by the only DDS\_DataWriter that is known to be writing the instance.

The read communication statuses are reset to FALSE again in the following circumstances:

• The status flag of the DDS\_DATA\_AVAILABLE\_STATUS becomes FALSE when either the corresponding listener operation (on\_data\_available) is called, or the read or take operation (or any of its variants) is called on the associated DDS\_DataReader.

![The flowchart begins with a black start node at the top.\n\n**Labeled Blocks:**\n*   'StatusChangedFlag = FALSE'\n*   'StatusChangedFlag = TRUE'\n\n**Connections and Flow:**\n1.  An arrow points from the start node down to the block labeled **'StatusChangedFlag = FALSE'**.\n2.  An arrow points from **'StatusChangedFlag = FALSE'** down to the block labeled **'StatusChangedFlag = TRUE'**.\n    *   Next to this downward arrow is the text: **'Data arrives OR change in InstanceState of a contained instance'**.\n    *   From this text, a jagged arrow points to the right, leading to the text: **'event which can cause the activation of a Listener'**.\n3.  A line loops from the bottom of the **'StatusChangedFlag = TRUE'** block back up to the left side of the **'StatusChangedFlag = FALSE'** block.\n    *   Next to this return line is the text: **'on_data_available OR read/take or any of its variants'**.](.vortex-opensplice-c-reference-guide/e3c76238c59ef381e04a226fc6e4756448f8989ade5e9e7976921cf36989b515.jpg)

Figure 25: Read Communication Status DDS\_DataReader Statecraft

• The status flag of the DDS\_DATA\_ON\_READERS\_STATUS becomes FALSE when any of the following events occurs:

- The corresponding listener operation (on\_data\_on\_readers) is called on the corresponding DDS\_Subscriber.
- The on\_data\_available listener operation is called on any DDS\_DataReader belonging to the DDS\_Subscriber.
- The read or take operation (or any of its variants) is called on any DDS\_DataReader belonging to the DDS\_Subscriber.

![The diagram is a flowchart depicting a state transition loop with an external event trigger.\n\n**Labeled Blocks:**\n*   A black circle (start node) at the top.\n*   A rounded rectangle labeled: `StatusChangedFlag = FALSE`\n*   A rounded rectangle labeled: `StatusChangedFlag = TRUE`\n\n**Connections:**\n*   An arrow points from the black circle down to `StatusChangedFlag = FALSE`.\n*   An arrow points from `StatusChangedFlag = FALSE` down to `StatusChangedFlag = TRUE`.\n*   An arrow loops from the bottom of `StatusChangedFlag = TRUE` back to the left side of `StatusChangedFlag = FALSE`. To the left of this path is the text: `on_data_on_readers OR on_data_available OR read/take or any of its variants`.\n*   A zig-zag arrow branches off the main downward path (between the two rectangles) to the right. Above this arrow is the text: `Data arrives OR change in InstanceState of any contained DataReader`. The arrow points to the text: `event which can cause the activation of a Listener`.](.vortex-opensplice-c-reference-guide/40a861410fc33d10b925d9ec67f48bf9d8bad6d48df24de524e74d69121bd184.jpg)

Figure 26: DDS\_Subscriber Statecraft for a Read Communication Status

# Listeners

The Listeners provide for an event-based mechanism to asynchronously inform the application of a status change event. Listeners are applicable for both the read communication statuses and the plain communication statuses. When one of these status change events occur, the associated Listener is activated, provided some pre-conditions are satisfied. When the Listener is activated, it will call the corresponding on\_&lt;status\_name&gt; operation of that Listener. Each on\_&lt;status\_name&gt; operation available in the Listener of an DDS\_Entity is also available in the Listener of the factory of the DDS\_Entity.

For both the read communication statuses and the plain communication statuses a Listener is only activated when a Listener is attached to this particular DDS\_Entity and enabled for this particular status. Statuses are enabled according to the DDS\_StatusKindMask parameter that was passed at creation time of the DDS\_Entity, or that was passed to the DDS\_&lt;DDS\_Entity&gt;\_set\_listener operation .

When an event occurs for a particular DDS\_Entity and for a particular status, but the applicable Listener is not activated for this status, the status is propagated up to the factory of this DDS\_Entity. For this factory, the same propagation rules apply. When even the DDS\_DomainParticipantListener is not attached or enabled for this status, the application will not be notified about this event. This means that a status change on a contained DDS\_Entity only invokes the Listener of its factory if the Listener of the contained DDS\_Entity itself does not handle the trigger event generated by the status change.

![Based on the provided image, here is the accurate and concise description of the flowchart:\n\n**Labeled Blocks:**\n*   **Top Center:** `((Interface)) Listener (from Infrastructure Module)`\n*   **Middle Left:** `((Interface)) DataWriterListener`\n    *   `on_liveliness_lost()``\n    *   `on_offered_deadline_missed()``\n    *   `on_offered_incompatible_qos()``\n    *   `on_publication_match()``\n*   **Center:** `((Interface)) TopicListener`\n    *   `on_inconsistent_topic()``\n*   **Middle Right:** `((Interface)) DataReaderListener`\n    *   `on_data_available()``\n    *   `on_liveliness_changed()``\n    *   `on_requested_deadline_missed()``\n    *   `on_requested_incompatible_qos()``\n    *   `on_sample_lost()``\n    *   `on_sample_rejected()``\n    *   `on_subscription_match()``\n*   **Bottom Left:** `((Interface)) PublisherListener`\n*   **Bottom Right:** `((Interface)) SubscriberListener`\n    *   `on_data_on_readers()``\n*   **Bottom Center:** `DomainParticipantListener`\n\n**Connections (Indicated by upward-pointing arrows):**\n*   `DomainParticipantListener` connects to `PublisherListener`, `TopicListener`, and `SubscriberListener`.\n*   `PublisherListener` connects to `DataWriterListener`.\n*   `SubscriberListener` connects to `DataReaderListener`.\n*   `TopicListener` connects to `Listener`.](.vortex-opensplice-c-reference-guide/f756e701b13f0a937e7755e4c16c21185e63f03a04a3edf4af90c87584d66d2a.jpg)

Figure 27: DCPS Listeners

The event propagation is also applicable to the read communication statuses. H o w e v e r, s i n c e t h e e v e n t h e r e i s t h e a r r i v a l o f d a t a , b o t h t h e DDS\_DATA\_ON\_READERS and DDS\_DATA\_AVAILABLE status are TRUE. The Data Distribution Service will first attempt to handle the DDS\_DATA\_ON\_READERS status and try to activate the DDS\_SubscriberListener. When this Listener is not a c t i v a t e d f o r t h i s s t a t u s , t h e e v e n t w i l l p r o p a g a t e t o t h e DDS\_DomainParticipantListener. Only when the DDS\_DATA\_ON\_READERS status can not be handled, the Data Distribution Service will attempt to handle the DDS\_DATA\_AVAILABLE status and try to activate the DDS\_DataReaderListener. In case this Listener is not activated for this status, the event will follow the propagation rules as described above.

# Conditions and Waitsets

The DDS\_Conditions in conjunction with DDS\_WaitSets provide for a wait-based mechanism to synchronously inform the application of status changes. A DDS\_Condition can be either a DDS\_ReadCondition, DDS\_QueryCondition, DDS\_StatusCondition or DDS\_GuardCondition. To create a DDS\_Condition one of the following operations can be used:

• DDS\_ReadCondition created by DDS\_DataReader\_create\_readcondition
• DDS\_QueryCondition created by DDS\_DataReader\_create\_querycondition
• DDS\_StatusCondition retrieved by DDS\_&lt;Entity&gt;\_get\_statuscondition on an DDS\_&lt;Entity&gt;
• DDS\_GuardCondition created by the C operation DDS\_GuardCondition\_\_alloc

Note that the DDS\_QueryCondition is a specialized DDS\_ReadCondition. The DDS\_GuardCondition is a different kind of DDS\_Condition since it is not c o n t r o l l e d b y a s t a t u s b u t d i r e c t l y b y t h e a p p l i c a t i o n ( w h e n a DDS\_GuardCondition is initially created, the trigger\_value is FALSE). The DDS\_StatusCondition is present by default with each DDS\_Entity, therefore, it does not have to be created.

![The diagram depicts two blocks representing classes or components, connected by a relationship line.\n\n**Blocks:**\n*   **Condition**: This block contains the method `get_trigger_value()`.\n*   **WaitSet**: This block contains the methods `attach_condition()`, `detach_condition()`, `get_conditions()`, and `wait()`.\n\n**Connections:**\n*   A horizontal line connects the two blocks.\n*   An arrow points from the **WaitSet** block towards the **Condition** block.\n*   A multiplicity of `*` is located next to the **Condition** block (at the arrowhead).\n*   A multiplicity of `*` is located next to the **WaitSet** block.](.vortex-opensplice-c-reference-guide/01bb93c805df9d59f90c5e7b2805184a08eb005cb27c4b08424614cbbb6d3831.jpg)

Figure 28: DCPS DDS\_WaitSets

A DDS\_WaitSet may have one or several DDS\_Conditions attached to it. An application thread may block execution (blocking may be limited by a timeout) by waiting on a DDS\_WaitSet until the trigger\_value of one or more of the DDS\_Conditions become TRUE. When a DDS\_Condition, whose trigger\_value evaluates to TRUE, is attached to a DDS\_WaitSet that is currently being waited on (using the DDS\_WaitSet\_wait operation), the DDS\_WaitSet will unblock immediately.

This (wait-based) mechanism is generally used as follows:

• The application creates a DDS\_WaitSet
• The application indicates which relevant information it wants to be notified of, by creating or retrieving DDS\_Condition objects (DDS\_StatusCondition, DDS\_ReadCondition, DDS\_QueryCondition or DDS\_GuardCondition) and attach them to a DDS\_WaitSet
• It then waits on that DDS\_WaitSet (using DDS\_WaitSet\_wait) until the trigger\_value of one or several DDS\_Condition objects (in the DDS\_WaitSet) become TRUE

• When the thread is unblocked, the application uses the result of the DDS\_WaitSet\_wait (i.e., the list of DDS\_Condition objects with trigger\_value==TRUE) to actually get the information:

- if the condition is a DDS\_StatusCondition and the status changes refer to a plain communication status, by calling get\_status\_changes and then get\_&lt;communication\_status&gt; on the relevant DDS\_Entity
- if the condition is a DDS\_StatusCondition and the status changes refer to the read communication status:

DDS\_DATA\_ON\_READERS, by calling get\_status\_changes and then DDS\_Subscriber\_get\_datareaders on the relevant DDS\_Subscriber and then DDS\_DataReader\_read/DDS\_DataReader\_take on the returned DDS\_DataReader objects

DDS\_DATA\_AVAILABLE, by calling get\_status\_changes and then DDS\_DataReader\_read/DDS\_DataReader\_take on the relevant DDS\_DataReader.

\- if it is a DDS\_ReadCondition or a DDS\_QueryCondition, by calling directly DDS\_DataReader\_read\_w\_condition / DDS\_DataReader\_take\_ w\_condition on the DDS\_DataReader with the DDS\_Condition as a parameter.

![**Classes and Attributes/Methods:**\n\n*   **Condition**: `get_trigger_value()`\n*   **StatusCondition**: `get_enabled_statuses()`, `get_entity()`, `set_enabled_statuses()`\n*   **GuardCondition**: `set_trigger_value()`\n*   **ReadCondition**: `get_datareader()`, `get_instance_state_mask()`, `get_sample_state_mask()`, `get_view_state_mask()`\n*   **QueryCondition**: `get_query_parameters()`, `get_query_expression()`, `set_query_parameters()`\n*   **Entity**: `enable()`, `((abstract)) get_listener()`, `((abstract)) get_qos()`, `get_status_changes()`, `get_statuscondition()`, `((abstract)) set_listener()`, `((abstract)) set_qos()`\n*   **DomainParticipant**: (Empty)\n*   **DataReader**: (Empty)\n*   **DomainEntity**: (Empty)\n*   **DataWriter**: (Empty)\n*   **Subscriber**: (Empty)\n*   **Publisher**: (Empty)\n*   **Topic**: (Empty)\n\n**Relationships:**\n\n*   **Inheritance (Solid lines with hollow arrowheads pointing to the parent class):**\n    *   `StatusCondition` inherits from `Condition`.\n    *   `GuardCondition` inherits from `Condition`.\n    *   `ReadCondition` inherits from `Condition`.\n    *   `QueryCondition` inherits from `ReadCondition`.\n    *   `DomainParticipant` inherits from `Entity`.\n    *   `DomainEntity` inherits from `Entity`.\n    *   `Topic` inherits from `DomainEntity`.\n    *   `Subscriber` inherits from `DomainEntity`.\n    *   `DataWriter` inherits from `DomainEntity`.\n    *   `Publisher` inherits from `DomainEntity`.\n\n*   **Association (Solid lines connecting classes):**\n    *   **Entity to StatusCondition**: A line connects `Entity` and `StatusCondition`. The multiplicity `1` is near `Entity`, and `0..1` is near `StatusCondition`. The line is labeled `statuscondition` and `entity`.\n    *   **ReadCondition to DataReader**: A line connects `ReadCondition` and `DataReader`. The multiplicity `*` is near `ReadCondition`, and `1` is near `DataReader`.\n\n*   **Dependency (Dashed lines with open arrowheads):**\n    *   `DataReader` has a `((create))` dependency on `ReadCondition`.\n    *   `DataReader` has a `((create))` dependency on `QueryCondition`.](.vortex-opensplice-c-reference-guide/f1e5e1eb3f17258b913b06ccfe8c5857a913320945ff448504e4f43de91329e1.jpg)

Figure 29: DCPS DDS\_Conditions

No extra information is passed from the Data Distribution Service to the application when a DDS\_WaitSet\_wait returns only the list of triggered DDS\_Condition objects. Therefore, it is the application responsibility to investigate which DDS\_Condition objects have triggered the DDS\_WaitSet.

# Blocking Behaviour

The result of a DDS\_WaitSet\_wait operation depends on the state of the DDS\_WaitSet, which in turn depends on whether at least one attached DDS\_Condition has a trigger\_value of TRUE. If the DDS\_WaitSet\_wait operation is called on DDS\_WaitSet with state BLOCKED it will block the calling thread. If DDS\_WaitSet\_wait is called on a DDS\_WaitSet with state UNBLOCKED it will return immediately. In addition, when the DDS\_WaitSet transitions from state BLOCKED to state UNBLOCKED it wakes up the thread (if any) that had called DDS\_WaitSet\_wait on it. Note that there can only be one thread waiting on a single DDS\_WaitSet.

![The flowchart depicts a state transition diagram with two labeled blocks: **BLOCKED** and **UNBLOCKED**.\n\n**Connections and Labels:**\n\n*   **Self-Loop on BLOCKED:** An arrow loops from the right side of the **BLOCKED** block back to its top.\n    *   Text: `DDS_WaitSet_wait`\n    *   Text: `Block calling thread`\n\n*   **Transition to UNBLOCKED:** A vertical arrow points downward from the bottom of the **BLOCKED** block to the top of the **UNBLOCKED** block.\n    *   Text: `(at least one attached condition has trigger_value == TRUE)`\n    *   Text: `Wakeup waiting threads`\n\n*   **Self-Loop on UNBLOCKED:** An arrow loops from the right side of the **UNBLOCKED** block back to its bottom.\n    *   Text: `DDS_WaitSet_wait`\n    *   Text: `Do not block. Return immediately`\n\n*   **Transition to BLOCKED:** An arrow loops from the left side of the **UNBLOCKED** block upwards to the left side of the **BLOCKED** block.\n    *   Text: `(all attached conditions have trigger_value == FALSE)`](.vortex-opensplice-c-reference-guide/617128cab4ec41ed2e85c27947eae4073d10ee189d13f00822513bc26ca114a5.jpg)

Figure 30: Blocking Behaviour of a Waitset State Chart

# DDS\_StatusCondition Trigger State

The trigger\_value of a DDS\_StatusCondition is the boolean OR of the StatusChangedFlag of all the communication statuses to which it is sensitive. T h a t i s , t r i g g e r \_ v a l u e = = F A L S E o n l y i f a l l t h e v a l u e s o f t h e StatusChangedFlags are FALSE.

The sensitivity of the DDS\_StatusCondition to a particular communication status is controlled by the bit-mask of enabled\_statuses set on the DDS\_Condition by means of theDDS\_StatusCondition\_set\_ enabled\_statuses operation.

# DDS\_ReadCondition and DDS\_QueryCondition Trigger State

Similar to the DDS\_StatusCondition, a DDS\_ReadCondition also has a trigger\_value that determines whether the attached DDS\_WaitSet is BLOCKED or UNBLOCKED. However, unlike the DDS\_StatusCondition, the trigger\_value of the DDS\_ReadCondition is tied to the presence of at least one sample managed by the Data Distribution Service with SampleState, ViewState, and InstanceState matching those of the DDS\_ReadCondition. Additionally, for the DDS\_QueryCondition, the data associated with the sample, must be such that the query\_expression evaluates to TRUE.

The fact that the trigger\_value of a DDS\_ReadCondition is dependent on the presence of samples on the associated DDS\_DataReader implies that a single DDS\_DataReader\_take operation can potentially change the trigger\_value of several DDS\_ReadCondition or DDS\_QueryCondition objects. For example, if all samples are taken, any DDS\_ReadCondition or DDS\_QueryCondition o b j e c t s a s s o c i a t e d w i t h t h e D D S \_ D a t a R e a d e r t h a t h a d t h e i r trigger\_value==TRUE before will see the trigger\_value change to FALSE. Note that this does not guarantee that DDS\_WaitSet objects, that had those DDS\_Condition objects separately attached to, will not be woken up. Once we have trigger\_value==TRUE on a DDS\_Condition it may wake up the D D S \_ W a i t S e t i t w a s a t t a c h e d t o , t h e c o n d i t i o n t r a n s i t i o n s t o trigger\_value==FALSE does not 'un-wake up' the DDS\_WaitSet as 'un-wakening' is not possible. The consequence is that an application blocked on a DDS\_WaitSet may return from the wait with a list of DDS\_Condition objects some of which are no longer “active”. This is unavoidable if multiple threads are concurrently waiting on separate DDS\_WaitSet objects and taking data associated with the same D DS \_D at aR ea de r D DS \_E nt it y. In ot her wor ds, a DDS\_WaitSet\_wait may return with a list of DDS\_Condition objects which all have a trigger\_value==FALSE. This only means that at some point one or more of the DDS\_Condition objects have had a trigger\_value==TRUE but no longer do.

# DDS\_GuardCondition Trigger State

The trigger\_value of a DDS\_GuardCondition is completely controlled by the application via the operation DDS\_GuardCondition\_set\_trigger\_value. This DDS\_Condition can be used to implement an application-defined wake-up of the blocked thread.

# Appendix

# G

# DDS\_Topic Definitions

The Data Distribution Service distributes its data in structured data types, called topics. The first step when using the Data Distribution Service consists of defining these topics. Since the Data Distribution Service supports using several programming languages, OMG IDL is used for this purpose. This appendix describes how to define the topics.

# DDS\_Topic Definition Example

All data distributed using the Data Distribution Service has to be defined as a topic. A topic is a structured data type, like a C-struct with several members. Whenever the application needs to read or write data, it will be reading or writing topics. The definition of each topic it will be using has to be written in (a subset of) OMG IDL. For example:

```c
module SPACE {
    struct Foo {
    long    userID; // owner of message
    long long index; // message index per owner
    string    content; // message body
    };
#pragma keylist Foo
};
```

This is the definition of a topic called Foo, used for sending and receiving messages (as an example). Even though the topic is defined using IDL, the Data Distribution Service will be using an equivalent C-struct which is accessed by the application using the type specific operations. Generation of the typed classes is achieved by invoking the Data Distribution Service IDL pre-processor: idlpp -l c -S &lt;idl\_filename&gt;.idl, a tool which translates the IDL topic definition into an equivalent C definition. The -l C option indicates that C-code has to be generated, the -S option indicates that this C code should be StandAlone C code, i.e. it must not have any dependency on external ORB libraries. In this example, the pre-processor will generate the classes SPACE\_FooTypeSupport, SPACE\_FooDataWriter and SPACE\_FooDataReader which contain the type specific operations.

The prefix SPACE\_ is generated from the IDL-module-name. The types of the fields are prescribed by the IDL-to-C mapping. After the Data Distribution Service IDL-pre-processor is run, the application will use the generated code.

# Complex Topics

The Foo topic is relatively simple, but the Data Distribution Service is capable of distributing more complex topics as well. In fact, any definition following the OpenSplice IDL subset is allowed. For a reference of this subset, see the BNF-notation in Appendix , Data Distribution Service IDL Subset in BNF Notation. It is important to know that the pre-processor accepts all IDL constructs but only the subset is being processed.

Apart from the trivial data types, the Data Distribution Service is capable of handling fixed-length arrays, bounded and unbounded sequences, union types and enumerations. Types can be nested, e.g. a struct can contain a struct field or an array of structs, or a sequence of strings or an array of sequences containing structs. For more information regarding the IDL to C mapping.

# IDL Pre-processor

This section contains the specification of the subset of OMG IDL that can be used to define the topics.

# IDL to Host Language Mapping

The Data Distribution Service IDL pre-processor translates the IDL-definition of the topics into language specific code. This translation is executed according to the OMG IDL mappings. Since the Data Distribution Service uses data-structures only, not all IDL-features are implemented by the pre-processor. Usually, the IDL definition consists of a module defining several structs and typedefs.

# Data Distribution Service IDL Keywords

The identifiers listed in this appendix are reserved for use as keywords in IDL and may not be used otherwise, unless escaped with a leading underscore.

<table><tr><td>abstract</td><td>exception</td><td>inout</td><td>provides</td><td>truncatable</td></tr><tr><td>any</td><td>emits</td><td>interface</td><td>public</td><td>typedef</td></tr><tr><td>attribute</td><td>enum</td><td>local</td><td>publishes</td><td>typeid</td></tr><tr><td>boolean</td><td>eventType</td><td>long</td><td>raises</td><td>typeprefix</td></tr><tr><td>case</td><td>factory</td><td>module</td><td>readonly</td><td>unsigned</td></tr><tr><td>char</td><td>FALSE</td><td>multiple</td><td>setraises</td><td>union</td></tr><tr><td>component</td><td>finder</td><td>native</td><td>sequence</td><td>uses</td></tr><tr><td>const</td><td>fixed</td><td>Object</td><td>short</td><td>ValueBase</td></tr><tr><td>consumes</td><td>float</td><td>octet</td><td>string</td><td>valuetype</td></tr><tr><td>context</td><td>getraises</td><td>oneway</td><td>struct</td><td>void</td></tr><tr><td>custom</td><td>home</td><td>out</td><td>supports</td><td>wchar</td></tr><tr><td>default</td><td>import</td><td>primarykey</td><td>switch</td><td>wstring</td></tr><tr><td>double</td><td>in</td><td>private</td><td>TRUE</td><td></td></tr></table>

Keywords must be written exactly as shown in the above list. Identifiers that collide with keywords are illegal. For example, boolean is a valid keyword; Boolean and BOOLEAN are illegal identifiers.

# Data Distribution Service IDL Pragma Keylist

To define a topic, the content must either be a struct or a union. The pre-processor will only generate the type specific classes when topic definition is accompanied by a &lt;pragmakeylist&gt;. When the &lt;pragmakeylist&gt; has no &lt;field\_id&gt;, the topic is available but no key is set. To define the keylist the definition, written in BNF-notation, is as follows:

```txt
&lt;pragmakeylist&gt;::= "#pragma keylist" &lt;type_id&gt;
&lt;field_id&gt;*
&lt;type_id&gt;::= &lt;struct_type_identifier&gt;
| &lt;union_type_identifier&gt;
&lt;field_id&gt;::= &lt;member_declarator&gt;
| &lt;element_spec_declarator&gt;
```

In case of a struct, &lt;type\_id&gt; is a &lt;struct\_type\_identifier&gt;. In case of a union, &lt;type\_id&gt; is a &lt;union\_type\_identifier&gt;. The &lt;struct\_type\_identifier&gt; is the identifier used in the struct declaration. The &lt;union\_type\_identifier&gt; is the identifier used in the union declaration. The &lt;field\_id&gt; is the identifier of a field in the struct or union identified by &lt;type\_id&gt;. In case of a struct, &lt;field\_id&gt; is a &lt;member\_declarator&gt; which is one of the declarators used in the struct member. In case of a union, &lt;field\_id&gt; is a &lt;element\_spec\_declarator&gt; which is one of the declarators used in the element specification in a case of the union.

For example, for the Foo example in Appendix , DDS\_Topic Definition Example the next pragma must be used to have the pre-processor generate the typed classes (SPACE\_FooTypeSupport, SPACE\_FooDataWriter and SPACE\_FooDataReader).

#pragma keylist Foo userID index

Note that in this example the userID and the index are used as a key.

# Data Distribution Service IDL Subset in BNF Notation

Only a subset is used by the pre-processor. A description of the Data Distribution Service IDL subset, written in BNF-notation, is as follows:

```cpp
&lt;definition&gt;::= &lt;type_dcl&gt; ";"
| &lt;const_dcl&gt; ";"
```

```txt
| &lt;module&gt; ";"
&lt;module&gt;::="module" &lt;identifier&gt; "{\" &lt;definition&gt;+ "}"
&lt;scoped_name&gt;::= &lt;identifier&gt;
| ":::" &lt;identifier&gt;
| &lt;scoped_name&gt; ":::" &lt;identifier&gt;
&lt;const_dcl&gt;::="const" &lt;const_type&gt;
&lt;identifier&gt; "=" &lt;const_exp&gt;
&lt;const_type&gt;::="integer_type>
| &lt;char_type&gt;
| &lt;boolean_type&gt;
| &lt;floating_pt_type&gt;
| &lt;string_type&gt;
| &lt;scoped_name&gt;
| &lt;octet_type&gt;
&lt;const_exp&gt;::="or_expr>
&lt;or_expr&gt;::="xor_expr>
| &lt;or_expr&gt; "|\" &lt;xor_expr&gt;
&lt;xor_expr&gt;::="and_expr>
| &lt;xor_expr&gt; "^\" &lt;and_expr&gt;
&lt;and_expr&gt;::="shift_expr>
| &lt;and_expr&gt; "&\" &lt;shift_expr&gt;
&lt;shift_expr&gt;::="add_expr>
| &lt;shift_expr&gt; ">>"" &lt;add_expr&gt;
| &lt;shift_expr&gt; "&lt;&lt;"" &lt;add_expr&gt;
&lt;add_expr&gt;::="mult_expr>
| &lt;add_expr&gt; "+" &lt;mult_expr&gt;
| &lt;add_expr&gt; "-" &lt;mult_expr&gt;
&lt;mult_expr&gt;::="unary_expr>
| &lt;mult_expr&gt; "*" &lt;unary_expr&gt;
| &lt;mult_expr&gt; "/" &lt;unary_expr&gt;
| &lt;mult_expr&gt; "%\" &lt;unary_expr&gt;
&lt;unary_expr&gt;::="unary_operator> &lt;primary_expr&gt;
| &lt;primary_expr&gt;
&lt;unary_operator&gt;::="-"
| "+"
| "~"
&lt;primary_expr&gt;::="scoped_name>
| &lt;literal&gt;
| "(" &lt;const_exp&gt; ")"
&lt;literal&gt;::="integer_literal>
| &lt;string_literal&gt;
| &lt;character_literal&gt;
| &lt;floating_pt_literal&gt;
| &lt;boolean_literal&gt;
&lt;boolean_literal&gt;::="TRUE"
| "FALSE"
&lt;positive_int_const&gt;::="const_exp>
&lt;type_dcl&gt;::="typedef" &lt;type_declarator&gt;
| &lt;struct_type&gt;
| &lt;union_type&gt;
```

```txt
| &lt;enum_type&gt;
&lt;type_declarator&gt;::= &lt;type_spec&gt; &lt;declarators&gt;
&lt;type_spec&gt;::= &lt;simple_type_spec&gt;
| &lt;constr_type_spec&gt;
&lt;simple_type_spec&gt;::= &lt;base_type_spec&gt;
| &lt;template_type_spec&gt;
| &lt;scoped_name&gt;
&lt;base_type_spec&gt;::= &lt;floating_pt_type&gt;
| &lt;integer_type&gt;
| &lt;char_type&gt;
| &lt;boolean_type&gt;
| &lt;octet_type&gt;
&lt;template_type_spec&gt;::= &lt;sequence_type&gt;
| &lt;string_type&gt;
&lt;constr_type_spec&gt;::= &lt;struct_type&gt;
| &lt;union_type&gt;
| &lt;enum_type&gt;
&lt;declarators&gt;::= &lt;declarator&gt; { ", " &lt;declarator&gt; }*
&lt;declarator&gt;::= &lt;simple_declarator&gt;
| &lt;complex_declarator&gt;
&lt;simple_declarator&gt;::= &lt;identifier&gt;
&lt;complex_declarator&gt;::= &lt;array_declarator&gt;
&lt;floating_pt_type&gt;::= "float"
| "double"
&lt;integer_type&gt;::= &lt;signed_int&gt;
| &lt;unsigned_int&gt;
&lt;signed_int&gt;::= &lt;signed_short_int&gt;
| &lt;signed_long_int&gt;
| &lt;signed_longlong_int&gt;
&lt;signed_short_int&gt;::= "short"
&lt;signed_long_int&gt;::= "long"
&lt;signed_longlong_int&gt;::= "long" "long"
&lt;unsigned_int&gt;::= &lt;unsigned_short_int&gt;
| &lt;unsigned_long_int&gt;
| &lt;unsigned_longlong_int&gt;
&lt;unsigned_short_int&gt;::= "unsigned" "short"
&lt;unsigned_long_int&gt;::= "unsigned" "long"
&lt;unsigned_longlong_int&gt;::= "unsigned" "long" "long"
&lt;char_type&gt;::= "char"
RHoobean_type>::= "boolean"
RHoctet_type>::= "octet"
RHstruct_type>::= "struct" &lt;identifier&gt; "{" &lt;member_list&gt; "}"
RHmember_list>::= &lt;member)+
RHmember&gt;::= &lt;type_spec&gt; &lt;declarators&gt; ";"
RHunion_type>::= "union" &lt;identifier&gt; "switch"
    "(" &lt;switch_type_spec&gt; ")"
    "{" &lt;switch_body&gt; "}"
RHswitch_type_spec>::= &lt;integer_type&gt;
| &lt;char_type&gt;
| &lt;boolean_type&gt;
```

Appendices
```cpp
| &lt;enum_type&gt;
| &lt;scoped_name&gt;
&lt;switch_body&gt;::= &lt;case&gt;
&lt;case&gt;::= &lt;case_label&gt;+ &lt;element_spec&gt; ";"
&lt;case_label&gt;::= "case" &lt;const_exp&gt; ":"
| "default" ":"
&lt;element_spec&gt;::= &lt;type_spec&gt; &lt;declarator&gt;
&lt;enum_type&gt;::= "enum" &lt;identifier&gt;
    "{\" &lt;enumerator&gt; { "," &lt;enumerator&gt; }* "}"
&lt;enumerator&gt;::= &lt;identifier&gt;
&lt;sequence_type&gt;::= "sequence" "&lt;\" &lt;simple_type_spec&gt; ","
    &lt;positive_int_const&gt; ">"
    | "sequence" "&lt;\" &lt;simple_type_spec&gt; ">"
&lt;string_type&gt;::= "string" "&lt;\" &lt;positive_int_const&gt; ">"
    | "string"
&lt;array_declarator&gt;::= &lt;identifier&gt; &lt;fixed_array_size&gt;
&lt;fixed_array_size&gt;::= "[" &lt;positive_int_const&gt; "]”
```

# Appendix

# H DCPS Queries and Filters

A subset of SQL syntax is used in several parts of OpenSplice:

• the filter\_expression in the DDS\_ContentFilteredTopic
• the topic\_expression in the DDS\_MultiTopic
• the query\_expression in the DDS\_QueryReadCondition.

Those expressions may use a subset of SQL, extended with the possibility to use program variables in the SQL expression. The allowed SQL expressions are defined with the BNF-grammar below. The following notational conventions are made:

• the NonTerminals are typeset in italics
• the ‘Terminals’ are quoted and typeset in a fixed width font
• the TOKENS are typeset in small caps
• the notation (element // ‘,’) represents a non-empty comma-separated list of elements.

# SQL Grammar in BNF

```autohotkey
Expression::= FilterExpression
    | TopicExpression
    | QueryExpression
FilterExpression::= Condition
TopicExpression::= SelectFrom {Where } ';'QueryExpression::= {Condition}'(FIELDNAME // ',') }
SelectFrom::= 'SELECT' Aggregation 'FROM' Selection
Aggregation::= '*'
    | (SubjectFieldSpec // ',')
SubjectFieldSpec::= FIELDNAME
    | FIELDNAME 'AS' FIELDNAME
    | FIELDNAME FIELDNAME
Selection::= TOPICNAME
    | TOPICTNAME NaturalJoin JoinItem
JoinItem::= TOPICNAME
    | TOPICNAME NaturalJoin JoinItem
    | '(' TOPICNAME NaturalJoin JoinItem ')'
NaturalJoin::= 'INNER NATURAL JOIN'
    | 'NATURAL JOIN'
    | 'NATURAL INNER JOIN'
Where::= 'WHERE' Condition
Condition::= Predicate
    | Condition 'AND' Condition
```

```txt
| Condition 'OR' Condition
| 'NOT' Condition
| '(' Condition ')'
Predicate::= ComparisonPredicate
| BetweenPredicate
ComparisonPredicate::= FIELDNAME RelOp Parameter
| Parameter RelOp FIELDNAME

BetweenPredicate::= FIELDNAME 'BETWEEN' Range
| FIELDNAME 'NOT BETWEEN' Range
RelOp::= '=' | '>' |'D>=' | '&lt;' | '&lt;=' | '&lt;&gt;' | like
Range::= Parameter 'AND' Parameter
Parameter::= INTEGERVALUE
| FLOATVALUE
| STRING
| ENUMERATEDVALUE
| PARAMETER
```

Note: INNER NATURAL JOIN, NATURAL JOIN, and NATURAL INNER JOIN are all aliases, in the sense that they have the same semantics. The aliases are all supported because they all are part of the SQL standard.

# SQL Token Expression

The syntax and meaning of the tokens used in the SQL grammar is described as follows:

FIELDNAME - A fieldname is a reference to a field in the data-structure. The dot ‘.’ is used to navigate through nested structures. The number of dots that may be used in a fieldname is unlimited. The field-name can refer to fields at any depth in the data structure. The names of the field are those specified in the IDL definition of the corresponding structure, which may or may not match the field names that appear on the C mapping of the structure

TOPICNAME - A topic name is an identifier for a topic, and is defined as any series of characters ‘a’, ..., ‘z’, ‘A’, ..., ‘Z’, ‘0’, ..., ‘9’, ‘\_’ but may not start with a digit

INTEGERVALUE - Any series of digits, optionally preceded by a plus or minus sign, representing a decimal integer value within the range of the system. A hexadecimal number is preceded by 0x and must be a valid hexadecimal expression

FLOATVALUE - Any series of digits, optionally preceded by a plus or minus sign and optionally including a floating point (‘.’). A power-of-ten expression may be post-fixed, which has the syntax en, where n is a number, optionally preceded by a plus or minus sign

STRING - Any series of characters encapsulated in single quotes, except a new-line character or a right quote. A string starts with a left or right quote, but ends with a right quote

ENUMERATEDVALUE - An enumerated value is a reference to a value declared within an enumeration. The name of the value must correspond to the names specified in the IDL definition of the enumeration, and must be encapsulated in single quotes. An enum value starts with a left or right quote, but ends with a right quote.

PARAMETER - A parameter is of the form %n, where n represents a natural number (zero included) smaller than 100. It refers to the $n + 1 ^ { \mathrm { t h } }$ argument in the given context.

Note: when RelOp is ‘like’, Unix filename wildcards must be used for strings instead of the normal SQL wildcards. This means any one character is ‘?’, any zero or more characters is ‘\*’

# SQL Examples

Assuming Topic “Location” has as an associated type a structure with fields “flight\_name, x, y, z”, and Topic “FlightPlan” has as fields “flight\_id, source, destination”. The following are examples of using these expressions.

Example of a topic\_expression:

“SELECT flight\_name, x, y, z AS height FROM ‘Location’ NATURAL JOIN ‘FlightPlan’ WHERE height &lt; 1000 AND x &lt;23”.

Example of a query\_expression or a filter\_expression:

$\mathrm { ^ { c } h e i g h t } &lt; 1 0 0 0 \mathrm { ~ A N D ~ x } &lt; 2 3 \mathrm { ^ { \circ } } .$

Appendices

# Appendix

# I Built-in Topics

As part of its operation, the middleware must discover and possibly keep track of the presence of remote entities such as a new participant in the domain. This information may also be important to the application, which may want to react to this discovery, or else access it on demand.

To make this information accessible to the application, the DCPS specification introduces a set of built-in topics and corresponding DataReader objects that can then be used by the application. The information is then accessed as normal application data. This approach avoids introducing a new API to access this information and allows the application to become aware of any changes in those values by means of any of the mechanisms presented in Appendix F, Listeners, Conditions and Waitsets.

The built-in data-readers all belong to a built-in Subscriber. This subscriber can be retrieved by using the method get\_builtin\_subscriber provided by the D o m a i n P a r t i c i p a n t ( f o r d e t a i l s , s e e S e c t i o n 3 . 2 . 1 . 1 6 , DDS\_DomainParticipant\_get\_builtin\_subscriber, on page 190). The built-in DataReader objects can be retrieved by using the operation lookup\_datareader, with the Subscriber and the topic name as parameter (for details, see Section 3.5.1.15, DDS\_Subscriber\_lookup\_datareader, on page 412).

The QoS of the built-in Subscriber and DataReader objects is given by the following table:

Table 27: Built-in Subscriber and DataReader QoS

&lt;table&gt;<tr><td>USER_DATA</td><td></td></tr><tr><td>TOPIC_DATA</td><td></td></tr><tr><td>GROUP_DATA</td><td></td></tr><tr><td>DURABILITY</td><td>TRANSIENT</td></tr><tr><td>DURABILITY_SERVICE</td><td>service_cleanup_delay = 0history_kind = KEEP_LASThistory_depth = 1max_samples = LENGTH_UNLIMITEDmax_instances = LENGTH_UNLIMITEDmax_samples_per_instance = LENGTH_UNLIMITED</td></tr><tr><td>PRESENTATION</td><td>access_scope = TOPICcoherent_access = FALSEordered_access = FALSE</td></tr><tr><td>DEADLINE</td><td>Period = infinite</td></tr><tr><td>LATENCY_BUDGET</td><td>duration = 0</td></tr><tr><td>OWNERSHIP</td><td>SHARED</td></tr><tr><td>LIVELINESS</td><td>kind = AUTOMATIClease_duration = 0</td></tr><tr><td>TIME_BASED_FILTER</td><td>minimum_separation = 0</td></tr><tr><td>PARTITION</td><td>__BUILT-IN PARTITION__</td></tr><tr><td>RELIABILITY</td><td>kind = RELIABLEmax_blocking_time = 100 millisecondsynchronous = FALSE</td></tr><tr><td>DESTINATION_ORDER</td><td>BY_RECEPTION_TIMESTAMP</td></tr><tr><td>HISTORY</td><td>kind = KEEP_LASTdepth = 1</td></tr><tr><td>RESOURCE_LIMITS</td><td>max_samples = LENGTH_UNLIMITEDmax_instances = LENGTH_UNLIMITEDmax_samples_per_instance = LENGTH_UNLIMITED</td></tr><tr><td>READER_DATA_LIFECYCLE</td><td>autopurge_nowriter_samples_delay = INFINITEautopurge_disposed_samples_delay = INFINITEinvalid_sample_visibility = MINIMUM_INVALID_SAMPLES</td></tr><tr><td>ENTITY_FACTORY</td><td>autoenable_created_entities = TRUE</td></tr><tr><td>SHARE</td><td>enable = FALSEname = NULL</td></tr><tr><td>READER_DATA_LIFESPAN</td><td>used = FALSEDuration = INFINITE</td></tr><tr><td>USER_KEY</td><td>enable = FALSEexpression = NULL</td></tr></table>

Built-in entities have default listener settings as well. The built-in Subscriber and all of its built-in Topics have nil listeners with all statuses appearing in their listener masks. The built-in DataReaders have nil listeners with no statuses in their masks.

The information that is accessible about the remote entities by means of the built-in topics includes all the QoS policies that apply to the corresponding remote Entity. The QoS policies appear as normal 'data' fields inside the data read by means of the built-in Topic. Additional information is provided to identify the Entity and facilitate the application logic.

The tables below list the built-in topics, their names, and the additional information (beyond the QoS policies that apply to the remote entity) that appears in the data associated with the built-in topic.

# ParticipantBuiltinTopicData

The DCPSParticipant topic communicates the existence of DomainParticipants by means of the ParticipantBuiltinTopicData datatype. Each ParticipantBuiltinTopicData sample in a Domain represents a D o m a i n P a r t i c i p a n t t h a t p a r t i c i p a t e s i n t h a t D o m a i n : a n e w ParticipantBuiltinTopicData instance is created when a newly added DomainParticipant is enabled, and it is disposed when that DomainParticipant is deleted. An updated ParticipantBuiltinTopicData sample is written each time the DomainParticipant modifies its UserDataQosPolicy.

Table 28: ParticipantBuiltinTopicData Members

<table><tr><td>Name</td><td>Type</td><td>Description</td></tr><tr><td>key</td><td>BuiltinTopicKey_t</td><td>Globally unique identifier of the participant</td></tr><tr><td>user_data</td><td>UserDataQosPolicy</td><td>User-defined data attached to the participant via a QosPolicy</td></tr></table>

# TopicBuiltinTopicData

The DCPSTopic topic communicates the existence of topics by means of the TopicBuiltinTopicData datatype. Each TopicBuiltinTopicData sample in a Domain represents a Topic in that Domain: a new TopicBuiltinTopicData instance is created when a newly added Topic is enabled. However, the instance is not disposed when a Topic is deleted by its participant because a topic lifecycle is tied to the lifecycle of a Domain, not to the lifecycle of an individual participant. (See also Section 3.2.1.13, DDS\_DomainParticipant\_delete\_topic, on page 186, which explains that a DomainParticipant can only delete its local proxy to the real Topic). An updated TopicBuiltinTopicData sample is written each time a Topic modifies one or more of its QosPolicy values.

Information published in the DCPSTopicTopic is critical to the data distribution service, therefore it cannot be disabled by means of the Domain/BuiltinTopics element in the configuration file.

Table 29: TopicBuiltinTopicData Members

<table><tr><td>Name</td><td>Type</td><td>Description</td></tr><tr><td>key</td><td>BuiltinTopicKey_t</td><td>Global unique identifier of the Topic</td></tr><tr><td>name</td><td>String</td><td>Name of the Topic</td></tr><tr><td>type_name</td><td>String</td><td>Type name of the Topic (i.e. the fully scoped IDL name)</td></tr><tr><td>durability</td><td>DurabilityQosPolicy</td><td>QosPolicy attached to the Topic</td></tr><tr><td>durability_service</td><td>DurabilityServiceQosPolicy</td><td>QosPolicy attached to the Topic</td></tr><tr><td>deadline</td><td>DeadlineQosPolicy</td><td>QosPolicy attached to the Topic</td></tr><tr><td>latency_budget</td><td>LatencyBudgetQosPolicy</td><td>QosPolicy attached to the Topic</td></tr><tr><td>liveliness</td><td>LivelinessQosPolicy</td><td>QosPolicy attached to the Topic</td></tr><tr><td>reliability</td><td>ReliabilityQosPolicy</td><td>QosPolicy attached to the Topic</td></tr><tr><td>transport_priority</td><td>TransportPriorityQosPolicy</td><td>QosPolicy attached to the Topic</td></tr><tr><td>lifespan</td><td>LifespanQosPolicy</td><td>QosPolicy attached to the Topic</td></tr><tr><td>destination_order</td><td>DestinationOrderQosPolicy</td><td>QosPolicy attached to the Topic</td></tr><tr><td>history</td><td>HistoryQosPolicy</td><td>QosPolicy attached to the Topic</td></tr><tr><td>resource_limits</td><td>ResourceLimitsQosPolicy</td><td>QosPolicy attached to the Topic</td></tr><tr><td>ownership</td><td>OwnershipQosPolicy</td><td>QosPolicy attached to the Topic</td></tr><tr><td>topic_data</td><td>TopicDataQosPolicy</td><td>QosPolicy attached to the Topic</td></tr></table>

# PublicationBuiltinTopicData

The DCPSPublication topic communicates the existence of datawriters by means of the PublicationBuiltinTopicData datatype. Each PublicationBuiltinTopicData sample in a Domain represents a datawriter in that Domain: a new PublicationBuiltinTopicData instance is created when a newly added DataWriter is enabled, and it is disposed when that DataWriter is deleted. An updated PublicationBuiltinTopicData sample is written each time the DataWriter (or the Publisher to which it belongs) modifies a QosPolicy that applies to the entities connected to it. Also will it be updated when the writer looses or regains its liveliness.

The PublicationBuiltinTopicData Topic is also used to return data through the get\_matched\_publication\_data operation on the DataReader as described in Section 3.5.2.13, DDS\_DataReader\_get\_matched\_publication\_data, on page 437.

Table 30: PublicationBuiltinTopicData Members

<table><tr><td>Name</td><td>Type</td><td>Description</td></tr><tr><td>key</td><td>BuiltinTopicKey_t</td><td>Global unique identifier of the DataWriter</td></tr><tr><td>participant_key</td><td>BuiltinTopicKey_t</td><td>Global unique identifier of the Participant to which the DataWriter belongs</td></tr><tr><td>topic_name</td><td>String</td><td>Name of the Topic used by the DataWriter</td></tr><tr><td>type_name</td><td>String</td><td>Type name of the Topic used by the DataWriter</td></tr><tr><td>durability</td><td>DurabilityQosPolicy</td><td>QosPolicy attached to the DataWriter</td></tr><tr><td>deadline</td><td>DeadlineQosPolicy</td><td>QosPolicy attached to the DataWriter</td></tr><tr><td>latency_budget</td><td>LatencyBudgetQosPolicy</td><td>QosPolicy attached to the DataWriter</td></tr><tr><td>liveliness</td><td>LivelinessQosPolicy</td><td>QosPolicy attached to the DataWriter</td></tr><tr><td>reliability</td><td>ReliabilityQosPolicy</td><td>QosPolicy attached to the DataWriter</td></tr><tr><td>lifespan</td><td>LifespanQosPolicy</td><td>QosPolicy attached to the DataWriter</td></tr><tr><td>destination_order</td><td>DestinationOrderQosPolicy</td><td>QosPolicy attached to the DataWriter</td></tr><tr><td>user_data</td><td>UserDataQosPolicy</td><td>QosPolicy attached to the DataWriter</td></tr><tr><td>ownership</td><td>OwnershipQosPolicy</td><td>QosPolicy attached to the DataWriter</td></tr><tr><td>ownership_strength</td><td>OwnershipStrengthQosPolicy</td><td>QosPolicy attached to the DataWriter</td></tr><tr><td>presentation</td><td>PresentationQosPolicy</td><td>QosPolicy attached to the Publisher to which the DataWriter belongs</td></tr><tr><td>partition</td><td>PartitionQosPolicy</td><td>QosPolicy attached to the Publisher to which the DataWriter belongs</td></tr><tr><td>topic_data</td><td>TopicDataQosPolicy</td><td>QosPolicy attached to the Topic used by the DataWriter</td></tr><tr><td>group_data</td><td>GroupDataQosPolicy</td><td>QosPolicy attached to the Publisher to which the DataWriter belongs</td></tr></table>

# SubscriptionBuiltinTopicData

The DCPSSubscription topic communicates the existence of datareaders by means of the SubscriptionBuiltinTopicData datatype. Each SubscriptionBuiltinTopicData sample in a Domain represents a datareader in that Domain: a new SubscriptionBuiltinTopicData instance is created when a newly added DataReader is enabled, and it is disposed when that

DataReader is deleted. An updated SubscriptionBuiltinTopicData sample is written each time the DataReader (or the Subscriber to which it belongs) modifies a QosPolicy that applies to the entities connected to it.

The SubscriptionBuiltinTopicData Topic is also used to return data through the get\_matched\_subscription\_data operation on the DataWriter as described in Section 3.4.2.9, DDS\_DataWriter\_get\_matched\_subscription\_data, on page 326.

Table 31: SubscriptionBuiltinTopicData Members

<table><tr><td>Name</td><td>Type</td><td>Description</td></tr><tr><td>key</td><td>BuiltinTopicKey_t</td><td>Global unique identifier of the DataReader</td></tr><tr><td>participant_key</td><td>BuiltinTopicKey_t</td><td>Global unique identifier of the Participant to which the DataReader belongs</td></tr><tr><td>topic_name</td><td>String</td><td>Name of the Topic used by the DataReader</td></tr><tr><td>type_name</td><td>String</td><td>Type name of the Topic used by the DataReader</td></tr><tr><td>durability</td><td>DurabilityQosPolicy</td><td>QosPolicy attached to the DataReader</td></tr><tr><td>deadline</td><td>DeadlineQosPolicy</td><td>QosPolicy attached to the DataReader</td></tr><tr><td>latency_budget</td><td>LatencyBudgetQosPolicy</td><td>QosPolicy attached to the DataReader</td></tr><tr><td>liveliness</td><td>LivelinessQosPolicy</td><td>QosPolicy attached to the DataReader</td></tr><tr><td>reliability</td><td>ReliabilityQosPolicy</td><td>QosPolicy attached to the DataReader</td></tr><tr><td>ownership</td><td>LifespanQosPolicy</td><td>QosPolicy attached to the DataReader</td></tr><tr><td>destination_order</td><td>DestinationOrderQosPolicy</td><td>QosPolicy attached to the DataReader</td></tr><tr><td>user_data</td><td>UserDataQosPolicy</td><td>QosPolicy attached to the DataReader</td></tr><tr><td>time_based_filter</td><td>TimeBasedFilterQosPolicy</td><td>QosPolicy attached to the DataReader</td></tr><tr><td>presentation</td><td>PresentationQosPolicy</td><td>QosPolicy attached to the Subscriber to which the DataReader belongs</td></tr><tr><td>partition</td><td>PartitionQosPolicy</td><td>QosPolicy attached to the Subscriber to which the DataReader belongs</td></tr><tr><td>topic_data</td><td>TopicDataQosPolicy</td><td>QosPolicy attached to the Topic used by the DataReader</td></tr><tr><td>group_data</td><td>GroupDataQosPolicy</td><td>QosPolicy attached to the Subscriber to which the DataReader belongs</td></tr></table>

# Other builtin topics

![The image shows a standard warning symbol consisting of a red triangle with a thick border pointing upwards. Inside the triangle, centered on a white background, is a black exclamation point.](.vortex-opensplice-c-reference-guide/b0bb2b4162cdcc10504d790e707f347723ec8d82e32ed2645a4178c7490a149f.jpg)

There are a number of other built-in topics that have not been mentioned. These topics (e.g. DCPSDelivery, DCPSHeartbeat and potentially some others) are proprietary and for internal use only. Users are discouraged from doing anything with these topics, so as not to interfere with internal mechanisms that rely on them. The structure of these topics may change without notification.

Appendices

# BIBLIOGRAPHY

# Bibliography

[1] OMG Data Distribution Service Revised Final Adopted Specification ptc/04-03-07, Object Management Group
[2] OMG C Language Mapping Specification formal/99-07-35, Object Management Group (OMG)
[3] OMG The Common Object Request Broker: Architecture and Specification, Version 3.0, formal/02-06-01, Object Management Group

Bibliography

# GLOSSARY

# G l o s s a r y

Acronyms

<table><tr><td>Acronym</td><td>Meaning</td></tr><tr><td>CORBA</td><td>Common Object Request Broker Architecture</td></tr><tr><td>DCPS</td><td>Data Centric Publish/Subscribe</td></tr><tr><td>DDS</td><td>Data Distribution Service</td></tr><tr><td>IDL</td><td>Interface Definition Language</td></tr><tr><td>OMG</td><td>Object Management Group</td></tr><tr><td>ORB</td><td>Object Request Broker</td></tr><tr><td>QoS</td><td>Quality of Service</td></tr><tr><td>SPLICE</td><td>Subscription Paradigm for the Logical Interconnection of Concurrent Engines</td></tr></table>

Glossary

# INDEX

# I n d e x

#

About the C Reference Guide. . . . . . . . . . xxiii

Affected Entities. . . . 577

# B

Basic Usage . . . . . 577

Blocking Behaviour . . . . . . 650

Bibliography . . . . . 673

Blocking Behaviour of a Waitset State Chart . 651

#

C Reference Guide Document Structure . . . . . . . 3

Changeable . . . . . 67

Class DDS\_Condition . . . 143

Class DDS\_ContentFilteredTopic . . . . . 268

Class DDS\_DataReader (abstract) . . . . . . . . . . 421

Class DDS\_DataSample. . . . 505

Class DDS\_DataWriter (abstract) . . . . . . . . . . 317

Class DDS\_DomainEntity (abstract) . . . . . . . . . 59

Class DDS\_DomainParticipant . . . . . . . . . . . . 161

Class DDS\_DomainParticipantFactory . . . . . . 220

Class DDS\_Entity (abstract). . . . . . 52

Class DDS\_GuardCondition . . 145

Class DDS\_MultiTopic . . . . . 273

Class DDS\_Publisher . . . . 290

Class DDS\_QueryCondition . . . . . . . . . . 529

Class DDS\_ReadCondition . . . . 525

Class DDS\_StatusCondition . . . . . . . . 148

Class DDS\_Subscriber . . . . 392

Class DDS\_Topic. . . . . . 258

Class DDS\_TopicDescription (abstract) . . . . . 255

Class DDS\_TypeSupport (abstract) . . . . . . . . . 283

Class DDS\_WaitSet . . . . 136

Class Model of the DCPS Topic-Definition Module . 254

Class SPACE\_FooDataReader. . . . . . . . . . . 465

Class SPACE\_FooDataWriter . . . . 345

Class SPACE\_FooTypeSupport. . . . . . 285

Communication Status . . 641

Communication Status Event . . . . . . . 643

Complex Topics . . . . . 654

Conditions and waitsets . . . 647

Contacts . . . xxv

# D

Data Distribution Service Defined Type . . . . . . 11

Data Distribution Service IDL Keywords . . . . 654

Data Distribution Service IDL Pragma Keylist 655

Data Distribution Service IDL Subset in BNF Notation . . . 655

Data Type “Foo” Typed Classes Pre-processor Generation . . . . . 46

DCPS DDS\_Conditions . . . . . . . . . . . 144, 650

DCPS DDS\_Status Values . . . . . 120

DCPS DDS\_WaitSets. . . . . 136, 648

DCPS Domain Module’s Class Model. . . . 44, 161

DCPS Infrastructure Module’s Class Model 42, 52

DCPS Inheritance. . . . 639

DCPS Listeners . . . . 117, 647

DCPS Module Composition. . . . . 41

DCPS Publication Module’s Class Model . . . . . 47

DCPS Subscription Module’s Class Model . . . . 48

DCPS Topic-Definition Module’s Class Model 45

DDS\_\_\_alloc . . . . 19

DDS\_\_\_alloc . . . 18

DDS\_\_\_alloc . . . 20

DDS\_\_allocbuf. . . . 18

DDS\_Condition\_get\_trigger\_value . . . . . . . . . 144

DDS\_ContentFilteredTopic\_get\_expression\_para

meters . . 270

DDS\_ContentFilteredTopic\_get\_filter\_expression 271

DDS\_ContentFilteredTopic\_get\_name (inherited) 271

DDS\_ContentFilteredTopic\_get\_participant (inherited) . . . . 272

DDS\_ContentFilteredTopic\_get\_related\_topic 272

DDS\_ContentFilteredTopic\_get\_type\_name (inherited). . . 273

DDS\_ContentFilteredTopic\_set\_expression\_para meters . . 273

DDS\_DataReader . . . . 645

DDS\_DataReader\_create\_querycondition . . . 427

DDS\_DataReader\_create\_readcondition . . . . 428

DDS\_DataReader\_delete\_contained\_entities . 430

DDS\_DataReader\_delete\_readcondition . . . . 432

DDS\_DataReader\_enable (inherited) . . . . . . . 434

DDS\_DataReader\_get\_key\_value (abstract). . 435

DDS\_DataReader\_get\_listener . . . . . . . . . . 436

DDS\_DataReader\_get\_liveliness\_changed\_status 436

DDS\_DataReader\_get\_matched\_publication\_data 437

DDS\_DataReader\_get\_matched\_publications 439

DDS\_DataReader\_get\_qos . . . . . . 441

DDS\_DataReader\_get\_requested\_deadline\_misse d\_status. . . 442

DDS\_DataReader\_get\_requested\_incompatible\_q os\_status . . 443

DDS\_DataReader\_get\_sample\_lost\_status. . . 444

DDS\_DataReader\_get\_sample\_rejected\_status446

DDS\_DataReader\_get\_status\_changes (inherited) 447

DDS\_DataReader\_get\_statuscondition (inherited) 447

DDS\_DataReader\_get\_subscriber. . . . . . . . . . 447

DDS\_DataReader\_get\_subscription\_match\_status 448

DDS\_DataReader\_get\_topicdescription . . . . . 449

DDS\_DataReader\_lookup\_instance (abstract) 336, 450

DDS\_DATAREADER\_QOS\_DEFAULT . . . 581

DDS\_DataReader\_read (abstract) . . . . . . . . . . 450

DDS\_DataReader\_read\_instance (abstract) . . 451

DDS\_DataReader\_read\_next\_instance (abstract). 451

DDS\_DataReader\_read\_next\_instance\_w\_conditi on (abstract) . . . 452

DDS\_DataReader\_read\_next\_sample (abstract). . 452

DDS\_DataReader\_read\_w\_condition (abstract). . 452

DDS\_DataReader\_return\_loan (abstract) . . . . 453

DDS\_DataReader\_set\_listener . . . 454

DDS\_DataReader\_set\_qos . . . . . 457

DDS\_DataReader\_take (abstract) . . . . . . . 458

DDS\_DataReader\_take\_instance (abstract) . . 459

DDS\_DataReader\_take\_next\_instance (abstract) . 459

DDS\_DataReader\_take\_next\_instance\_w\_conditi on (abstract) . . . 460

DDS\_DataReader\_take\_next\_sample (abstract). . 460

DDS\_DataReader\_take\_w\_condition (abstract) . . 461

DDS\_DataReader\_wait\_for\_historical\_data. . 461

DDS\_DataReaderListener. . . . . 38

DDS\_DataReaderListener interface . . . . . . . . 516

DDS\_DataReaderListener\_\_alloc. . . . . . 517

DDS\_DataReaderListener\_on\_data\_available (abstract) . . 518

DDS\_DataReaderListener\_on\_liveliness\_changed (abstract) . 519

DDS\_DataReaderListener\_on\_requested\_deadline \_missed (abstract) . . 520

DDS\_DataReaderListener\_on\_requested\_incomp atible\_qos (abstract) . . . . 521

DDS\_DataReaderListener\_on\_sample\_lost (abstract) . . 522

DDS\_DataReaderListener\_on\_sample\_rejected (abstract) . . 522

DDS\_DataReaderListener\_on\_subscription\_matc h (abstract) . . . 523

DDS\_DataReaderQos . . . . . . 579

DDS\_DataWriter\_assert\_liveliness . . . . . . . . 321

DDS\_DataWriter\_dispose (abstract). . . . . . . . 323

DDS\_DataWriter\_dispose\_w\_timestamp (abstract) . . 323, 345

DDS\_DataWriter\_enable (inherited) . . . . . . . 323

DDS\_DataWriter\_get\_key\_value (abstract). . . 324

DDS\_DataWriter\_get\_listener . . . . . 324

DDS\_DataWriter\_get\_liveliness\_lost\_status . . 324

DDS\_DataWriter\_get\_matched\_subscription\_data 326

DDS\_DataWriter\_get\_matched\_subscriptions. 327

DDS\_DataWriter\_get\_offered\_deadline\_missed\_s tatus . . .329

DDS\_DataWriter\_get\_offered\_incompatible\_qos\_ status . . 330

DDS\_DataWriter\_get\_publication\_match\_status . 332

DDS\_DataWriter\_get\_publisher . . . . . . . . . . . 333

DDS\_DataWriter\_get\_qos . . . . . . 334

DDS\_DataWriter\_get\_status\_changes (inherited) . 335

DDS\_DataWriter\_get\_statuscondition (inherited) . 335

DDS\_DataWriter\_get\_topic . . . . . . . . 335

DDS\_DATAWRITER\_QOS\_DEFAULT . . . .584

DDS\_DataWriter\_register\_instance (abstract). 336

DDS\_DataWriter\_register\_instance\_w\_timestamp (abstract) . . .337

DDS\_DataWriter\_set\_listener . . . . . . . . . . 337

DDS\_DataWriter\_set\_qos . . . . . . 339

DDS\_DataWriter\_unregister\_instance (abstract). . 341

DDS\_DataWriter\_unregister\_instance\_w\_timesta mp (abstract) . . .341

DDS\_DataWriter\_write (abstract) . . . . . . . . . . 344

DDS\_DataWriter\_write\_w\_timestamp (abstract) . 344

DDS\_DataWriterListener . . . . 35

DDS\_DataWriterListener interface . . . . . . . . . 385

DDS\_DataWriterListener\_\_alloc . . . . . . 386

DDS\_DataWriterListener\_on\_liveliness\_lost (abstract) . . . 387

DDS\_DataWriterListener\_on\_offered\_deadline missed (abstract) . . .388

DDS\_DataWriterListener\_on\_offered\_incompatib le\_qos (abstract) . . . 389

DDS\_DataWriterListener\_on\_publication\_match (abstract) . .390

DDS\_DataWriterQos . . . . 582

dds\_dcps.idl . . . 599

DDS\_DeadlineQosPolicy. . . . . . . . . . . . 69, 70, 84

DDS\_DestinationOrderQosPolicy . . . . . . . . . . 71

DDS\_DomainParticipant\_assert\_liveliness . . . 166

DDS\_DomainParticipant\_contains\_entity . . . . 167

DDS\_DomainParticipant\_create\_contentfilteredto pic . . 168

DDS\_DomainParticipant\_create\_multitopic . . 169

DDS\_DomainParticipant\_create\_publisher . . . 171

DDS\_DomainParticipant\_create\_subscriber . . 174

DDS\_DomainParticipant\_create\_topic . . . . . . 177

DDS\_DomainParticipant\_delete\_contained\_entiti es . . 179

DDS\_DomainParticipant\_delete\_contentfilteredto pic . . . 181

DDS\_DomainParticipant\_delete\_multitopic . . 183

DDS\_DomainParticipant\_delete\_publisher . . . 184

DDS\_DomainParticipant\_delete\_subscriber . . 185

DDS\_DomainParticipant\_delete\_topic . . . . . . 186

DDS\_DomainParticipant\_enable (inherited) . . 188

DDS\_DomainParticipant\_find\_topic . . . . . . . . 188

DDS\_DomainParticipant\_get\_builtin\_subscriber . 190

DDS\_DomainParticipant\_get\_current\_time . . 190

DDS\_DomainParticipant\_get\_default\_publisher qos . . . 192

DDS\_DomainParticipant\_get\_default\_subscriber\_ qos . . . 193

DDS\_DomainParticipant\_get\_default\_topic\_qos . 195

DDS\_DomainParticipant\_get\_discovered\_particip ant\_data . . . 198

DDS\_DomainParticipant\_get\_discovered\_particip ants . 196

DDS\_DomainParticipant\_get\_discovered\_topic\_d ata . . . 201

DDS\_DomainParticipant\_get\_discovered\_topics . 199

DDS\_DomainParticipant\_get\_domain\_id . . . . 202

DDS\_DomainParticipant\_get\_listener . . . . . . . 203

DDS\_DomainParticipant\_get\_qos . . . . . . . . . . 204

DDS\_DomainParticipant\_get\_status\_changes (inherited) . . . 205

DDS\_DomainParticipant\_get\_statuscondition (inherited) . . . 205

DDS\_DomainParticipant\_ignore\_participant . 205

DDS\_DomainParticipant\_ignore\_publication 206

DDS\_DomainParticipant\_ignore\_subscription 206

DDS\_DomainParticipant\_ignore\_topic . . . . . 206

DDS\_DomainParticipant\_lookup\_topicdescriptio n . 206

DDS\_DomainParticipant\_set\_default\_publisher\_q os . 207

DDS\_DomainParticipant\_set\_default\_subscriber qos . 209

DDS\_DomainParticipant\_set\_default\_topic\_qos . 210

DDS\_DomainParticipant\_set\_listener . . . . . . 212

DDS\_DomainParticipant\_set\_qos. . . . . . . . . . 215

DDS\_DomainParticipantFactory\_create\_participa nt. . 221

DDS\_DomainParticipantFactory\_delete\_participa nt. . 225

DDS\_DomainParticipantFactory\_get\_default\_part icipant\_qos . . . 226

DDS\_DomainParticipantFactory\_get\_instance 227

DDS\_DomainParticipantFactory\_lookup\_particip ant . . . 229

DDS\_DomainParticipantFactory\_set\_default\_part icipant\_qos . . . 230

DDS\_DomainParticipantListener . . . . . . . . . . . 27

DDS\_DomainParticipantListener interface. . . 239

DDS\_DomainParticipantListener\_\_alloc . . . . 242

DDS\_DomainParticipantListener\_on\_data\_availa ble (inherited, abstract) . 243

DDS\_DomainParticipantListener\_on\_data\_on\_rea ders (inherited, abstract). . . 243

DDS\_DomainParticipantListener\_on\_inconsistent \_topic (inherited, abstract) . . . 243

DDS\_DomainParticipantListener\_on\_liveliness\_c hanged (inherited, abstract) . . . . 243

DDS\_DomainParticipantListener\_on\_liveliness\_l ost (inherited, abstract). . . 244

DDS\_DomainParticipantListener\_on\_offered\_dea dline\_missed (inherited, abstract) . . . . . . 244

DDS\_DomainParticipantListener\_on\_offered\_inc ompatible\_qos (inherited, abstract) . . . . . 244

DDS\_DomainParticipantListener\_on\_publication \_match (inherited, abstract) . . . 245

DDS\_DomainParticipantListener\_on\_requested\_d eadline\_missed (inherited, abstract). . . . . 245

DDS\_DomainParticipantListener\_on\_requested\_i ncompatible\_qos (inherited, abstract) . . . 245

DDS\_DomainParticipantListener\_on\_sample\_lost (inherited, abstract) 246

DDS\_DomainParticipantListener\_on\_sample\_reje cted (inherited, abstract) . 246

DDS\_DomainParticipantListener\_on\_subscription \_match (inherited, abstract) . . . 246

DDS\_DomainParticipantQos . . . . . . . . . . . . 585

DDS\_DurabilityQosPolicy . . . 73

DDS\_DurabilityServiceQosPolicy . . . . . . . . . . 76

DDS\_Entity\_enable . 54

DDS\_Entity\_get\_instance\_handle . . . . . . . . . . 55

DDS\_Entity\_get\_listener (abstract) . . . . . . . . . 56

DDS\_Entity\_get\_qos (abstract) . . . . 56

DDS\_Entity\_get\_status\_changes . . . . 57

DDS\_Entity\_get\_statuscondition . . . . 58

DDS\_Entity\_set\_listener (abstract). . . . . . . . . . 59

DDS\_Entity\_set\_qos (abstract). . . . . 59

DDS\_EntityFactoryQosPolicy . . . . . . . . . . . . 79

DDS\_free . . . 21

DDS\_GroupDataQosPolicy . . . 80

DDS\_GuardCondition\_\_alloc. . . 146

DDS\_GuardCondition\_get\_trigger\_value (inherited). . 147

DDS\_GuardCondition\_set\_trigger\_value. . . . 147

DDS\_HistoryQosPolicy . . . 80

DDS\_InconsistentTopicStatus . . . 122

DDS\_LatencyBudgetQosPolicy . . . . 83

DDS\_LifespanQosPolicy . . . . . 84

DDS\_Listener interface. . 116

DDS\_LivelinessChangedStatus . . . . . . . . . . 122

DDS\_LivelinessLostStatus . . 124

DDS\_LivelinessQosPolicy . . . . . . . . . . . . . 85, 87

DDS\_MultiTopic\_get\_expression\_parameters 274

DDS\_MultiTopic\_get\_name (inherited) . . . . . 275

DDS\_MultiTopic\_get\_participant (inherited). 276

DDS\_MultiTopic\_get\_subscription\_expression. . 276

DDS\_MultiTopic\_get\_type\_name (inherited) 277

DDS\_MultiTopic\_set\_expression\_parameters 277

DDS\_OfferedDeadlineMissedStatus . . . . . . . 125

DDS\_OfferedIncompatibleQosStatus . . . . . . . 126

DDS\_OwnershipQosPolicy . . . . . . . . . . . 87, 631

DDS\_OwnershipStrengthQosPolicy . . . . . . . . . 90

DDS\_PARTICIPANT\_QOS\_DEFAULT 586, 587

DDS\_PartitionQosPolicy . . . . . 91

DDS\_PresentationQosPolicy . . . . . . . . . . . 92

DDS\_PublicationMatchStatus . . . . 128

DDS\_Publisher\_begin\_coherent\_changes . . . . 292

DDS\_Publisher\_copy\_from\_topic\_qos . . . . . . 294

DDS\_Publisher\_create\_datawriter . . . . . . . . . . 295

DDS\_Publisher\_delete\_contained\_entities . . . 299

DDS\_Publisher\_delete\_datawriter . . . . . . . . . . 300

DDS\_Publisher\_enable (inherited). . . . . . . . . . 301

DDS\_Publisher\_end\_coherent\_changes. . . . . . 301

DDS\_Publisher\_get\_default\_datawriter\_qos . . 302

DDS\_Publisher\_get\_listener . . . . . . 304

DDS\_Publisher\_get\_participant . . . . . . . . . . . . 304

DDS\_Publisher\_get\_qos. . . . . 305

DDS\_Publisher\_get\_status\_changes (inherited) . . 306

DDS\_Publisher\_get\_statuscondition (inherited) . . 306

DDS\_Publisher\_lookup\_datawriter . . . . . . . . . 306

DDS\_PUBLISHER\_QOS\_DEFAULT . . . . . .589

DDS\_Publisher\_resume\_publications . . . . . . . 307

DDS\_Publisher\_set\_default\_datawriter\_qos . . 308

DDS\_Publisher\_set\_listener. . . . 310

DDS\_Publisher\_set\_qos . . . . . 312

DDS\_Publisher\_suspend\_publications. . . . . . . 314

DDS\_PublisherListener . . . 34

DDS\_PublisherListener interface. . . . . . 380

DDS\_PublisherListener\_\_alloc . . . . 383

DDS\_PublisherListener\_on\_liveliness\_lost (inherited, abstract) . . . . 383

DDS\_PublisherListener\_on\_offered\_deadline\_mi ssed (inherited, abstract) . .384

DDS\_PublisherListener\_on\_offered\_incompatible \_qos (inherited, abstract) . . . . 384

DDS\_PublisherListener\_on\_publication\_match (inherited, abstract) . . . 384

DDS\_PublisherQos. . . . . 588

DDS\_QueryCondition\_get\_datareader (inherited). 530

DDS\_QueryCondition\_get\_instance\_state\_mask (inherited) . . 530

DDS\_QueryCondition\_get\_query\_arguments .531

DDS\_QueryCondition\_get\_query\_expression.532

DDS\_QueryCondition\_get\_sample\_state\_mask

(inherited) . . . . . . . 532

DDS\_QueryCondition\_get\_trigger\_value (inherited) . . 533

DDS\_QueryCondition\_get\_view\_state\_mask (inherited) . . . 533

DDS\_QueryCondition\_set\_query\_arguments . 533

DDS\_ReadCondition\_get\_datareader . . . . . . . 526

DDS\_ReadCondition\_get\_instance\_state\_mask . . 526

DDS\_ReadCondition\_get\_sample\_state\_mask 527

DDS\_ReadCondition\_get\_trigger\_value (inherited) . . 528

DDS\_ReadCondition\_get\_view\_state\_mask . . 528

DDS\_ReaderDataLifecycleQosPolicy . . . . . . . . 99

DDS\_ReliabilityQosPolicy . . 102

DDS\_RequestedDeadlineMissedStatus . . . . . . 129

DDS\_RequestedIncompatibleQosStatus . . . . . 130

DDS\_ResourceLimitsQosPolicy . . . . . . 104

DDS\_SampleInfo . . . . 506

DDS\_SampleLostStatus. . . . 132

DDS\_SampleRejectedStatus . . . . . . 133

DDS\_sequence\_get\_release . . . . 17

DDS\_sequence\_set\_release . . . 16

DDS\_StatusCondition\_get\_enabled\_statuses . 149

DDS\_StatusCondition\_get\_entity . . . . . . . 151

DDS\_StatusCondition\_get\_trigger\_value (inherited) . . 151

DDS\_StatusCondition\_set\_enabled\_statuses. . 152

DDS\_string\_alloc . . . . . 20

DDS\_Subscriber. . . . . 645

DDS\_Subscriber Statecraft for a Read Communication Status . 646

DDS\_Subscriber\_begin\_access . . . . . . . . . . . 395

DDS\_Subscriber\_copy\_from\_topic\_qos . . . . . 396

DDS\_Subscriber\_create\_datareader. . . . . . . . . 398

DDS\_Subscriber\_delete\_contained\_entities . . 401

DDS\_Subscriber\_delete\_datareader. . . . . . . . . 403

DDS\_Subscriber\_enable (inherited) . . . . . . . . 404

DDS\_Subscriber\_end\_access. . . . 405

DDS\_Subscriber\_get\_datareaders . . . . . . . . . . 406

DDS\_Subscriber\_get\_default\_datareader\_qos. 408

DDS\_Subscriber\_get\_listener . . . . 409

DDS\_Subscriber\_get\_participant. . . . . . . 410

DDS\_Subscriber\_get\_qos . . . . 411

DDS\_Subscriber\_get\_status\_changes (inherited) .

412

DDS\_Subscriber\_get\_statuscondition (inherited). 412

DDS\_Subscriber\_lookup\_datareader . . . . . . . 412

DDS\_Subscriber\_notify\_datareaders . . . . . . . 413

DDS\_SUBSCRIBER\_QOS\_DEFAULT . . . 590

DDS\_Subscriber\_set\_default\_datareader\_qos 414

DDS\_Subscriber\_set\_listener . . . 416

DDS\_Subscriber\_set\_qos . . . . . 419

DDS\_SubscriberListener. . . 36

DDS\_SubscriberListener\_\_alloc . . . . . . . . . . . 512

DDS\_SubscriberListener\_on\_data\_available (inherited, abstract) . 513

DDS\_SubscriberListener\_on\_data\_on\_readers (abstract). . . 513

DDS\_SubscriberListener\_on\_liveliness\_changed (inherited, abstract) . . 514

DDS\_SubscriberListener\_on\_requested\_deadline \_missed (inherited, abstract) . 514

DDS\_SubscriberListener\_on\_requested\_incompat ible\_qos (inherited, abstract) . . 515

DDS\_SubscriberListener\_on\_sample\_lost (inherited, abstract) . 515

DDS\_SubscriberListener\_on\_sample\_rejected (inherited, abstract) . . 515

DDS\_SubscriberListener\_on\_subscription\_match (inherited, abstract) . . 515

DDS\_SubscriberQos . . . 589

DDS\_SubscriptionMatchStatus. . . 134

DDS\_TimeBasedFilterQosPolicy . . . . . . . . . . 107

DDS\_Topic Definition Example. . . . . . . 653

DDS\_Topic\_enable (inherited) . . . . . . . . . . . . 259

DDS\_Topic\_get\_inconsistent\_topic\_status . . 260

DDS\_Topic\_get\_listener. . . . 261

DDS\_Topic\_get\_name (inherited) . . . . . . . . . 261

DDS\_Topic\_get\_participant (inherited) . . . . . 261

DDS\_Topic\_get\_qos. . . . . 262

DDS\_Topic\_get\_status\_changes (inherited). . 263

DDS\_Topic\_get\_statuscondition (inherited) . 263

DDS\_Topic\_get\_type\_name (inherited) . . . . . 263

DDS\_TOPIC\_QOS\_DEFAULT . . . . . . . . . . . 592

DDS\_Topic\_set\_listener . . . 263

DDS\_Topic\_set\_qos . . . . . 265

DDS\_TopicDataQosPolicy . . . 108

DDS\_TopicDescription\_get\_name . . . . . . . . . 256

DDS\_TopicDescription\_get\_participant. . . . . 256

DDS\_TopicDescription\_get\_type\_name . . . . 257

DDS\_TopicListener . . . . 32

DDS\_TopicListener interface . . . . . . . . 278

DDS\_TopicListener\_\_alloc . . . 279

DDS\_TopicListener\_on\_inconsistent\_topic (abstract) . . 280

DDS\_TopicQos. . . . 590

DDS\_TransportPriorityQosPolicy . . . . . . . . . 109

DDS\_TypeSupport\_\_alloc (abstract) . . . . . . . 284

DDS\_TypeSupport\_get\_type\_name (abstract) 284

DDS\_TypeSupport\_register\_type (abstract). . 284

DDS\_UserDataQosPolicy . . . . . . . 110

DDS\_WaitSet\_\_alloc . . . 137

DDS\_WaitSet\_attach\_condition . . . . . . . . 137

DDS\_WaitSet\_detach\_condition . . . . . . . . . . 139

DDS\_WaitSet\_get\_conditions . . . . . . . . . 140

DDS\_WaitSet\_wait. . 141

DDS\_WriterDataLifecycleQosPolicy . . . . . . . 110

Default attributes. . 65

Document Structure 3

Domain Module . . . 43, 161

# F

Functionality . . . . . . 41

# I

IDL Mapping Rules for Sequences . . . . . . . . .

IDL Pre-processor . . . 654

IDL to Host Language Mapping . . . . . . . . . . . 654

Infrastructure Module . . . . . 42, 52

Inheritance of Abstract Operations . . . . . 40

instance\_state . . . . 631

# L

Listeners . . . . 646

Listeners Interfaces . . . 22

# M

Memory Management . .

# O

Operations. . . . . . . . 4

Operations Concerning States . . . . . . . . . . . . . 635

# P

Plain Communication Status State Chart . . . . . 644

Plain Sequences . . . 11

Pre-defined Bit Mask Definitions. . . . . . . . . . . 634

Pre-processor Generation of the Typed Classes for

Data Type “Foo” . . . . 255

Publication Module . . . . 46, 289

Publication Type Specific Classes . . . . . . . . . . 317

# Q

QosPolicy Basics . . 67

QosPolicy Default Attributes . . 65

QosPolicy Objects . . . . . . 12

QosPolicy Settings . . . . . . . 61

# R

read . . . 635

Read Communication Status sDDS\_DataReader Statecraft . . . 645

read\_instance . . . . 637

read\_next\_sample . . . . . 636

read\_w\_condition . . . . . 636

Requested Offered PresentationQosPolicy. . . . . 98

Requested/Offered . . . . 61

Requested/Offered

DDS\_DestinationOrderQosPolicy . . . . . . . 72

Requested/Offered DDS\_DurabilityQosPolicy . 75

Requested/Offered DDS\_ReliabilityQosPolicy 89, 104

Resources and operations . . . . . . 12

Return Codes . . .

Return Value . . . 299

RxO . . 66

# S

sample\_state . . . . . 629

SampleInfo Class . . . . 629

Sequences . . 11

Sequences DDS\_ . 13

Sequences Embeded in QosPolicy Objects . . . . 12

Sequences Embeded in Status Objects . . . . . . . . 12

Signal Handling . . . . . . . 8

Snapshot . . . . . . 632, 633

SPACE\_FooDataReader\_create\_querycondition (inherited) . . . 471

SPACE\_FooDataReader\_create\_readcondition (inherited) . . . 471

SPACE\_FooDataReader\_delete\_contained\_entitie s (inherited) . . . 472

SPACE\_FooDataReader\_delete\_readcondition (inherited). . . 472

SPACE\_FooDataReader\_enable (inherited) . . 472

SPACE\_FooDataReader\_get\_key\_value . . . . 472

SPACE\_FooDataReader\_get\_listener (inherited). 474

SPACE\_FooDataReader\_get\_liveliness\_changed status (inherited). . . 474

SPACE\_FooDataReader\_get\_matched\_publicatio n\_data (inherited) . . . 474

SPACE\_FooDataReader\_get\_matched\_publicatio ns (inherited) . 474

SPACE\_FooDataReader\_get\_qos (inherited) . 475

SPACE\_FooDataReader\_get\_requested\_deadline \_missed\_status (inherited) . . 475

SPACE\_FooDataReader\_get\_requested\_incompat ible\_qos\_status (inherited) . . 475

SPACE\_FooDataReader\_get\_sample\_lost\_status (inherited). . . 476

SPACE\_FooDataReader\_get\_sample\_rejected\_sta tus (inherited) . . . 476

SPACE\_FooDataReader\_get\_status\_changes (inherited). . . 476

SPACE\_FooDataReader\_get\_statuscondition (inherited). . . 476

SPACE\_FooDataReader\_get\_subscriber (inherited). . . 477

SPACE\_FooDataReader\_get\_subscription\_match \_status (inherited). . . 477

SPACE\_FooDataReader\_get\_topicdescription (inherited). . . 477

SPACE\_FooDataReader\_read . . . . . . . . . . 478

SPACE\_FooDataReader\_read\_instance . . . . . 483

SPACE\_FooDataReader\_read\_next\_instance 485

SPACE\_FooDataReader\_read\_next\_instance\_w condition. 488

SPACE\_FooDataReader\_read\_next\_sample . 490

SPACE\_FooDataReader\_read\_w\_condition . 490

SPACE\_FooDataReader\_return\_loan. . . . . . . 492

SPACE\_FooDataReader\_set\_listener (inherited) . 494

SPACE\_FooDataReader\_set\_qos (inherited) . 495

SPACE\_FooDataReader\_take. . . . 495

SPACE\_FooDataReader\_take\_instance . . . . . 497

SPACE\_FooDataReader\_take\_next\_sample . 503

SPACE\_FooDataReader\_take\_w\_condition . 503

SPACE\_FooDataReader\_wait\_for\_historical\_data (inherited). . 505

SPACE\_FooDataWriter\_assert\_liveliness (inherited). . 349

SPACE\_FooDataWriter\_dispose . . . . . . . . . . 349

SPACE\_FooDataWriter\_dispose\_w\_timestamp . 353, 380

SPACE\_FooDataWriter\_enable (inherited) . . 355

SPACE\_FooDataWriter\_get\_key\_value. . . . . 355

SPACE\_FooDataWriter\_get\_listener (inherited) . 356

SPACE\_FooDataWriter\_get\_liveliness\_lost\_statu s (inherited) . . 357

SPACE\_FooDataWriter\_get\_matched\_subscriptio n\_data (inherited) . . 357

SPACE\_FooDataWriter\_get\_matched\_subscriptio ns (inherited) . 357

SPACE\_FooDataWriter\_get\_offered\_deadline\_mi ssed\_status (inherited) . . 357

SPACE\_FooDataWriter\_get\_offered\_incompatibl e\_qos\_status (inherited) . . 358

SPACE\_FooDataWriter\_get\_publication\_match\_s tatus (inherited) . . 358

SPACE\_FooDataWriter\_get\_publisher (inherited) 358

SPACE\_FooDataWriter\_get\_qos (inherited) . 358

SPACE\_FooDataWriter\_get\_status\_changes (inherited). . 359

SPACE\_FooDataWriter\_get\_statuscondition (inherited). . 359

SPACE\_FooDataWriter\_get\_topic (inherited) 359

SPACE\_FooDataWriter\_register\_instance. . . 359

SPACE\_FooDataWriter\_register\_instance\_w\_tim estamp . . 363

SPACE\_FooDataWriter\_set\_listener (inherited) . 364

SPACE\_FooDataWriter\_set\_qos (inherited) . 365

SPACE\_FooDataWriter\_unregister\_instance. 365

SPACE\_FooDataWriter\_unregister\_instance\_w\_ti mestamp . . . 369

SPACE\_FooDataWriter\_write . . . . . . . . . . . . 371

SPACE\_FooDataWriter\_write\_w\_timestamp 375

SPACE\_FooTypeSupport\_\_alloc . . . . . . . . . . 285

SPACE\_FooTypeSupport\_get\_type\_name. . . 286

SPACE\_FooTypeSupport\_register\_type . . . . .287
SQL Examples . . . . . 661
SQL Grammar in BNF . . . . 659
SQL Token Expression. . . . . . 660
Standard Defined Type. . . . . 10
State Chart of the instance\_state for a Single Instance . . . 632
State Chart of the sample\_state for a Single Sample 630
State Chart of the view\_state for a Single Instance 633
State Definitions . . . . 634

State Masks . . 634
State per Sample. . . . . 630
Status Description Per DDS\_Entity . . . . . . . . 118
Status Objects . . . . . 12
Status Per DDS\_Entity . . . . . 148
Struct DDS\_Listener . . . 24
Struct DDS\_SampleInfo. . . . . 506
Struct DDS\_Status . . . 117
Struct QosPolicy. . . . . . . 59
Subscription Module . . . 48, 391
Subscription Type Specific Classes . . . . . . . . . 420

# T

take . . . 636
take\_next\_instance . . . . 499
take\_next\_sample . . . . . 636
take\_w\_condition . . . . 636
The DCPS Publication Module’s Class Model 289
The DCPS Subscription Module’s Class Model . . 391

Thread Safety . . . . . . . 8
Topic-Definition Module . . . . . 44, 254
Topic-Definition type specific classes . . . . . . . 283
Trigger State of the DDS\_GuardCondition . . . 652
Trigger State of the DDS\_ReadCondition and DDS\_QueryCondition. . . 651
Trigger State of the DDS\_StatusCondition . . . 651

# U

User Defined Type . . . . . 10

# V

view\_state . . . . . . 632

Index
[🔗 Link to the original document](.vortex-opensplice-c-reference-guide/vortex-opensplice-c-reference-guide.pdf)
