2.2.1.2.概念大纲
2.2.1.2.1.概述
图 2‑1 概述
Information flows with the aid of the following constructs[1]: Publisher and DataWriter on the sending side; Subscriber and DataReader on the receiving side.
信息通过在发送方的Publisher、DataWriter和在接收方的Subscriber、DataReader进行流动。
- A Publisher is an object responsible for data distribution. It may publish data of different data types. A DataWriter acts as a typed[2] accessor to a publisher. The DataWriter is the object the application must use to communicate to a publisher the existence and value of data-objects of a given type. When data-object values have been communicated to the publisher through the appropriate data-writer, it is the publisher’s responsibility to perform the distribution (the publisher will do this according to its own QoS, or the QoS attached to the corresponding data-writer). A publication is defined by the association of a data-writer to a publisher. This association expresses the intent of the application to publish the data described by the data-writer in the context provided by the publisher.
- 发布者(Publisher)是负责数据分发的对象。 它可以发布不同数据类型的数据。 DataWriter充当发布者的类型化访问者。 DataWriter是应用程序必须用来与发布者通信的对象,通信内容包括给定类型的数据对象是否存在和其值。 当数据对象值通过适当的DataWriter传送给发布者时,发布者有责任执行数据分发(发布者将根据其自己的QoS或附加到相应DataWriter的QoS来执行此操作)。一次发布由DataWriter与发布者的关联来定义。 该关联表达了应用程序在由发布者提供的上下文中发布由DataWriter描述的数据的意图。
- A Subscriber is an object responsible for receiving published data and making it available (according to the Subscriber’s QoS) to the receiving application. It may receive and dispatch data of different specified types. To access the received data, the application must use a typed DataReader attached to the subscriber. Thus, a subscription is defined by the association of a data-reader with a subscriber. This association expresses the intent of the application to subscribe to the data described by the data-reader in the context provided by the subscriber.
- 订阅者(Subscriber)是负责接收发布的数据并将其提供给准备接收的应用程序(根据订阅者的QoS)的对象。 它可以接收和分发指定的不同类型的数据。 要访问收到的数据,应用程序必须使用附加到订阅者的类型化的DataReader。 因此,订阅是通过数据DataReader与订阅者的关联来定义的。 该关联表达了应用程序在用户提供的上下文中订阅由DataReader的数据的意图。
Topic objects conceptually fit between publications and subscriptions. Publications must be known in such a way that subscriptions can refer to them unambiguously. A Topic is meant to fulfill that purpose: it associates a name (unique in the domain[3]), a data-type, and QoS related to the data itself. In addition to the topic QoS, the QoS of the DataWriter associated with that Topic and the QoS of the Publisher associated to the DataWriter control the behavior on the publisher’s side, while the corresponding Topic, DataReader, and Subscriber QoS control the behavior on the subscriber’s side.
主题对象在概念上适合发布和订阅。 发布必须以一种方式公布,以让订阅可以明确地引用它们。 主题旨在实现该目的:它将名称(域中唯一)、数据类型以及与数据本身相关的QoS相关联。 除了主题QoS之外,与该Topic关联的DataWriter的QoS以及与DataWriter关联的Publisher的QoS控制发布方的行为,而相应的Topic、DataReader和Subscriber的QoS控制订阅方的行为 侧。
When an application wishes to publish data of a given type, it must create a Publisher (or reuse an already created one) and a DataWriter with all the characteristics of the desired publication. Similarly, when an application wishes to receive data, it must create a Subscriber (or reuse an already created one) and a DataReader to define the subscription.
应用程序希望发布给定类型的数据时,必须创建一个Publisher(或重新使用已创建的Publisher)和一个具有所需发布的所有特征的DataWriter。 同样,应用程序希望接收数据时,必须创建Subscriber(或重新使用已创建的Subscriber)和DataReader来定义订阅。
[1] All those constructs are local to the application part. Actually they play the role of proxies to the service. 所有这些构造对应用程序部分都是本地的。 其实他们扮演着代理服务的角色。
[2] ‘typed’ means that each DataWriter object is dedicated to one application data-type. ‘类型化’意味着每个DataWriter对象专用于一个应用程序数据类型。
[3] Broadly speaking, a domain represents the set of applications that are communicating with each other. This concept is defined more precisely in 2.2.1.2.2, Overall Conceptual Model and 2.2.2.2.1, DomainParticipant Class.