PLCnext API Documentation 25.0.2.69
Public Member Functions | List of all members
Arp::Base::Rsc::Commons::Services::RscClient Class Reference

This class monitors a RSC client call using RAII idiom. More...

#include <RscClient.TransactionGuard.hpp>

Inheritance diagram for Arp::Base::Rsc::Commons::Services::RscClient:
Inheritance graph

Public Member Functions

 TransactionGuard (IRscServiceProxy &serviceProxy)
 
 TransactionGuard (const TransactionGuard &arg)=delete
 
 TransactionGuard (TransactionGuard &&arg) noexcept=delete
 
TransactionGuard & operator= (const TransactionGuard &arg)=delete
 
TransactionGuard & operator= (TransactionGuard &&arg) noexcept=delete
 
 RscClient (const String &ipcAppName)
 Constructs a RSC client for IPC communication. More...
 
 RscClient (const Url &url=Url::GetEmpty())
 Constructs a RSC client for remote communication. More...
 
 RscClient (const RscClient &arg)=delete
 
 RscClient (RscClient &&arg) noexcept
 The default move constructor. More...
 
RscClientoperator= (const RscClient &arg)=delete
 
RscClientoperator= (RscClient &&arg) noexcept
 The default move-assignment operator. More...
 
 ~RscClient (void)
 The default destructor.
 
bool IsIpc (void) const
 Determines if this client is used for IPC (local) communication. More...
 
bool IsConnected (void) const
 Determines if this instance is connected yet. More...
 
RscReaderGetReader (void)
 Gets the RSC reader. More...
 
RscWriterGetWriter (void)
 Gets the RSC writer. More...
 
void Connect (const Url &url=Url::GetEmpty())
 Connect this client to the specified url. More...
 
bool TryConnect (const Url &url=Url::GetEmpty())
 Tries to connect this client to the specified url. More...
 
void Reconnect (const Url &url=Url::GetEmpty())
 Reconnect this client to the specified url. More...
 
bool TryReconnect (const Url &url=Url::GetEmpty())
 Tries to reconnect this client to the specified url. More...
 
void Close (bool disconnectRemoting=true)
 Disconnects this client. More...
 
void Authenticate (SecurityToken authenticationToken)
 Authenticates the actual connection. More...
 
RscHandle GetServiceProviderHandle (const char *serviceProviderName)
 Gets the service provider handle of the specified service provider name. More...
 
RscHandle GetServiceHandle (RscHandle serviceProviderHandle, const char *serviceName)
 Gets the service handle of the specified service. More...
 
RscHandle GetServiceHandle (const char *serviceProviderName, const char *serviceName)
 Gets the service handle of the specified service. More...
 
void GetServiceHandles (const char *serviceProviderName, const char *serviceName, RscHandle &serviceProviderHandle, RscHandle &serviceHandle)
 Gets the service handles of the specified service. More...
 
Impl & GetImpl (void)
 For internal use only. More...
 
const Impl & GetImpl (void) const
 

Detailed Description

This class monitors a RSC client call using RAII idiom.

This class implements a RSC client.

This class is not intended for direct use, but required by RscGenerator to implement services.

Constructor & Destructor Documentation

◆ RscClient() [1/3]

Arp::Base::Rsc::Commons::Services::RscClient::RscClient ( const String ipcAppName)

Constructs a RSC client for IPC communication.

Parameters
ipcAppNameThe application name of the process to connect to.

◆ RscClient() [2/3]

Arp::Base::Rsc::Commons::Services::RscClient::RscClient ( const Url url = Url::GetEmpty())

Constructs a RSC client for remote communication.

Parameters
urlThe url to connect to.

◆ RscClient() [3/3]

Arp::Base::Rsc::Commons::Services::RscClient::RscClient ( RscClient &&  arg)
defaultnoexcept

The default move constructor.

Parameters
argThe argument to move.

Member Function Documentation

◆ Authenticate()

void Arp::Base::Rsc::Commons::Services::RscClient::Authenticate ( SecurityToken  authenticationToken)

Authenticates the actual connection.

Parameters
authenticationTokenThe authentication token.

The authentication token might be retrieved by IPasswordAuthenticationService

See also
Arp::System::Security::Services::IPasswordAuthenticationService

◆ Close()

void Arp::Base::Rsc::Commons::Services::RscClient::Close ( bool  disconnectRemoting = true)

Disconnects this client.

Parameters
disconnectRemotingIf this parameter is true the connection is closed explicitly by RSC, before the socket connection is closed. This might solve any troubleshooting during shutdown of the process.

◆ Connect()

void Arp::Base::Rsc::Commons::Services::RscClient::Connect ( const Url url = Url::GetEmpty())

Connect this client to the specified url.

Parameters
urlThe url to connect to for any communication kind.
See also
RscCommunicationKind
Exceptions
RscExceptionIf the connection could not be established.

◆ GetImpl()

const RscClient::Impl & Arp::Base::Rsc::Commons::Services::RscClient::GetImpl ( void  )

For internal use only.

Returns
The impl instance.

◆ GetReader()

RscReader & Arp::Base::Rsc::Commons::Services::RscClient::GetReader ( void  )

Gets the RSC reader.

Returns
The RSC reader.

◆ GetServiceHandle() [1/2]

RscHandle Arp::Base::Rsc::Commons::Services::RscClient::GetServiceHandle ( const char *  serviceProviderName,
const char *  serviceName 
)

Gets the service handle of the specified service.

Parameters
serviceProviderNameThe service provider name of the service.
serviceNameThe service name to get the handle from.
Returns
The service handle of the specified service.

◆ GetServiceHandle() [2/2]

RscHandle Arp::Base::Rsc::Commons::Services::RscClient::GetServiceHandle ( RscHandle  serviceProviderHandle,
const char *  serviceName 
)

Gets the service handle of the specified service.

Parameters
serviceProviderHandleThe service provider handle of the service.
serviceNameThe service name to get the handle from.
Returns
The service handle of the specified service.

◆ GetServiceHandles()

void Arp::Base::Rsc::Commons::Services::RscClient::GetServiceHandles ( const char *  serviceProviderName,
const char *  serviceName,
RscHandle &  serviceProviderHandle,
RscHandle &  serviceHandle 
)

Gets the service handles of the specified service.

Parameters
serviceProviderNameThe service provider name of the service.
serviceNameThe service name to get the handle from.
serviceProviderHandleThe resulting service provider handle.
serviceHandleThe resulting service handle.

◆ GetServiceProviderHandle()

RscHandle Arp::Base::Rsc::Commons::Services::RscClient::GetServiceProviderHandle ( const char *  serviceProviderName)

Gets the service provider handle of the specified service provider name.

Parameters
serviceProviderNameThe specified service provider name to get the handle from.
Returns
The service provider handle of the specified service provider name.

◆ GetWriter()

RscWriter & Arp::Base::Rsc::Commons::Services::RscClient::GetWriter ( void  )

Gets the RSC writer.

Returns
The RSC writer.

◆ IsConnected()

bool Arp::Base::Rsc::Commons::Services::RscClient::IsConnected ( void  ) const

Determines if this instance is connected yet.

Returns
true if this instance is connected, otherwise false.

◆ IsIpc()

bool Arp::Base::Rsc::Commons::Services::RscClient::IsIpc ( void  ) const

Determines if this client is used for IPC (local) communication.

Returns
true if this client is used for IPC (local) communication, otherwise false.

◆ operator=()

RscClient & Arp::Base::Rsc::Commons::Services::RscClient::operator= ( RscClient &&  arg)
defaultnoexcept

The default move-assignment operator.

Parameters
argThe argument to move.
Returns
This instance.

◆ Reconnect()

void Arp::Base::Rsc::Commons::Services::RscClient::Reconnect ( const Url url = Url::GetEmpty())

Reconnect this client to the specified url.

Parameters
urlThe url to connect to for any communication kind.
See also
RscCommunicationKind
Exceptions
RscExceptionIf the connection could not be established.

◆ TryConnect()

bool Arp::Base::Rsc::Commons::Services::RscClient::TryConnect ( const Url url = Url::GetEmpty())

Tries to connect this client to the specified url.

Parameters
urlThe url to connect to for any communication kind.
See also
RscCommunicationKind
Returns
true if the connection could be established, otherwise false.

◆ TryReconnect()

bool Arp::Base::Rsc::Commons::Services::RscClient::TryReconnect ( const Url url = Url::GetEmpty())

Tries to reconnect this client to the specified url.

Parameters
urlThe url to connect to for any communication kind.
See also
RscCommunicationKind
Returns
true if the connection could be established, otherwise false.

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