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

Use this class to publish and retrieve Rsc and Remoting services. More...

#include <ServiceManager.hpp>

Static Public Member Functions

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...
 
template<class TService >
static TService::Ptr GetService (void)
 Gets a Rsc service of the service provider Arp. 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...
 
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 void PublishRemotingServiceProvider (CRemotingServiceProviderBase *pServiceProvider)
 Publishes a remoting service provider and all of its services. More...
 
template<class TService , class TServiceFactory >
static void PublishRemotingService (const char *serviceProviderName)
 Publishes a remoting service of the specified service provider. More...
 
template<class TService >
static TService::Ptr GetRemotingService (const char *serviceProviderName)
 Gets a Remoting service of the specified service provider. More...
 

Detailed Description

Use this class to publish and retrieve Rsc and Remoting services.

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

Member Function Documentation

◆ GetRemotingService()

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

Gets a Remoting service of the specified service provider.

Parameters
serviceProviderNameThe name of the service provider or the process name to get the specified service from.
Template Parameters
TServiceThe remoting service type to retrieve.
Returns
The pointer of the requested service instance or nullptr if the service could not be found.

This operation should be used for Remoting services but not Rsc services.

◆ GetService() [1/2]

template<class TService >
TService::Ptr Arp::System::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.

◆ GetService() [2/2]

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

Gets a Rsc service of the service provider Arp.

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

◆ PublishComponentService()

static 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.

◆ PublishRemotingService()

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

Publishes a remoting service of the specified service provider.

Parameters
serviceProviderNameThe name of the remoting service provider.
Template Parameters
TServiceThe remoting service type to register.
TServiceFactoryThe service factory type of the specified service. Must implement the singleton policy.

This operation should be used by remoting services but not Rsc services.

◆ PublishRemotingServiceProvider()

static void Arp::System::Rsc::ServiceManager::PublishRemotingServiceProvider ( CRemotingServiceProviderBase *  pServiceProvider)
static

Publishes a remoting service provider and all of its services.

Parameters
pServiceProviderThe remoting service provider to publish.

This operation should be used to publish Remoting services but not Rsc services.

◆ PublishService() [1/2]

template<class TService , class TServiceFactory >
void Arp::System::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 register.
TServiceFactoryThe factory type of the specified service. Must implement the singleton policy.

◆ PublishService() [2/2]

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

Registers a Rsc service.

The service provider name if retrieved from the specified service factory and defaults to Arp.

Template Parameters
TServiceThe service type to register.
TServiceFactoryThe factory type of the specified service. Shall implement the singleton policy.</patypeparamram>

◆ TryGetService() [1/2]

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

Gets a service of the specified service provider.

Parameters
serviceNameThe name of the service or service type to get.
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<7c>.

◆ TryGetService() [2/2]

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

Tries to get a service of the service provider Arp.

Parameters
serviceNameThe name of the service or service type to get.
resultThe pointer of the requested service instance or nullptr if the service could not be found.
Returns
true on success, otherwise false<7c>.

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