diff options
author | Bernard Normier <bernard@zeroc.com> | 2017-01-11 16:15:49 -0500 |
---|---|---|
committer | Bernard Normier <bernard@zeroc.com> | 2017-01-11 16:15:49 -0500 |
commit | f6a5299766fe3db2273afd78f145486b091513ed (patch) | |
tree | 87eead6b9fa33e43f7b863093fd410167d9cb23a /cpp | |
parent | Fixed Glacier2/router IE browser test failure (diff) | |
download | ice-f6a5299766fe3db2273afd78f145486b091513ed.tar.bz2 ice-f6a5299766fe3db2273afd78f145486b091513ed.tar.xz ice-f6a5299766fe3db2273afd78f145486b091513ed.zip |
Moved UniquePtr to IceInternal
Removed ctor and assignment operator from UniquePtr
Diffstat (limited to 'cpp')
36 files changed, 116 insertions, 123 deletions
diff --git a/cpp/include/Ice/OutgoingAsync.h b/cpp/include/Ice/OutgoingAsync.h index cb83850a048..f401975a569 100644 --- a/cpp/include/Ice/OutgoingAsync.h +++ b/cpp/include/Ice/OutgoingAsync.h @@ -22,7 +22,7 @@ #include <Ice/InputStream.h> #include <Ice/ObserverHelper.h> #include <Ice/LocalException.h> -#include <IceUtil/UniquePtr.h> +#include <Ice/UniquePtr.h> #ifndef ICE_CPP11_MAPPING # include <Ice/AsyncResult.h> @@ -171,8 +171,8 @@ protected: Ice::LocalObjectPtr _cookie; #endif - IceUtil::UniquePtr<Ice::Exception> _ex; - IceUtil::UniquePtr<Ice::LocalException> _cancellationException; + IceInternal::UniquePtr<Ice::Exception> _ex; + IceInternal::UniquePtr<Ice::LocalException> _cancellationException; InvocationObserver _observer; ObserverHelperT<Ice::Instrumentation::ChildInvocationObserver> _childObserver; diff --git a/cpp/include/IceUtil/SHA1.h b/cpp/include/Ice/SHA1.h index d3ec7e48499..7666d0c2a0f 100644 --- a/cpp/include/IceUtil/SHA1.h +++ b/cpp/include/Ice/SHA1.h @@ -7,15 +7,15 @@ // // ********************************************************************** -#ifndef ICE_UTIL_SHA1_H -#define ICE_UTIL_SHA1_H +#ifndef ICE_SHA1_H +#define ICE_SHA1_H -#include <IceUtil/Config.h> -#include <IceUtil/UniquePtr.h> +#include <Ice/Config.h> +#include <Ice/UniquePtr.h> #include <vector> -namespace IceUtilInternal +namespace IceInternal { ICE_API void @@ -39,7 +39,7 @@ private: SHA1 operator=(const SHA1&); class Hasher; - IceUtil::UniquePtr<Hasher> _hasher; + UniquePtr<Hasher> _hasher; }; #endif diff --git a/cpp/include/IceUtil/UniquePtr.h b/cpp/include/Ice/UniquePtr.h index 0a81df47fad..0abf17b5843 100644 --- a/cpp/include/IceUtil/UniquePtr.h +++ b/cpp/include/Ice/UniquePtr.h @@ -7,12 +7,12 @@ // // ********************************************************************** -#ifndef ICE_UTIL_UNIQUE_PTR_H -#define ICE_UTIL_UNIQUE_PTR_H +#ifndef ICE_UNIQUE_PTR_H +#define ICE_UNIQUE_PTR_H -#include <IceUtil/Config.h> +#include <Ice/Config.h> -namespace IceUtil +namespace IceInternal { #ifdef ICE_CPP11_MAPPING @@ -32,17 +32,6 @@ public: { } - UniquePtr(UniquePtr& o) : - _ptr(o.release()) - { - } - - UniquePtr& operator=(UniquePtr& o) - { - reset(o.release()); - return *this; - } - ~UniquePtr() { if(_ptr != 0) @@ -79,7 +68,6 @@ public: return _ptr; } - T* get() const { return _ptr; @@ -99,6 +87,9 @@ public: private: + UniquePtr(UniquePtr&); + UniquePtr& operator=(UniquePtr&); + T* _ptr; }; diff --git a/cpp/include/IceUtil/IceUtil.h b/cpp/include/IceUtil/IceUtil.h index ca25d393152..b7b3c3c30c3 100644 --- a/cpp/include/IceUtil/IceUtil.h +++ b/cpp/include/IceUtil/IceUtil.h @@ -40,7 +40,6 @@ #include <IceUtil/Time.h> #include <IceUtil/Timer.h> #include <IceUtil/UUID.h> -#include <IceUtil/UniquePtr.h> #include <IceUtil/PopDisableWarnings.h> #endif diff --git a/cpp/src/Glacier2Lib/SessionHelper.cpp b/cpp/src/Glacier2Lib/SessionHelper.cpp index 074f4d7a6ae..0e52daeba47 100644 --- a/cpp/src/Glacier2Lib/SessionHelper.cpp +++ b/cpp/src/Glacier2Lib/SessionHelper.cpp @@ -541,7 +541,7 @@ private: const Glacier2::SessionCallbackPtr _callback; const Glacier2::SessionHelperPtr _session; - IceUtil::UniquePtr<Ice::Exception> _ex; + IceInternal::UniquePtr<Ice::Exception> _ex; }; class CreatedCommunicator : public Ice::DispatcherCall diff --git a/cpp/src/Ice/Application.cpp b/cpp/src/Ice/Application.cpp index 4b81f69614e..a2b733053e0 100644 --- a/cpp/src/Ice/Application.cpp +++ b/cpp/src/Ice/Application.cpp @@ -13,7 +13,7 @@ #include <IceUtil/CtrlCHandler.h> #include <IceUtil/Cond.h> #include <IceUtil/ArgVector.h> -#include <IceUtil/UniquePtr.h> +#include <Ice/UniquePtr.h> using namespace std; using namespace Ice; diff --git a/cpp/src/Ice/BatchRequestQueue.h b/cpp/src/Ice/BatchRequestQueue.h index c8cb3090e7a..878b2a2ef6d 100644 --- a/cpp/src/Ice/BatchRequestQueue.h +++ b/cpp/src/Ice/BatchRequestQueue.h @@ -13,7 +13,7 @@ #include <IceUtil/Shared.h> #include <IceUtil/Mutex.h> #include <IceUtil/Monitor.h> -#include <IceUtil/UniquePtr.h> +#include <Ice/UniquePtr.h> #include <Ice/BatchRequestInterceptor.h> #include <Ice/BatchRequestQueueF.h> @@ -54,7 +54,7 @@ private: bool _batchStreamCanFlush; int _batchRequestNum; size_t _batchMarker; - IceUtil::UniquePtr<Ice::LocalException> _exception; + IceInternal::UniquePtr<Ice::LocalException> _exception; size_t _maxSize; }; diff --git a/cpp/src/Ice/ConnectRequestHandler.cpp b/cpp/src/Ice/ConnectRequestHandler.cpp index e8b5acbd486..586852fe1fb 100644 --- a/cpp/src/Ice/ConnectRequestHandler.cpp +++ b/cpp/src/Ice/ConnectRequestHandler.cpp @@ -272,7 +272,7 @@ ConnectRequestHandler::flushRequests() #ifdef ICE_CPP11_MAPPING std::unique_ptr<Ice::LocalException> exception; #else - IceUtil::UniquePtr<Ice::LocalException> exception; + IceInternal::UniquePtr<Ice::LocalException> exception; #endif while(!_requests.empty()) // _requests is immutable when _flushing = true { diff --git a/cpp/src/Ice/ConnectRequestHandler.h b/cpp/src/Ice/ConnectRequestHandler.h index 1a250e41de4..4a0c5b2892b 100644 --- a/cpp/src/Ice/ConnectRequestHandler.h +++ b/cpp/src/Ice/ConnectRequestHandler.h @@ -12,7 +12,7 @@ #include <IceUtil/Monitor.h> #include <IceUtil/Mutex.h> -#include <IceUtil/UniquePtr.h> +#include <Ice/UniquePtr.h> #include <Ice/ConnectRequestHandlerF.h> #include <Ice/RequestHandler.h> @@ -63,7 +63,7 @@ private: Ice::ConnectionIPtr _connection; bool _compress; - IceUtil::UniquePtr<Ice::LocalException> _exception; + IceInternal::UniquePtr<Ice::LocalException> _exception; bool _initialized; bool _flushing; diff --git a/cpp/src/Ice/ConnectionI.h b/cpp/src/Ice/ConnectionI.h index 6bd7437c436..72652518b94 100644 --- a/cpp/src/Ice/ConnectionI.h +++ b/cpp/src/Ice/ConnectionI.h @@ -15,7 +15,7 @@ #include <IceUtil/Time.h> #include <IceUtil/StopWatch.h> #include <IceUtil/Timer.h> -#include <IceUtil/UniquePtr.h> +#include <Ice/UniquePtr.h> #include <Ice/CommunicatorF.h> #include <Ice/Connection.h> @@ -349,7 +349,7 @@ private: std::map<Int, IceInternal::OutgoingAsyncBasePtr> _asyncRequests; std::map<Int, IceInternal::OutgoingAsyncBasePtr>::iterator _asyncRequestsHint; - IceUtil::UniquePtr<LocalException> _exception; + IceInternal::UniquePtr<LocalException> _exception; const size_t _messageSizeMax; IceInternal::BatchRequestQueuePtr _batchRequestQueue; diff --git a/cpp/src/Ice/Instance.h b/cpp/src/Ice/Instance.h index 2e4fd503b16..c0d679085e3 100644 --- a/cpp/src/Ice/Instance.h +++ b/cpp/src/Ice/Instance.h @@ -42,7 +42,6 @@ #include <Ice/FacetMap.h> #include <Ice/Process.h> #include <list> -#include <IceUtil/UniquePtr.h> namespace Ice { diff --git a/cpp/src/Ice/LocatorInfo.h b/cpp/src/Ice/LocatorInfo.h index 36528f7790d..7809f211eb1 100644 --- a/cpp/src/Ice/LocatorInfo.h +++ b/cpp/src/Ice/LocatorInfo.h @@ -22,7 +22,7 @@ #include <Ice/PropertiesF.h> #include <Ice/Version.h> -#include <IceUtil/UniquePtr.h> +#include <Ice/UniquePtr.h> namespace IceInternal { @@ -139,7 +139,7 @@ public: bool _sent; bool _response; Ice::ObjectPrxPtr _proxy; - IceUtil::UniquePtr<Ice::Exception> _exception; + IceInternal::UniquePtr<Ice::Exception> _exception; }; typedef IceUtil::Handle<Request> RequestPtr; diff --git a/cpp/src/Ice/OutgoingAsync.cpp b/cpp/src/Ice/OutgoingAsync.cpp index 40c753fe656..4776672ff9a 100644 --- a/cpp/src/Ice/OutgoingAsync.cpp +++ b/cpp/src/Ice/OutgoingAsync.cpp @@ -994,7 +994,7 @@ OutgoingAsync::response() string operation; _is.read(operation, false); - IceUtil::UniquePtr<RequestFailedException> ex; + IceInternal::UniquePtr<RequestFailedException> ex; switch(replyStatus) { case replyObjectNotExist: @@ -1035,7 +1035,7 @@ OutgoingAsync::response() string unknown; _is.read(unknown, false); - IceUtil::UniquePtr<UnknownException> ex; + IceInternal::UniquePtr<UnknownException> ex; switch(replyStatus) { case replyUnknownException: diff --git a/cpp/src/Ice/Reference.cpp b/cpp/src/Ice/Reference.cpp index 8ec124a1c41..c55b3037a33 100644 --- a/cpp/src/Ice/Reference.cpp +++ b/cpp/src/Ice/Reference.cpp @@ -1796,7 +1796,7 @@ IceInternal::RoutableReference::createConnection(const vector<EndpointIPtr>& all const vector<EndpointIPtr> _endpoints; const GetConnectionCallbackPtr _callback; size_t _i; - IceUtil::UniquePtr<Ice::LocalException> _exception; + IceInternal::UniquePtr<Ice::LocalException> _exception; }; // diff --git a/cpp/src/Ice/RequestHandler.h b/cpp/src/Ice/RequestHandler.h index ac97141f743..5921ae52c01 100644 --- a/cpp/src/Ice/RequestHandler.h +++ b/cpp/src/Ice/RequestHandler.h @@ -11,7 +11,7 @@ #define ICE_REQUEST_HANDLER_H #include <IceUtil/Shared.h> -#include <IceUtil/UniquePtr.h> +#include <Ice/UniquePtr.h> #include <Ice/RequestHandlerF.h> #include <Ice/ReferenceF.h> @@ -44,7 +44,7 @@ public: private: - IceUtil::UniquePtr<Ice::LocalException> _ex; + IceInternal::UniquePtr<Ice::LocalException> _ex; }; diff --git a/cpp/src/Ice/SHA1.cpp b/cpp/src/Ice/SHA1.cpp index 141ffda9a6a..e8a7d986d42 100644 --- a/cpp/src/Ice/SHA1.cpp +++ b/cpp/src/Ice/SHA1.cpp @@ -7,7 +7,7 @@ // // ********************************************************************** -#include <IceUtil/SHA1.h> +#include <Ice/SHA1.h> #ifndef ICE_OS_UWP # if defined(_WIN32) @@ -25,7 +25,7 @@ using namespace IceUtil; #ifndef ICE_OS_UWP -namespace IceUtilInternal +namespace IceInternal { class SHA1::Hasher @@ -65,7 +65,7 @@ namespace const int SHA_DIGEST_LENGTH = 20; } -IceUtilInternal::SHA1::Hasher::Hasher() : +IceInternal::SHA1::Hasher::Hasher() : _ctx(0), _hash(0) { @@ -80,7 +80,7 @@ IceUtilInternal::SHA1::Hasher::Hasher() : } } -IceUtilInternal::SHA1::Hasher::~Hasher() +IceInternal::SHA1::Hasher::~Hasher() { if(_hash) { @@ -93,19 +93,19 @@ IceUtilInternal::SHA1::Hasher::~Hasher() } } # elif defined(__APPLE__) -IceUtilInternal::SHA1::Hasher::Hasher() +IceInternal::SHA1::Hasher::Hasher() { CC_SHA1_Init(&_ctx); } # else -IceUtilInternal::SHA1::Hasher::Hasher() +IceInternal::SHA1::Hasher::Hasher() { SHA1_Init(&_ctx); } # endif void -IceUtilInternal::SHA1::Hasher::update(const unsigned char* data, size_t length) +IceInternal::SHA1::Hasher::update(const unsigned char* data, size_t length) { # if defined(_WIN32) if(!CryptHashData(_hash, data, static_cast<DWORD>(length), 0)) @@ -120,7 +120,7 @@ IceUtilInternal::SHA1::Hasher::update(const unsigned char* data, size_t length) } void -IceUtilInternal::SHA1::Hasher::finalize(vector<unsigned char>& md) +IceInternal::SHA1::Hasher::finalize(vector<unsigned char>& md) { # if defined(_WIN32) md.resize(SHA_DIGEST_LENGTH); @@ -138,30 +138,30 @@ IceUtilInternal::SHA1::Hasher::finalize(vector<unsigned char>& md) # endif } -IceUtilInternal::SHA1::SHA1() : +IceInternal::SHA1::SHA1() : _hasher(new Hasher()) { } -IceUtilInternal::SHA1::~SHA1() +IceInternal::SHA1::~SHA1() { } void -IceUtilInternal::SHA1::update(const unsigned char* data, std::size_t length) +IceInternal::SHA1::update(const unsigned char* data, std::size_t length) { _hasher->update(data, length); } void -IceUtilInternal::SHA1::finalize(std::vector<unsigned char>& md) +IceInternal::SHA1::finalize(std::vector<unsigned char>& md) { _hasher->finalize(md); } #endif void -IceUtilInternal::sha1(const unsigned char* data, size_t length, vector<unsigned char>& md) +IceInternal::sha1(const unsigned char* data, size_t length, vector<unsigned char>& md) { #if defined(ICE_OS_UWP) auto dataA = diff --git a/cpp/src/Ice/WSTransceiver.cpp b/cpp/src/Ice/WSTransceiver.cpp index 2c074c75974..413b88ed630 100644 --- a/cpp/src/Ice/WSTransceiver.cpp +++ b/cpp/src/Ice/WSTransceiver.cpp @@ -18,7 +18,7 @@ #include <Ice/LocalException.h> #include <Ice/Base64.h> #include <IceUtil/Random.h> -#include <IceUtil/SHA1.h> +#include <Ice/SHA1.h> #include <IceUtil/StringUtil.h> // Python 2.7 under Windows. @@ -1028,7 +1028,7 @@ IceInternal::WSTransceiver::handleRequest(Buffer& responseBuffer) out << "Sec-WebSocket-Accept: "; string input = key + _wsUUID; vector<unsigned char> hash; - IceUtilInternal::sha1(reinterpret_cast<const unsigned char*>(&input[0]), input.size(), hash); + sha1(reinterpret_cast<const unsigned char*>(&input[0]), input.size(), hash); out << IceInternal::Base64::encode(hash) << "\r\n" << "\r\n"; // EOM string str = out.str(); @@ -1126,7 +1126,7 @@ IceInternal::WSTransceiver::handleResponse() } string input = _key + _wsUUID; vector<unsigned char> hash; - IceUtilInternal::sha1(reinterpret_cast<const unsigned char*>(&input[0]), input.size(), hash); + sha1(reinterpret_cast<const unsigned char*>(&input[0]), input.size(), hash); if(val != IceInternal::Base64::encode(hash)) { throw WebSocketException("invalid value `" + val + "' for Sec-WebSocket-Accept"); diff --git a/cpp/src/IceBT/TransceiverI.h b/cpp/src/IceBT/TransceiverI.h index 705d22865a4..9df1032702f 100644 --- a/cpp/src/IceBT/TransceiverI.h +++ b/cpp/src/IceBT/TransceiverI.h @@ -15,7 +15,7 @@ #include <IceBT/StreamSocket.h> #include <Ice/Transceiver.h> -#include <IceUtil/UniquePtr.h> +#include <Ice/UniquePtr.h> namespace IceBT { @@ -56,7 +56,7 @@ private: std::string _addr; std::string _uuid; bool _needConnect; - IceUtil::UniquePtr<Ice::Exception> _exception; + IceInternal::UniquePtr<Ice::Exception> _exception; IceUtil::Monitor<IceUtil::Mutex> _lock; void connectCompleted(int, const ConnectionPtr&); diff --git a/cpp/src/IceGrid/AdapterCache.cpp b/cpp/src/IceGrid/AdapterCache.cpp index 21d15103452..e9fd5d85e2b 100644 --- a/cpp/src/IceGrid/AdapterCache.cpp +++ b/cpp/src/IceGrid/AdapterCache.cpp @@ -169,7 +169,7 @@ private: int _synchronizeCount; int _synchronizedCount; int _nReplicas; - IceUtil::UniquePtr<Ice::Exception> _exception; + IceInternal::UniquePtr<Ice::Exception> _exception; }; typedef IceUtil::Handle<ReplicaGroupSyncCallback> ReplicaGroupSyncCallbackPtr; diff --git a/cpp/src/IceGrid/Database.cpp b/cpp/src/IceGrid/Database.cpp index 5c9167b784d..ce458e52936 100644 --- a/cpp/src/IceGrid/Database.cpp +++ b/cpp/src/IceGrid/Database.cpp @@ -713,8 +713,8 @@ Database::updateApplication(const ApplicationUpdateInfo& updt, bool noRestart, A ApplicationInfo oldApp; ApplicationUpdateInfo update = updt; - IceUtil::UniquePtr<ApplicationHelper> previous; - IceUtil::UniquePtr<ApplicationHelper> helper; + IceInternal::UniquePtr<ApplicationHelper> previous; + IceInternal::UniquePtr<ApplicationHelper> helper; try { Lock sync(*this); @@ -755,8 +755,8 @@ Database::syncApplicationDescriptor(const ApplicationDescriptor& newDesc, bool n ApplicationUpdateInfo update; ApplicationInfo oldApp; - IceUtil::UniquePtr<ApplicationHelper> previous; - IceUtil::UniquePtr<ApplicationHelper> helper; + IceInternal::UniquePtr<ApplicationHelper> previous; + IceInternal::UniquePtr<ApplicationHelper> helper; try { Lock sync(*this); @@ -800,8 +800,8 @@ Database::instantiateServer(const string& application, ApplicationUpdateInfo update; ApplicationInfo oldApp; - IceUtil::UniquePtr<ApplicationHelper> previous; - IceUtil::UniquePtr<ApplicationHelper> helper; + IceInternal::UniquePtr<ApplicationHelper> previous; + IceInternal::UniquePtr<ApplicationHelper> helper; try { diff --git a/cpp/src/IceGrid/DescriptorParser.cpp b/cpp/src/IceGrid/DescriptorParser.cpp index 173cdb72011..8e8d96542d0 100644 --- a/cpp/src/IceGrid/DescriptorParser.cpp +++ b/cpp/src/IceGrid/DescriptorParser.cpp @@ -61,15 +61,15 @@ private: int _line; int _column; - IceUtil::UniquePtr<ApplicationDescriptorBuilder> _currentApplication; - IceUtil::UniquePtr<NodeDescriptorBuilder> _currentNode; - IceUtil::UniquePtr<TemplateDescriptorBuilder> _currentTemplate; - IceUtil::UniquePtr<ServerInstanceDescriptorBuilder> _currentServerInstance; - IceUtil::UniquePtr<ServiceInstanceDescriptorBuilder> _currentServiceInstance; - IceUtil::UniquePtr<ServerDescriptorBuilder> _currentServer; - IceUtil::UniquePtr<ServiceDescriptorBuilder> _currentService; + IceInternal::UniquePtr<ApplicationDescriptorBuilder> _currentApplication; + IceInternal::UniquePtr<NodeDescriptorBuilder> _currentNode; + IceInternal::UniquePtr<TemplateDescriptorBuilder> _currentTemplate; + IceInternal::UniquePtr<ServerInstanceDescriptorBuilder> _currentServerInstance; + IceInternal::UniquePtr<ServiceInstanceDescriptorBuilder> _currentServiceInstance; + IceInternal::UniquePtr<ServerDescriptorBuilder> _currentServer; + IceInternal::UniquePtr<ServiceDescriptorBuilder> _currentService; CommunicatorDescriptorBuilder* _currentCommunicator; - IceUtil::UniquePtr<PropertySetDescriptorBuilder> _currentPropertySet; + IceInternal::UniquePtr<PropertySetDescriptorBuilder> _currentPropertySet; bool _isTopLevel; bool _inAdapter; diff --git a/cpp/src/IceGrid/IceGridNode.cpp b/cpp/src/IceGrid/IceGridNode.cpp index 0c14ca557b4..027a266a3a3 100644 --- a/cpp/src/IceGrid/IceGridNode.cpp +++ b/cpp/src/IceGrid/IceGridNode.cpp @@ -81,7 +81,7 @@ private: IceUtil::TimerPtr _timer; RegistryIPtr _registry; NodeIPtr _node; - IceUtil::UniquePtr<NodeSessionManager> _sessions; + IceInternal::UniquePtr<NodeSessionManager> _sessions; Ice::ObjectAdapterPtr _adapter; }; diff --git a/cpp/src/IceGrid/LocatorI.cpp b/cpp/src/IceGrid/LocatorI.cpp index 1ca7a9645d6..575ebe71fd4 100644 --- a/cpp/src/IceGrid/LocatorI.cpp +++ b/cpp/src/IceGrid/LocatorI.cpp @@ -454,7 +454,7 @@ private: unsigned int _count; LocatorAdapterInfoSeq::const_iterator _lastAdapter; std::map<std::string, Ice::ObjectPrx> _proxies; - IceUtil::UniquePtr<Ice::Exception> _exception; + IceInternal::UniquePtr<Ice::Exception> _exception; }; class RoundRobinRequest : public LocatorI::Request, SynchronizationCallback, public IceUtil::Mutex @@ -752,7 +752,7 @@ private: bool _waitForActivation; set<string> _failed; set<string> _activatingOrFailed; - IceUtil::UniquePtr<Ice::Exception> _exception; + IceInternal::UniquePtr<Ice::Exception> _exception; }; class FindAdapterByIdCallback : public SynchronizationCallback diff --git a/cpp/src/IceGrid/NodeSessionManager.cpp b/cpp/src/IceGrid/NodeSessionManager.cpp index dcf06b34a05..c29103ac0ce 100644 --- a/cpp/src/IceGrid/NodeSessionManager.cpp +++ b/cpp/src/IceGrid/NodeSessionManager.cpp @@ -35,7 +35,7 @@ NodeSessionPrx NodeSessionKeepAliveThread::createSession(InternalRegistryPrx& registry, IceUtil::Time& timeout) { NodeSessionPrx session; - IceUtil::UniquePtr<Ice::Exception> exception; + IceInternal::UniquePtr<Ice::Exception> exception; TraceLevelsPtr traceLevels = _node->getTraceLevels(); try { diff --git a/cpp/src/IceGrid/RegistryI.h b/cpp/src/IceGrid/RegistryI.h index 25b8891ea26..8fa74eb3938 100644 --- a/cpp/src/IceGrid/RegistryI.h +++ b/cpp/src/IceGrid/RegistryI.h @@ -11,6 +11,7 @@ #define ICE_GRID_REGISTRYI_H #include <IceUtil/Timer.h> +#include <Ice/UniquePtr.h> #include <IceGrid/Registry.h> #include <IceGrid/Internal.h> #include <IceGrid/PlatformInfo.h> @@ -119,7 +120,7 @@ private: IceUtil::TimerPtr _timer; SessionServantManagerPtr _servantManager; int _sessionTimeout; - IceUtil::UniquePtr<ReplicaSessionManager> _session; + IceInternal::UniquePtr<ReplicaSessionManager> _session; mutable PlatformInfo _platform; ClientSessionFactoryPtr _clientSessionFactory; diff --git a/cpp/src/IceGrid/ReplicaSessionManager.cpp b/cpp/src/IceGrid/ReplicaSessionManager.cpp index 9895963a1c5..dfc55e299bd 100644 --- a/cpp/src/IceGrid/ReplicaSessionManager.cpp +++ b/cpp/src/IceGrid/ReplicaSessionManager.cpp @@ -465,7 +465,7 @@ ReplicaSessionPrx ReplicaSessionManager::createSession(InternalRegistryPrx& registry, IceUtil::Time& timeout) { ReplicaSessionPrx session; - IceUtil::UniquePtr<Ice::Exception> exception; + IceInternal::UniquePtr<Ice::Exception> exception; try { if(_traceLevels && _traceLevels->replica > 1) diff --git a/cpp/src/IceGrid/ServerCache.cpp b/cpp/src/IceGrid/ServerCache.cpp index af4bd9654ea..20a9d967ff3 100644 --- a/cpp/src/IceGrid/ServerCache.cpp +++ b/cpp/src/IceGrid/ServerCache.cpp @@ -393,7 +393,7 @@ ServerEntry::unsync() Lock sync(*this); if(_loaded.get()) { - _load = _loaded; + _load.reset(_loaded.release()); } _proxy = 0; _adapters.clear(); @@ -421,7 +421,7 @@ ServerEntry::update(const ServerInfo& info, bool noRestart) { Lock sync(*this); - IceUtil::UniquePtr<ServerInfo> descriptor(new ServerInfo()); + IceInternal::UniquePtr<ServerInfo> descriptor(new ServerInfo()); *descriptor = info; _updated = true; @@ -430,17 +430,17 @@ ServerEntry::update(const ServerInfo& info, bool noRestart) { if(_loaded.get() && descriptor->node != _loaded->node) { - _destroy = _loaded; + _destroy.reset(_loaded.release()); } else if(_load.get() && descriptor->node != _load->node) { - _destroy = _load; + _destroy.reset(_load.release()); } } - _load = descriptor; + _load.reset(descriptor.release()); _noRestart = noRestart; - _loaded.reset(0); + _loaded.reset(); _allocatable = info.descriptor->allocatable; if(info.descriptor->activation == "session") { @@ -462,18 +462,18 @@ ServerEntry::destroy(bool noRestart) if(_loaded.get()) { assert(!_destroy.get()); - _destroy = _loaded; + _destroy.reset(_loaded.release()); } else if(_load.get()) { assert(!_destroy.get()); - _destroy = _load; + _destroy.reset(_load.release()); } } _noRestart = noRestart; - _load.reset(0); - _loaded.reset(0); + _load.reset(); + _loaded.reset(); _allocatable = false; } @@ -685,7 +685,7 @@ ServerEntry::syncImpl() if(!_load.get() && !_destroy.get()) { - _load = _loaded; // Re-load the current server. + _load.reset(_loaded.release()); // Re-load the current server. } _updated = false; @@ -853,8 +853,8 @@ ServerEntry::loadCallback(const ServerPrx& proxy, const AdapterPrxDict& adpts, i // time should set the correct timeout before invoking on the // proxy (e.g.: server start/stop, adapter activate). // - _loaded = _load; - assert(_loaded.get()); + assert(_load.get()); + _loaded.reset(_load.release()); _proxy = proxy; _adapters = adpts; _activationTimeout = at; @@ -1126,7 +1126,7 @@ ServerEntry::allocated(const SessionIPtr& session) _updated = true; if(!_load.get()) { - _load = _loaded; + _load.reset(_loaded.release()); } _session = session; _load->sessionId = session->getId(); @@ -1213,7 +1213,7 @@ ServerEntry::released(const SessionIPtr& session) _updated = true; if(!_load.get()) { - _load = _loaded; + _load.reset(_loaded.release()); } _load->sessionId = ""; _session = 0; diff --git a/cpp/src/IceGrid/ServerCache.h b/cpp/src/IceGrid/ServerCache.h index 224d2c0e341..d604439caa8 100644 --- a/cpp/src/IceGrid/ServerCache.h +++ b/cpp/src/IceGrid/ServerCache.h @@ -12,6 +12,7 @@ #include <IceUtil/Mutex.h> #include <IceUtil/Shared.h> +#include <Ice/UniquePtr.h> #include <IceGrid/Descriptor.h> #include <IceGrid/Internal.h> #include <IceGrid/Registry.h> @@ -110,9 +111,9 @@ private: ServerCache& _cache; const std::string _id; - IceUtil::UniquePtr<ServerInfo> _loaded; - IceUtil::UniquePtr<ServerInfo> _load; - IceUtil::UniquePtr<ServerInfo> _destroy; + IceInternal::UniquePtr<ServerInfo> _loaded; + IceInternal::UniquePtr<ServerInfo> _load; + IceInternal::UniquePtr<ServerInfo> _destroy; ServerPrx _proxy; AdapterPrxDict _adapters; @@ -121,7 +122,7 @@ private: bool _synchronizing; bool _updated; - IceUtil::UniquePtr<Ice::Exception> _exception; + IceInternal::UniquePtr<Ice::Exception> _exception; bool _noRestart; std::vector<SynchronizationCallbackPtr> _callbacks; diff --git a/cpp/src/IceGrid/ServerI.h b/cpp/src/IceGrid/ServerI.h index 0512664ce7c..d2fc8ccc28b 100644 --- a/cpp/src/IceGrid/ServerI.h +++ b/cpp/src/IceGrid/ServerI.h @@ -327,7 +327,7 @@ private: std::vector<AMD_Node_loadServerPtr> _loadCB; bool _clearDir; InternalServerDescriptorPtr _desc; - IceUtil::UniquePtr<DeploymentException> _exception; + IceInternal::UniquePtr<DeploymentException> _exception; InternalServerDescriptorPtr _runtime; bool _updating; TraceLevelsPtr _traceLevels; diff --git a/cpp/src/IceLocatorDiscovery/PluginI.cpp b/cpp/src/IceLocatorDiscovery/PluginI.cpp index 3e63ec6a681..366f2a9a485 100644 --- a/cpp/src/IceLocatorDiscovery/PluginI.cpp +++ b/cpp/src/IceLocatorDiscovery/PluginI.cpp @@ -120,7 +120,7 @@ protected: exception_ptr _exception; #else const Ice::AMD_Object_ice_invokePtr _amdCB; - IceUtil::UniquePtr<Ice::Exception> _exception; + IceInternal::UniquePtr<Ice::Exception> _exception; #endif Ice::LocatorPrxPtr _locatorPrx; diff --git a/cpp/src/IcePatch2Lib/Util.cpp b/cpp/src/IcePatch2Lib/Util.cpp index 451acfc81fb..27612badf9d 100644 --- a/cpp/src/IcePatch2Lib/Util.cpp +++ b/cpp/src/IcePatch2Lib/Util.cpp @@ -18,7 +18,7 @@ #include <IceUtil/IceUtil.h> #include <IceUtil/StringUtil.h> #include <IceUtil/FileUtil.h> -#include <IceUtil/SHA1.h> +#include <Ice/SHA1.h> #include <IceUtil/Exception.h> #include <IcePatch2Lib/Util.h> #include <IcePatch2/FileServer.h> @@ -823,7 +823,7 @@ getFileInfoSeqInternal(const string& basePath, const string& relPath, int compre ByteSeq bytesSHA(20); if(!bytes.empty()) { - IceUtilInternal::sha1(reinterpret_cast<unsigned char*>(&bytes[0]), bytes.size(), bytesSHA); + IceInternal::sha1(reinterpret_cast<unsigned char*>(&bytes[0]), bytes.size(), bytesSHA); } else { @@ -892,7 +892,7 @@ getFileInfoSeqInternal(const string& basePath, const string& relPath, int compre } else { - IceUtilInternal::SHA1 hasher; + IceInternal::SHA1 hasher; if(relPath.size() != 0) { hasher.update(reinterpret_cast<const IceUtil::Byte*>(relPath.c_str()), relPath.size()); @@ -1223,7 +1223,7 @@ IcePatch2Internal::getFileTree0(const LargeFileInfoSeq& infoSeq, FileTree0& tree if(!allChecksums1.empty()) { - IceUtilInternal::sha1(reinterpret_cast<unsigned char*>(&allChecksums1[0]), allChecksums1.size(), tree1.checksum); + IceInternal::sha1(reinterpret_cast<unsigned char*>(&allChecksums1[0]), allChecksums1.size(), tree1.checksum); } else { @@ -1235,7 +1235,7 @@ IcePatch2Internal::getFileTree0(const LargeFileInfoSeq& infoSeq, FileTree0& tree if(!allChecksums0.empty()) { - IceUtilInternal::sha1(reinterpret_cast<unsigned char*>(&allChecksums0[0]), allChecksums0.size(), tree0.checksum); + IceInternal::sha1(reinterpret_cast<unsigned char*>(&allChecksums0[0]), allChecksums0.size(), tree0.checksum); } else { diff --git a/cpp/test/Glacier2/router/Client.cpp b/cpp/test/Glacier2/router/Client.cpp index bd93abd04cc..f7d007dd943 100644 --- a/cpp/test/Glacier2/router/Client.cpp +++ b/cpp/test/Glacier2/router/Client.cpp @@ -65,7 +65,7 @@ public: private: bool _haveResponse; - IceUtil::UniquePtr<Exception> _ex; + IceInternal::UniquePtr<Exception> _ex; Int _response; }; typedef IceUtil::Handle<AsyncCallback> AsyncCallbackPtr; diff --git a/cpp/test/Ice/background/Configuration.h b/cpp/test/Ice/background/Configuration.h index 29e7026d90c..367dfaa4429 100644 --- a/cpp/test/Ice/background/Configuration.h +++ b/cpp/test/Ice/background/Configuration.h @@ -11,6 +11,7 @@ #define TEST_CONFIGURATION_H #include <IceUtil/IceUtil.h> +#include <Ice/UniquePtr.h> #include <Ice/LocalException.h> #include <Ice/Selector.h> @@ -53,15 +54,15 @@ public: private: - IceUtil::UniquePtr<Ice::LocalException> _connectorsException; - IceUtil::UniquePtr<Ice::LocalException> _connectException; + IceInternal::UniquePtr<Ice::LocalException> _connectorsException; + IceInternal::UniquePtr<Ice::LocalException> _connectException; IceInternal::SocketOperation _initializeSocketOperation; int _initializeResetCount; - IceUtil::UniquePtr<Ice::LocalException> _initializeException; + IceInternal::UniquePtr<Ice::LocalException> _initializeException; int _readReadyCount; - IceUtil::UniquePtr<Ice::LocalException> _readException; + IceInternal::UniquePtr<Ice::LocalException> _readException; int _writeReadyCount; - IceUtil::UniquePtr<Ice::LocalException> _writeException; + IceInternal::UniquePtr<Ice::LocalException> _writeException; bool _buffered; static Configuration* _instance; diff --git a/cpp/test/Ice/interceptor/AMDInterceptorI.h b/cpp/test/Ice/interceptor/AMDInterceptorI.h index fea7b042f39..e98bb86e6d0 100644 --- a/cpp/test/Ice/interceptor/AMDInterceptorI.h +++ b/cpp/test/Ice/interceptor/AMDInterceptorI.h @@ -12,6 +12,7 @@ #include <InterceptorI.h> #include <IceUtil/IceUtil.h> +#include <Ice/UniquePtr.h> class AMDInterceptorI : public InterceptorI { @@ -31,7 +32,7 @@ private: #ifndef ICE_CPP11_MAPPING Ice::DispatchInterceptorAsyncCallbackPtr _defaultCb; #endif - IceUtil::UniquePtr<IceUtil::Exception> _exception; + IceInternal::UniquePtr<IceUtil::Exception> _exception; IceUtil::Mutex _mutex; }; diff --git a/cpp/test/IceGrid/activation/AllTests.cpp b/cpp/test/IceGrid/activation/AllTests.cpp index 8176830298e..8892c284746 100644 --- a/cpp/test/IceGrid/activation/AllTests.cpp +++ b/cpp/test/IceGrid/activation/AllTests.cpp @@ -79,7 +79,7 @@ public: private: Ice::ObjectPrx _proxy; - IceUtil::UniquePtr<Ice::LocalException> _exception; + IceInternal::UniquePtr<Ice::LocalException> _exception; bool _finished; int _nRepetitions; }; @@ -414,7 +414,7 @@ allTests(const Ice::CommunicatorPtr& communicator) } for(p = threads.begin(); p != threads.end(); ++p) { - IceUtil::UniquePtr<Ice::LocalException> ex((*p)->waitUntilFinished()); + IceInternal::UniquePtr<Ice::LocalException> ex((*p)->waitUntilFinished()); test(dynamic_cast<Ice::NoEndpointException*>(ex.get())); } threads.resize(0); @@ -430,7 +430,7 @@ allTests(const Ice::CommunicatorPtr& communicator) } for(p = threads.begin(); p != threads.end(); ++p) { - IceUtil::UniquePtr<Ice::LocalException> ex((*p)->waitUntilFinished()); + IceInternal::UniquePtr<Ice::LocalException> ex((*p)->waitUntilFinished()); test(dynamic_cast<Ice::NoEndpointException*>(ex.get())); } threads.resize(0); @@ -446,7 +446,7 @@ allTests(const Ice::CommunicatorPtr& communicator) } for(p = threads.begin(); p != threads.end(); ++p) { - IceUtil::UniquePtr<Ice::LocalException> ex((*p)->waitUntilFinished()); + IceInternal::UniquePtr<Ice::LocalException> ex((*p)->waitUntilFinished()); test(dynamic_cast<Ice::NoEndpointException*>(ex.get())); } threads.resize(0); @@ -499,7 +499,7 @@ allTests(const Ice::CommunicatorPtr& communicator) } for(p = threads.begin(); p != threads.end(); ++p) { - IceUtil::UniquePtr<Ice::LocalException> ex((*p)->waitUntilFinished()); + IceInternal::UniquePtr<Ice::LocalException> ex((*p)->waitUntilFinished()); test(dynamic_cast<Ice::NoEndpointException*>(ex.get())); } admin->stopServer("server-activation-timeout"); diff --git a/cpp/test/IceUtil/sha1/Client.cpp b/cpp/test/IceUtil/sha1/Client.cpp index 1b7c3178590..e8cecbd6ee9 100644 --- a/cpp/test/IceUtil/sha1/Client.cpp +++ b/cpp/test/IceUtil/sha1/Client.cpp @@ -7,7 +7,7 @@ // // ********************************************************************** -#include <IceUtil/SHA1.h> +#include <Ice/SHA1.h> #include <TestCommon.h> using namespace std; @@ -82,7 +82,7 @@ int main(int argc, char* argv[]) { const SHA1Item* item = &items[i]; vector<unsigned char> buffer; - IceUtilInternal::sha1(reinterpret_cast<const unsigned char*>(item->data), strlen(item->data), buffer); + IceInternal::sha1(reinterpret_cast<const unsigned char*>(item->data), strlen(item->data), buffer); test(buffer.size() == 20); string digest = toHex(string(reinterpret_cast<const char*>(&buffer[0]), 20)); test(item->digest == digest); @@ -91,7 +91,7 @@ int main(int argc, char* argv[]) for(int i = 0; i < itemsSize; ++i) { const SHA1Item* item = &items[i]; - IceUtilInternal::SHA1 hasher; + IceInternal::SHA1 hasher; // // Test adding the data in chunks // |