summaryrefslogtreecommitdiff
path: root/cpp/include
diff options
context:
space:
mode:
Diffstat (limited to 'cpp/include')
-rw-r--r--cpp/include/Ice/BasicStream.h12
-rw-r--r--cpp/include/Ice/Incoming.h41
-rw-r--r--cpp/include/Ice/IncomingAsync.h4
-rw-r--r--cpp/include/Ice/Outgoing.h11
-rw-r--r--cpp/include/Ice/OutgoingAsync.h2
5 files changed, 34 insertions, 36 deletions
diff --git a/cpp/include/Ice/BasicStream.h b/cpp/include/Ice/BasicStream.h
index ae68aa68490..fc8ca6654c5 100644
--- a/cpp/include/Ice/BasicStream.h
+++ b/cpp/include/Ice/BasicStream.h
@@ -35,13 +35,13 @@ class ICE_API BasicStream : public Buffer
{
public:
- BasicStream(const InstancePtr&);
+ BasicStream(Instance*);
//
- // Must return const InstancePtr&, because we don't hold an
- // InstancePtr for optimization reasons (see comments below).
+ // Must return Instance*, because we don't hold an InstancePtr for
+ // optimization reasons (see comments below).
//
- const InstancePtr& instance() const;
+ Instance* instance() const;
void swap(BasicStream&);
@@ -125,9 +125,9 @@ private:
//
// Optimization. The instance may not be deleted while a
- // stack-allocated Incoming still holds it.
+ // stack-allocated BasicStream still holds it.
//
- const InstancePtr& _instance;
+ Instance* _instance;
struct ReadEncaps
{
diff --git a/cpp/include/Ice/Incoming.h b/cpp/include/Ice/Incoming.h
index b9833a58d53..c762add3ff1 100644
--- a/cpp/include/Ice/Incoming.h
+++ b/cpp/include/Ice/Incoming.h
@@ -18,36 +18,22 @@
#include <Ice/InstanceF.h>
#include <Ice/ConnectionF.h>
#include <Ice/ServantLocatorF.h>
-#include <Ice/IncomingAsyncF.h>
#include <Ice/BasicStream.h>
#include <Ice/Current.h>
namespace IceInternal
{
-class ICE_API Incoming : public ::IceUtil::noncopyable
+class ICE_API IncomingBase : public ::IceUtil::noncopyable
{
-public:
-
- Incoming(const InstancePtr&, const ::Ice::ObjectAdapterPtr&, ::IceInternal::Connection*, bool, bool);
-
- void invoke();
+protected:
- BasicStream* is();
- BasicStream* os();
-
-private:
+ IncomingBase(Instance*, Connection*, const ::Ice::ObjectAdapterPtr&, bool, bool);
+ IncomingBase(IncomingBase& in); // Adopts the argument. It must not be used afterwards.
- void finishInvoke();
- void warning(const ::Ice::Exception&) const;
- void warning(const std::string&) const;
-
- //
- // IncomingAsync needs access to the various data members
- // below. Without making IncomingAsync a friend class, we would
- // have to write lots of otherwise useless accessors.
- //
- friend class IncomingAsync;
+ void __finishInvoke();
+ void __warning(const ::Ice::Exception&) const;
+ void __warning(const std::string&) const;
Ice::Current _current;
Ice::ObjectPtr _servant;
@@ -65,6 +51,19 @@ private:
BasicStream _is;
BasicStream _os;
+
+};
+
+class ICE_API Incoming : public IncomingBase
+{
+public:
+
+ Incoming(Instance*, Connection*, const ::Ice::ObjectAdapterPtr&, bool, bool);
+
+ void invoke();
+
+ BasicStream* is();
+ BasicStream* os();
};
}
diff --git a/cpp/include/Ice/IncomingAsync.h b/cpp/include/Ice/IncomingAsync.h
index 02bbe0705dc..f2736a3d707 100644
--- a/cpp/include/Ice/IncomingAsync.h
+++ b/cpp/include/Ice/IncomingAsync.h
@@ -47,13 +47,13 @@ private:
// We need a separate InstancePtr, because _is and _os only hold a
// Instance* for optimization.
//
- InstancePtr _instance;
+ InstancePtr _instanceCopy;
//
// We need a separate ConnectionPtr, because IncomingBase only
// holds a Connection* for optimization.
//
- ConnectionPtr _connection;
+ ConnectionPtr _connectionCopy;
};
}
diff --git a/cpp/include/Ice/Outgoing.h b/cpp/include/Ice/Outgoing.h
index a76b35faaeb..691bbfe6bc1 100644
--- a/cpp/include/Ice/Outgoing.h
+++ b/cpp/include/Ice/Outgoing.h
@@ -56,8 +56,7 @@ class ICE_API Outgoing : public ::IceUtil::noncopyable, public IceUtil::Monitor<
{
public:
- Outgoing(const ConnectionPtr&, const ReferencePtr&, const std::string&, ::Ice::OperationMode,
- const ::Ice::Context&);
+ Outgoing(Connection*, Reference*, const std::string&, ::Ice::OperationMode, const ::Ice::Context&);
~Outgoing();
bool invoke(); // Returns true if ok, false if user exception.
@@ -70,11 +69,11 @@ public:
private:
//
- // Optimization. The connection and the reference may not be deleted
- // while a stack-allocated Incoming still holds it.
+ // Optimization. The connection and the reference may not be
+ // deleted while a stack-allocated Outgoing still holds it.
//
- const ConnectionPtr& _connection;
- const ReferencePtr& _reference;
+ Connection* _connection;
+ Reference* _reference;
std::auto_ptr< ::Ice::LocalException> _exception;
diff --git a/cpp/include/Ice/OutgoingAsync.h b/cpp/include/Ice/OutgoingAsync.h
index 568ba86e221..0d100dda36d 100644
--- a/cpp/include/Ice/OutgoingAsync.h
+++ b/cpp/include/Ice/OutgoingAsync.h
@@ -60,7 +60,7 @@ private:
//
// We need a separate InstancePtr, because _is and _os only hold a
- // const InstancePtr& for optimization.
+ // Instance* for optimization.
//
InstancePtr _instance;