PLCnext API Documentation 25.0.2.69
Public Member Functions | Static Public Member Functions | List of all members
Arp::Base::Rsc::ServiceManager Class Reference

This class is used to publish and retrieve RSC services. More...

#include <ServiceManager.hpp>

Public Member Functions

 ServiceManager (void)=delete
 makes this class pure static
 

Static Public Member Functions

template<class TService >
static TService::Ptr GetService (void)
 Gets a RSC service. The service provider is determined by the proxy factory. More...
 
template<class TService >
static TService::Ptr GetService (const char *serviceProviderName)
 Gets a service of the specified service provider. More...
 
template<class TService >
static bool TryGetService (typename TService::Ptr &result)
 Tries to get a service of the service provider Arp. More...
 
template<class TService >
static bool TryGetService (const char *serviceProviderName, typename TService::Ptr &result)
 Gets a service of the specified service provider. More...
 
template<class TService , class TServiceFactory >
static void PublishService (void)
 Registers a RSC service. More...
 
template<class TService , class TServiceFactory >
static void PublishService (const char *serviceProviderName)
 Registers a RSC service of the specified service provider. More...
 
static void PublishComponentService (const char *componentName, const char *serviceName, IRscServiceFactory *pServiceFactory)
 Publishes a service of the specified service or type of the specified component, which serves as service provider. More...
 
static Impl & GetImpl (void)
 

Detailed Description

This class is used to publish and retrieve RSC services.

The implementation of this class is pure static, that is, the class provides only static operations.

Member Function Documentation

◆ GetService() [1/2]

template<class TService >
TService::Ptr Arp::Base::Rsc::ServiceManager::GetService ( const char *  serviceProviderName)
inlinestatic

Gets a service of the specified service provider.

Template Parameters
TServiceThe service type to get.
Parameters
serviceProviderNameThe name of the service provider or the process name to get the specified service from.
Returns
The pointer of the requested service instance.
Exceptions
InvalidOperationExceptionIf the service could not be found.
ArgumentExceptionIf the service provider specified by <paramref ="serviceProviderName" /> does not exist.

This operation is only used by internal infrastructure. Use ServiceManager::GetService(void) instead.

◆ GetService() [2/2]

template<class TService >
TService::Ptr Arp::Base::Rsc::ServiceManager::GetService ( void  )
inlinestatic

Gets a RSC service. The service provider is determined by the proxy factory.

Template Parameters
TServiceThe service type to get.
Returns
The pointer of the requested service instance.
Exceptions
InvalidOperationExceptionIf the service could not be found.

◆ PublishComponentService()

void Arp::System::Rsc::ServiceManager::PublishComponentService ( const char *  componentName,
const char *  serviceName,
IRscServiceFactory pServiceFactory 
)
static

Publishes a service of the specified service or type of the specified component, which serves as service provider.

Parameters
componentNameThe name of the component to publish the service for.
serviceNameThe name of the service or service type to publish.
pServiceFactoryThe pointer to the factory of the specified service.

◆ PublishService() [1/2]

template<class TService , class TServiceFactory >
void Arp::Base::Rsc::ServiceManager::PublishService ( const char *  serviceProviderName)
inlinestatic

Registers a RSC service of the specified service provider.

Parameters
serviceProviderNameThe name of the service provider.
Template Parameters
TServiceThe service type to publish.
TServiceFactoryThe factory type of the specified service. Shall implement the singleton pattern.

This operation is only used by internal infrastructure. Use ServiceManager::PublishService<T>(void) instead.

◆ PublishService() [2/2]

template<class TService , class TServiceFactory >
void Arp::Base::Rsc::ServiceManager::PublishService ( void  )
inlinestatic

Registers a RSC service.

The service provider name is retrieved from the specified service factory or defaults to the local application/process name.

Template Parameters
TServiceThe service type to register.
TServiceFactoryThe service factory. Shall implement the singleton pattern.

◆ TryGetService() [1/2]

template<class TService >
bool Arp::Base::Rsc::ServiceManager::TryGetService ( const char *  serviceProviderName,
typename TService::Ptr &  result 
)
inlinestatic

Gets a service of the specified service provider.

Template Parameters
TServiceThe type of the service or service type to get.
Parameters
serviceProviderNameThe name or URL of the service provider or the application name to get the specified service from.
resultThe pointer of the requested service instance or nullptr if the service could not be found.
Returns
true on success, otherwise false.

This operation is only used by internal infrastructure. Use ServiceManager::TryGetService<T>(result) instead.

◆ TryGetService() [2/2]

template<class TService >
bool Arp::Base::Rsc::ServiceManager::TryGetService ( typename TService::Ptr &  result)
inlinestatic

Tries to get a service of the service provider Arp.

Template Parameters
TServiceThe service type to get.
Parameters
resultThe pointer of the requested service instance or nullptr if the service could not be found.
Returns
true on success, otherwise false.

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