summaryrefslogtreecommitdiff
path: root/cpp/src/Ice/Outgoing.cpp
diff options
context:
space:
mode:
authorBernard Normier <bernard@zeroc.com>2006-10-23 18:33:30 +0000
committerBernard Normier <bernard@zeroc.com>2006-10-23 18:33:30 +0000
commit5f9595c9ed69ddb8e10c848656db9d76b2b32b52 (patch)
tree9924a667b4c38de117dc9dfcb55d4bd640715354 /cpp/src/Ice/Outgoing.cpp
parentminor edits (diff)
downloadice-5f9595c9ed69ddb8e10c848656db9d76b2b32b52.tar.bz2
ice-5f9595c9ed69ddb8e10c848656db9d76b2b32b52.tar.xz
ice-5f9595c9ed69ddb8e10c848656db9d76b2b32b52.zip
More implicit context; changed proxy generated code
Diffstat (limited to 'cpp/src/Ice/Outgoing.cpp')
-rw-r--r--cpp/src/Ice/Outgoing.cpp32
1 files changed, 26 insertions, 6 deletions
diff --git a/cpp/src/Ice/Outgoing.cpp b/cpp/src/Ice/Outgoing.cpp
index f14425f5a21..3f90b1a9668 100644
--- a/cpp/src/Ice/Outgoing.cpp
+++ b/cpp/src/Ice/Outgoing.cpp
@@ -14,6 +14,7 @@
#include <Ice/Endpoint.h>
#include <Ice/LocalException.h>
#include <Ice/Protocol.h>
+#include <Ice/Instance.h>
using namespace std;
using namespace Ice;
@@ -45,7 +46,7 @@ IceInternal::LocalExceptionWrapper::retry() const
}
IceInternal::Outgoing::Outgoing(ConnectionI* connection, Reference* ref, const string& operation,
- OperationMode mode, const Context& context, bool compress) :
+ OperationMode mode, const Context* context, bool compress) :
_connection(connection),
_reference(ref),
_state(StateUnsent),
@@ -92,12 +93,31 @@ IceInternal::Outgoing::Outgoing(ConnectionI* connection, Reference* ref, const s
_os.write(static_cast<Byte>(mode));
- _os.writeSize(Int(context.size()));
- Context::const_iterator p;
- for(p = context.begin(); p != context.end(); ++p)
+ if(context != 0)
{
- _os.write(p->first);
- _os.write(p->second);
+ //
+ // Explicit context
+ //
+ __write(&_os, *context, __U__Context());
+ }
+ else
+ {
+ //
+ // Implicit context
+ //
+ const ImplicitContextIPtr& implicitContext =
+ _reference->getInstance()->getImplicitContext();
+
+ const Context& prxContext = _reference->getContext()->getValue();
+
+ if(implicitContext == 0)
+ {
+ __write(&_os, prxContext, __U__Context());
+ }
+ else
+ {
+ implicitContext->write(prxContext, &_os);
+ }
}
//