DDS标准中英文对照(2)

1.Data-Centric Publish-Subscribe (DCPS)

1.1. 概述

This clause describes DCPS. DCPS defines the functionality used by an application to publish and subscribe to the values of data objects. It allows:

本条款描述DCPS。DCPS定义应用程序用于发布和订阅数据对象值的功能,它允许:

 

  • Publishing applications to identify the data objects they intend to publish, and then provide values for these objects.
  • 发布应用程序标识他们打算发布的数据对象,然后为这些对象提供值。

 

  • Subscribing applications to identify which data objects they are interested in, and then access their data values.
  • 订阅应用程序标识他们感兴趣的数据对象,然后访问它们的数据值。

 

  • Applications to define topics, to attach type information to the topics, to create publisher and subscriber entities, to attach QoS policies to all these entities and, in summary, to make all these entities operate.
  • 应用程序定义主题,将类型信息附加到主题,创建发布者和订阅者实体,将QoS策略附加到所有这些实体,并总而言之使所有这些实体都能够运行(operate)。

 

The description is organized into two sub clauses:

描述分为两个子条款:

 

  • The Platform Independent Model (PIM).
  • 平台无关模型(PIM)

 

  • The Platform Specific Model (PSM) for the OMG IDL platform based on the PIM.
  • 基于PIM的OMG IDL平台的平台相关模型(PSM)。

 

1.2. 平台相关模型(PIM)

1.2.1. 概述和设计原理

1.2.1.1.格式和约定

The purpose of this sub clause is to provide an operational overview of the DCPS PIM. To do so, it introduces many terms. Some of them are common terms whose meaning, in the context of publish-subscribe, is different from common usage. In cases where it is deemed appropriate, such terms will be italicized. Other terms are unique to publish-subscribe and/or to this specification, and are incorporated as key elements of the Class Model. The first time such terms are used, they will be formatted with Bold-italics[1]. Subsequent occurrences may not be highlighted in any way.

本小节的目的是提供DCPS PIM的操作概述。 为此,本小节引入了许多术语。其中一些是常用术语,但在发布-订阅模型方面的含义与常见用法不同。 适当的时候,这些条款将被斜体化。 其他术语是发布-订阅模型和/或本规范所独有的,并且被合并为类模型的关键元素。 第一次使用这些术语时,它们将用采用加粗斜体格式,后续出现时将可能不会以任何方式突出显示。

 

In addition to the UML diagrams, all the classes that constitute the Service are documented using tables. The format used to document these classes is shown below.

除了UML图之外,构成服务的所有类都采用表格的形式进行描述。 下面显示了用于记录这些类的格式。

 

<class name>

attributes
<attribute name> <attribute type>  
   
operations
<operation name>   <return type>
  <parameter> <parameter type>
 
 

 

The operation <paramter> can contain the modifier “in,” “out,” or “inout” ahead of the parameter name. If this modifier is omitted, it is implied that the parameter is an “in” parameter.

操作(operation)的参数<parameter>可以在参数名称之前包含修饰符“in”,“out”或“inout”。 如果省略此修饰符,则暗示参数是“in”(输入)参数。

 

In some cases the operation parameters or return value(s) are a collection with elements of a given <type>. This is indicated with the notation “<type>[].” This notation does not imply that it will be implemented as an array. The actual implementation is defined by the PSM: it may end up being mapped to a sequence, a list, or other kind of collection.

某些情况下,操作参数或返回值是给定<type>的元素的集合,用符号“<type> []”表示。这个表示法并不意味着它将实现为一个数组。实际的实现由PSM定义:它可能最终映射到序列、列表或其他类型的集合。

 

For example, the class named ‘MyClass’ below has a single attribute, named ‘my_attribute’ of type ‘long’ and a single operation ‘my_operation’ that returns a long. The operation takes four parameters. The first, ‘param1,’ is an output parameter of type long; the second, ‘param2,’ an input-output parameter of type long; the third, ‘param3,’ is an input parameter (the “in” modifier is implied by omission) of type long; and the fourth, ‘param4,’ is also an input parameter of type collection of longs.[2]

例如,下面名为’MyClass’的类有一个属性,名为’my_attribute’,类型为’long’,单个操作’my_operation’返回一个long。 该操作需要四个参数。 第一个参数’param1’是long类型的输出参数; 第二个参数“param2”是long类型的输入输出参数; 第三个参数“param3”是一个long类型的输入参数(省略暗含的“in”修饰符); 而第四个“param4”也是long类型集合的输入参数。

 

MyClass

attributes
my_attribute long  
operations
my_operation   long
  out: param1 long
  inout: param2 long
  param3 long
  in: param4 long[]

 

 

At the PIM level we have modeled errors as operation return codes typed ReturnCode_t. Each PSM may map these to either return codes or exceptions. The complete list of return codes is indicated below.

在PIM级别,我们将错误建模为操作的类型为ReturnCode_t返回码。每个PSM可以将这些映射到返回码或异常。 返回码的完整列表如下所示。

 

 

Return Codes

OK Successful return.

成功返回。

ERROR Generic, unspecified error.

一般未指定的错误。

BAD_PARAMETER Illegal parameter value.

非法参数值。

UNSUPPORTED Unsupported operation. Can only be returned by operations that are optional.

未支持的操作,只有可选的操作才会返回此代码。

ALREADY_DELETED The object target of this operation has already been deleted.

此操作的对象目标已被删除。

OUT_OF_RESOURCES Service ran out of the resources needed to complete the operation.

服务耗尽完成操作所需的资源。

NOT_ENABLED Operation invoked on an Entity that is not yet enabled.

在尚未启用的实体(Entity)上调用操作。

IMMUTABLE_POLICY Application attempted to modify an immutable QosPolicy.

应用程序试图修改一个不可变的QosPolicy

INCONSISTENT_POLICY Application specified a set of policies that are not consistent with each other.

应用程序指定了一组彼此不一致的策略。

PRECODITION_NOT_MET A pre-condition for the operation was not met.

操作的前提条件不满足

TIMEOUT The operation timed out.

操作超时。

ILLEGAL_OPERATION An operation was invoked on an inappropriate object or at an inappropriate time (as determined by policies set by the specification or the Service implementation). There is no precondition that could be changed to make the operation succeed.

在不适当的对象上或在不适当的时间调用操作(由规范或服务实现设置的策略确定)。 没有可以改变的使操作成功的先决条件。

NO_DATA Indicates a transient situation where the operation did not return any data but there is no inherent error.

表示操作没有返回任何数据且没有固有错误的临时情况。

 

Any operation with return type ReturnCode_t may return OK, ERROR, or ILLEGAL_OPERATION. Any operation that takes an input parameter may additionally return BAD_PARAMETER. Any operation on an object created from any of the factories may additionally return ALREADY_DELETED. Any operation that is stated as optional may additionally return UNSUPPORTED. The return codes OK, ERROR, ILLEGAL_OPERATION, ALREADY_DELETED, UNSUPPORTED, and BAD_PARAMETER are the standard return codes and the specification won’t mention them explicitly for each operation. Operations that may return any of the additional (non-standard) error codes above will state so explicitly.

任何返回值类型为ReturnCode_t的操作都可能返回OK, ERROR, or ILLEGAL_OPERATION。任何有输入参数的操作另外还可能返回BAD_PARAMETER。针对由工厂创建的对象的操作还有可能返回ALREADY_DELETED。声明为可选的操作可能会额外返回UNSUPPORTED。 返回码OK,ERROR、ILLEGAL_OPERATION、ALREADY_DELETED、NSUPPORTED和BAD_PARAMETER是标准的返回代码,规范不会对每个操作明确提及它们。 可能返回上述任何附加(非标准)的错误代码的操作将明确陈述。

 

It is an error for an application to use an Entity that has already been deleted by means of the corresponding delete operation on the factory. If an application does this, the result is unspecified and will depend on the implementation and the PSM. In the cases where the implementation can detect the use of a deleted entity, the operation should fail and return ALREADY_DELETED.

应用程序使用已通过工厂上的相应删除操作删除的实体是错误的。 如果应用程序执行此操作,则结果未指定,并取决于实现和PSM。 在实现可以检测到使用已删除的实体的情况下,操作会失败并返回ALREADY_DELETED。

 

[1] In this case, the written name is exactly the one of the corresponding class, which forbids the use of the plural. In case this would lead to ambiguity, it has been followed by ‘objects’ to state that there may not be only one of these.

[2] That is, a collection where the type of each element is ‘long’.

发表评论

邮箱地址不会被公开。 必填项已用*标注