diff options
Diffstat (limited to 'cpp/src')
-rw-r--r-- | cpp/src/Ice/Object.cpp | 33 | ||||
-rw-r--r-- | cpp/src/slice2cpp/Gen.cpp | 28 |
2 files changed, 61 insertions, 0 deletions
diff --git a/cpp/src/Ice/Object.cpp b/cpp/src/Ice/Object.cpp index 82a527f4e5c..029d925f301 100644 --- a/cpp/src/Ice/Object.cpp +++ b/cpp/src/Ice/Object.cpp @@ -126,6 +126,39 @@ Ice::Object::__isMutating(const std::string& s) } void +Ice::Object::__write(::IceInternal::BasicStream* __os) const +{ + JTCSyncT<JTCMutex> sync(_activeFacetMapMutex); + + __os->write(Int(_activeFacetMap.size())); + for (map<string, ObjectPtr>::const_iterator p = _activeFacetMap.begin(); p != _activeFacetMap.end(); ++p) + { + __os->write(p->first); + __os->write(p->second); + } +} + +void +Ice::Object::__read(::IceInternal::BasicStream* __is) +{ + JTCSyncT<JTCMutex> sync(_activeFacetMapMutex); + + Int sz; + __is->read(sz); + + _activeFacetMap.clear(); + _activeFacetMapHint = _activeFacetMap.end(); + + while (sz-- > 0) + { + pair<string, ObjectPtr> v; + __is->read(v.first); + __is->read("", v.second); + _activeFacetMapHint = _activeFacetMap.insert(_activeFacetMapHint, v); + } +} + +void Ice::Object::_addFacet(const ObjectPtr& facet, const string& name) { JTCSyncT<JTCMutex> sync(_activeFacetMapMutex); diff --git a/cpp/src/slice2cpp/Gen.cpp b/cpp/src/slice2cpp/Gen.cpp index 204ac5b076d..156212eaed4 100644 --- a/cpp/src/slice2cpp/Gen.cpp +++ b/cpp/src/slice2cpp/Gen.cpp @@ -1741,6 +1741,20 @@ Slice::Gen::ObjectVisitor::visitClassDefEnd(const ClassDefPtr& p) C << nl << "#endif"; C.restoreIndent(); } + else + { + C.zeroIndent(); + C << nl << "#ifdef WIN32"; // COMPILERBUG + C.restoreIndent(); + C << nl << "Object::__write(__os);"; + C.zeroIndent(); + C << nl << "#else"; + C.restoreIndent(); + C << nl << "::Ice::Object::__write(__os);"; + C.zeroIndent(); + C << nl << "#endif"; + C.restoreIndent(); + } C << eb; C << sp; C << nl << "void" << nl << scoped.substr(2) << "::__read(::IceInternal::BasicStream* __is)"; @@ -1762,6 +1776,20 @@ Slice::Gen::ObjectVisitor::visitClassDefEnd(const ClassDefPtr& p) C << nl << "#endif"; C.restoreIndent(); } + else + { + C.zeroIndent(); + C << nl << "#ifdef WIN32"; // COMPILERBUG + C.restoreIndent(); + C << nl << "Object::__read(__is);"; + C.zeroIndent(); + C << nl << "#else"; + C.restoreIndent(); + C << nl << "::Ice::Object::__read(__is);"; + C.zeroIndent(); + C << nl << "#endif"; + C.restoreIndent(); + } C << eb; } H << eb << ';'; |