summaryrefslogtreecommitdiff
path: root/cpp/src/Ice/Initialize.cpp
diff options
context:
space:
mode:
authorBernard Normier <bernard@zeroc.com>2017-04-21 16:31:39 -0400
committerBernard Normier <bernard@zeroc.com>2017-04-21 16:31:39 -0400
commit708c40f1d45d5e311de5a746ada81b7f55cbef79 (patch)
tree1cb7b8232c51e626026655fe46622c3ea4d9060f /cpp/src/Ice/Initialize.cpp
parentAllow to run tests in Windows without C++ compiler (diff)
downloadice-708c40f1d45d5e311de5a746ada81b7f55cbef79.tar.bz2
ice-708c40f1d45d5e311de5a746ada81b7f55cbef79.tar.xz
ice-708c40f1d45d5e311de5a746ada81b7f55cbef79.zip
Changed default ctor of CommunicatorHolder
Diffstat (limited to 'cpp/src/Ice/Initialize.cpp')
-rw-r--r--cpp/src/Ice/Initialize.cpp27
1 files changed, 27 insertions, 0 deletions
diff --git a/cpp/src/Ice/Initialize.cpp b/cpp/src/Ice/Initialize.cpp
index e2a334037c0..3180cb367c6 100644
--- a/cpp/src/Ice/Initialize.cpp
+++ b/cpp/src/Ice/Initialize.cpp
@@ -405,6 +405,17 @@ Ice::CommunicatorHolder::CommunicatorHolder(shared_ptr<Communicator> communicato
}
Ice::CommunicatorHolder&
+Ice::CommunicatorHolder::operator=(shared_ptr<Communicator> communicator)
+{
+ if(_communicator)
+ {
+ _communicator->destroy();
+ }
+ _communicator = std::move(communicator);
+ return *this;
+}
+
+Ice::CommunicatorHolder&
Ice::CommunicatorHolder::operator=(CommunicatorHolder&& other)
{
if(_communicator)
@@ -417,6 +428,10 @@ Ice::CommunicatorHolder::operator=(CommunicatorHolder&& other)
#else // C++98 mapping
+Ice::CommunicatorHolder::CommunicatorHolder()
+{
+}
+
Ice::CommunicatorHolder::CommunicatorHolder(int& argc, const char* argv[], const InitializationData& initData,
int version) :
_communicator(initialize(argc, argv, initData, version))
@@ -486,6 +501,18 @@ Ice::CommunicatorHolder::CommunicatorHolder(const CommunicatorPtr& communicator)
_communicator(communicator)
{
}
+
+Ice::CommunicatorHolder&
+Ice::CommunicatorHolder::operator=(const CommunicatorPtr& communicator)
+{
+ if(_communicator)
+ {
+ _communicator->destroy();
+ }
+ _communicator = communicator;
+ return *this;
+}
+
#endif
Ice::CommunicatorHolder::~CommunicatorHolder()