[hydra-commits] beagles: branch ice/slice-preserving-translators r587 - /ice/branches/slice-p...

SVN commits to the Hydra project hydra-commits at lists.digium.com
Fri Apr 23 17:53:55 CDT 2010


Author: beagles
Date: Fri Apr 23 17:53:54 2010
New Revision: 587

URL: https://origsvn.digium.com/svn-view/hydra?view=rev&rev=587
Log:
adding runtime support for a 'preserve' metadata tag to create unsliceable class and exception hierarchies (first rough cut)

Modified:
    ice/branches/slice-preserving-translators/cs/src/Ice/BasicStream.cs

Modified: ice/branches/slice-preserving-translators/cs/src/Ice/BasicStream.cs
URL: https://origsvn.digium.com/svn-view/hydra/ice/branches/slice-preserving-translators/cs/src/Ice/BasicStream.cs?view=diff&rev=587&r1=586&r2=587
==============================================================================
--- ice/branches/slice-preserving-translators/cs/src/Ice/BasicStream.cs (original)
+++ ice/branches/slice-preserving-translators/cs/src/Ice/BasicStream.cs Fri Apr 23 17:53:54 2010
@@ -647,6 +647,24 @@
             expand(v.Length);
             _buf.b.put(v);
         }
+
+	public virtual byte[] getSkippedSlices()
+	{
+	    if(_currentObjectStart < _currentSliceStart)
+	    {
+		byte[] result;
+		try
+		{
+		    result = _buf.b.toArray(_currentObjectStart, _currentSliceStart - _currentObjectStart);
+		}
+		finally
+		{
+		}
+
+		return result;
+	    }
+	    return null;
+	}
 
         public virtual void readBlob(byte[] v)
         {
@@ -2138,6 +2156,7 @@
                 throw new Ice.MarshalException("Invalid class instance index");
             }
 
+	    _currentObjectStart = _currentSliceStart = _buf.b.position();
             string mostDerivedId = readTypeId();
             string id = mostDerivedId;
 
@@ -2210,6 +2229,7 @@
                             TraceUtil.traceSlicing("class", id, _slicingCat, instance_.initializationData().logger);
                         }
                         skipSlice(); // Slice off this derived part -- we don't understand it.
+			_currentSliceStart = _buf.b.position();
                         id = readTypeId(); // Read next id for next iteration.
                         continue;
                     }
@@ -2925,6 +2945,9 @@
         private int _readSlice;
         private int _writeSlice;
 
+	private int _currentObjectStart;
+	private int _currentSliceStart;
+
         private int _traceSlicing;
         private string _slicingCat;
 





More information about the asterisk-scf-commits mailing list