summaryrefslogtreecommitdiff
path: root/cpp/include/Ice
diff options
context:
space:
mode:
Diffstat (limited to 'cpp/include/Ice')
-rw-r--r--cpp/include/Ice/CommunicatorAsync.h3
-rw-r--r--cpp/include/Ice/ConnectionAsync.h5
-rw-r--r--cpp/include/Ice/DispatchInterceptor.h2
-rw-r--r--cpp/include/Ice/Dispatcher.h7
-rw-r--r--cpp/include/Ice/Exception.h23
-rw-r--r--cpp/include/Ice/ExceptionHelpers.h22
-rw-r--r--cpp/include/Ice/GCObject.h4
-rw-r--r--cpp/include/Ice/LocalObject.h7
-rw-r--r--cpp/include/Ice/Outgoing.h4
-rw-r--r--cpp/include/Ice/OutgoingAsync.h9
-rw-r--r--cpp/include/Ice/ProxyHandle.h3
11 files changed, 46 insertions, 43 deletions
diff --git a/cpp/include/Ice/CommunicatorAsync.h b/cpp/include/Ice/CommunicatorAsync.h
index f93b9b9b960..549542567dd 100644
--- a/cpp/include/Ice/CommunicatorAsync.h
+++ b/cpp/include/Ice/CommunicatorAsync.h
@@ -10,9 +10,10 @@
#ifndef ICE_COMMUNICATOR_ASYNC_H
#define ICE_COMMUNICATOR_ASYNC_H
+#ifndef ICE_CPP11_MAPPING
+
#include <Ice/Communicator.h>
-#ifndef ICE_CPP11_MAPPING
namespace Ice
{
diff --git a/cpp/include/Ice/ConnectionAsync.h b/cpp/include/Ice/ConnectionAsync.h
index cd1588191f7..ce9fd85e7af 100644
--- a/cpp/include/Ice/ConnectionAsync.h
+++ b/cpp/include/Ice/ConnectionAsync.h
@@ -10,13 +10,14 @@
#ifndef ICE_CONNECTION_ASYNC_H
#define ICE_CONNECTION_ASYNC_H
+#ifndef ICE_CPP11_MAPPING
+
#include <Ice/Connection.h>
#include <Ice/Proxy.h>
namespace Ice
{
-#ifndef ICE_CPP11_MAPPING
template<class T>
class CallbackNC_Connection_flushBatchRequests : public Callback_Connection_flushBatchRequests_Base,
public ::IceInternal::OnewayCallbackNC<T>
@@ -110,8 +111,8 @@ newCallback_Connection_flushBatchRequests(T* instance, void (T::*excb)(const ::I
{
return new Callback_Connection_flushBatchRequests<T, CT>(instance, excb, sentcb);
}
-#endif
}
#endif
+#endif
diff --git a/cpp/include/Ice/DispatchInterceptor.h b/cpp/include/Ice/DispatchInterceptor.h
index 37051ef400e..63a0a5e96e2 100644
--- a/cpp/include/Ice/DispatchInterceptor.h
+++ b/cpp/include/Ice/DispatchInterceptor.h
@@ -26,7 +26,7 @@ public:
__dispatch(IceInternal::Incoming&, const Current&);
};
-typedef IceInternal::Handle<DispatchInterceptor> DispatchInterceptorPtr;
+ICE_DEFINE_PTR(DispatchInterceptorPtr, DispatchInterceptor);
}
diff --git a/cpp/include/Ice/Dispatcher.h b/cpp/include/Ice/Dispatcher.h
index 51dceba00c7..cb9a25c124e 100644
--- a/cpp/include/Ice/Dispatcher.h
+++ b/cpp/include/Ice/Dispatcher.h
@@ -10,6 +10,12 @@
#ifndef ICE_DISPATCHER_H
#define ICE_DISPATCHER_H
+#if !defined(ICE_CPP11_MAPPING) || defined(ICE_BUILDING_SRC)
+//
+// Part of the C++98 mapping, and "internal" definitions when building Ice
+// with the C++11 mapping
+//
+
#include <IceUtil/Config.h>
#include <IceUtil/Shared.h>
#include <IceUtil/Handle.h>
@@ -43,3 +49,4 @@ typedef IceUtil::Handle<Dispatcher> DispatcherPtr;
}
#endif
+#endif
diff --git a/cpp/include/Ice/Exception.h b/cpp/include/Ice/Exception.h
index d06f576aae3..b957a91be0c 100644
--- a/cpp/include/Ice/Exception.h
+++ b/cpp/include/Ice/Exception.h
@@ -51,28 +51,32 @@ public:
virtual ~LocalException() throw();
#endif
- static const std::string& ice_staticId();
-
-#ifndef ICE_CPP11_MAPPING
+#ifdef ICE_CPP11_MAPPING
+ std::unique_ptr<LocalException> ice_clone() const;
+#else
virtual LocalException* ice_clone() const = 0;
#endif
+
+ static const std::string& ice_staticId();
};
class ICE_API UserException : public IceUtil::Exception
{
public:
- static const std::string& ice_staticId();
-
virtual void __write(::Ice::OutputStream*) const;
virtual void __read(::Ice::InputStream*);
virtual bool __usesClasses() const;
-#ifndef ICE_CPP11_MAPPING
+#ifdef ICE_CPP11_MAPPING
+ std::unique_ptr<UserException> ice_clone() const;
+#else
virtual UserException* ice_clone() const = 0;
#endif
+ static const std::string& ice_staticId();
+
protected:
virtual void __writeImpl(::Ice::OutputStream*) const {};
@@ -90,12 +94,13 @@ public:
virtual ~SystemException() throw();
#endif
- static const std::string& ice_staticId();
-
-#ifndef ICE_CPP11_MAPPING
+#ifdef ICE_CPP11_MAPPING
+ std::unique_ptr<SystemException> ice_clone() const;
+#else
virtual SystemException* ice_clone() const = 0;
#endif
+ static const std::string& ice_staticId();
};
}
diff --git a/cpp/include/Ice/ExceptionHelpers.h b/cpp/include/Ice/ExceptionHelpers.h
index e4dfa076f34..04c37669f07 100644
--- a/cpp/include/Ice/ExceptionHelpers.h
+++ b/cpp/include/Ice/ExceptionHelpers.h
@@ -20,43 +20,29 @@ namespace Ice
class LocalException;
-template<typename T, typename B> class LocalExceptionHelper : public B
+template<typename T, typename B> class LocalExceptionHelper : public IceUtil::ExceptionHelper<T, B>
{
public:
- using B::B;
-
- LocalExceptionHelper() = default;
+ using IceUtil::ExceptionHelper<T, B>::ExceptionHelper;
virtual std::string ice_id() const override
{
return T::ice_staticId();
}
-
- virtual void ice_throw() const override
- {
- throw static_cast<const T&>(*this);
- }
};
-template<typename T, typename B> class UserExceptionHelper : public B
+template<typename T, typename B> class UserExceptionHelper : public IceUtil::ExceptionHelper<T, B>
{
public:
- using B::B;
-
- UserExceptionHelper() = default;
+ using IceUtil::ExceptionHelper<T, B>::ExceptionHelper;
virtual std::string ice_id() const override
{
return T::ice_staticId();
}
- virtual void ice_throw() const override
- {
- throw static_cast<const T&>(*this);
- }
-
protected:
virtual void __writeImpl(Ice::OutputStream* os) const override
diff --git a/cpp/include/Ice/GCObject.h b/cpp/include/Ice/GCObject.h
index 2e407ee32c9..e115795be20 100644
--- a/cpp/include/Ice/GCObject.h
+++ b/cpp/include/Ice/GCObject.h
@@ -10,13 +10,13 @@
#ifndef ICE_GC_OBJECT_H
#define ICE_GC_OBJECT_H
+#ifndef ICE_CPP11_MAPPING
+
#include <Ice/Object.h>
#include <IceUtil/MutexPtrLock.h>
#include <IceUtil/Mutex.h>
-#ifndef ICE_CPP11_MAPPING
-
namespace IceInternal
{
diff --git a/cpp/include/Ice/LocalObject.h b/cpp/include/Ice/LocalObject.h
index fd765e04f0a..01f17caf60f 100644
--- a/cpp/include/Ice/LocalObject.h
+++ b/cpp/include/Ice/LocalObject.h
@@ -10,6 +10,12 @@
#ifndef ICE_LOCAL_OBJECT_H
#define ICE_LOCAL_OBJECT_H
+#if !defined(ICE_CPP11_MAPPING) || defined(ICE_BUILDING_SRC)
+//
+// Part of the C++98 mapping, and "internal" definitions when building Ice
+// with the C++11 mapping
+//
+
#include <IceUtil/Shared.h>
#include <Ice/LocalObjectF.h>
@@ -27,3 +33,4 @@ public:
}
#endif
+#endif
diff --git a/cpp/include/Ice/Outgoing.h b/cpp/include/Ice/Outgoing.h
index 5c03011e699..9bb0810e38f 100644
--- a/cpp/include/Ice/Outgoing.h
+++ b/cpp/include/Ice/Outgoing.h
@@ -66,11 +66,7 @@ protected:
OutgoingBase(Instance*);
Ice::OutputStream _os;
-#ifdef ICE_CPP11_MAPPING
- std::exception_ptr _exception;
-#else
IceUtil::UniquePtr<Ice::Exception> _exception;
-#endif
bool _sent;
InvocationObserver _observer;
ObserverHelperT<Ice::Instrumentation::ChildInvocationObserver> _childObserver;
diff --git a/cpp/include/Ice/OutgoingAsync.h b/cpp/include/Ice/OutgoingAsync.h
index df204b6a350..0a2edead961 100644
--- a/cpp/include/Ice/OutgoingAsync.h
+++ b/cpp/include/Ice/OutgoingAsync.h
@@ -23,10 +23,10 @@
#include <Ice/InputStream.h>
#include <Ice/ObserverHelper.h>
#include <Ice/LocalException.h>
+#include <IceUtil/UniquePtr.h>
#ifndef ICE_CPP11_MAPPING
# include <Ice/AsyncResult.h>
-# include <IceUtil/UniquePtr.h>
#endif
#include <exception>
@@ -163,16 +163,15 @@ protected:
#ifdef ICE_CPP11_MAPPING
std::mutex _m;
using Lock = std::lock_guard<std::mutex>;
- std::exception_ptr _ex;
- std::exception_ptr _cancellationException;
#else
IceUtil::Monitor<IceUtil::Mutex> _m;
typedef IceUtil::Monitor<IceUtil::Mutex>::Lock Lock;
- IceUtil::UniquePtr<Ice::Exception> _ex;
- IceUtil::UniquePtr<Ice::LocalException> _cancellationException;
Ice::LocalObjectPtr _cookie;
#endif
+ IceUtil::UniquePtr<Ice::Exception> _ex;
+ IceUtil::UniquePtr<Ice::LocalException> _cancellationException;
+
InvocationObserver _observer;
ObserverHelperT<Ice::Instrumentation::ChildInvocationObserver> _childObserver;
diff --git a/cpp/include/Ice/ProxyHandle.h b/cpp/include/Ice/ProxyHandle.h
index 22b29213839..628fb2b460b 100644
--- a/cpp/include/Ice/ProxyHandle.h
+++ b/cpp/include/Ice/ProxyHandle.h
@@ -10,12 +10,13 @@
#ifndef ICE_PROXY_HANDLE_H
#define ICE_PROXY_HANDLE_H
+#ifndef ICE_CPP11_MAPPING // C++98 mapping
+
#include <IceUtil/Handle.h>
#include <Ice/Config.h>
#include <iosfwd>
-#ifndef ICE_CPP11_MAPPING // C++98 mapping
namespace IceInternal
{