RTC Toolkit 5.1.0
Loading...
Searching...
No Matches
Public Types | Public Member Functions | List of all members
rtctk::componentFramework::ServiceDiscovery Class Reference

Class that implements a very basic service discovery mechanism. More...

#include <rtctk/componentFramework/serviceDiscovery.hpp>

Public Types

using ServiceEndpoint = ServiceRegistryIf::ServiceEndpoint
 

Public Member Functions

 ServiceDiscovery (std::unique_ptr< ServiceRegistryIf > &&adapter, const std::string &comp_name="")
 Create a new ServiceDiscovery object.
 
 ServiceDiscovery (const elt::mal::Uri &registry, const std::string &comp_name="")
 Create a new ServiceDiscovery object.
 
std::vector< std::string > ListComponents (const std::string &service_type=ServiceRegistryIf::COMPONENT_TYPE)
 Get known components.
 
ServiceEndpoint GetOldbEndpoint ()
 Get the Oldb Endpoint from the ServiceDiscovery.
 
ServiceEndpoint GetRuntimeRepoEndpoint ()
 Get the Runtime Repository Endpoint from the ServiceDiscovery.
 
ServiceEndpoint GetPersistentRepoEndpoint ()
 Get the Persistent Repository Endpoint from the ServiceDiscovery.
 
ServiceEndpoint GetReqRepEndpoint (const std::string &name="", const std::string &service_type=ServiceRegistryIf::COMPONENT_TYPE, const bool health_check=true)
 Get the Request/Reply Endpoint of a service like component.
 
ServiceEndpoint GetPubSubEndpoint (const std::string &component_name="", const std::string &service_type=ServiceRegistryIf::COMPONENT_TYPE, const bool health_check=true)
 Get the PubSub Endpoint of a component.
 

Detailed Description

Class that implements a very basic service discovery mechanism.

Member Typedef Documentation

◆ ServiceEndpoint

Constructor & Destructor Documentation

◆ ServiceDiscovery() [1/2]

rtctk::componentFramework::ServiceDiscovery::ServiceDiscovery ( std::unique_ptr< ServiceRegistryIf > && adapter,
const std::string & comp_name = "" )
explicit

Create a new ServiceDiscovery object.

Parameters
[in]adapterA unique_ptr to the Service Registry to use for service discovery.
[in]comp_nameOptional: the component name if used from within an RTC component.

◆ ServiceDiscovery() [2/2]

rtctk::componentFramework::ServiceDiscovery::ServiceDiscovery ( const elt::mal::Uri & registry,
const std::string & comp_name = "" )
explicit

Create a new ServiceDiscovery object.

Parameters
[in]registryURI to the Service Registry, currently only file:// and consul URIs are supported.
[in]comp_nameOptional: the component name if used from within an RTC component.

Member Function Documentation

◆ GetOldbEndpoint()

ServiceDiscovery::ServiceEndpoint rtctk::componentFramework::ServiceDiscovery::GetOldbEndpoint ( )

Get the Oldb Endpoint from the ServiceDiscovery.

◆ GetPersistentRepoEndpoint()

ServiceDiscovery::ServiceEndpoint rtctk::componentFramework::ServiceDiscovery::GetPersistentRepoEndpoint ( )

Get the Persistent Repository Endpoint from the ServiceDiscovery.

◆ GetPubSubEndpoint()

ServiceDiscovery::ServiceEndpoint rtctk::componentFramework::ServiceDiscovery::GetPubSubEndpoint ( const std::string & component_name = "",
const std::string & service_type = ServiceRegistryIf::COMPONENT_TYPE,
const bool health_check = true )

Get the PubSub Endpoint of a component.

Parameters
[in]component_nameOptional: instance (component) name, otherwise component name during construction is used.
service_typetype of service e.g. rtctk_component
[in]health_checkOptional: if should be checked for the health of the component before returning a valid endpoint

◆ GetReqRepEndpoint()

ServiceDiscovery::ServiceEndpoint rtctk::componentFramework::ServiceDiscovery::GetReqRepEndpoint ( const std::string & name = "",
const std::string & service_type = ServiceRegistryIf::COMPONENT_TYPE,
const bool health_check = true )

Get the Request/Reply Endpoint of a service like component.

Parameters
[in]nameOptional: instance (component) name, otherwise component name during construction is used.
service_typetype of service e.g. rtctk_component
[in]health_checkOptional: if should be checked for the health of the service (component) before returning a valid endpoint

◆ GetRuntimeRepoEndpoint()

ServiceDiscovery::ServiceEndpoint rtctk::componentFramework::ServiceDiscovery::GetRuntimeRepoEndpoint ( )

Get the Runtime Repository Endpoint from the ServiceDiscovery.

◆ ListComponents()

std::vector< std::string > rtctk::componentFramework::ServiceDiscovery::ListComponents ( const std::string & service_type = ServiceRegistryIf::COMPONENT_TYPE)

Get known components.

Use this method to retrieve all services of a certain type (components by default) known to the service discovery

Parameters
service_typetype of service e.g. rtctk_component, if empty all types will be considered
Returns
vector of strings containing the component names

The documentation for this class was generated from the following files: