Maps SDK for C++ 1.0.0
Loading...
Searching...
No Matches
gem::TopicNotificationService Class Reference

TopicNotificationService object. More...

Inheritance diagram for gem::TopicNotificationService:
Collaboration diagram for gem::TopicNotificationService:

Public Member Functions

 TopicNotificationService (const TopicNotificationService &)=delete
 TopicNotificationService (TopicNotificationService &&tns)=default
 Default move constructor noexcept is deduced.
TopicNotificationService & operator= (const TopicNotificationService &)=delete
TopicNotificationService & operator= (TopicNotificationService &&tns)=default
 Default move assignment noexcept is deduced.
int registerForTopic (const String &topic, TopicListener topicListener) noexcept
 Register for notifications on the given topic.
int unregisterFromTopic (const String &topic, TopicListener topicListener) noexcept
 Unregister for notifications on the given topic.
int unregisterFromAllTopics (TopicListener topicListener) noexcept
 Unregister for all notifications.
int publishOnTopic (const String &topic, const DataBuffer &data, ProgressListener listener) noexcept
 Publish data on the given topic.
int canPublishOnTopic () const noexcept
 Check if data can be published.

Detailed Description

TopicNotificationService object.

Implements share-read / write Api object over ITopicNotificationService.

This behaves like a singleton, i.e. all instances are sharing behind the same API interface

Constructor & Destructor Documentation

◆ TopicNotificationService()

gem::TopicNotificationService::TopicNotificationService ( TopicNotificationService && tns)
default

Default move constructor noexcept is deduced.

Parameters
[in]tnsThe object to be moved

Member Function Documentation

◆ canPublishOnTopic()

int gem::TopicNotificationService::canPublishOnTopic ( ) const
inlinenoexcept

Check if data can be published.

Returns
The operation error code

◆ operator=()

TopicNotificationService & gem::TopicNotificationService::operator= ( TopicNotificationService && tns)
default

Default move assignment noexcept is deduced.

Parameters
[in]tnsThe object to be moved
Returns
A reference to the current object

◆ publishOnTopic()

int gem::TopicNotificationService::publishOnTopic ( const String & topic,
const DataBuffer & data,
ProgressListener listener )
inlinenoexcept

Publish data on the given topic.

Parameters
[in]topicThe topic string
[in]dataThe data buffer
[in]listenerProgress listener. If empty, data is considered to be volatile ( i.e. no guarantee it will be published )
Returns
The operation error code

◆ registerForTopic()

int gem::TopicNotificationService::registerForTopic ( const String & topic,
TopicListener topicListener )
inlinenoexcept

Register for notifications on the given topic.

Parameters
[in]topicThe topic string.

Can contain many levels separated by KTokenLevelSeparator, e.g. "MyTopic/MySubtopic1/MySubtopic2"

Use KSingleTokenLevelWildcard to register for any value on a selected level, e.g "MyTopic/+/Subtopic"

Use KMultiTokenLevelWildcard to register for any value on all remaining levels, e.g "MyTopic/Subtopic/#"

Parameters
[in]topicListenerThe listener for messages on the given topic
Returns
The operation error code

◆ unregisterFromAllTopics()

int gem::TopicNotificationService::unregisterFromAllTopics ( TopicListener topicListener)
inlinenoexcept

Unregister for all notifications.

Parameters
[in]topicListenerThe topic listener used in registerForTopic call.
Returns
The operation error code

◆ unregisterFromTopic()

int gem::TopicNotificationService::unregisterFromTopic ( const String & topic,
TopicListener topicListener )
inlinenoexcept

Unregister for notifications on the given topic.

Parameters
[in]topicThe topic string
[in]topicListenerThe topic listener used in registerForTopic call.
Returns
The operation error code