summaryrefslogtreecommitdiff
path: root/cpp/include/Ice/SlicedData.h
diff options
context:
space:
mode:
authorMark Spruiell <mes@zeroc.com>2012-05-08 18:14:39 -0700
committerMark Spruiell <mes@zeroc.com>2012-05-08 18:14:39 -0700
commit7774bb92669779fd165a0510a360fdaecd69f0c3 (patch)
tree8ea8bba6cac4128cd3e511ff21534db130ff8e49 /cpp/include/Ice/SlicedData.h
parentFixed ICE-4709, batch requests and UnmarshalOutOfBoundsException (diff)
downloadice-7774bb92669779fd165a0510a360fdaecd69f0c3.tar.bz2
ice-7774bb92669779fd165a0510a360fdaecd69f0c3.tar.xz
ice-7774bb92669779fd165a0510a360fdaecd69f0c3.zip
* C++ implementation for compact/sliced formats
* C++ implementation for "preserve-slice" metadata * C++ tests for compact/sliced/preserved types * Updated stream API * Python changes for stream API * Python tests for compact/sliced formats * Added Ice.Default.SlicedFormat property
Diffstat (limited to 'cpp/include/Ice/SlicedData.h')
-rw-r--r--cpp/include/Ice/SlicedData.h84
1 files changed, 84 insertions, 0 deletions
diff --git a/cpp/include/Ice/SlicedData.h b/cpp/include/Ice/SlicedData.h
new file mode 100644
index 00000000000..da6f6ea952f
--- /dev/null
+++ b/cpp/include/Ice/SlicedData.h
@@ -0,0 +1,84 @@
+// **********************************************************************
+//
+// Copyright (c) 2003-2010 ZeroC, Inc. All rights reserved.
+//
+// This copy of Ice is licensed to you under the terms described in the
+// ICE_LICENSE file included in this distribution.
+//
+// **********************************************************************
+
+#ifndef ICE_SLICED_DATA_H
+#define ICE_SLICED_DATA_H
+
+#include <Ice/SlicedDataF.h>
+#include <Ice/ObjectF.h>
+#include <Ice/GCShared.h>
+
+namespace Ice
+{
+
+//
+// SliceInfo encapsulates the details of a slice for an unknown class or exception type.
+//
+struct ICE_API SliceInfo : public ::IceUtil::Shared
+{
+ //
+ // The Slice type ID for this slice.
+ //
+ ::std::string typeId;
+
+ //
+ // The encoded bytes for this slice, including the leading size integer.
+ //
+ ::std::vector<Byte> bytes;
+
+ //
+ // The Ice objects referenced by this slice.
+ //
+ ::std::vector<ObjectPtr> objects;
+};
+
+//
+// SlicedData holds the slices of unknown types.
+//
+class ICE_API SlicedData : public ::IceInternal::GCShared
+{
+public:
+
+ SlicedData(const SliceInfoSeq&);
+
+ const SliceInfoSeq slices;
+
+ //
+ // Returns true if any of the preserved slices contain object references.
+ //
+ bool hasObjects() const
+ {
+ return _hasObjects;
+ }
+
+ void clearObjects();
+
+ //
+ // The internal methods below are necessary to support garbage collection
+ // of Ice objects.
+ //
+
+ virtual void __gcReachable(IceInternal::GCCountMap&) const;
+ virtual void __gcClear();
+
+ void __decRefUnsafe()
+ {
+ --_ref;
+ }
+
+ void __addObject(IceInternal::GCCountMap&);
+
+private:
+
+ bool _hasObjects;
+};
+
+}
+
+#endif