Ice 3.7 C++11 API Reference
|
A helper class that uses Resource Acquisition Is Initialization (RAII) to initialize and hold a communicator instance, and automatically destroy the communicator when the holder goes out of scope. More...
#include <Ice/Ice.h>
Public Member Functions | |
const CommunicatorPtr & | communicator () const |
Obtains the communicator instance. More... | |
CommunicatorHolder () | |
The holder's initial state is empty. More... | |
CommunicatorHolder (CommunicatorHolder &&)=default | |
CommunicatorHolder (const CommunicatorHolder &)=delete | |
CommunicatorHolder (std::shared_ptr< Communicator > communicator) | |
Adopts the given communicator. More... | |
template<class... T> | |
CommunicatorHolder (T &&... args) | |
Calls initialize to create a communicator with the provided arguments. More... | |
operator bool () const | |
Determines whether the holder contains an instance. More... | |
const CommunicatorPtr & | operator-> () const |
Obtains the communicator instance. More... | |
CommunicatorHolder & | operator= (CommunicatorHolder &&holder) noexcept |
Adopts the communicator in the given holder. More... | |
CommunicatorHolder & | operator= (std::shared_ptr< Communicator > communicator) |
Adopts the given communicator. More... | |
CommunicatorPtr | release () |
Obtains the communicator instance and clears the reference held by the holder. More... | |
~CommunicatorHolder () | |
A helper class that uses Resource Acquisition Is Initialization (RAII) to initialize and hold a communicator instance, and automatically destroy the communicator when the holder goes out of scope.
Ice::CommunicatorHolder::CommunicatorHolder | ( | ) |
The holder's initial state is empty.
|
inlineexplicit |
Calls initialize to create a communicator with the provided arguments.
This constructor accepts all of the same overloaded argument styles as initialize.
Ice::CommunicatorHolder::CommunicatorHolder | ( | std::shared_ptr< Communicator > | communicator | ) |
Adopts the given communicator.
communicator | The new communicator instance to hold. |
|
delete |
|
default |
Ice::CommunicatorHolder::~CommunicatorHolder | ( | ) |
const CommunicatorPtr& Ice::CommunicatorHolder::communicator | ( | ) | const |
Obtains the communicator instance.
|
explicit |
Determines whether the holder contains an instance.
const CommunicatorPtr& Ice::CommunicatorHolder::operator-> | ( | ) | const |
Obtains the communicator instance.
|
noexcept |
Adopts the communicator in the given holder.
If this holder currently holds a communicator, it will be destroyed.
holder | The holder from which to adopt a communicator. |
CommunicatorHolder& Ice::CommunicatorHolder::operator= | ( | std::shared_ptr< Communicator > | communicator | ) |
Adopts the given communicator.
If this holder currently holds a communicator, it will be destroyed.
communicator | The new communicator instance to hold. |
CommunicatorPtr Ice::CommunicatorHolder::release | ( | ) |
Obtains the communicator instance and clears the reference held by the holder.