DCPS API Reference

The DCPS (Data-Centric Publish-Subscribe) API is the main interface for DDS applications.

Core Entities

DomainParticipant

Entry point for DDS applications.

auto participant = astutedds::dcps::DomainParticipantFactory::create_participant(
    domain_id,
    PARTICIPANT_QOS_DEFAULT
);

Topic

Named data channel.

auto topic = participant->create_topic<DataType>(
    "TopicName",
    TOPIC_QOS_DEFAULT
);

Publisher / DataWriter

Publish data to topics.

auto publisher = participant->create_publisher();
auto writer = publisher->create_datawriter(topic, DATAWRITER_QOS_DEFAULT);
writer->write(sample);

Subscriber / DataReader

Subscribe to topic data.

auto subscriber = participant->create_subscriber();
auto reader = subscriber->create_datareader(topic, DATAREADER_QOS_DEFAULT);

std::vector<DataType> samples;
reader->take(samples);

QoS Policies

See QoS Documentation for details.

Header Files

  • <astutedds/dcps/domain_participant.hpp>
  • <astutedds/dcps/topic.hpp>
  • <astutedds/dcps/publisher.hpp>
  • <astutedds/dcps/subscriber.hpp>
  • <astutedds/dcps/data_writer.hpp>
  • <astutedds/dcps/data_reader.hpp>
  • <astutedds/dcps/qos.hpp>