diff options
author | Mark Spruiell <mes@zeroc.com> | 2004-10-19 02:27:18 +0000 |
---|---|---|
committer | Mark Spruiell <mes@zeroc.com> | 2004-10-19 02:27:18 +0000 |
commit | 4ee06da3e23c279897cef5b2b51487875b4486b7 (patch) | |
tree | e2080691778256ebf32ceabc7d8edce6e869fbad /cpp/src/Ice/Object.cpp | |
parent | updating dependencies (diff) | |
download | ice-4ee06da3e23c279897cef5b2b51487875b4486b7.tar.bz2 ice-4ee06da3e23c279897cef5b2b51487875b4486b7.tar.xz ice-4ee06da3e23c279897cef5b2b51487875b4486b7.zip |
adding streaming API
Diffstat (limited to 'cpp/src/Ice/Object.cpp')
-rw-r--r-- | cpp/src/Ice/Object.cpp | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/cpp/src/Ice/Object.cpp b/cpp/src/Ice/Object.cpp index 61ed16c259a..70ce15164f0 100644 --- a/cpp/src/Ice/Object.cpp +++ b/cpp/src/Ice/Object.cpp @@ -11,6 +11,7 @@ #include <Ice/Incoming.h> #include <Ice/IncomingAsync.h> #include <Ice/LocalException.h> +#include <Ice/Stream.h> using namespace std; using namespace Ice; @@ -221,6 +222,35 @@ Ice::Object::__read(BasicStream* __is, bool __rid) } void +Ice::Object::__write(const OutputStreamPtr& __out) const +{ + __out->writeTypeId(ice_staticId()); + __out->startSlice(); + __out->writeSize(0); // For compatibility with the old AFM. + __out->endSlice(); +} + +void +Ice::Object::__read(const InputStreamPtr& __in, bool __rid) +{ + if(__rid) + { + __in->readTypeId(); + } + + __in->startSlice(); + + // For compatibility with the old AFM. + Int sz = __in->readSize(); + if(sz != 0) + { + throw Ice::MarshalException(__FILE__, __LINE__); + } + + __in->endSlice(); +} + +void Ice::__patch__ObjectPtr(void* __addr, ObjectPtr& v) { ObjectPtr* p = static_cast<ObjectPtr*>(__addr); @@ -271,3 +301,16 @@ Ice::BlobjectAsync::__dispatch(Incoming& in, const Current& current) } return DispatchAsync; } + +void +Ice::ice_writeObject(const OutputStreamPtr& out, const ObjectPtr& p) +{ + out->writeObject(p); +} + +void +Ice::ice_readObject(const InputStreamPtr& in, ObjectPtr& p) +{ + Ice::ReadObjectCallbackPtr cb = new ReadObjectCallbackI(__patch__ObjectPtr, &p); + in->readObject(cb); +} |