[hydra-commits] kpfleming: branch ice/skipped-slice-recovery r565 - in /ice/branches/skipped-...

SVN commits to the Hydra project hydra-commits at lists.digium.com
Fri Apr 2 16:13:09 CDT 2010


Author: kpfleming
Date: Fri Apr  2 16:13:08 2010
New Revision: 565

URL: https://origsvn.digium.com/svn-view/hydra?view=rev&rev=565
Log:
create a branch for experimenting with enabling objects to be able to
persist slices of their data that they don't understand when they pass
through components


Added:
    ice/branches/skipped-slice-recovery/   (props changed)
      - copied from r564, ice/trunk/
Modified:
    ice/branches/skipped-slice-recovery/cpp/include/Ice/BasicStream.h
    ice/branches/skipped-slice-recovery/cpp/src/Ice/BasicStream.cpp

Propchange: ice/branches/skipped-slice-recovery/
------------------------------------------------------------------------------
--- svn:mergeinfo (added)
+++ svn:mergeinfo Fri Apr  2 16:13:08 2010
@@ -1,0 +1,2 @@
+/ice/branches/icebox-local:149-423
+/ice/upstream/3.4.0:509-510

Modified: ice/branches/skipped-slice-recovery/cpp/include/Ice/BasicStream.h
URL: https://origsvn.digium.com/svn-view/hydra/ice/branches/skipped-slice-recovery/cpp/include/Ice/BasicStream.h?view=diff&rev=565&r1=564&r2=565
==============================================================================
--- ice/branches/skipped-slice-recovery/cpp/include/Ice/BasicStream.h (original)
+++ ice/branches/skipped-slice-recovery/cpp/include/Ice/BasicStream.h Fri Apr  2 16:13:08 2010
@@ -301,6 +301,8 @@
     void writeBlob(const std::vector<Ice::Byte>&);
     void readBlob(std::vector<Ice::Byte>&, Ice::Int);
 
+    void readSkippedSliceBlob(std::vector<Ice::Byte>&);
+
     void writeBlob(const Ice::Byte* v, Container::size_type sz)
     {
         if(sz > 0)
@@ -648,6 +650,9 @@
     Container::size_type _readSlice;
     Container::size_type _writeSlice;
 
+    Container::iterator _currentObjectStart;
+    Container::iterator _currentSliceStart;
+
     void writeInstance(const Ice::ObjectPtr&, Ice::Int);
     void patchPointers(Ice::Int, IndexToPtrMap::const_iterator, PatchMap::iterator);
 

Modified: ice/branches/skipped-slice-recovery/cpp/src/Ice/BasicStream.cpp
URL: https://origsvn.digium.com/svn-view/hydra/ice/branches/skipped-slice-recovery/cpp/src/Ice/BasicStream.cpp?view=diff&rev=565&r1=564&r2=565
==============================================================================
--- ice/branches/skipped-slice-recovery/cpp/src/Ice/BasicStream.cpp (original)
+++ ice/branches/skipped-slice-recovery/cpp/src/Ice/BasicStream.cpp Fri Apr  2 16:13:08 2010
@@ -439,6 +439,19 @@
 }
 
 void
+IceInternal::BasicStream::readSkippedSliceBlob(vector<Byte>& v)
+{
+    if(_currentObjectStart < _currentSliceStart)
+    {
+        vector<Byte>(_currentObjectStart, _currentSliceStart).swap(v);
+    }
+    else
+    {
+        v.clear();
+    }
+}
+
+void
 IceInternal::BasicStream::readBlob(vector<Byte>& v, Int sz)
 {
     if(sz > 0)
@@ -1799,6 +1812,7 @@
         throw MarshalException(__FILE__, __LINE__, "Invalid class instance index");
     }
 
+    _currentObjectStart = _currentSliceStart = i;
     string mostDerivedId;
     readTypeId(mostDerivedId);
     string id = mostDerivedId;
@@ -1866,6 +1880,7 @@
                     traceSlicing("class", id, _slicingCat, _instance->initializationData().logger);
                 }
                 skipSlice(); // Slice off this derived part -- we don't understand it.
+                _currentSliceStart = i;
                 readTypeId(id); // Read next id for next iteration.
                 continue;
             }





More information about the asterisk-scf-commits mailing list