5.2. Endpoint¶
-
class
eprosima::is::sh::websocket
::
Endpoint
: public eprosima::is::FullSystem, public eprosima::is::ServiceClient¶ Represents a WebSocket endpoint for the Integration Service. The Endpoint class will be later specialized for client and server applications.
Subclassed by eprosima::is::sh::websocket::Client, eprosima::is::sh::websocket::Server
Public Functions
-
Endpoint
(const std::string &name)¶ Constructor.
- Parameters
name
: The name given to this Endpoint instance. It will be used to identify logging traces.
-
bool
configure
(const core::RequiredTypes &types, const YAML::Node &configuration, TypeRegistry &type_registry) override¶ Inherited from SystemHandle.
-
bool
okay
() const = 0¶ Inherited from SystemHandle.
-
bool
spin_once
() = 0¶ Inherited from SystemHandle.
-
~Endpoint
() = default¶ Destructor.
-
bool
subscribe
(const std::string &topic_name, const xtypes::DynamicType &message_type, TopicSubscriberSystem::SubscriptionCallback *callback, const YAML::Node &configuration) final override¶ Inherited from TopicSubscriberSystem.
-
bool
is_internal_message
(void *filter_handle) final override¶ Inherited from TopicSubscriberSystem.
-
std::shared_ptr<TopicPublisher>
advertise
(const std::string &topic_name, const xtypes::DynamicType &message_type, const YAML::Node &configuration) final override¶ Inherited from TopicPublisherSystem.
-
bool
create_client_proxy
(const std::string &service_name, const xtypes::DynamicType &service_type, ServiceClientSystem::RequestCallback *callback, const YAML::Node &configuration) final override¶ Inherited from ServiceClientSystem.
-
bool
create_client_proxy
(const std::string &service_name, const xtypes::DynamicType &request_type, const xtypes::DynamicType &reply_type, ServiceClientSystem::RequestCallback *callback, const YAML::Node &configuration) final override¶ Inherited from ServiceClientSystem.
-
std::shared_ptr<ServiceProvider>
create_service_proxy
(const std::string &service_name, const xtypes::DynamicType &service_type, const YAML::Node &configuration) final override¶ Inherited from ServiceProviderSystem.
-
std::shared_ptr<ServiceProvider>
create_service_proxy
(const std::string &service_name, const xtypes::DynamicType &request_type, const xtypes::DynamicType &reply_type, const YAML::Node &configuration) final override¶ Inherited from ServiceProviderSystem.
-
void
startup_advertisement
(const std::string &topic, const xtypes::DynamicType &message_type, const std::string &id, const YAML::Node &configuration)¶ Send out an advertisement the next time a connection is made.
- Parameters
[in] topic
: The topic name.[in] message_type
: The Dynamic Type message representation.[in] id
: The publisher ID.[in] configuration
: Additional configuration, in YAML format, required to advertise the topic.
-
void
runtime_advertisement
(const std::string &topic, const xtypes::DynamicType &message_type, const std::string &id, const YAML::Node &configuration) = 0¶ Send out an advertisement to all existing connections right away. This is for publication topics that are determined at runtime by topic templates.
- Parameters
[in] topic
: The topic name.[in] message_type
: The Dynamic Type message representation.[in] id
: The message ID.[in] configuration
: Additional configuration, in YAML format, required to advertise the topic.
-
bool
publish
(const std::string &topic, const xtypes::DynamicData &message)¶ Publish a message to a certain topic.
- See
- Return
true
if the publication was made,false
otherwise.- Parameters
[in] topic
: The topic name to publish to.[in] message
: The message data instance to be published.
Call a service.
- See
- Parameters
[in] service
: The name of the service to be called.[in] request
: Request message for the service.[inout] client
: The proxy for the client that is making the request.[in] call_handle
: A handle for the call.
Inherited from ServiceClient.
Process an advertisement message. This step is required prior to publish operation.
- Parameters
[in] topic_name
: The name of the topic to be advertised.[in] message_type
: The type name of the topic to be advertised.[in] id
: The publisher ID.[in] connection_handle
: Opaque pointer which identifies the current connection.
Process an unadvertisement message.
- Parameters
[in] topic_name
: The name of the topic to be unadvertised.[in] id
: The publisher ID.[in] connection_handle
: Opaque pointer which identifies the current connection.
Process an publication.
- Parameters
[in] topic_name
: The name of the topic where the message will be published to.[in] message
: The message published.[in] connection_handle
: Opaque pointer which identifies the current connection.
Process a request for subscribing to a certain topic.
- Parameters
[in] topic_name
: The name of the topic where the subscription will be performed to.[in] message_type
: The dynamic type of the topic to get subscribed to.[in] id
: The identifier of the message.[in] connection_handle
: Opaque pointer which identifies the current connection.
Process a request for unsubscribing to a certain topic.
- Parameters
[in] topic_name
: The name of the topic where the subscription will be stopped.[in] id
: The identifier of the message.[in] connection_handle
: Opaque pointer which identifies the current connection.
Process a service request.
- Parameters
[in] service_name
: The name of the service.[in] request
: The request data.[in] id
: The service ID.[in] connection_handle
: Opaque pointer which identifies the current connection.
Process a service advertisement. This is required prior to calling a service.
- Parameters
[in] service_name
: The name of the service.[in] req_type
: The request data type.[in] reply_type
: The reply data type.[in] connection_handle
: Opaque pointer which identifies the current connection.
Process a service unadvertisement. The service will no longer be available.
- Parameters
[in] service_name
: The name of the service.[in] service_type
: The service type. Usually refers to the request type.[in] connection_handle
: Opaque pointer which identifies the current connection.
Process a service response.
- Parameters
[in] service_name
: The name of the service.[in] response
: The response data.[in] id
: The service ID.[in] connection_handle
: Opaque pointer which identifies the current connection.
-