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 | |
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')
-rw-r--r-- | cpp/src/Freeze/TransactionalEvictorI.cpp | 6 | ||||
-rw-r--r-- | cpp/src/Ice/Exception.cpp | 45 | ||||
-rw-r--r-- | cpp/src/Ice/Object.cpp | 45 | ||||
-rw-r--r-- | cpp/src/Ice/OpaqueEndpointI.h | 4 | ||||
-rw-r--r-- | cpp/src/Ice/OutgoingAsync.cpp | 5 | ||||
-rw-r--r-- | cpp/src/IceSSL/EndpointI.h | 4 | ||||
-rw-r--r-- | cpp/src/slice2cpp/Gen.cpp | 304 | ||||
-rw-r--r-- | cpp/src/slice2cs/Gen.cpp | 298 | ||||
-rw-r--r-- | cpp/src/slice2java/Gen.cpp | 239 |
9 files changed, 427 insertions, 523 deletions
diff --git a/cpp/src/Freeze/TransactionalEvictorI.cpp b/cpp/src/Freeze/TransactionalEvictorI.cpp index d41e0e1f3ec..594d8f1a599 100644 --- a/cpp/src/Freeze/TransactionalEvictorI.cpp +++ b/cpp/src/Freeze/TransactionalEvictorI.cpp @@ -81,11 +81,11 @@ Freeze::TransactionalEvictorI::TransactionalEvictorI(const ObjectAdapterPtr& ada _currentEvictorSize(0) { - class DipatchInterceptorAdapter : public Ice::DispatchInterceptor + class DispatchInterceptorAdapter : public Ice::DispatchInterceptor { public: - DipatchInterceptorAdapter(const TransactionalEvictorIPtr& evictor) : + DispatchInterceptorAdapter(const TransactionalEvictorIPtr& evictor) : _evictor(evictor) { } @@ -100,7 +100,7 @@ Freeze::TransactionalEvictorI::TransactionalEvictorI(const ObjectAdapterPtr& ada TransactionalEvictorIPtr _evictor; }; - _interceptor = new DipatchInterceptorAdapter(this); + _interceptor = new DispatchInterceptorAdapter(this); string propertyPrefix = string("Freeze.Evictor.") + envName + '.' + _filename; 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 diff --git a/cpp/src/Ice/Object.cpp b/cpp/src/Ice/Object.cpp index 096bf434b5f..93256b730d0 100644 --- a/cpp/src/Ice/Object.cpp +++ b/cpp/src/Ice/Object.cpp @@ -248,6 +248,50 @@ Ice::Object::__collocDispatch(IceInternal::Direct& request) return request.run(this); } +void +Ice::Object::__write(IceInternal::BasicStream* os) const +{ + os->startWriteObject(0); + __writeImpl(os); + os->endWriteObject(); +} + +void +Ice::Object::__read(IceInternal::BasicStream* is) +{ + is->startReadObject(); + __readImpl(is); + is->endReadObject(false); +} + +void +Ice::Object::__write(const OutputStreamPtr& os) const +{ + os->startObject(0); + __writeImpl(os); + os->endObject(); +} + +void +Ice::Object::__read(const InputStreamPtr& is) +{ + is->startObject(); + __readImpl(is); + is->endObject(false); +} + +void +Ice::Object::__writeImpl(const OutputStreamPtr&) const +{ + throw MarshalException(__FILE__, __LINE__, "class was not generated with stream support"); +} + +void +Ice::Object::__readImpl(const InputStreamPtr&) +{ + throw MarshalException(__FILE__, __LINE__, "class was not generated with stream support"); +} + namespace { @@ -401,6 +445,7 @@ Ice::BlobjectArrayAsync::__dispatch(Incoming& in, const Current& current) } return DispatchAsync; } + void Ice::ice_writeObject(const OutputStreamPtr& out, const ObjectPtr& p) { diff --git a/cpp/src/Ice/OpaqueEndpointI.h b/cpp/src/Ice/OpaqueEndpointI.h index c9e3e05a20d..7e303d68205 100644 --- a/cpp/src/Ice/OpaqueEndpointI.h +++ b/cpp/src/Ice/OpaqueEndpointI.h @@ -44,6 +44,10 @@ public: virtual bool operator==(const Ice::LocalObject&) const; virtual bool operator<(const Ice::LocalObject&) const; +#ifdef __SUNPRO_CC + using EndpointI::connectionId; +#endif + protected: virtual ::Ice::Int hashInit() const; diff --git a/cpp/src/Ice/OutgoingAsync.cpp b/cpp/src/Ice/OutgoingAsync.cpp index f608b6f434b..126fa243ddc 100644 --- a/cpp/src/Ice/OutgoingAsync.cpp +++ b/cpp/src/Ice/OutgoingAsync.cpp @@ -1039,6 +1039,11 @@ IceInternal::CommunicatorBatchOutgoingAsync::flushConnection(const ConnectionIPt return false; } +#ifdef __SUNPRO_CC + using BatchOutgoingAsync::__sent; +#endif + + virtual void __finished(const Ice::LocalException& ex, bool) { _remoteObserver.failed(ex.ice_name()); diff --git a/cpp/src/IceSSL/EndpointI.h b/cpp/src/IceSSL/EndpointI.h index d551bd0626a..7a7602a16d7 100644 --- a/cpp/src/IceSSL/EndpointI.h +++ b/cpp/src/IceSSL/EndpointI.h @@ -48,6 +48,10 @@ public: virtual bool operator==(const Ice::LocalObject&) const; virtual bool operator<(const Ice::LocalObject&) const; +#ifdef __SUNPRO_CC + using IceInternal::EndpointI::connectionId; +#endif + private: virtual ::Ice::Int hashInit() const; diff --git a/cpp/src/slice2cpp/Gen.cpp b/cpp/src/slice2cpp/Gen.cpp index 3d89df4997b..88db0da48c4 100644 --- a/cpp/src/slice2cpp/Gen.cpp +++ b/cpp/src/slice2cpp/Gen.cpp @@ -406,15 +406,13 @@ Slice::Gen::generate(const UnitPtr& p) { C << "\n#include <Ice/LocalException.h>"; } + + H << "\n#include <Ice/StreamF.h>"; if(_stream) { - H << "\n#include <Ice/Stream.h>"; - } - else - { - H << "\n#include <Ice/StreamF.h>"; - } + C << "\n#include <Ice/Stream.h>"; + } } if(p->hasContentsWithMetaData("preserve-slice")) @@ -872,35 +870,69 @@ Slice::Gen::TypesVisitor::visitExceptionEnd(const ExceptionPtr& p) { ExceptionPtr base = p->base(); bool basePreserved = p->inheritsMetaData("preserve-slice"); - bool preserved = basePreserved || p->hasMetaData("preserve-slice"); + bool preserved = p->hasMetaData("preserve-slice"); - H << sp << nl << "virtual void __write(::IceInternal::BasicStream*) const;"; + if(preserved && !basePreserved) + { + H << sp << nl << "virtual void __write(::IceInternal::BasicStream*) const;"; + H << nl << "virtual void __read(::IceInternal::BasicStream*);"; + + if(_stream) + { + H << nl << "virtual void __write(const ::Ice::OutputStreamPtr&) const;"; + H << nl << "virtual void __read(const ::Ice::InputStreamPtr&);"; + } + else + { + string baseName = base ? fixKwd(base->scoped()) : string("::Ice::UserException"); + H << nl << "#ifdef __SUNPRO_CC"; + H << nl << "using " << baseName << "::__write;"; + H << nl << "using " << baseName << "::__read;"; + H << nl << "#endif"; + } + } + + H.dec(); + H << sp << nl << "protected:"; + H.inc(); + H << nl << "virtual void __writeImpl(::IceInternal::BasicStream*) const;"; - H << nl << "virtual void __read(::IceInternal::BasicStream*);"; H << nl << "virtual void __readImpl(::IceInternal::BasicStream*);"; - H << nl << "virtual void __write(const ::Ice::OutputStreamPtr&) const;"; - H << nl << "virtual void __read(const ::Ice::InputStreamPtr&);"; if(_stream) { H << nl << "virtual void __writeImpl(const ::Ice::OutputStreamPtr&) const;"; H << nl << "virtual void __readImpl(const ::Ice::InputStreamPtr&);"; } - - C << sp << nl << "void" << nl << scoped.substr(2) << "::__write(::IceInternal::BasicStream* __os) const"; - C << sb; - if(preserved) - { - C << nl << "__os->startWriteException(__slicedData);"; - } else { - C << nl << "__os->startWriteException(0);"; + string baseName = base ? fixKwd(base->scoped()) : string("::Ice::UserException"); + H << nl << "#ifdef __SUNPRO_CC"; + H << nl << "using " << baseName << "::__writeImpl;"; + H << nl << "using " << baseName << "::__readImpl;"; + H << nl << "#endif"; } - C << nl << "__writeImpl(__os);"; - C << nl << "__os->endWriteException();"; - C << eb; + if(preserved && !basePreserved) + { + + H << sp << nl << "::Ice::SlicedDataPtr __slicedData;"; + + C << sp << nl << "void" << nl << scoped.substr(2) << "::__write(::IceInternal::BasicStream* __os) const"; + C << sb; + C << nl << "__os->startWriteException(__slicedData);"; + C << nl << "__writeImpl(__os);"; + C << nl << "__os->endWriteException();"; + C << eb; + + C << sp << nl << "void" << nl << scoped.substr(2) << "::__read(::IceInternal::BasicStream* __is)"; + C << sb; + C << nl << "__is->startReadException();"; + C << nl << "__readImpl(__is);"; + C << nl << "__slicedData = __is->endReadException(true);"; + C << eb; + } + C << sp << nl << "void" << nl << scoped.substr(2) << "::__writeImpl(::IceInternal::BasicStream* __os) const"; C << sb; C << nl << "__os->startWriteSlice(\"" << p->scoped() << "\", " << (!base ? "true" : "false") << ");"; @@ -912,20 +944,6 @@ Slice::Gen::TypesVisitor::visitExceptionEnd(const ExceptionPtr& p) } C << eb; - C << sp << nl << "void" << nl << scoped.substr(2) << "::__read(::IceInternal::BasicStream* __is)"; - C << sb; - C << nl << "__is->startReadException();"; - C << nl << "__readImpl(__is);"; - if(preserved) - { - C << nl << "__slicedData = __is->endReadException(true);"; - } - else - { - C << nl << "__is->endReadException(false);"; - } - C << eb; - C << sp << nl << "void" << nl << scoped.substr(2) << "::__readImpl(::IceInternal::BasicStream* __is)"; C << sb; C << nl << "__is->startReadSlice();"; @@ -939,19 +957,22 @@ Slice::Gen::TypesVisitor::visitExceptionEnd(const ExceptionPtr& p) if(_stream) { - C << sp << nl << "void" << nl << scoped.substr(2) << "::__write(const ::Ice::OutputStreamPtr& __os) const"; - C << sb; - if(preserved) + if(preserved && !basePreserved) { + C << sp << nl << "void" << nl << scoped.substr(2) << "::__write(const ::Ice::OutputStreamPtr& __os) const"; + C << sb; C << nl << "__os->startException(__slicedData);"; + C << nl << "__writeImpl(__os);"; + C << nl << "__os->endException();"; + C << eb; + + C << sp << nl << "void" << nl << scoped.substr(2) << "::__read(const ::Ice::InputStreamPtr& __is)"; + C << sb; + C << nl << "__is->startException();"; + C << nl << "__readImpl(__is);"; + C << nl << "__slicedData = __is->endException(true);"; + C << eb; } - else - { - C << nl << "__os->startException(0);"; - } - C << nl << "__writeImpl(__os);"; - C << nl << "__os->endException();"; - C << eb; C << sp << nl << "void" << nl << scoped.substr(2) << "::__writeImpl(const ::Ice::OutputStreamPtr& __os) const"; @@ -965,20 +986,6 @@ Slice::Gen::TypesVisitor::visitExceptionEnd(const ExceptionPtr& p) } C << eb; - C << sp << nl << "void" << nl << scoped.substr(2) << "::__read(const ::Ice::InputStreamPtr& __is)"; - C << sb; - C << nl << "__is->startException();"; - C << nl << "__readImpl(__is);"; - if(preserved) - { - C << nl << "__slicedData = __is->endException(true);"; - } - else - { - C << nl << "__is->endException(false);"; - } - C << eb; - C << sp << nl << "void" << nl << scoped.substr(2) << "::__readImpl(const ::Ice::InputStreamPtr& __is)"; C << sb; @@ -991,34 +998,8 @@ Slice::Gen::TypesVisitor::visitExceptionEnd(const ExceptionPtr& p) } C << eb; } - else - { - // - // Emit placeholder functions to catch errors. - // - C << sp << nl << "void" << nl << scoped.substr(2) << "::__write(const ::Ice::OutputStreamPtr&) const"; - C << sb; - C << nl << "::Ice::MarshalException ex(__FILE__, __LINE__);"; - C << nl << "ex.reason = \"exception " << scoped.substr(2) << " was not generated with stream support\";"; - C << nl << "throw ex;"; - C << eb; - - C << sp << nl << "void" << nl << scoped.substr(2) << "::__read(const ::Ice::InputStreamPtr&)"; - C << sb; - C << nl << "::Ice::MarshalException ex(__FILE__, __LINE__);"; - C << nl << "ex.reason = \"exception " << scoped .substr(2)<< " was not generated with stream support\";"; - C << nl << "throw ex;"; - C << eb; - } - - if(preserved && !basePreserved) - { - H.zeroIndent(); - H << sp << nl << "protected:"; - H.restoreIndent(); - H << sp << nl << "::Ice::SlicedDataPtr __slicedData;"; - } + factoryName = "__F" + p->flattenedScope() + p->name(); C << sp << nl << "struct " << factoryName << " : public ::IceInternal::UserExceptionFactory"; @@ -3648,7 +3629,7 @@ Slice::Gen::ObjectVisitor::visitClassDefEnd(const ClassDefPtr& p) base = bases.front(); } bool basePreserved = p->inheritsMetaData("preserve-slice"); - bool preserved = basePreserved || p->hasMetaData("preserve-slice"); + bool preserved = p->hasMetaData("preserve-slice"); if(!p->isLocal()) { @@ -3790,35 +3771,72 @@ Slice::Gen::ObjectVisitor::visitClassDefEnd(const ClassDefPtr& p) } } - H << sp; - H << nl << "virtual void __write(::IceInternal::BasicStream*) const;"; + if(!p->isAbstract()) + { + H << sp << nl << "static const ::Ice::ObjectFactoryPtr& ice_factory();"; + } + + if(preserved && !basePreserved) + { + H << sp; + H << nl << "virtual void __write(::IceInternal::BasicStream*) const;"; + H << nl << "virtual void __read(::IceInternal::BasicStream*);"; + + if(_stream) + { + H << nl << "virtual void __write(const ::Ice::OutputStreamPtr&) const;"; + H << nl << "virtual void __read(const ::Ice::InputStreamPtr&);"; + } + else + { + string baseName = base ? fixKwd(base->scoped()) : string("::Ice::Object"); + H << nl << "#ifdef __SUNPRO_CC"; + H << nl << "using " << baseName << "::__write;"; + H << nl << "using " << baseName << "::__read;"; + H << nl << "#endif"; + } + } + + H.dec(); + H << sp << nl << "protected:"; + H.inc(); + H << nl << "virtual void __writeImpl(::IceInternal::BasicStream*) const;"; - H << nl << "virtual void __read(::IceInternal::BasicStream*);"; H << nl << "virtual void __readImpl(::IceInternal::BasicStream*);"; - H << nl << "virtual void __write(const ::Ice::OutputStreamPtr&) const;"; - H << nl << "virtual void __read(const ::Ice::InputStreamPtr&);"; if(_stream) { H << nl << "virtual void __writeImpl(const ::Ice::OutputStreamPtr&) const;"; H << nl << "virtual void __readImpl(const ::Ice::InputStreamPtr&);"; } - - C << sp; - C << nl << "void" << nl << scoped.substr(2) - << "::__write(::IceInternal::BasicStream* __os) const"; - C << sb; - if(preserved) + else { - C << nl << "__os->startWriteObject(__slicedData);"; + string baseName = base ? fixKwd(base->scoped()) : string("::Ice::Object"); + H << nl << "#ifdef __SUNPRO_CC"; + H << nl << "using " << baseName << "::__writeImpl;"; + H << nl << "using " << baseName << "::__readImpl;"; + H << nl << "#endif"; } - else + + if(preserved && !basePreserved) { - C << nl << "__os->startWriteObject(0);"; + C << sp; + C << nl << "void" << nl << scoped.substr(2) + << "::__write(::IceInternal::BasicStream* __os) const"; + C << sb; + C << nl << "__os->startWriteObject(__slicedData);"; + C << nl << "__writeImpl(__os);"; + C << nl << "__os->endWriteObject();"; + C << eb; + + C << sp; + C << nl << "void" << nl << scoped.substr(2) << "::__read(::IceInternal::BasicStream* __is)"; + C << sb; + C << nl << "__is->startReadObject();"; + C << nl << "__readImpl(__is);"; + C << nl << "__slicedData = __is->endReadObject(true);"; + C << eb; } - C << nl << "__writeImpl(__os);"; - C << nl << "__os->endWriteObject();"; - C << eb; C << sp; C << nl << "void" << nl << scoped.substr(2) @@ -3834,21 +3852,6 @@ Slice::Gen::ObjectVisitor::visitClassDefEnd(const ClassDefPtr& p) C << eb; C << sp; - C << nl << "void" << nl << scoped.substr(2) << "::__read(::IceInternal::BasicStream* __is)"; - C << sb; - C << nl << "__is->startReadObject();"; - C << nl << "__readImpl(__is);"; - if(preserved) - { - C << nl << "__slicedData = __is->endReadObject(true);"; - } - else - { - C << nl << "__is->endReadObject(false);"; - } - C << eb; - - C << sp; C << nl << "void" << nl << scoped.substr(2) << "::__readImpl(::IceInternal::BasicStream* __is)"; C << sb; C << nl << "__is->startReadSlice();"; @@ -3862,19 +3865,22 @@ Slice::Gen::ObjectVisitor::visitClassDefEnd(const ClassDefPtr& p) if(_stream) { - C << sp << nl << "void" << nl << scoped.substr(2) << "::__write(const ::Ice::OutputStreamPtr& __os) const"; - C << sb; - if(preserved) + if(preserved && !basePreserved) { + C << sp << nl << "void" << nl << scoped.substr(2) << "::__write(const ::Ice::OutputStreamPtr& __os) const"; + C << sb; C << nl << "__os->startObject(__slicedData);"; + C << nl << "__writeImpl(__os);"; + C << nl << "__os->endObject();"; + C << eb; + + C << sp << nl << "void" << nl << scoped.substr(2) << "::__read(const ::Ice::InputStreamPtr& __is)"; + C << sb; + C << nl << "__is->startObject();"; + C << nl << "__readImpl(__is);"; + C << nl << "__slicedData = __is->endObject(true);"; + C << eb; } - else - { - C << nl << "__os->startObject(0);"; - } - C << nl << "__writeImpl(__os);"; - C << nl << "__os->endObject();"; - C << eb; C << sp << nl << "void" << nl << scoped.substr(2) << "::__writeImpl(const ::Ice::OutputStreamPtr& __os) const"; @@ -3888,20 +3894,6 @@ Slice::Gen::ObjectVisitor::visitClassDefEnd(const ClassDefPtr& p) } C << eb; - C << sp << nl << "void" << nl << scoped.substr(2) << "::__read(const ::Ice::InputStreamPtr& __is)"; - C << sb; - C << nl << "__is->startObject();"; - C << nl << "__readImpl(__is);"; - if(preserved) - { - C << nl << "__slicedData = __is->endObject(true);"; - } - else - { - C << nl << "__is->endObject(false);"; - } - C << eb; - C << sp << nl << "void" << nl << scoped.substr(2) << "::__readImpl(const ::Ice::InputStreamPtr& __is)"; C << sb; C << nl << "__is->startSlice();"; @@ -3913,31 +3905,9 @@ Slice::Gen::ObjectVisitor::visitClassDefEnd(const ClassDefPtr& p) } C << eb; } - else - { - // - // Emit placeholder functions to catch errors. - // - C << sp << nl << "void" << nl << scoped.substr(2) << "::__write(const ::Ice::OutputStreamPtr&) const"; - C << sb; - C << nl << "::Ice::MarshalException ex(__FILE__, __LINE__);"; - C << nl << "ex.reason = \"type " << scoped.substr(2) << " was not generated with stream support\";"; - C << nl << "throw ex;"; - C << eb; - - C << sp; - C << nl << "void" << nl << scoped.substr(2) << "::__read(const ::Ice::InputStreamPtr&)"; - C << sb; - C << nl << "::Ice::MarshalException ex(__FILE__, __LINE__);"; - C << nl << "ex.reason = \"type " << scoped.substr(2) << " was not generated with stream support\";"; - C << nl << "throw ex;"; - C << eb; - } if(!p->isAbstract()) { - H << sp << nl << "static const ::Ice::ObjectFactoryPtr& ice_factory();"; - string factoryName = "__F" + p->flattenedScope() + p->name(); C << sp; C << nl << "class " << factoryName << " : public ::Ice::ObjectFactory"; @@ -4002,7 +3972,7 @@ Slice::Gen::ObjectVisitor::visitClassDefEnd(const ClassDefPtr& p) // // Emit data members. Access visibility may be specified by metadata. // - bool inProtected = false; + bool inProtected = true; DataMemberList dataMembers = p->dataMembers(); bool prot = p->hasMetaData("protected"); for(DataMemberList::const_iterator q = dataMembers.begin(); q != dataMembers.end(); ++q) diff --git a/cpp/src/slice2cs/Gen.cpp b/cpp/src/slice2cs/Gen.cpp index 121976a7433..ff4961353d4 100644 --- a/cpp/src/slice2cs/Gen.cpp +++ b/cpp/src/slice2cs/Gen.cpp @@ -1131,7 +1131,7 @@ Slice::CsVisitor::writeDispatchAndMarshalling(const ClassDefPtr& p, bool stream) DataMemberList optionalMembers = p->orderedOptionalDataMembers(); DataMemberList classMembers = p->classDataMembers(); const bool basePreserved = p->inheritsMetaData("preserve-slice"); - const bool preserved = basePreserved || p->hasMetaData("preserve-slice"); + const bool preserved = p->hasMetaData("preserve-slice"); ClassList bases = p->bases(); ClassDefPtr base; @@ -1142,31 +1142,68 @@ Slice::CsVisitor::writeDispatchAndMarshalling(const ClassDefPtr& p, bool stream) _out << sp << nl << "#region Marshaling support"; - _out << sp; - if(!p->isInterface()) - { - emitGeneratedCodeAttribute(); - } - _out << nl << "public override void write__(IceInternal.BasicStream os__)"; - _out << sb; - if(preserved) + + if(preserved && !basePreserved) { + _out << sp; + if(!p->isInterface()) + { + emitGeneratedCodeAttribute(); + } + + _out << nl << "public override void write__(IceInternal.BasicStream os__)"; + _out << sb; _out << nl << "os__.startWriteObject(slicedData__);"; + _out << nl << "writeImpl__(os__);"; + _out << nl << "os__.endWriteObject();"; + _out << eb; + + _out << sp; + if(!p->isInterface()) + { + emitGeneratedCodeAttribute(); + } + _out << nl << "public override void read__(IceInternal.BasicStream is__)"; + _out << sb; + _out << nl << "is__.startReadObject();"; + _out << nl << "readImpl__(is__);"; + _out << nl << "slicedData__ = is__.endReadObject(true);"; + _out << eb; + + if(stream) + { + _out << sp; + if(!p->isInterface()) + { + emitGeneratedCodeAttribute(); + } + _out << nl << "public override void write__(Ice.OutputStream outS__)"; + _out << sb; + _out << nl << "outS__.startObject(slicedData__);"; + _out << nl << "writeImpl__(outS__);"; + _out << nl << "outS__.endObject();"; + _out << eb; + + _out << sp; + if(!p->isInterface()) + { + emitGeneratedCodeAttribute(); + } + _out << nl << "public override void read__(Ice.InputStream inS__)"; + _out << sb; + _out << nl << "inS__.startObject();"; + _out << nl << "readImpl__(inS__);"; + _out << nl << "slicedData__ = inS__.endObject(true);"; + _out << eb; + } } - else - { - _out << nl << "os__.startWriteObject(null);"; - } - _out << nl << "writeImpl__(os__);"; - _out << nl << "os__.endWriteObject();"; - _out << eb; _out << sp; if(!p->isInterface()) { emitGeneratedCodeAttribute(); } - _out << nl << "public override void writeImpl__(IceInternal.BasicStream os__)"; + _out << nl << "protected override void writeImpl__(IceInternal.BasicStream os__)"; _out << sb; _out << nl << "os__.startWriteSlice(ice_staticId(), " << (!base ? "true" : "false") << ");"; for(DataMemberList::const_iterator d = members.begin(); d != members.end(); ++d) @@ -1283,31 +1320,13 @@ Slice::CsVisitor::writeDispatchAndMarshalling(const ClassDefPtr& p, bool stream) _out << eb; } + _out << sp; if(!p->isInterface()) { emitGeneratedCodeAttribute(); } - _out << nl << "public override void read__(IceInternal.BasicStream is__)"; - _out << sb; - _out << nl << "is__.startReadObject();"; - _out << nl << "readImpl__(is__);"; - if(preserved) - { - _out << nl << "slicedData__ = is__.endReadObject(true);"; - } - else - { - _out << nl << "is__.endReadObject(false);"; - } - _out << eb; - - _out << sp; - if(!p->isInterface()) - { - emitGeneratedCodeAttribute(); - } - _out << nl << "public override void readImpl__(IceInternal.BasicStream is__)"; + _out << nl << "protected override void readImpl__(IceInternal.BasicStream is__)"; _out << sb; _out << nl << "is__.startReadSlice();"; int classMemberCount = static_cast<int>(allClassMembers.size() - classMembers.size()); @@ -1340,26 +1359,7 @@ Slice::CsVisitor::writeDispatchAndMarshalling(const ClassDefPtr& p, bool stream) { emitGeneratedCodeAttribute(); } - _out << nl << "public override void write__(Ice.OutputStream outS__)"; - _out << sb; - if(preserved) - { - _out << nl << "outS__.startObject(slicedData__);"; - } - else - { - _out << nl << "outS__.startObject(null);"; - } - _out << nl << "writeImpl__(outS__);"; - _out << nl << "outS__.endObject();"; - _out << eb; - - _out << sp; - if(!p->isInterface()) - { - emitGeneratedCodeAttribute(); - } - _out << nl << "public " << (base ? "override" : "virtual") << " void writeImpl__(Ice.OutputStream outS__)"; + _out << nl << "protected override void writeImpl__(Ice.OutputStream outS__)"; _out << sb; _out << nl << "outS__.startSlice(ice_staticId(), " << (!base ? "true" : "false") << ");"; for(DataMemberList::const_iterator d = members.begin(); d != members.end(); ++d) @@ -1385,26 +1385,7 @@ Slice::CsVisitor::writeDispatchAndMarshalling(const ClassDefPtr& p, bool stream) { emitGeneratedCodeAttribute(); } - _out << nl << "public override void read__(Ice.InputStream inS__)"; - _out << sb; - _out << nl << "inS__.startObject();"; - _out << nl << "readImpl__(inS__);"; - if(preserved) - { - _out << nl << "slicedData__ = inS__.endObject(true);"; - } - else - { - _out << nl << "inS__.endObject(false);"; - } - _out << eb; - - _out << sp; - if(!p->isInterface()) - { - emitGeneratedCodeAttribute(); - } - _out << nl << "public " << (base ? "override" : "virtual") << " void readImpl__(Ice.InputStream inS__)"; + _out << nl << "protected override void readImpl__(Ice.InputStream inS__)"; _out << sb; _out << nl << "inS__.startSlice();"; classMemberCount = static_cast<int>(allClassMembers.size() - classMembers.size()); @@ -1428,36 +1409,6 @@ Slice::CsVisitor::writeDispatchAndMarshalling(const ClassDefPtr& p, bool stream) } _out << eb; } - else - { - // - // Emit placeholder functions to catch errors. - // - string scoped = p->scoped(); - _out << sp; - if(!p->isInterface()) - { - emitGeneratedCodeAttribute(); - } - _out << nl << "public override void write__(Ice.OutputStream outS__)"; - _out << sb; - _out << nl << "Ice.MarshalException ex = new Ice.MarshalException();"; - _out << nl << "ex.reason = \"type " << scoped.substr(2) << " was not generated with stream support\";"; - _out << nl << "throw ex;"; - _out << eb; - - _out << sp; - if(!p->isInterface()) - { - emitGeneratedCodeAttribute(); - } - _out << nl << "public override void read__(Ice.InputStream inS__)"; - _out << sb; - _out << nl << "Ice.MarshalException ex = new Ice.MarshalException();"; - _out << nl << "ex.reason = \"type " << scoped.substr(2) << " was not generated with stream support\";"; - _out << nl << "throw ex;"; - _out << eb; - } if(preserved && !basePreserved) { @@ -3437,27 +3388,53 @@ Slice::Gen::TypesVisitor::visitExceptionEnd(const ExceptionPtr& p) ExceptionPtr base = p->base(); const bool basePreserved = p->inheritsMetaData("preserve-slice"); - const bool preserved = basePreserved || p->hasMetaData("preserve-slice"); + const bool preserved = p->hasMetaData("preserve-slice"); - _out << sp; - emitGeneratedCodeAttribute(); - _out << nl << "public override void write__(IceInternal.BasicStream os__)"; - _out << sb; - if(preserved) + if(preserved && !basePreserved) { + _out << sp; + emitGeneratedCodeAttribute(); + _out << nl << "public override void write__(IceInternal.BasicStream os__)"; + _out << sb; _out << nl << "os__.startWriteException(slicedData__);"; + _out << nl << "writeImpl__(os__);"; + _out << nl << "os__.endWriteException();"; + _out << eb; + + _out << sp; + emitGeneratedCodeAttribute(); + _out << nl << "public override void read__(IceInternal.BasicStream is__)"; + _out << sb; + _out << nl << "is__.startReadException();"; + _out << nl << "readImpl__(is__);"; + _out << nl << "slicedData__ = is__.endReadException(true);"; + _out << eb; + + if(_stream) + { + _out << sp; + emitGeneratedCodeAttribute(); + _out << nl << "public override void write__(Ice.OutputStream outS__)"; + _out << sb; + _out << nl << "outS__.startException(slicedData__);"; + _out << nl << "writeImpl__(outS__);"; + _out << nl << "outS__.endException();"; + _out << eb; + + _out << sp; + emitGeneratedCodeAttribute(); + _out << nl << "public override void read__(Ice.InputStream inS__)"; + _out << sb; + _out << nl << "inS__.startException();"; + _out << nl << "readImpl__(inS__);"; + _out << nl << "slicedData__ = inS__.endException(true);"; + _out << eb; + } } - else - { - _out << nl << "os__.startWriteException(null);"; - } - _out << nl << "writeImpl__(os__);"; - _out << nl << "os__.endWriteException();"; - _out << eb; _out << sp; emitGeneratedCodeAttribute(); - _out << nl << "public override void writeImpl__(IceInternal.BasicStream os__)"; + _out << nl << "protected override void writeImpl__(IceInternal.BasicStream os__)"; _out << sb; _out << nl << "os__.startWriteSlice(\"" << scoped << "\", " << (!base ? "true" : "false") << ");"; for(DataMemberList::const_iterator q = dataMembers.begin(); q != dataMembers.end(); ++q) @@ -3567,23 +3544,7 @@ Slice::Gen::TypesVisitor::visitExceptionEnd(const ExceptionPtr& p) _out << sp; emitGeneratedCodeAttribute(); - _out << nl << "public override void read__(IceInternal.BasicStream is__)"; - _out << sb; - _out << nl << "is__.startReadException();"; - _out << nl << "readImpl__(is__);"; - if(preserved) - { - _out << nl << "slicedData__ = is__.endReadException(true);"; - } - else - { - _out << nl << "is__.endReadException(false);"; - } - _out << eb; - - _out << sp; - emitGeneratedCodeAttribute(); - _out << nl << "public override void readImpl__(IceInternal.BasicStream is__)"; + _out << nl << "protected override void readImpl__(IceInternal.BasicStream is__)"; _out << sb; _out << nl << "is__.startReadSlice();"; DataMemberList classMembers = p->classDataMembers(); @@ -3604,23 +3565,7 @@ Slice::Gen::TypesVisitor::visitExceptionEnd(const ExceptionPtr& p) { _out << sp; emitGeneratedCodeAttribute(); - _out << nl << "public override void write__(Ice.OutputStream outS__)"; - _out << sb; - if(preserved) - { - _out << nl << "outS__.startException(slicedData__);"; - } - else - { - _out << nl << "outS__.startException(null);"; - } - _out << nl << "writeImpl__(outS__);"; - _out << nl << "outS__.endException();"; - _out << eb; - - _out << sp; - emitGeneratedCodeAttribute(); - _out << nl << "public " << (base ? "override" : "virtual") << " void writeImpl__(Ice.OutputStream outS__)"; + _out << nl << "protected override void writeImpl__(Ice.OutputStream outS__)"; _out << sb; _out << nl << "outS__.startSlice(\"" << scoped << "\", " << (!base ? "true" : "false") << ");"; for(DataMemberList::const_iterator q = dataMembers.begin(); q != dataMembers.end(); ++q) @@ -3636,23 +3581,7 @@ Slice::Gen::TypesVisitor::visitExceptionEnd(const ExceptionPtr& p) _out << sp; emitGeneratedCodeAttribute(); - _out << nl << "public override void read__(Ice.InputStream inS__)"; - _out << sb; - _out << nl << "inS__.startException();"; - _out << nl << "readImpl__(inS__);"; - if(preserved) - { - _out << nl << "slicedData__ = inS__.endException(true);"; - } - else - { - _out << nl << "inS__.endException(false);"; - } - _out << eb; - - _out << sp; - emitGeneratedCodeAttribute(); - _out << nl << "public " << (base ? "override" : "virtual") << " void readImpl__(Ice.InputStream inS__)"; + _out << nl << "protected override void readImpl__(Ice.InputStream inS__)"; _out << sb; _out << nl << "inS__.startSlice();"; classMemberCount = static_cast<int>(allClassMembers.size() - classMembers.size()); @@ -3668,30 +3597,7 @@ Slice::Gen::TypesVisitor::visitExceptionEnd(const ExceptionPtr& p) } _out << eb; } - else - { - // - // Emit placeholder functions to catch errors. - // - _out << sp; - emitGeneratedCodeAttribute(); - _out << nl << "public override void write__(Ice.OutputStream outS__)"; - _out << sb; - _out << nl << "Ice.MarshalException ex = new Ice.MarshalException();"; - _out << nl << "ex.reason = \"exception " << scoped.substr(2) << " was not generated with stream support\";"; - _out << nl << "throw ex;"; - _out << eb; - - _out << sp; - emitGeneratedCodeAttribute(); - _out << nl << "public override void read__(Ice.InputStream inS__)"; - _out << sb; - _out << nl << "Ice.MarshalException ex = new Ice.MarshalException();"; - _out << nl << "ex.reason = \"exception " << scoped.substr(2) << " was not generated with stream support\";"; - _out << nl << "throw ex;"; - _out << eb; - } - + if(preserved && !basePreserved) { _out << sp << nl << "protected Ice.SlicedData slicedData__;"; diff --git a/cpp/src/slice2java/Gen.cpp b/cpp/src/slice2java/Gen.cpp index c9f7f42e243..033e077302a 100644 --- a/cpp/src/slice2java/Gen.cpp +++ b/cpp/src/slice2java/Gen.cpp @@ -1335,23 +1335,50 @@ Slice::JavaVisitor::writeDispatchAndMarshalling(Output& out, const ClassDefPtr& DataMemberList members = p->dataMembers(); DataMemberList optionalMembers = p->orderedOptionalDataMembers(); bool basePreserved = p->inheritsMetaData("preserve-slice"); - bool preserved = basePreserved || p->hasMetaData("preserve-slice"); + bool preserved = p->hasMetaData("preserve-slice"); - out << sp << nl << "public void" << nl << "__write(IceInternal.BasicStream __os)"; - out << sb; - if(preserved) + if(preserved && !basePreserved) { + out << sp << nl << "public void" << nl << "__write(IceInternal.BasicStream __os)"; + out << sb; out << nl << "__os.startWriteObject(__slicedData);"; + out << nl << "__writeImpl(__os);"; + out << nl << "__os.endWriteObject();"; + out << eb; + + out << sp << nl << "public void" << nl << "__read(IceInternal.BasicStream __is)"; + out << sb; + out << nl << "__is.startReadObject();"; + out << nl << "__readImpl(__is);"; + out << nl << "__slicedData = __is.endReadObject(true);"; + out << eb; + + if(stream) + { + out << sp << nl << "public void" << nl << "__write(Ice.OutputStream __outS)"; + out << sb; + if(preserved) + { + out << nl << "__outS.startObject(__slicedData);"; + } + else + { + out << nl << "__outS.startObject(null);"; + } + out << nl << "__writeImpl(__outS);"; + out << nl << "__outS.endObject();"; + out << eb; + + out << sp << nl << "public void" << nl << "__read(Ice.InputStream __inS)"; + out << sb; + out << nl << "__inS.startObject();"; + out << nl << "__readImpl(__inS);"; + out << nl << "__slicedData = __inS.endObject(true);"; + out << eb; + } } - else - { - out << nl << "__os.startWriteObject(null);"; - } - out << nl << "__writeImpl(__os);"; - out << nl << "__os.endWriteObject();"; - out << eb; - out << sp << nl << "public void" << nl << "__writeImpl(IceInternal.BasicStream __os)"; + out << sp << nl << "protected void" << nl << "__writeImpl(IceInternal.BasicStream __os)"; out << sb; out << nl << "__os.startWriteSlice(ice_staticId(), " << (!base ? "true" : "false") << ");"; iter = 0; @@ -1373,27 +1400,13 @@ Slice::JavaVisitor::writeDispatchAndMarshalling(Output& out, const ClassDefPtr& } out << eb; - out << sp << nl << "public void" << nl << "__read(IceInternal.BasicStream __is)"; - out << sb; - out << nl << "__is.startReadObject();"; - out << nl << "__readImpl(__is);"; - if(preserved) - { - out << nl << "__slicedData = __is.endReadObject(true);"; - } - else - { - out << nl << "__is.endReadObject(false);"; - } - out << eb; - DataMemberList allClassMembers = p->allClassDataMembers(); if(allClassMembers.size() != 0) { writePatcher(out, package, allClassMembers, stream); } - out << sp << nl << "public void" << nl << "__readImpl(IceInternal.BasicStream __is)"; + out << sp << nl << "protected void" << nl << "__readImpl(IceInternal.BasicStream __is)"; out << sb; out << nl << "__is.startReadSlice();"; DataMemberList classMembers = p->classDataMembers(); @@ -1420,21 +1433,7 @@ Slice::JavaVisitor::writeDispatchAndMarshalling(Output& out, const ClassDefPtr& if(stream) { - out << sp << nl << "public void" << nl << "__write(Ice.OutputStream __outS)"; - out << sb; - if(preserved) - { - out << nl << "__outS.startObject(__slicedData);"; - } - else - { - out << nl << "__outS.startObject(null);"; - } - out << nl << "__writeImpl(__outS);"; - out << nl << "__outS.endObject();"; - out << eb; - - out << sp << nl << "public void" << nl << "__writeImpl(Ice.OutputStream __outS)"; + out << sp << nl << "protected void" << nl << "__writeImpl(Ice.OutputStream __outS)"; out << sb; out << nl << "__outS.startSlice(ice_staticId(), " << (!base ? "true" : "false") << ");"; iter = 0; @@ -1456,21 +1455,7 @@ Slice::JavaVisitor::writeDispatchAndMarshalling(Output& out, const ClassDefPtr& } out << eb; - out << sp << nl << "public void" << nl << "__read(Ice.InputStream __inS)"; - out << sb; - out << nl << "__inS.startObject();"; - out << nl << "__readImpl(__inS);"; - if(preserved) - { - out << nl << "__slicedData = __inS.endObject(true);"; - } - else - { - out << nl << "__inS.endObject(false);"; - } - out << eb; - - out << sp << nl << "public void" << nl << "__readImpl(Ice.InputStream __inS)"; + out << sp << nl << "protected void" << nl << "__readImpl(Ice.InputStream __inS)"; out << sb; out << nl << "__inS.startSlice();"; iter = 0; @@ -1493,27 +1478,7 @@ Slice::JavaVisitor::writeDispatchAndMarshalling(Output& out, const ClassDefPtr& } out << eb; } - else - { - // - // Emit placeholder functions to catch errors. - // - string scoped = p->scoped(); - out << sp << nl << "public void" << nl << "__write(Ice.OutputStream __outS)"; - out << sb; - out << nl << "Ice.MarshalException ex = new Ice.MarshalException();"; - out << nl << "ex.reason = \"type " << scoped.substr(2) << " was not generated with stream support\";"; - out << nl << "throw ex;"; - out << eb; - - out << sp << nl << "public void" << nl << "__read(Ice.InputStream __inS)"; - out << sb; - out << nl << "Ice.MarshalException ex = new Ice.MarshalException();"; - out << nl << "ex.reason = \"type " << scoped.substr(2) << " was not generated with stream support\";"; - out << nl << "throw ex;"; - out << eb; - } - + if(preserved && !basePreserved) { out << sp << nl << "protected Ice.SlicedData __slicedData;"; @@ -3248,27 +3213,48 @@ Slice::Gen::TypesVisitor::visitExceptionEnd(const ExceptionPtr& p) string package = getPackage(p); ExceptionPtr base = p->base(); bool basePreserved = p->inheritsMetaData("preserve-slice"); - bool preserved = basePreserved || p->hasMetaData("preserve-slice"); + bool preserved = p->hasMetaData("preserve-slice"); DataMemberList members = p->dataMembers(); DataMemberList optionalMembers = p->orderedOptionalDataMembers(); int iter; - out << sp << nl << "public void" << nl << "__write(IceInternal.BasicStream __os)"; - out << sb; - if(preserved) + if(preserved && !basePreserved) { + + out << sp << nl << "public void" << nl << "__write(IceInternal.BasicStream __os)"; + out << sb; out << nl << "__os.startWriteException(__slicedData);"; - } - else - { - out << nl << "__os.startWriteException(null);"; - } - out << nl << "__writeImpl(__os);"; - out << nl << "__os.endWriteException();"; - out << eb; + out << nl << "__writeImpl(__os);"; + out << nl << "__os.endWriteException();"; + out << eb; + + out << sp << nl << "public void" << nl << "__read(IceInternal.BasicStream __is)"; + out << sb; + out << nl << "__is.startReadException();"; + out << nl << "__readImpl(__is);"; + out << nl << "__slicedData = __is.endReadException(true);"; + out << eb; + + if(_stream) + { + out << sp << nl << "public void" << nl << "__write(Ice.OutputStream __outS)"; + out << sb; + out << nl << "__outS.startException(__slicedData);"; + out << nl << "__writeImpl(__outS);"; + out << nl << "__outS.endException();"; + out << eb; - out << sp << nl << "public void" << nl << "__writeImpl(IceInternal.BasicStream __os)"; + out << sp << nl << "public void" << nl << "__read(Ice.InputStream __inS)"; + out << sb; + out << nl << "__inS.startException();"; + out << nl << "__readImpl(__inS);"; + out << nl << "__slicedData = __inS.endException(true);"; + out << eb; + } + } + + out << sp << nl << "protected void" << nl << "__writeImpl(IceInternal.BasicStream __os)"; out << sb; out << nl << "__os.startWriteSlice(\"" << scoped << "\", " << (!base ? "true" : "false") << ");"; iter = 0; @@ -3289,27 +3275,13 @@ Slice::Gen::TypesVisitor::visitExceptionEnd(const ExceptionPtr& p) out << nl << "super.__writeImpl(__os);"; } out << eb; - - out << sp << nl << "public void" << nl << "__read(IceInternal.BasicStream __is)"; - out << sb; - out << nl << "__is.startReadException();"; - out << nl << "__readImpl(__is);"; - if(preserved) - { - out << nl << "__slicedData = __is.endReadException(true);"; - } - else - { - out << nl << "__is.endReadException(false);"; - } - out << eb; - + DataMemberList allClassMembers = p->allClassDataMembers(); if(allClassMembers.size() != 0) { writePatcher(out, package, allClassMembers, _stream); } - out << sp << nl << "public void" << nl << "__readImpl(IceInternal.BasicStream __is)"; + out << sp << nl << "protected void" << nl << "__readImpl(IceInternal.BasicStream __is)"; out << sb; out << nl << "__is.startReadSlice();"; iter = 0; @@ -3336,21 +3308,7 @@ Slice::Gen::TypesVisitor::visitExceptionEnd(const ExceptionPtr& p) if(_stream) { - out << sp << nl << "public void" << nl << "__write(Ice.OutputStream __outS)"; - out << sb; - if(preserved) - { - out << nl << "__outS.startException(__slicedData);"; - } - else - { - out << nl << "__outS.startException(null);"; - } - out << nl << "__writeImpl(__outS);"; - out << nl << "__outS.endException();"; - out << eb; - - out << sp << nl << "public void" << nl << "__writeImpl(Ice.OutputStream __outS)"; + out << sp << nl << "protected void" << nl << "__writeImpl(Ice.OutputStream __outS)"; out << sb; out << nl << "__outS.startSlice(\"" << scoped << "\", " << (!base ? "true" : "false") << ");"; iter = 0; @@ -3372,21 +3330,7 @@ Slice::Gen::TypesVisitor::visitExceptionEnd(const ExceptionPtr& p) } out << eb; - out << sp << nl << "public void" << nl << "__read(Ice.InputStream __inS)"; - out << sb; - out << nl << "__inS.startException();"; - out << nl << "__readImpl(__inS);"; - if(preserved) - { - out << nl << "__slicedData = __inS.endException(true);"; - } - else - { - out << nl << "__inS.endException(false);"; - } - out << eb; - - out << sp << nl << "public void" << nl << "__readImpl(Ice.InputStream __inS)"; + out << sp << nl << "protected void" << nl << "__readImpl(Ice.InputStream __inS)"; out << sb; out << nl << "__inS.startSlice();"; iter = 0; @@ -3409,26 +3353,7 @@ Slice::Gen::TypesVisitor::visitExceptionEnd(const ExceptionPtr& p) } out << eb; } - else - { - // - // Emit placeholder functions to catch errors. - // - out << sp << nl << "public void" << nl << "__write(Ice.OutputStream __outS)"; - out << sb; - out << nl << "Ice.MarshalException ex = new Ice.MarshalException();"; - out << nl << "ex.reason = \"exception " << scoped.substr(2) << " was not generated with stream support\";"; - out << nl << "throw ex;"; - out << eb; - - out << sp << nl << "public void" << nl << "__read(Ice.InputStream __inS)"; - out << sb; - out << nl << "Ice.MarshalException ex = new Ice.MarshalException();"; - out << nl << "ex.reason = \"exception " << scoped.substr(2) << " was not generated with stream support\";"; - out << nl << "throw ex;"; - out << eb; - } - + if(preserved && !basePreserved) { out << sp << nl << "protected Ice.SlicedData __slicedData;"; |