diff options
author | Bernard Normier <bernard@zeroc.com> | 2012-10-13 16:50:07 -0400 |
---|---|---|
committer | Bernard Normier <bernard@zeroc.com> | 2012-10-13 16:50:07 -0400 |
commit | 210d46ee60f8f9821ec21d99fe2a6a87ec9e7de5 (patch) | |
tree | 11d66335012d44932004877760271f95305be186 /cpp/src/Ice/Exception.cpp | |
parent | .NET CF fixes (diff) | |
download | ice-210d46ee60f8f9821ec21d99fe2a6a87ec9e7de5.tar.bz2 ice-210d46ee60f8f9821ec21d99fe2a6a87ec9e7de5.tar.xz ice-210d46ee60f8f9821ec21d99fe2a6a87ec9e7de5.zip |
Better generated __read and __write for classes and exceptions (C++, Java and C#)
Diffstat (limited to 'cpp/src/Ice/Exception.cpp')
-rw-r--r-- | cpp/src/Ice/Exception.cpp | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/cpp/src/Ice/Exception.cpp b/cpp/src/Ice/Exception.cpp index 724a306017f..91b1377230b 100644 --- a/cpp/src/Ice/Exception.cpp +++ b/cpp/src/Ice/Exception.cpp @@ -12,6 +12,8 @@ #include <Ice/Network.h> #include <Ice/Plugin.h> #include <Ice/SlicedData.h> +#include <Ice/BasicStream.h> +#include <Ice/Stream.h> #include <IceUtil/StringUtil.h> #ifdef ICE_OS_WINRT # include <IceUtil/Unicode.h> @@ -83,7 +85,50 @@ throwMarshalException(const char* file, int line, const string& reason) } } +} +void +Ice::UserException::__write(::IceInternal::BasicStream* os) const +{ + os->startWriteException(0); + __writeImpl(os); + os->endWriteException(); +} + +void +Ice::UserException::__read(::IceInternal::BasicStream* is) +{ + is->startReadException(); + __readImpl(is); + is->endReadException(false); +} + +void +Ice::UserException::__write(const Ice::OutputStreamPtr& os) const +{ + os->startException(0); + __writeImpl(os); + os->endException(); +} + +void +Ice::UserException::__read(const Ice::InputStreamPtr& is) +{ + is->startException(); + __readImpl(is); + is->endException(false); +} + +void +Ice::UserException::__writeImpl(const Ice::OutputStreamPtr&) const +{ + throw MarshalException(__FILE__, __LINE__, "user exception was not generated with stream support"); +} + +void +Ice::UserException::__readImpl(const Ice::InputStreamPtr&) +{ + throw MarshalException(__FILE__, __LINE__, "user exception was not generated with stream support"); } bool |