![]() |
OpenSplice C# API
v6.x
OpenSplice C# Data Distribution Service Data-Centric Publish-Subscribe API
|
A ISubscriber is the object responsible for the actual reception of the data resulting from its subscriptions. More...
Public Member Functions | |
ReturnCode | BeginAccess () |
This operation indicates that the application will begin accessing a coherent and/or ordered set of modifications that spans multiple DataReaders attached to this Subscriber. The access will be completed by a matching call to EndAccess(). More... | |
ReturnCode | CopyFromTopicQos (ref DataReaderQos dataReaderQos, TopicQos topicQos) |
This operation will copy the policies in topicQos to the corresponding policies in datareaderQos. More... | |
IDataReader | CreateDataReader (ITopicDescription topic) |
This method creates a IDataReader with default values. More... | |
IDataReader | CreateDataReader (ITopicDescription topic, IDataReaderListener listener, StatusKind mask) |
This method creates a IDataReader and if applicable, attaches the optionally specified IDataReaderListener to it. More... | |
IDataReader | CreateDataReader (ITopicDescription topic, DataReaderQos qos) |
This method creates a IDataReader with the desired QosPolicy settings, but without an IDataReaderListener. More... | |
IDataReader | CreateDataReader (ITopicDescription topic, DataReaderQos qos, IDataReaderListener listener, StatusKind mask) |
This operation creates a IDataReader with the desired QosPolicy settings, for the desired ITopicDescription and attaches the optionally specified IDataReaderListener to it. More... | |
ReturnCode | DeleteContainedEntities () |
This operation deletes all the IDataReader objects that were created by means of the CreateDatareader operation on the ISubscriber. More... | |
ReturnCode | DeleteDataReader (IDataReader dataReader) |
This operation deletes a IDataReader that belongs to the ISubscriber. More... | |
ReturnCode | EndAccess () |
This operation indicates that the application will stop accessing a coherent and/or ordered set of modifications that spans multiple DataReaders attached to this ISubscriber. This access must have been started by a matching call to BeginAccess(). More... | |
ReturnCode | GetDataReaders (ref IDataReader[] readers) |
This operation allows the application to access the DataReader objects that contain samples. More... | |
ReturnCode | GetDataReaders (ref IDataReader[] readers, SampleStateKind sampleStates, ViewStateKind viewStates, InstanceStateKind instanceStates) |
This operation allows the application to access the DataReader objects that contain samples with the specified SampleStates, ViewStates, and InstanceStates. More... | |
ReturnCode | GetDefaultDataReaderQos (ref DataReaderQos qos) |
This operation gets the default QosPolicy settings of the IDataReader. More... | |
ReturnCode | GetQos (ref SubscriberQos qos) |
This operation allows access to the existing set of QoS policies for a ISubscriber. More... | |
IDataReader | LookupDataReader (string topicName) |
This operation returns a previously created IDataReader belonging to the ISubscriber which is attached to a ITopic with the matching topicName. More... | |
ReturnCode | NotifyDataReaders () |
This operation invokes the OnDataAvailable operation on IDataReaderListener objects which are attached to the contained IDataReader entities having new, available data. More... | |
ReturnCode | SetDefaultDataReaderQos (DataReaderQos qos) |
This operation sets the default DataReaderQos of the IDataReader. More... | |
ReturnCode | SetListener (ISubscriberListener listener, StatusKind mask) |
This operation attaches a ISubscriberListener to the ISubscriber. More... | |
ReturnCode | SetQos (SubscriberQos qos) |
This operation replaces the existing set of QosPolicy settings for a ISubscriber. More... | |
![]() | |
ReturnCode | Enable () |
This operation enables the IEntity on which it is being called when the IEntity was created with the EntityFactoryQosPolicy set to false. More... | |
Properties | |
ISubscriberListener | Listener [get] |
This property returns the ISubscriberListener currently attached to the ISubscriber. More... | |
IDomainParticipant | Participant [get] |
This property allows access to the IDomainParticipant associated with the ISubscriber. More... | |
![]() | |
InstanceHandle | InstanceHandle [get] |
This operation returns the InstanceHandle of the builtin topic sample that represents the specified IEntity. More... | |
StatusKind | StatusChanges [get] |
This operation returns a mask with the communication statuses in the IEntity that are triggered. More... | |
IStatusCondition | StatusCondition [get] |
This property allows access to the IStatusCondition associated with the IEntity. More... | |
A ISubscriber is the object responsible for the actual reception of the data resulting from its subscriptions.
A ISubscriber acts on behalf of one or more IDataReader objects that are related to it. When it receives data (from the other parts of the system), it indicates to the application that data is available through its IDataReaderListener and by enabling related Conditions. The application can access the list of concerned IDataReader objects through the operation ISubscriber.GetDataReaders and then access the data available through operations on the IDataReader.
Definition at line 3944 of file DdsDcpsInterfaces.cs.
ReturnCode DDS.ISubscriber.BeginAccess | ( | ) |
This operation indicates that the application will begin accessing a coherent and/or ordered set of modifications that spans multiple DataReaders attached to this Subscriber. The access will be completed by a matching call to EndAccess().
This operation indicates that the application is about to access a set of coherent and/or ordered samples in any of the IDataReader objects attached to the ISubscriber. 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.
The application is required to use this operation only if the PresentationQosPolicy of the Subscriber to which the DataReader belongs has the AccessScope set to ‘GROUP’. In the aforementioned case, the operation BeginAccess() must be called prior to calling any of the sample-accessing operations, namely: GetDatareaders on the Subscriber and Read(), Take(), and all their variants on any IDataReader. Otherwise the sample-accessing operations will return the error DDS.ReturnCode PreconditionNotMet. Once the application has finished accessing the data samples it must call EndAccess().
It is not required for the application to call BeginAccess() / EndAccess() if the PresentationQosPolicy has the AccessScope set to something other than ‘GROUP’. Calling BeginAccess() / EndAccess() in this case is not considered an error and has no effect.
The calls to BeginAccess() / EndAccess() may be nested. In that case, the application must call EndAccess() as many times as it called BeginAccess().
Note that a coherent Subscriber should first be enabled, otherwise this operation will return an error. See DDS.IEntity.Enable() for additional information.
ReturnCode DDS.ISubscriber.CopyFromTopicQos | ( | ref DataReaderQos | dataReaderQos, |
TopicQos | topicQos | ||
) |
This operation will copy the policies in topicQos to the corresponding policies in datareaderQos.
This operation will copy the QosPolicy settings in topicQos to the corresponding QosPolicy settings in dataReaderQos (replacing the values in datareaderQos, if present). This is a convenience operation, useful in combination with the operations GetDefaultDataWriterQos and ITopic.GetQos. The operation CopyFromTopicQos can be used to merge the IDataReader default QosPolicy settings with the corresponding ones on the ITopic. The resulting DataReaderQos can then be used to create a new IDataReader, or set its DataReaderQos.
This operation does not check the resulting dataReaderQos for self consistency. This is because the merged dataReaderQos may not be the final one, as the application can still modify some QosPolicy settings prior to applying the DataReaderQos to the IDataReader.
dataReaderQos | The destination DataReaderQos struct to which the QosPolicy settings will be copied. |
topicQos | The source TopicQos, which will be copied. |
IDataReader DDS.ISubscriber.CreateDataReader | ( | ITopicDescription | topic | ) |
This method creates a IDataReader with default values.
This operation creates a IDataReader with the default DataReaderQos, a null IDataReaderListener and 0 StatusKind mask.
If the SetDefaultDataReaderQos() method is called, then the default DataReaderQos will be the QoS given to that method. Otherwise it will equal a new DataReaderQos.
To delete the IDataReader the operation DeleteDataReader() or DeleteContainedEntities() must be used.
See CreateDataReader for:
topic | The TopicDescription for which the DataReader is created. This may be a Topic, MultiTopic or ContentFilteredTopic. |
IDataReader DDS.ISubscriber.CreateDataReader | ( | ITopicDescription | topic, |
IDataReaderListener | listener, | ||
StatusKind | mask | ||
) |
This method creates a IDataReader and if applicable, attaches the optionally specified IDataReaderListener to it.
This operation creates a IDataReader with the default DataReaderQos, a null IDataReaderListener and 0 StatusKind mask.
If the SetDefaultDataReaderQos() method is called, then the default DataReaderQos will be the QoS given to that method. Otherwise it will equal a new DataReaderQos.
To delete the IDataReader the operation DeleteDataReader() or DeleteContainedEntities() must be used.
See CreateDataReader for:
topic | The TopicDescription for which the DataReader is created. This may be a Topic, MultiTopic or ContentFilteredTopic. |
listener | The IDataReaderListener instance which will be attached to the new IDataReader. It is permitted to use null as the value of the listener: this behaves as a IDataReaderListener whose operations perform no action. |
mask | A bit-mask in which each bit enables the invocation of the IDataReaderListener. for a certain status. |
IDataReader DDS.ISubscriber.CreateDataReader | ( | ITopicDescription | topic, |
DataReaderQos | qos | ||
) |
This method creates a IDataReader with the desired QosPolicy settings, but without an IDataReaderListener.
This operation creates a IDataReader with the default DataReaderQos, a null IDataReaderListener and 0 StatusKind mask.
In case the specified QosPolicy settings are not consistent, no IDataReader is created and null is returned.
The function CopyFromTopicQos() is available for convenience. That will provide a DataReaderQos that is consistent with the given TopicQos.
To delete the IDataReader the operation DeleteDataReader() or DeleteContainedEntities() must be used.
See CreateDataReader for:
topic | The TopicDescription for which the DataReader is created. This may be a Topic, MultiTopic or ContentFilteredTopic. |
qos | The struct with the QosPolicy settings for the new IDataReader, when these QosPolicy settings are not self consistent, no IDataReader is created. |
IDataReader DDS.ISubscriber.CreateDataReader | ( | ITopicDescription | topic, |
DataReaderQos | qos, | ||
IDataReaderListener | listener, | ||
StatusKind | mask | ||
) |
This operation creates a IDataReader with the desired QosPolicy settings, for the desired ITopicDescription and attaches the optionally specified IDataReaderListener to it.
This operation creates a IDataReader with the desired QosPolicy settings, for the desired ITopicDescription and attaches the optionally specified IDataReaderListener to it. The ITopicDescription may be a ITopic, IMultiTopic or IContentFilteredTopic. The returned IDataReader is attached (and belongs) to the ISubscriber.
In case the specified QosPolicy settings are not consistent, no IDataReader is created and null is returned.
The function CopyFromTopicQos() is available for convenience. That will provide a DataReaderQos that is consistent with the given TopicQos.
To delete the IDataReader the operation DeleteDataReader() or DeleteContainedEntities() must be used.
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 IPublisherListener 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<status_name>Status from inside the listener it will see the status already reset.
The following statuses are applicable to the IDataReader
Be aware that the PublicationMatched 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 the description for the NetworkingService/Discovery/enabled property in the Deployment Manual for more information about this subject.) In this case the operation will return null.
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 0 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.
Status Propagation
In case a communication status is not activated in the mask of the IDataReaderListener, the ISubscriberListener of the containing ISubscriber is invoked (if attached and activated for the status that occurred). This allows the application to set a default behaviour in the ISubscriberListener of the containing ISubscriber and a IDataReader specific behaviour when needed.
In case the communication status is not activated in the mask of the ISubscriberListener either, the communication status will be propagated to the IDomainParticipantListener of the containing IDomainParticipant.
In case the IDomainParticipantListener is also not attached or the communication status is not activated in its mask, the application is not notified of the change.
topic | The TopicDescription for which the DataReader is created. This may be a Topic, MultiTopic or ContentFilteredTopic. |
qos | The struct with the QosPolicy settings for the new IDataReader, when these QosPolicy settings are not self consistent, no IDataReader is created. |
listener | The IDataReaderListener instance which will be attached to the new IDataReader. It is permitted to use null as the value of the listener: this behaves as a IDataReaderListener whose operations perform no action. |
mask | A bit-mask in which each bit enables the invocation of the IDataReaderListener. for a certain status. |
ReturnCode DDS.ISubscriber.DeleteContainedEntities | ( | ) |
This operation deletes all the IDataReader objects that were created by means of the CreateDatareader operation on the ISubscriber.
This operation deletes all the IDataReader objects that were created by means of the CreateDatareader operation on the ISubscriber. In other words, it deletes all contained IDataReader objects. Prior to deleting each IDataReader, this operation recursively calls the corresponding DeleteContainedEntities() operation on each IDataReader. In other words, all IDataReader objects in the ISubscriber are deleted, including the IQueryCondition and IReadCondition objects contained by the IDataReader.
ReturnCode DDS.ISubscriber.DeleteDataReader | ( | IDataReader | dataReader | ) |
This operation deletes a IDataReader that belongs to the ISubscriber.
This operation deletes a IDataReader that belongs to the ISubscriber. When the operation is called on a different ISubscriber, as used when the IDataReader was created, the operation has no effect and returns PreconditionNotMet.
The deletion of the IDataReader is not allowed if there are any IReadCondition or IQueryCondition objects that are attached to the IDataReader. In that case the operation returns PreconditionNotMet.
dataReader | The IDataReader which is to be deleted. |
ReturnCode DDS.ISubscriber.EndAccess | ( | ) |
This operation indicates that the application will stop accessing a coherent and/or ordered set of modifications that spans multiple DataReaders attached to this ISubscriber. This access must have been started by a matching call to BeginAccess().
Indicates that the application has finished accessing the data samples in IDataReader objects managed by the ISubscriber. This operation must be used to ‘close’ a corresponding BeginAccess(). 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 EndAccess the application should no longer access any of the Data or SampleInfo elements returned from the sample-accessing operations.
This call must close a previous call to BeginAccess() otherwise the operation will return the error DDS.ReturnCode PreconditionNotMet.
Please consult DDS.IEntity.Enable() for additional information about coherent access
ReturnCode DDS.ISubscriber.GetDataReaders | ( | ref IDataReader [] | readers | ) |
This operation allows the application to access the DataReader objects that contain samples.
This functionallity of this function is the same as calling GetDataReaders(ref IDataReader[] readers, SampleStateKind sampleStates, ViewStateKind viewStates, InstanceStateKind instanceStates) with all states set to Any.
readers | An array which is used to pass the list of all DataReaders that contain samples. |
ReturnCode DDS.ISubscriber.GetDataReaders | ( | ref IDataReader [] | readers, |
SampleStateKind | sampleStates, | ||
ViewStateKind | viewStates, | ||
InstanceStateKind | instanceStates | ||
) |
This operation allows the application to access the DataReader objects that contain samples with the specified SampleStates, ViewStates, and InstanceStates.
If the PresentationQosPolicy of the ISubscriber to which the IDataReader belongs has the AccessScope set to ‘GROUP’, this operation should only be invoked inside a BeginAccess() / EndAccess() block. Otherwise it will return the error DDS.ReturnCode PrecoditionNotMet.
Depending on the setting of the PresentationQoSPolicy, the returned collection of IDataReader objects may be:
This difference is due to the fact that, in the second situation it is required to access samples belonging to different IDataReader objects in a particular order. In this case, the application should process each IDataReader in the same order it appears in the ‘list’ and read or take exactly one sample from each IDataReader.
readers | An array which is used to pass the list of all DataReaders that contain samples of the specified SampleStates, ViewStates, and InstanceStates. |
sampleStates | A mask, which selects only those readers that have samples with the desired sample states. |
viewStates | A mask, which selects only those readers that have samples with the desired view states. |
instanceStates | A mask, which selects only those readers that have samples with the desired instance states. |
ReturnCode DDS.ISubscriber.GetDefaultDataReaderQos | ( | ref DataReaderQos | qos | ) |
This operation gets the default QosPolicy settings of the IDataReader.
This operation gets the default QosPolicy settings of the IDataReader (that is the DataReaderQos) which is used for newly created IDataReader objects, in case no QoS was provided. The default DataReaderQos is only used when the constant is supplied as parameter qos to specify the DataReaderQos in the CreateDataReader operation. The application must provide the DataReaderQos struct in which the QosPolicy settings can be stored and pass the qos reference to the operation. The operation writes the default QosPolicy settings to the struct referenced 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 SetDefaultDataReaderQos, or, if the call was never made, the default values as specified for each QosPolicy setting
qos | A reference to the DataReaderQos struct(provided by the application) in which the default QosPolicy settings for the IDataReader are written. |
ReturnCode DDS.ISubscriber.GetQos | ( | ref SubscriberQos | qos | ) |
This operation allows access to the existing set of QoS policies for a ISubscriber.
This operation allows access to the existing set of QoS policies of a ISubscriber on which this operation is used. This SubscriberQos is stored at the location pointed to by the qos parameter.
qos | A reference to the destination SubscriberQos struct in which the QosPolicy settings will be copied. |
IDataReader DDS.ISubscriber.LookupDataReader | ( | string | topicName | ) |
This operation returns a previously created IDataReader belonging to the ISubscriber which is attached to a ITopic with the matching topicName.
This operation returns a previously created IDataReader belonging to the ISubscriber which is attached to a ITopic with the matching topicName. When multiple IDataReader 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 ISubscriber, which returns the built-in IDataReader objects for the built-in Topics.
topicName | The name of the ITopic, which is attached to the IDataReader to look for. |
ReturnCode DDS.ISubscriber.NotifyDataReaders | ( | ) |
This operation invokes the OnDataAvailable operation on IDataReaderListener objects which are attached to the contained IDataReader entities having new, available data.
This operation invokes the OnDataAvailable operation on the IDataReaderListener objects attached to contained IDataReader entities that have received information, but which have not yet been processed by those DataReaders.
The NotifyDataReaders operation ignores the bit mask value of individual IDataReaderListener objects, even when the DDS.StatusKind DataAvailable bit has not been set on a IDataReader that has new, available data. The OnDataAvailable operation will still be invoked, when the DDS.StatusKind DataAvailable bit has not been set on a IDataReader, but will not propagate to the IDomainParticipantListener.
When the IDataReader has attached a null listener, the event will be consumed and will not propagate to the IDomainParticipantListener. (Remember that a null listener is regarded as a listener that handles all its events as a NOOP).
ReturnCode DDS.ISubscriber.SetDefaultDataReaderQos | ( | DataReaderQos | qos | ) |
This operation sets the default DataReaderQos of the IDataReader.
This operation sets the default DataReaderQos of the IDataReader (that is the struct with the QosPolicy settings). This QosPolicy is used for newly created IDataReader objects in case no QoS was provided parameter qos to specify the DataReaderQos in the CreateDataReader operation. This operation checks if the DataReaderQos is self consistent. If it is not, the operation has no effect and returns InconsistentPolicy. The values set by this operation are returned by GetDefaultDataReaderQos().
qos | The DataReaderQos struct, which containsthe new default QosPolicy settings for the newly created DataReaders. |
ReturnCode DDS.ISubscriber.SetListener | ( | ISubscriberListener | listener, |
StatusKind | mask | ||
) |
This operation attaches a ISubscriberListener to the ISubscriber.
This operation attaches a ISubscriberListener to the ISubscriber. Only one ISubscriberListener can be attached to each ISubscriber. If a ISubscriberListener was already attached, the operation will replace it with the new one. When listener is null, it represents a listener that is treated as a NOOP for all statuses activated in the bit mask.
See CreateSubscriber for:
listener | The ISubscriberListener instance, which will be attached to the ISubscriber. |
mask | A bit mask in which each bit enables the invocation of the ISubscriberListener for a certain status. |
ReturnCode DDS.ISubscriber.SetQos | ( | SubscriberQos | qos | ) |
This operation replaces the existing set of QosPolicy settings for a ISubscriber.
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 ISubscriber, which can only be set before the ISubscriber is enabled, the operation will fail and a DDS.ReturnCode ImmutablePolicy 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.ReturnCode InconsistentPolicy 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.ReturnCode Ok).
qos | The new set of QosPolicy settings for the ISubscriber. |
|
get |
This property returns the ISubscriberListener currently attached to the ISubscriber.
Only one listener can be attached to the ISubscriber at any particular time. This property returns the listener that is currently attached to the ISubscriber.
Definition at line 4345 of file DdsDcpsInterfaces.cs.
|
get |
This property allows access to the IDomainParticipant associated with the ISubscriber.
Definition at line 4451 of file DdsDcpsInterfaces.cs.