summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBernard Normier <bernard@zeroc.com>2017-04-07 21:41:04 -0400
committerBernard Normier <bernard@zeroc.com>2017-04-07 21:41:04 -0400
commit5e58618ca24587f57d9b502b7342c8a7968261f3 (patch)
tree27de2449fe2d982434db0f8d69b30f118c4f5ff5
parentMinor fix to JS controller and PHP timeout test (bumped hold time) (diff)
downloadice-5e58618ca24587f57d9b502b7342c8a7968261f3.tar.bz2
ice-5e58618ca24587f57d9b502b7342c8a7968261f3.tar.xz
ice-5e58618ca24587f57d9b502b7342c8a7968261f3.zip
ICE-7768: fixed C++11 Blobject API
-rw-r--r--cpp/include/Ice/Object.h13
-rw-r--r--cpp/src/Glacier2/Blobject.h10
-rw-r--r--cpp/src/IceLocatorDiscovery/PluginI.cpp25
-rw-r--r--cpp/test/Ice/echo/BlobjectI.cpp4
-rw-r--r--cpp/test/Ice/echo/BlobjectI.h2
-rw-r--r--cpp/test/Ice/invoke/BlobjectI.cpp12
-rw-r--r--cpp/test/Ice/invoke/BlobjectI.h8
-rw-r--r--cpp/test/Ice/objects/TestI.cpp2
-rw-r--r--cpp/test/Ice/objects/TestI.h2
9 files changed, 34 insertions, 44 deletions
diff --git a/cpp/include/Ice/Object.h b/cpp/include/Ice/Object.h
index 5dc57b8a92b..94418425359 100644
--- a/cpp/include/Ice/Object.h
+++ b/cpp/include/Ice/Object.h
@@ -83,13 +83,10 @@ public:
static const std::string& ice_staticId();
-#ifndef ICE_CPP11_MAPPING
- virtual bool ice_dispatch(Ice::Request&, const DispatchInterceptorAsyncCallbackPtr& = 0);
-#else
virtual bool ice_dispatch(Ice::Request&,
std::function<bool()> = nullptr,
std::function<bool(std::exception_ptr)> = nullptr);
-#endif
+
virtual bool _iceDispatch(IceInternal::Incoming&, const Current&);
struct Ice_invokeResult
@@ -161,7 +158,7 @@ public:
//
// Returns true if ok, false if user exception.
//
- virtual bool ice_invoke(const std::vector<Byte>&, std::vector<Byte>&, const Current&) = 0;
+ virtual bool ice_invoke(ICE_IN(std::vector<Byte>), std::vector<Byte>&, const Current&) = 0;
virtual bool _iceDispatch(IceInternal::Incoming&, const Current&);
};
@@ -173,7 +170,7 @@ public:
//
// Returns true if ok, false if user exception.
//
- virtual bool ice_invoke(const std::pair<const Byte*, const Byte*>&, std::vector<Byte>&, const Current&) = 0;
+ virtual bool ice_invoke(ICE_IN(std::pair<const Byte*, const Byte*>), std::vector<Byte>&, const Current&) = 0;
virtual bool _iceDispatch(IceInternal::Incoming&, const Current&);
};
@@ -184,7 +181,7 @@ public:
#ifdef ICE_CPP11_MAPPING
virtual void ice_invokeAsync(std::vector<Byte>,
- std::function<void(bool, std::vector<Byte>)>,
+ std::function<void(bool, const std::vector<Byte>&)>,
std::function<void(std::exception_ptr)>,
const Current&) = 0;
#else
@@ -199,7 +196,7 @@ public:
#ifdef ICE_CPP11_MAPPING
virtual void ice_invokeAsync(std::pair<const Byte*, const Byte*>,
- std::function<void(bool, std::pair<const Byte*, const Byte*>)>,
+ std::function<void(bool, const std::pair<const Byte*, const Byte*>&)>,
std::function<void(std::exception_ptr)>,
const Current&) = 0;
#else
diff --git a/cpp/src/Glacier2/Blobject.h b/cpp/src/Glacier2/Blobject.h
index 323f581a56b..420e6b2f9dd 100644
--- a/cpp/src/Glacier2/Blobject.h
+++ b/cpp/src/Glacier2/Blobject.h
@@ -20,22 +20,22 @@ namespace Glacier2
class Blobject : public Ice::BlobjectArrayAsync
{
public:
-
+
Blobject(const InstancePtr&, const Ice::ConnectionPtr&, const Ice::Context&);
virtual ~Blobject();
void destroy();
-
+
virtual void updateObserver(const Glacier2::Instrumentation::SessionObserverPtr&);
-
- void invokeResponse(bool, const std::pair<const Ice::Byte*, const Ice::Byte*>&,
+
+ void invokeResponse(bool, const std::pair<const Ice::Byte*, const Ice::Byte*>&,
const Ice::AMD_Object_ice_invokePtr&);
void invokeSent(bool, const Ice::AMD_Object_ice_invokePtr&);
void invokeException(const Ice::Exception&, const Ice::AMD_Object_ice_invokePtr&);
protected:
- void invoke(Ice::ObjectPrx&, const Ice::AMD_Object_ice_invokePtr&,
+ void invoke(Ice::ObjectPrx&, const Ice::AMD_Object_ice_invokePtr&,
const std::pair<const Ice::Byte*, const Ice::Byte*>&, const Ice::Current&);
const InstancePtr _instance;
diff --git a/cpp/src/IceLocatorDiscovery/PluginI.cpp b/cpp/src/IceLocatorDiscovery/PluginI.cpp
index 4d58d1121dc..34c23efc01b 100644
--- a/cpp/src/IceLocatorDiscovery/PluginI.cpp
+++ b/cpp/src/IceLocatorDiscovery/PluginI.cpp
@@ -64,11 +64,7 @@ public:
}
void invoke(const Ice::LocatorPrxPtr&);
-#ifdef ICE_CPP11_MAPPING
- void response(const bool, pair<const Ice::Byte*, const Ice::Byte*>);
-#else
- void response(const bool, const pair<const Ice::Byte*, const Ice::Byte*>&);
-#endif
+ void response(bool, const pair<const Ice::Byte*, const Ice::Byte*>&);
void exception(const Ice::Exception&);
protected:
@@ -105,7 +101,7 @@ public:
#ifdef ICE_CPP11_MAPPING
virtual void ice_invokeAsync(pair<const Ice::Byte*, const Ice::Byte*>,
- function<void(bool, pair<const Ice::Byte*, const Ice::Byte*>)>,
+ function<void(bool, const pair<const Ice::Byte*, const Ice::Byte*>&)>,
function<void(exception_ptr)>,
const Ice::Current&);
#else
@@ -384,7 +380,7 @@ Request::invoke(const Ice::LocatorPrxPtr& l)
outPair.first = &outParams[0];
outPair.second = outPair.first + outParams.size();
}
- self->response(ok, move(outPair));
+ self->response(ok, outPair);
},
[self](exception_ptr e)
{
@@ -433,19 +429,16 @@ Request::invoke(const Ice::LocatorPrxPtr& l)
#endif
}
-#ifdef ICE_CPP11_MAPPING
-void
-Request::response(bool ok, pair<const Ice::Byte*, const Ice::Byte*> outParams)
-{
- _responseCB(ok, move(outParams));
-}
-#else
+
void
Request::response(bool ok, const pair<const Ice::Byte*, const Ice::Byte*>& outParams)
{
+#ifdef ICE_CPP11_MAPPING
+ _responseCB(ok, outParams);
+#else
_amdCB->ice_response(ok, outParams);
-}
#endif
+}
void
Request::exception(const Ice::Exception& ex)
@@ -625,7 +618,7 @@ LocatorI::setLookupReply(const LookupReplyPrxPtr& lookupReply)
#ifdef ICE_CPP11_MAPPING
void
LocatorI::ice_invokeAsync(pair<const Ice::Byte*, const Ice::Byte*> inParams,
- function<void(bool, pair<const Ice::Byte*, const Ice::Byte*>)> responseCB,
+ function<void(bool, const pair<const Ice::Byte*, const Ice::Byte*>&)> responseCB,
function<void(exception_ptr)> exceptionCB,
const Ice::Current& current)
{
diff --git a/cpp/test/Ice/echo/BlobjectI.cpp b/cpp/test/Ice/echo/BlobjectI.cpp
index 894e217569c..b0c1d479ab3 100644
--- a/cpp/test/Ice/echo/BlobjectI.cpp
+++ b/cpp/test/Ice/echo/BlobjectI.cpp
@@ -79,7 +79,7 @@ BlobjectI::flushBatch()
#ifdef ICE_CPP11_MAPPING
void
BlobjectI::ice_invokeAsync(std::vector<Ice::Byte> inEncaps,
- std::function<void(bool, std::vector<Ice::Byte>)> response,
+ std::function<void(bool, const std::vector<Ice::Byte>&)> response,
std::function<void(std::exception_ptr)> ex,
const Ice::Current& current)
{
@@ -112,7 +112,7 @@ BlobjectI::ice_invokeAsync(std::vector<Ice::Byte> inEncaps,
else
{
obj->ice_oneway()->ice_invokeAsync(current.operation, current.mode, inEncaps,
- [](bool, std::vector<Ice::Byte>) { assert(0); },
+ [](bool, const std::vector<Ice::Byte>&) { assert(0); },
ex,
[&](bool) { response(true, vector<Ice::Byte>()); },
current.ctx);
diff --git a/cpp/test/Ice/echo/BlobjectI.h b/cpp/test/Ice/echo/BlobjectI.h
index 16db90e0b5c..1c130b654d2 100644
--- a/cpp/test/Ice/echo/BlobjectI.h
+++ b/cpp/test/Ice/echo/BlobjectI.h
@@ -25,7 +25,7 @@ public:
#ifdef ICE_CPP11_MAPPING
virtual void ice_invokeAsync(std::vector<Ice::Byte>,
- std::function<void(bool, std::vector<Ice::Byte>)>,
+ std::function<void(bool, const std::vector<Ice::Byte>&)>,
std::function<void(std::exception_ptr)>,
const Ice::Current&) override;
diff --git a/cpp/test/Ice/invoke/BlobjectI.cpp b/cpp/test/Ice/invoke/BlobjectI.cpp
index 2f65a4f3621..cfe6fd9ddee 100644
--- a/cpp/test/Ice/invoke/BlobjectI.cpp
+++ b/cpp/test/Ice/invoke/BlobjectI.cpp
@@ -84,14 +84,14 @@ invokeInternal(Ice::InputStream& in, vector<Ice::Byte>& outEncaps, const Ice::Cu
}
bool
-BlobjectI::ice_invoke(const vector<Ice::Byte>& inEncaps, vector<Ice::Byte>& outEncaps, const Ice::Current& current)
+BlobjectI::ice_invoke(ICE_IN(vector<Ice::Byte>) inEncaps, vector<Ice::Byte>& outEncaps, const Ice::Current& current)
{
Ice::InputStream in(current.adapter->getCommunicator(), current.encoding, inEncaps);
return invokeInternal(in, outEncaps, current);
}
bool
-BlobjectArrayI::ice_invoke(const pair<const Ice::Byte*, const Ice::Byte*>& inEncaps, vector<Ice::Byte>& outEncaps,
+BlobjectArrayI::ice_invoke(ICE_IN(pair<const Ice::Byte*, const Ice::Byte*>) inEncaps, vector<Ice::Byte>& outEncaps,
const Ice::Current& current)
{
Ice::InputStream in(current.adapter->getCommunicator(), current.encoding, inEncaps);
@@ -101,19 +101,19 @@ BlobjectArrayI::ice_invoke(const pair<const Ice::Byte*, const Ice::Byte*>& inEnc
#ifdef ICE_CPP11_MAPPING
void
BlobjectAsyncI::ice_invokeAsync(vector<Ice::Byte> inEncaps,
- function<void(bool, vector<Ice::Byte>)> response,
+ function<void(bool, const vector<Ice::Byte>&)> response,
function<void(exception_ptr)>,
const Ice::Current& current)
{
Ice::InputStream in(current.adapter->getCommunicator(), inEncaps);
vector<Ice::Byte> outEncaps;
bool ok = invokeInternal(in, outEncaps, current);
- response(ok, move(outEncaps));
+ response(ok, outEncaps);
}
void
BlobjectArrayAsyncI::ice_invokeAsync(pair<const Ice::Byte*, const Ice::Byte*> inEncaps,
- function<void(bool, pair<const Ice::Byte*, const Ice::Byte*>)> response,
+ function<void(bool, const pair<const Ice::Byte*, const Ice::Byte*>&)> response,
function<void(exception_ptr)>,
const Ice::Current& current)
{
@@ -130,7 +130,7 @@ BlobjectArrayAsyncI::ice_invokeAsync(pair<const Ice::Byte*, const Ice::Byte*> in
outPair.first = &outEncaps[0];
outPair.second = &outEncaps[0] + outEncaps.size();
}
- response(ok, move(outPair));
+ response(ok, outPair);
}
#else
void
diff --git a/cpp/test/Ice/invoke/BlobjectI.h b/cpp/test/Ice/invoke/BlobjectI.h
index c198f2059be..a33d390d835 100644
--- a/cpp/test/Ice/invoke/BlobjectI.h
+++ b/cpp/test/Ice/invoke/BlobjectI.h
@@ -16,14 +16,14 @@ class BlobjectI : public Ice::Blobject
{
public:
- virtual bool ice_invoke(const std::vector<Ice::Byte>&, std::vector<Ice::Byte>&, const Ice::Current&);
+ virtual bool ice_invoke(ICE_IN(std::vector<Ice::Byte>), std::vector<Ice::Byte>&, const Ice::Current&);
};
class BlobjectArrayI : public Ice::BlobjectArray
{
public:
- virtual bool ice_invoke(const std::pair<const Ice::Byte*, const Ice::Byte*>&, std::vector<Ice::Byte>&,
+ virtual bool ice_invoke(ICE_IN(std::pair<const Ice::Byte*, const Ice::Byte*>), std::vector<Ice::Byte>&,
const Ice::Current&);
};
@@ -33,7 +33,7 @@ class BlobjectAsyncI : public Ice::BlobjectAsync
public:
virtual void ice_invokeAsync(std::vector<Ice::Byte>,
- std::function<void(bool, std::vector<Ice::Byte>)>,
+ std::function<void(bool, const std::vector<Ice::Byte>&)>,
std::function<void(std::exception_ptr)>,
const Ice::Current&);
};
@@ -43,7 +43,7 @@ class BlobjectArrayAsyncI : public Ice::BlobjectArrayAsync
public:
virtual void ice_invokeAsync(std::pair<const Ice::Byte*, const Ice::Byte*>,
- std::function<void(bool, std::pair<const Ice::Byte*, const Ice::Byte*>)>,
+ std::function<void(bool, const std::pair<const Ice::Byte*, const Ice::Byte*>&)>,
std::function<void(std::exception_ptr)>,
const Ice::Current&);
};
diff --git a/cpp/test/Ice/objects/TestI.cpp b/cpp/test/Ice/objects/TestI.cpp
index 98a3eb4554b..de5abeefbaf 100644
--- a/cpp/test/Ice/objects/TestI.cpp
+++ b/cpp/test/Ice/objects/TestI.cpp
@@ -340,7 +340,7 @@ InitialI::throwEDerived(const Ice::Current&)
}
bool
-UnexpectedObjectExceptionTestI::ice_invoke(const std::vector<Ice::Byte>&,
+UnexpectedObjectExceptionTestI::ice_invoke(ICE_IN(std::vector<Ice::Byte>),
std::vector<Ice::Byte>& outParams,
const Ice::Current& current)
{
diff --git a/cpp/test/Ice/objects/TestI.h b/cpp/test/Ice/objects/TestI.h
index a590472e8d4..1e399f24ffd 100644
--- a/cpp/test/Ice/objects/TestI.h
+++ b/cpp/test/Ice/objects/TestI.h
@@ -153,7 +153,7 @@ class UnexpectedObjectExceptionTestI : public Ice::Blobject
{
public:
- virtual bool ice_invoke(const std::vector<Ice::Byte>&, std::vector<Ice::Byte>&, const Ice::Current&);
+ virtual bool ice_invoke(ICE_IN(std::vector<Ice::Byte>), std::vector<Ice::Byte>&, const Ice::Current&);
};
ICE_DEFINE_PTR(UnexpectedObjectExceptionTestIPtr, UnexpectedObjectExceptionTestI);