diff --git a/CHANGELOG-3.8.md b/CHANGELOG-3.8.md
index 1f285067830..96639e8aaf7 100644
--- a/CHANGELOG-3.8.md
+++ b/CHANGELOG-3.8.md
@@ -22,6 +22,45 @@ This feature has been deprecated since Ice 3.7.
- An interface can no longer be used as a type This feature, known as "interface by value", has been deprecated since
Ice 3.7. You can still define proxies with the usual syntax, `Greeter*`, where `Greeter` represents an interface.
+## C++ Changes
+
+- The C++98 mapping is now called the Original mapping.
+
+- The C++11 mapping is now called the New mapping.
+
+- (Original mapping) The base class for mapped class instances is now Ice::Value, like in the new mapping. Previously,
+Ice::Object was the base class for both mapped class instances and servants.
+
+- (Original mapping) Ice::Value does not derive from IceUtil::Shared and the generated Ptr for mapped classed is now an
+Ice::SharedPtr that behaves mostly like the previous IceUtil (and IceInternal) Handle by wrapping a std::shared_ptr.
+The important differences are:
+ - the comparison operators of Ice::SharedPtr compare pointers like std::shared_ptr but unlike IceUtil::Handle.
+ - the pointed-to object no longer holds the reference count, and as result you must be careful and avoid creating
+ multiple SharedPtr managing the same object. For example:
+ ```
+ MyClassPtr c1 = new MyClass(); // SharedPtr to class instance
+ MyClassPtr c2 = c1; // c1 and c2 point to the same instance
+ MyClassPtr c3 = c1.get(); // c3 points to the same instance. With Ice 3.7 and before, it's ok as it simply adds a
+ // a reference count to the shared instance. As of Ice 3.8, it's incorrect since c3 is a new
+ // independent SharedPtr with its own reference count.
+ ```
+
+- (Original mapping) Removed all support for garbage collection (GC) of class instances. If you create or receive a
+graph of class instances with a cycle, you must break this cycle to avoid a leak.
+
+- (New mapping) Ice::optional is now an alias for std::optional.
+
+- (Original mapping) IceUtil::Optional is now an alias for std::optional. When upgrading from Ice 3.7 or earlier, you
+need to replace calls to `get()` on IceUtil::Optional by calls to `value()`.
+
+## Objective-C Changes
+
+- The base class for class instances is now Ice::Value. Previously, Ice::Object was the base class for both mapped class
+instances and servants.
+
+- The slice compiler no longer generates an Objective-C protocol for Slice classes. It generates only an Objective-C
+class (interface).
+
## Ice Service Changes
- The implementations of Glacier2, IceGrid, IceStorm and IcePatch2 were updated to use the new C++ mapping.
diff --git a/config/PropertyNames.xml b/config/PropertyNames.xml
index 63e32eff874..2ea8c4e8976 100644
--- a/config/PropertyNames.xml
+++ b/config/PropertyNames.xml
@@ -319,7 +319,6 @@ generated from the section label.
-
diff --git a/cpp/config/Make.rules b/cpp/config/Make.rules
index 2bcc0152fd2..df9cecb3fbe 100644
--- a/cpp/config/Make.rules
+++ b/cpp/config/Make.rules
@@ -104,8 +104,6 @@ cpp11_projects = test/Common \
test/IceGrid/% \
test/IceBridge/simple
-cpp11_excludes = test/Ice/gc
-
#
# If building on a Linux multilib platform, we restrict what we build for
# the 32-bits architecture. We basically, build the same set of components
diff --git a/cpp/include/Ice/Communicator.h b/cpp/include/Ice/Communicator.h
index d6d8b7ae7f8..fa57de1e278 100644
--- a/cpp/include/Ice/Communicator.h
+++ b/cpp/include/Ice/Communicator.h
@@ -26,7 +26,6 @@
#include
#include
#include
-#include
#include
#include
#include
diff --git a/cpp/include/Ice/GCValue.h b/cpp/include/Ice/GCValue.h
deleted file mode 100644
index 04675b6f31b..00000000000
--- a/cpp/include/Ice/GCValue.h
+++ /dev/null
@@ -1,76 +0,0 @@
-//
-// Copyright (c) ZeroC, Inc. All rights reserved.
-//
-
-#ifndef ICE_GC_OBJECT_H
-#define ICE_GC_OBJECT_H
-
-#ifndef ICE_CPP11_MAPPING
-
-#include
-
-#include
-#include
-
-namespace IceInternal
-{
-
-class GCValue;
-
-class GCVisitor
-{
-public:
-
- virtual ~GCVisitor()
- {
- }
-
- virtual bool visit(GCValue*) = 0;
-};
-
-class ICE_API GCValue : public virtual Ice::Value
-{
-public:
-
- //
- // Flags constant used for collection of graphs
- //
- static const unsigned char Collectable;
- static const unsigned char CycleMember;
- static const unsigned char Visiting;
-
- //
- // Override IceUtil::Shared methods
- //
- virtual void __incRef();
- virtual void __decRef();
- virtual int __getRef() const;
- virtual void __setNoDelete(bool);
-
- //
- // Override Object methods
- //
- virtual bool _iceGcVisit(GCVisitor&);
- virtual void ice_collectable(bool);
-
- //
- // This method is implemented by Slice classes to visit class
- // members.
- //
- virtual void _iceGcVisitMembers(IceInternal::GCVisitor&) = 0;
-
- int _iceGetRefUnsafe()
- {
- return _ref;
- }
-
-private:
-
- bool collect(IceUtilInternal::MutexPtrLock&);
-};
-
-}
-
-#endif
-
-#endif
diff --git a/cpp/include/Ice/Handle.h b/cpp/include/Ice/Handle.h
index 46e0bc1265f..06202f3d928 100644
--- a/cpp/include/Ice/Handle.h
+++ b/cpp/include/Ice/Handle.h
@@ -9,8 +9,7 @@
#include
//
-// "Handle" or "smart pointer" template for classes derived from
-// IceInternal::GCShared, IceUtil::Shared, or IceUtil::SimpleShared.
+// "Handle" or "smart pointer" template for classes derived from IceUtil::Shared, or IceUtil::SimpleShared.
//
// In contrast to IceUtil::Handle, IceInternal::Handle can be used
// for a type T that has been declared but not defined. The only
diff --git a/cpp/include/Ice/InputStream.h b/cpp/include/Ice/InputStream.h
index 7f4380149ca..16df572c1dd 100644
--- a/cpp/include/Ice/InputStream.h
+++ b/cpp/include/Ice/InputStream.h
@@ -36,7 +36,7 @@ patchHandle(void* addr, const ValuePtr& v)
IceInternal::Ex::throwUOE(T::ice_staticId(), v);
}
#else
- IceInternal::Handle* p = static_cast*>(addr);
+ SharedPtr* p = static_cast*>(addr);
_icePatchValuePtr(*p, v); // Generated _icePatchValuePtr function, necessary for forward declarations.
#endif
}
@@ -251,16 +251,6 @@ class ICE_API InputStream : public IceInternal::Buffer
void setCompactIdResolver(const CompactIdResolverPtr& r);
#endif
-#ifndef ICE_CPP11_MAPPING
- /**
- * Indicates whether to mark instances of Slice classes as collectable. If the stream is
- * initialized with a communicator, this setting defaults to the value of the
- * Ice.CollectObjects property, otherwise the setting defaults to false.
- * @param b True to mark instances as collectable, false otherwise.
- */
- void setCollectObjects(bool b);
-#endif
-
/**
* Indicates whether to slice instances of Slice classes to a known Slice type when a more
* derived type is unknown. An instance is "sliced" when no static information is available
@@ -1094,7 +1084,7 @@ class ICE_API InputStream : public IceInternal::Buffer
read(&patchHandle, &v);
}
#else // C++98 mapping
- template void read(IceInternal::Handle& v)
+ template void read(Ice::SharedPtr& v)
{
read(&patchHandle, &v);
}
@@ -1476,10 +1466,6 @@ class ICE_API InputStream : public IceInternal::Buffer
Encaps _preAllocatedEncaps;
-#ifndef ICE_CPP11_MAPPING
- bool _collectObjects;
-#endif
-
bool _traceSlicing;
size_t _classGraphDepthMax;
diff --git a/cpp/include/Ice/MetricsAdminI.h b/cpp/include/Ice/MetricsAdminI.h
index 4fafd69b9ad..27b0e03f962 100644
--- a/cpp/include/Ice/MetricsAdminI.h
+++ b/cpp/include/Ice/MetricsAdminI.h
@@ -121,7 +121,7 @@ template class MetricsMapT : public MetricsMapI, private IceU
public:
typedef MetricsType T;
- typedef ICE_INTERNAL_HANDLE TPtr;
+ typedef ICE_SHARED_PTR TPtr;
ICE_DEFINE_PTR(MetricsMapTPtr, MetricsMapT);
diff --git a/cpp/include/Ice/MetricsFunctional.h b/cpp/include/Ice/MetricsFunctional.h
index 3d4dc819dff..c0f04534167 100644
--- a/cpp/include/Ice/MetricsFunctional.h
+++ b/cpp/include/Ice/MetricsFunctional.h
@@ -64,6 +64,22 @@ template struct ReferenceWrapper& >
return v.get();
}
};
+
+template struct ReferenceWrapper >
+{
+ static R* get(const Ice::SharedPtr& v)
+ {
+ return v.get();
+ }
+};
+
+template struct ReferenceWrapper& >
+{
+ static R* get(const Ice::SharedPtr& v)
+ {
+ return v.get();
+ }
+};
#endif
template struct ReferenceWrapper
diff --git a/cpp/include/Ice/MetricsObserverI.h b/cpp/include/Ice/MetricsObserverI.h
index 5ec343b6be9..75763dbc0f0 100644
--- a/cpp/include/Ice/MetricsObserverI.h
+++ b/cpp/include/Ice/MetricsObserverI.h
@@ -31,7 +31,7 @@ template class MetricsHelperT
virtual std::string operator()(const std::string&) const = 0;
- virtual void initMetrics(const ICE_INTERNAL_HANDLE&) const
+ virtual void initMetrics(const ICE_SHARED_PTR&) const
{
// To be overridden in specialization to initialize state attributes
}
diff --git a/cpp/include/Ice/ObjectAdapter.h b/cpp/include/Ice/ObjectAdapter.h
index d66dc6c35cb..5457c81812d 100644
--- a/cpp/include/Ice/ObjectAdapter.h
+++ b/cpp/include/Ice/ObjectAdapter.h
@@ -26,7 +26,6 @@
#include
#include
#include
-#include
#include
#include
#include
diff --git a/cpp/include/Ice/ObjectF.h b/cpp/include/Ice/ObjectF.h
index c4cde83c57e..303e247a7d2 100644
--- a/cpp/include/Ice/ObjectF.h
+++ b/cpp/include/Ice/ObjectF.h
@@ -19,9 +19,6 @@ using ObjectPtr = ::std::shared_ptr;
#else
ICE_API Object* upCast(Object*);
typedef IceInternal::Handle ObjectPtr;
-/// \cond INTERNAL
-ICE_API void _icePatchValuePtr(ObjectPtr&, const ObjectPtr&);
-/// \endcond
#endif
}
diff --git a/cpp/include/Ice/OutputStream.h b/cpp/include/Ice/OutputStream.h
index d1915dd2f81..2c9eb387e80 100644
--- a/cpp/include/Ice/OutputStream.h
+++ b/cpp/include/Ice/OutputStream.h
@@ -810,9 +810,9 @@ class ICE_API OutputStream : public IceInternal::Buffer
* Writes a value instance to the stream.
* @param v The value to be written.
*/
- template void write(const IceInternal::Handle& v)
+ template void write(const Ice::SharedPtr& v)
{
- write(ValuePtr(upCast(v.get())));
+ write(ValuePtr(v));
}
#endif
diff --git a/cpp/include/Ice/Properties.h b/cpp/include/Ice/Properties.h
index a9af97d4e93..d2c4a2e683d 100644
--- a/cpp/include/Ice/Properties.h
+++ b/cpp/include/Ice/Properties.h
@@ -26,7 +26,6 @@
#include
#include
#include
-#include
#include
#include
#include
diff --git a/cpp/include/Ice/PropertiesF.h b/cpp/include/Ice/PropertiesF.h
index 61ca36187c2..b3e9057d09e 100644
--- a/cpp/include/Ice/PropertiesF.h
+++ b/cpp/include/Ice/PropertiesF.h
@@ -115,9 +115,6 @@ ICE_API Object* upCast(PropertiesAdmin*);
typedef ::IceInternal::Handle< PropertiesAdmin> PropertiesAdminPtr;
typedef ::IceInternal::ProxyHandle< ::IceProxy::Ice::PropertiesAdmin> PropertiesAdminPrx;
typedef PropertiesAdminPrx PropertiesAdminPrxPtr;
-/// \cond INTERNAL
-ICE_API void _icePatchValuePtr(PropertiesAdminPtr&, const ObjectPtr&);
-/// \endcond
}
diff --git a/cpp/include/Ice/SharedPtr.h b/cpp/include/Ice/SharedPtr.h
new file mode 100644
index 00000000000..70053fcc199
--- /dev/null
+++ b/cpp/include/Ice/SharedPtr.h
@@ -0,0 +1,128 @@
+//
+// Copyright (c) ZeroC, Inc. All rights reserved.
+//
+
+#ifndef ICE_SHARED_PTR_H
+#define ICE_SHARED_PTR_H
+
+#include
+
+namespace Ice
+{
+
+/**
+ * A smart pointer that wraps a std::shared_ptr and provides an API similar to the IceUtil::Handle API.
+ * It's the primary smart pointer for the Original Mapping.
+ * \headerfile Ice/Ice.h
+ */
+template
+class SharedPtr
+{
+public:
+
+ typedef T element_type;
+
+ SharedPtr(T* p = nullptr) noexcept : _ptr(p)
+ {
+ }
+
+ SharedPtr(const SharedPtr&) noexcept = default;
+
+ template
+ SharedPtr(const SharedPtr& r) noexcept : _ptr(r.underlying())
+ {
+ }
+
+ explicit SharedPtr(std::shared_ptr&& r) noexcept : _ptr(std::move(r))
+ {
+ }
+
+ ~SharedPtr() = default;
+
+ SharedPtr& operator=(T* p) noexcept
+ {
+ if(_ptr.get() != p)
+ {
+ _ptr = std::shared_ptr(p);
+ }
+ return *this;
+ }
+
+ template
+ SharedPtr& operator=(const SharedPtr& r) noexcept
+ {
+ if(_ptr != r.underlying())
+ {
+ _ptr = r.underlying();
+ }
+ return *this;
+ }
+
+ SharedPtr& operator=(const SharedPtr& r) noexcept
+ {
+ if(_ptr != r._ptr)
+ {
+ _ptr = r._ptr;
+ }
+ return *this;
+ }
+
+ T* get() const noexcept { return _ptr.get(); }
+
+ T* operator->() const noexcept { return _ptr.get(); }
+
+ T& operator*() const noexcept { return *_ptr; }
+
+ operator bool() const noexcept { return _ptr.operator bool(); }
+
+ void swap(SharedPtr& other) noexcept { _ptr.swap(other._ptr); }
+
+ std::shared_ptr& underlying() noexcept { return _ptr; }
+ const std::shared_ptr& underlying() const noexcept { return _ptr; }
+
+ template
+ static SharedPtr dynamicCast(const SharedPtr& r) noexcept
+ {
+ return SharedPtr(std::dynamic_pointer_cast(r.underlying()));
+ }
+
+private:
+
+ std::shared_ptr _ptr;
+};
+
+// The semantics of these comparison operators is _not_ the same as with IceUtil::Handle. IceUtil::Handle compares the
+// pointed-to objects, after dereferencing the pointers. SharedPtr compares the pointers like shared_ptr.
+// This does not make a significant difference for Ice::Value and Ice::Object since their default comparison operators
+// in Ice 3.7 and before compares "this".
+
+template
+inline bool operator==(const SharedPtr& lhs, const SharedPtr& rhs) noexcept { return lhs.underlying() == rhs.underlying(); }
+
+#if __cplusplus >= 202002L
+
+template
+inline std::strong_ordering operator<=>(const SharedPtr& lhs, const SharedPtr& rhs) noexcept { return lhs.underlying() <=> rhs.underlying(); }
+
+#else
+
+template
+inline bool operator!=(const SharedPtr& lhs, const SharedPtr& rhs) noexcept { return lhs.underlying() != rhs.underlying(); }
+
+template
+inline bool operator<(const SharedPtr& lhs, const SharedPtr& rhs) noexcept { return lhs.underlying() < rhs.underlying();}
+
+template
+inline bool operator<=(const SharedPtr& lhs, const SharedPtr& rhs) noexcept { return lhs.underlying() <= rhs.underlying(); }
+
+template
+inline bool operator>(const SharedPtr& lhs, const SharedPtr& rhs) noexcept { return lhs.underlying() > rhs.underlying(); }
+
+template
+inline bool operator>=(const SharedPtr& lhs, const SharedPtr& rhs) noexcept { return lhs.underlying() >= rhs.underlying(); }
+
+#endif
+
+}
+
+#endif
diff --git a/cpp/include/Ice/SlicedData.h b/cpp/include/Ice/SlicedData.h
index 3b579ca513f..56ad3155a8b 100644
--- a/cpp/include/Ice/SlicedData.h
+++ b/cpp/include/Ice/SlicedData.h
@@ -6,7 +6,6 @@
#define ICE_SLICED_DATA_H
#include
-#include
#include
namespace Ice
@@ -76,25 +75,13 @@ class ICE_API SlicedData
* Clears the slices to break potential cyclic references.
*/
void clear();
-
-#ifndef ICE_CPP11_MAPPING
- /// \cond INTERNAL
- void _iceGcVisitMembers(IceInternal::GCVisitor&);
- /// \endcond
-#endif
-
};
/**
* Represents an instance of an unknown type.
* \headerfile Ice/Ice.h
*/
-class ICE_API UnknownSlicedValue :
-#ifdef ICE_CPP11_MAPPING
- public Value
-#else
- public IceInternal::GCValue
-#endif
+class ICE_API UnknownSlicedValue : public Value
{
public:
@@ -150,10 +137,6 @@ class ICE_API UnknownSlicedValue :
*/
virtual std::string ice_id() const;
- /// \cond INTERNAL
- virtual void _iceGcVisitMembers(IceInternal::GCVisitor&);
- /// \endcond
-
/// \cond STREAM
virtual void _iceWrite(::Ice::OutputStream*) const;
virtual void _iceRead(::Ice::InputStream*);
diff --git a/cpp/include/Ice/SlicedDataF.h b/cpp/include/Ice/SlicedDataF.h
index 83842a02508..24087f62154 100644
--- a/cpp/include/Ice/SlicedDataF.h
+++ b/cpp/include/Ice/SlicedDataF.h
@@ -5,8 +5,9 @@
#ifndef ICE_SLICED_DATA_F_H
#define ICE_SLICED_DATA_F_H
-#include
+#include
#include
+#include
namespace Ice
{
@@ -28,8 +29,7 @@ typedef IceInternal::Handle SliceInfoPtr;
ICE_API IceUtil::Shared* upCast(SlicedData*);
typedef IceInternal::Handle SlicedDataPtr;
-ICE_API IceUtil::Shared* upCast(UnknownSlicedValue*);
-typedef IceInternal::Handle UnknownSlicedValuePtr;
+using UnknownSlicedValuePtr = SharedPtr;
#endif
/** The slices of unknown types. */
diff --git a/cpp/include/Ice/StreamHelpers.h b/cpp/include/Ice/StreamHelpers.h
index 967ab6ddabd..9fc0910330d 100644
--- a/cpp/include/Ice/StreamHelpers.h
+++ b/cpp/include/Ice/StreamHelpers.h
@@ -6,6 +6,7 @@
#define ICE_STREAM_HELPERS_H
#include
+#include
#include
#include
@@ -421,7 +422,7 @@ struct StreamableTraits<::std::shared_ptr, typename ::std::enable_if<::std::i
};
#else
template
-struct StreamableTraits< ::IceInternal::Handle >
+struct StreamableTraits>
{
static const StreamHelperCategory helper = StreamHelperCategoryClass;
static const int minWireSize = 1;
diff --git a/cpp/include/Ice/Value.h b/cpp/include/Ice/Value.h
index 738870dbc01..1e7632ff121 100644
--- a/cpp/include/Ice/Value.h
+++ b/cpp/include/Ice/Value.h
@@ -5,13 +5,7 @@
#ifndef ICE_VALUE_H
#define ICE_VALUE_H
-// TODO: temporary
-#ifdef ICE_CPP11_MAPPING
-# include
-#else
-# include
-#endif
-
+#include
#include
namespace Ice
@@ -20,11 +14,6 @@ namespace Ice
class InputStream;
}
-namespace IceInternal
-{
- class GCVisitor;
-}
-
namespace Ice
{
@@ -153,29 +142,22 @@ template class ValueHelper : public Base
* The base class for instances of Slice classes.
* \headerfile Ice/Ice.h
*/
-class ICE_API Value : public virtual IceUtil::Shared
+class ICE_API Value
{
public:
- virtual bool operator==(const Value&) const;
- virtual bool operator<(const Value&) const;
+ Value() = default;
+ Value(const Value&) = default;
+ Value(Value&&) = default;
+ Value& operator=(const Value&) = default;
+ Value& operator=(Value&&) = default;
+ virtual ~Value() = default;
/// \cond STREAM
virtual void _iceWrite(Ice::OutputStream*) const;
virtual void _iceRead(Ice::InputStream*);
/// \endcond
- /// \cond INTERNAL
- virtual bool _iceGcVisit(IceInternal::GCVisitor&) { return false; }
- /// \endcond
-
- /**
- * Determines whether this object, and by extension the graph of all objects reachable from this object,
- * are eligible for garbage collection when all external references to the graph have been released.
- * @param b True if the object is eligible, false otherwise.
- */
- virtual void ice_collectable(bool b);
-
/**
* The Ice run time invokes this method prior to marshaling an object's data members. This allows a subclass
* to override this method in order to validate its data members.
@@ -213,15 +195,6 @@ class ICE_API Value : public virtual IceUtil::Shared
*/
virtual SlicedDataPtr ice_getSlicedData() const;
-protected:
-
- Value() = default;
- Value(const Value&) = default;
- Value(Value&&) = default;
- Value& operator=(const Value&) = default;
- Value& operator=(Value&&) = default;
- virtual ~Value() = default;
-
protected:
/// \cond STREAM
diff --git a/cpp/include/Ice/ValueF.h b/cpp/include/Ice/ValueF.h
index 56a29f81122..2ee3456d1d8 100644
--- a/cpp/include/Ice/ValueF.h
+++ b/cpp/include/Ice/ValueF.h
@@ -6,7 +6,7 @@
#define ICE_VALUE_F_H
#include
-#include
+#include
namespace Ice
{
@@ -20,8 +20,8 @@ using ValuePtr = ::std::shared_ptr;
#else
-ICE_API Value* upCast(Value*);
-typedef IceInternal::Handle ValuePtr;
+using ValuePtr = SharedPtr;
+
/// \cond INTERNAL
ICE_API void _icePatchValuePtr(ValuePtr&, const ValuePtr&);
/// \endcond
diff --git a/cpp/include/IceBox/Service.h b/cpp/include/IceBox/Service.h
index f82f62dfe48..cdc9b5faa17 100644
--- a/cpp/include/IceBox/Service.h
+++ b/cpp/include/IceBox/Service.h
@@ -26,7 +26,6 @@
#include
#include
#include
-#include
#include
#include
#include
diff --git a/cpp/include/IceGrid/PluginFacade.h b/cpp/include/IceGrid/PluginFacade.h
index 70710c4079e..453d34560e9 100644
--- a/cpp/include/IceGrid/PluginFacade.h
+++ b/cpp/include/IceGrid/PluginFacade.h
@@ -26,7 +26,6 @@
#include
#include
#include
-#include
#include
#include
#include
diff --git a/cpp/include/IceUtil/Config.h b/cpp/include/IceUtil/Config.h
index 10dfe256f3c..7a16824b47d 100644
--- a/cpp/include/IceUtil/Config.h
+++ b/cpp/include/IceUtil/Config.h
@@ -291,9 +291,11 @@ typedef long long Int64;
# include
# define ICE_HANDLE ::std::shared_ptr
# define ICE_INTERNAL_HANDLE ::std::shared_ptr
+# define ICE_SHARED_PTR ::std::shared_ptr
# define ICE_PROXY_HANDLE ::std::shared_ptr
# define ICE_MAKE_SHARED(T, ...) ::std::make_shared(__VA_ARGS__)
# define ICE_DEFINE_PTR(TPtr, T) using TPtr = ::std::shared_ptr
+# define ICE_DEFINE_SHARED_PTR(TPtr, T) using TPtr = ::std::shared_ptr
# define ICE_ENUM(CLASS,ENUMERATOR) CLASS::ENUMERATOR
# define ICE_SCOPED_ENUM(CLASS,ENUMERATOR) CLASS::ENUMERATOR
# define ICE_NULLPTR nullptr
@@ -309,9 +311,11 @@ typedef long long Int64;
#else // C++98 mapping
# define ICE_HANDLE ::IceUtil::Handle
# define ICE_INTERNAL_HANDLE ::IceInternal::Handle
+# define ICE_SHARED_PTR ::Ice::SharedPtr
# define ICE_PROXY_HANDLE ::IceInternal::ProxyHandle
# define ICE_MAKE_SHARED(T, ...) new T(__VA_ARGS__)
# define ICE_DEFINE_PTR(TPtr, T) typedef ::IceUtil::Handle TPtr
+# define ICE_DEFINE_SHARED_PTR(TPtr, T) using TPtr = ::Ice::SharedPtr
# define ICE_ENUM(CLASS,ENUMERATOR) ENUMERATOR
# define ICE_SCOPED_ENUM(CLASS,ENUMERATOR) CLASS##ENUMERATOR
# define ICE_NULLPTR 0
diff --git a/cpp/include/IceUtil/Shared.h b/cpp/include/IceUtil/Shared.h
index 5df56b94a0f..eda50a00fa4 100644
--- a/cpp/include/IceUtil/Shared.h
+++ b/cpp/include/IceUtil/Shared.h
@@ -80,7 +80,7 @@ class ICE_API Shared
//
// Flag constant used by the Shared class. Derived classes
- // such as GCValue define more flag constants.
+ // can define more flag constants.
//
static const unsigned char NoDelete;
diff --git a/cpp/msbuild/ice.test.sln b/cpp/msbuild/ice.test.sln
index 2679c905002..01372fea0bb 100644
--- a/cpp/msbuild/ice.test.sln
+++ b/cpp/msbuild/ice.test.sln
@@ -184,13 +184,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "server", "..\test\Ice\fault
{C7223CC8-0AAA-470B-ACB3-12B9DE75525C} = {C7223CC8-0AAA-470B-ACB3-12B9DE75525C}
EndProjectSection
EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "gc", "gc", "{D47FCF7F-D83C-4699-9B3B-F58265E6239A}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "client", "..\test\Ice\gc\msbuild\client.vcxproj", "{FA42EA5F-FDBE-4F27-ACC7-7717E401C868}"
- ProjectSection(ProjectDependencies) = postProject
- {C7223CC8-0AAA-470B-ACB3-12B9DE75525C} = {C7223CC8-0AAA-470B-ACB3-12B9DE75525C}
- EndProjectSection
-EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "hash", "hash", "{74640E74-D6AA-414C-8238-0FFDC854AE98}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "client", "..\test\Ice\hash\msbuild\client.vcxproj", "{685612A9-F2AA-4ACA-8327-5D40E4731906}"
@@ -1689,18 +1682,6 @@ Global
{CC0C7076-D15B-42AB-AFD6-CE40472F6E84}.Release|Win32.Build.0 = Release|Win32
{CC0C7076-D15B-42AB-AFD6-CE40472F6E84}.Release|x64.ActiveCfg = Release|x64
{CC0C7076-D15B-42AB-AFD6-CE40472F6E84}.Release|x64.Build.0 = Release|x64
- {FA42EA5F-FDBE-4F27-ACC7-7717E401C868}.Cpp11-Debug|Win32.ActiveCfg = Cpp11-Debug|Win32
- {FA42EA5F-FDBE-4F27-ACC7-7717E401C868}.Cpp11-Debug|x64.ActiveCfg = Cpp11-Debug|x64
- {FA42EA5F-FDBE-4F27-ACC7-7717E401C868}.Cpp11-Release|Win32.ActiveCfg = Cpp11-Release|Win32
- {FA42EA5F-FDBE-4F27-ACC7-7717E401C868}.Cpp11-Release|x64.ActiveCfg = Cpp11-Release|x64
- {FA42EA5F-FDBE-4F27-ACC7-7717E401C868}.Debug|Win32.ActiveCfg = Debug|Win32
- {FA42EA5F-FDBE-4F27-ACC7-7717E401C868}.Debug|Win32.Build.0 = Debug|Win32
- {FA42EA5F-FDBE-4F27-ACC7-7717E401C868}.Debug|x64.ActiveCfg = Debug|x64
- {FA42EA5F-FDBE-4F27-ACC7-7717E401C868}.Debug|x64.Build.0 = Debug|x64
- {FA42EA5F-FDBE-4F27-ACC7-7717E401C868}.Release|Win32.ActiveCfg = Release|Win32
- {FA42EA5F-FDBE-4F27-ACC7-7717E401C868}.Release|Win32.Build.0 = Release|Win32
- {FA42EA5F-FDBE-4F27-ACC7-7717E401C868}.Release|x64.ActiveCfg = Release|x64
- {FA42EA5F-FDBE-4F27-ACC7-7717E401C868}.Release|x64.Build.0 = Release|x64
{685612A9-F2AA-4ACA-8327-5D40E4731906}.Cpp11-Debug|Win32.ActiveCfg = Cpp11-Debug|Win32
{685612A9-F2AA-4ACA-8327-5D40E4731906}.Cpp11-Debug|Win32.Build.0 = Cpp11-Debug|Win32
{685612A9-F2AA-4ACA-8327-5D40E4731906}.Cpp11-Debug|x64.ActiveCfg = Cpp11-Debug|x64
@@ -4175,8 +4156,6 @@ Global
{81413A55-9551-483B-BAC5-7D903C5DC167} = {2CAF9731-CB18-498C-A3EF-24F3D8A334AC}
{606D6061-3084-498A-988A-7F5B9FE8732D} = {81413A55-9551-483B-BAC5-7D903C5DC167}
{CC0C7076-D15B-42AB-AFD6-CE40472F6E84} = {81413A55-9551-483B-BAC5-7D903C5DC167}
- {D47FCF7F-D83C-4699-9B3B-F58265E6239A} = {2CAF9731-CB18-498C-A3EF-24F3D8A334AC}
- {FA42EA5F-FDBE-4F27-ACC7-7717E401C868} = {D47FCF7F-D83C-4699-9B3B-F58265E6239A}
{74640E74-D6AA-414C-8238-0FFDC854AE98} = {2CAF9731-CB18-498C-A3EF-24F3D8A334AC}
{685612A9-F2AA-4ACA-8327-5D40E4731906} = {74640E74-D6AA-414C-8238-0FFDC854AE98}
{D3A57C0F-C26F-4D25-A890-4D151D16C0D7} = {2CAF9731-CB18-498C-A3EF-24F3D8A334AC}
diff --git a/cpp/src/Ice/GCValue.cpp b/cpp/src/Ice/GCValue.cpp
deleted file mode 100644
index 58336ac81a7..00000000000
--- a/cpp/src/Ice/GCValue.cpp
+++ /dev/null
@@ -1,442 +0,0 @@
-//
-// Copyright (c) ZeroC, Inc. All rights reserved.
-//
-
-#include
-
-#ifndef ICE_CPP11_MAPPING
-
-#include
-#include
-
-using namespace std;
-using namespace IceUtil;
-using namespace IceInternal;
-
-namespace
-{
-
-typedef ::map GCCountMap;
-Mutex* gcMutex = 0;
-
-class Init
-{
-public:
-
- Init()
- {
- gcMutex = new Mutex();
- }
-
- ~Init()
- {
- delete gcMutex;
- gcMutex = 0;
- }
-};
-
-Init init;
-
-class ClearMembers : public GCVisitor
-{
-public:
-
- virtual bool visit(GCValue*);
-};
-ClearMembers clearMembers;
-
-class DecreaseRefCounts : public GCVisitor
-{
-public:
-
- DecreaseRefCounts(GCCountMap&);
-
- virtual bool visit(GCValue*);
-
-private:
-
- GCCountMap& _counts;
-};
-
-class RestoreRefCountsIfReachable : public GCVisitor
-{
-public:
-
- RestoreRefCountsIfReachable(GCCountMap&);
-
- virtual bool visit(GCValue*);
-
-private:
-
- GCCountMap& _counts;
- bool _reachable;
-};
-
-class MarkCollectable : public GCVisitor
-{
-public:
-
- MarkCollectable();
-
- virtual bool visit(GCValue*);
-
- void visitNeighbor(GCValue*);
-
-private:
-
- int _counter;
- map _numbers;
- stack _p;
- stack _s;
-
- class VisitNeighbors : public IceInternal::GCVisitor
- {
- public:
-
- void setVisitor(MarkCollectable*);
- virtual bool visit(GCValue*);
-
- private:
-
- MarkCollectable* _visitor;
- };
- VisitNeighbors _neighborsVisitor;
-};
-
-class ClearCollectable : public GCVisitor
-{
-public:
-
- virtual bool visit(GCValue*);
-};
-
-}
-
-bool
-ClearMembers::visit(GCValue*)
-{
- return true;
-}
-
-DecreaseRefCounts::DecreaseRefCounts(GCCountMap& counts) : _counts(counts)
-{
-}
-
-bool
-DecreaseRefCounts::visit(GCValue* obj)
-{
- //
- // Visit the object only once when the object is inserted for
- // the first time in the counts map. After, we just decrement
- // its reference count. Decrementing the reference counts of
- // reachable objects will indicate when a cycle is
- // collectable. Collectable objects are those with a reference
- // count of zero and for which there's no "reachable" parent
- // object (objects with a reference count > 0).
- //
- GCCountMap::iterator p = _counts.find(obj);
- if(p == _counts.end())
- {
- _counts.insert(make_pair(obj, obj->_iceGetRefUnsafe() - 1));
- if(obj->__hasFlag(GCValue::Collectable))
- {
- obj->_iceGcVisitMembers(*this);
- }
- }
- else
- {
- --p->second;
- }
- return false;
-}
-
-RestoreRefCountsIfReachable::RestoreRefCountsIfReachable(GCCountMap& counts) : _counts(counts), _reachable(false)
-{
-}
-
-bool
-RestoreRefCountsIfReachable::visit(GCValue* obj)
-{
- GCCountMap::iterator p = _counts.find(obj);
- if(p == _counts.end())
- {
- //
- // If the object has been removed from the counts map,
- // it's reachable.
- //
- return false;
- }
- else if(_reachable)
- {
- //
- // If parent object is reachable, this object is also
- // reachable. Remove it from the counts map and also make
- // reachable children.
- //
- _counts.erase(p);
- obj->_iceGcVisitMembers(*this);
- }
- else if(p->second == 0)
- {
- //
- // If the object is collectable, set its count to -1 to
- // indicate that it was already visited prevent it from
- // being visited again.
- //
- p->second = -1;
- obj->_iceGcVisitMembers(*this);
- }
- else if(p->second > 0)
- {
- //
- // Object isn't collectable, remove it from the counts map
- // and visit its sub-graph to remove children wobjects from
- // the counts map since they are also reachable.
- //
- _counts.erase(p);
-
- _reachable = true;
- obj->_iceGcVisitMembers(*this);
- _reachable = false;
- }
- return false;
-}
-
-MarkCollectable::MarkCollectable() : _counter(0)
-{
- _neighborsVisitor.setVisitor(this);
-}
-
-bool
-MarkCollectable::visit(GCValue* obj)
-{
- //
- // Set the collectable flag on the object graph. While setting the
- // flag, we also check if the object graph has cycles and mark all the
- // objects which are part of a cycle with the CycleMember flag.
- //
- // We use the path-based strong component algorithm to detect the
- // strong components of the graph.
- //
-
- if(obj->__hasFlag(GCValue::Collectable))
- {
- return false;
- }
- obj->__setFlag(GCValue::Collectable);
-
- _numbers[obj] = ++_counter;
- _p.push(obj);
- _s.push(obj);
-
- obj->_iceGcVisitMembers(_neighborsVisitor);
-
- if(_p.top() == obj)
- {
- GCValue* o;
- do
- {
- o = _s.top();
- _s.pop();
- o->__setFlag(GCValue::CycleMember);
- }
- while(o != obj);
- _p.pop();
- }
- return false;
-}
-
-void
-MarkCollectable::visitNeighbor(GCValue* obj)
-{
- map::const_iterator p = _numbers.find(obj);
- if(p == _numbers.end())
- {
- visit(obj);
- }
- else if(!obj->__hasFlag(GCValue::CycleMember))
- {
- while(_numbers[_p.top()] > p->second)
- {
- _p.pop();
- }
- }
-}
-
-void
-MarkCollectable::VisitNeighbors::setVisitor(MarkCollectable* visitor)
-{
- _visitor = visitor;
-}
-
-bool
-MarkCollectable::VisitNeighbors::visit(GCValue* obj)
-{
- _visitor->visitNeighbor(obj);
- return false;
-}
-
-bool
-ClearCollectable::visit(GCValue* obj)
-{
- //
- // Clear the collectable flag on the object graph.
- //
- if(obj->__hasFlag(GCValue::Collectable))
- {
- obj->__clearFlag(GCValue::Collectable | GCValue::CycleMember);
- obj->_iceGcVisitMembers(*this);
- }
- return false;
-}
-
-//
-// Flags constant used for collection of graphs.
-//
-const unsigned char GCValue::Collectable = 2;
-const unsigned char GCValue::CycleMember = 4;
-const unsigned char GCValue::Visiting = 8;
-
-//
-// GCValue
-//
-void
-IceInternal::GCValue::__incRef()
-{
- IceUtilInternal::MutexPtrLock lock(gcMutex);
- ++_ref;
-}
-
-void
-IceInternal::GCValue::__decRef()
-{
- IceUtilInternal::MutexPtrLock lock(gcMutex);
- bool doDelete = false;
- assert(_ref > 0);
-
- //
- // Try to collect the object each time its reference count is
- // decremented and only if it's part of a cycle.
- //
- if(_ref > 1 && __hasFlag(CycleMember) && collect(lock))
- {
- return;
- }
-
- if(--_ref == 0)
- {
- doDelete = !__hasFlag(NoDelete);
- __setFlag(NoDelete);
- }
-
- lock.release();
- if(doDelete)
- {
- delete this;
- }
-}
-
-int
-IceInternal::GCValue::__getRef() const
-{
- IceUtilInternal::MutexPtrLock lock(gcMutex);
- return _ref;
-}
-
-void
-IceInternal::GCValue::__setNoDelete(bool b)
-{
- IceUtilInternal::MutexPtrLock lock(gcMutex);
- IceUtil::Shared::__setNoDelete(b);
-}
-
-bool
-GCValue::_iceGcVisit(GCVisitor& v)
-{
- return v.visit(this);
-}
-
-void
-GCValue::ice_collectable(bool enable)
-{
- IceUtilInternal::MutexPtrLock lock(gcMutex);
- if(enable)
- {
- ClearCollectable().visit(this);
- MarkCollectable().visit(this);
- }
- else
- {
- ClearCollectable().visit(this);
- }
-}
-
-bool
-GCValue::collect(IceUtilInternal::MutexPtrLock& lock)
-{
- GCCountMap counts;
-
- //
- // Go through the object graph and decrease reference counts for
- // all the objects from the graph. Cycles which can be collected
- // should lead to objects with a zero reference count.
- //
- DecreaseRefCounts(counts).visit(this);
- assert(counts.find(this) != counts.end());
- if(counts[this] > 0)
- {
- return false; // Object is still reachable, we're done.
- }
-
- //
- // Go the graph again and check for objects which are still
- // reachable. If there are any, we restore the reference counts
- // for the sub-graph of the reachable object and we remove the
- // reachable objects from the counts map. At the end, if the
- // counts map is empty, it indicates that this object graph isn't
- // collectable yet.
- //
- RestoreRefCountsIfReachable(counts).visit(this);
- if(counts.empty())
- {
- return false;
- }
-
- assert(counts.find(this) != counts.end()); // This object must be collectable.
-
- //
- // At this point, we can release the lock. The objects from counts
- // are un-reachable from the user code and clearing the members of
- // the collectable objects requires acquiring the mutex to
- // decrement their reference counts.
- //
- lock.release();
-
- //
- // Break all the cyclic reference counts of objects which are
- // remaining in the counts map by clearing members.
- //
- // We first go through the list to mark all the objects as
- // non-deletable and we also disable collection for all those
- // objects since we already know they are collectable.
- //
- // After clearing members, we delete all the collectable
- // objects. We can't just delete the objects since those objects
- // likely point to each other.
- //
- for(GCCountMap::const_iterator p = counts.begin(); p != counts.end(); ++p)
- {
- p->first->__setFlag(NoDelete);
- p->first->__clearFlag(CycleMember); // Disable cycle collection.
- }
- for(GCCountMap::const_iterator p = counts.begin(); p != counts.end(); ++p)
- {
- p->first->_iceGcVisitMembers(clearMembers);
- }
- for(GCCountMap::const_iterator p = counts.begin(); p != counts.end(); ++p)
- {
- delete p->first;
- }
- return true;
-}
-#endif
diff --git a/cpp/src/Ice/InputStream.cpp b/cpp/src/Ice/InputStream.cpp
index 030e5971733..39ff95bce57 100644
--- a/cpp/src/Ice/InputStream.cpp
+++ b/cpp/src/Ice/InputStream.cpp
@@ -156,10 +156,6 @@ Ice::InputStream::initialize(Instance* instance, const EncodingVersion& encoding
initialize(encoding);
_instance = instance;
-
-#ifndef ICE_CPP11_MAPPING
- _collectObjects = _instance->collectObjects();
-#endif
_traceSlicing = _instance->traceLevels()->slicing > 0;
_classGraphDepthMax = _instance->classGraphDepthMax();
}
@@ -170,9 +166,6 @@ Ice::InputStream::initialize(const EncodingVersion& encoding)
_instance = 0;
_encoding = encoding;
_currentEncaps = 0;
-#ifndef ICE_CPP11_MAPPING
- _collectObjects = false;
-#endif
_traceSlicing = false;
_classGraphDepthMax = 0x7fffffff;
_closure = 0;
@@ -217,14 +210,6 @@ Ice::InputStream::setCompactIdResolver(const CompactIdResolverPtr& r)
_compactIdResolver = r;
}
-#ifndef ICE_CPP11_MAPPING
-void
-Ice::InputStream::setCollectObjects(bool on)
-{
- _collectObjects = on;
-}
-#endif
-
void
Ice::InputStream::setSliceValues(bool on)
{
@@ -271,9 +256,6 @@ Ice::InputStream::swap(InputStream& other)
std::swap(_instance, other._instance);
std::swap(_encoding, other._encoding);
-#ifndef ICE_CPP11_MAPPING
- std::swap(_collectObjects, other._collectObjects);
-#endif
std::swap(_traceSlicing, other._traceSlicing);
std::swap(_classGraphDepthMax, other._classGraphDepthMax);
std::swap(_closure, other._closure);
@@ -1595,12 +1577,6 @@ Ice::InputStream::postUnmarshal(const ValuePtr& v) const
{
try
{
-#ifndef ICE_CPP11_MAPPING
- if(_collectObjects)
- {
- v->ice_collectable(true);
- }
-#endif
v->ice_postUnmarshal();
}
catch(const std::exception& ex)
diff --git a/cpp/src/Ice/Instance.cpp b/cpp/src/Ice/Instance.cpp
index 61e786b0401..b495f6b51a3 100644
--- a/cpp/src/Ice/Instance.cpp
+++ b/cpp/src/Ice/Instance.cpp
@@ -942,7 +942,6 @@ IceInternal::Instance::Instance(const CommunicatorPtr& communicator, const Initi
_messageSizeMax(0),
_batchAutoFlushSize(0),
_classGraphDepthMax(0),
- _collectObjects(false),
_toStringMode(ICE_ENUM(ToStringMode, Unicode)),
_acceptClassCycles(false),
_implicitContext(0),
@@ -1206,8 +1205,6 @@ IceInternal::Instance::Instance(const CommunicatorPtr& communicator, const Initi
}
}
- const_cast(_collectObjects) = _initData.properties->getPropertyAsInt("Ice.CollectObjects") > 0;
-
string toStringModeStr = _initData.properties->getPropertyWithDefault("Ice.ToStringMode", "Unicode");
if(toStringModeStr == "ASCII")
{
diff --git a/cpp/src/Ice/Instance.h b/cpp/src/Ice/Instance.h
index 150167190d8..4995c393285 100644
--- a/cpp/src/Ice/Instance.h
+++ b/cpp/src/Ice/Instance.h
@@ -104,7 +104,6 @@ class Instance : public IceUtil::Shared, public IceUtil::Monitor::iterator q = (*p)->instances.begin(); q != (*p)->instances.end(); ++q)
- {
- if(q->get()->_iceGcVisit(visitor))
- {
- *q = 0;
- }
- }
- }
-}
-#endif
-
Ice::UnknownSlicedValue::UnknownSlicedValue(const string& unknownTypeId) : _unknownTypeId(unknownTypeId)
{
}
@@ -101,15 +81,6 @@ Ice::UnknownSlicedValue::ice_id() const
return _unknownTypeId;
}
-void
-Ice::UnknownSlicedValue::_iceGcVisitMembers(IceInternal::GCVisitor& _v)
-{
- if(_slicedData)
- {
- _slicedData->_iceGcVisitMembers(_v);
- }
-}
-
#endif
void
diff --git a/cpp/src/Ice/Value.cpp b/cpp/src/Ice/Value.cpp
index 0b09dbf56fa..d73d6e03009 100644
--- a/cpp/src/Ice/Value.cpp
+++ b/cpp/src/Ice/Value.cpp
@@ -5,6 +5,7 @@
#include
#include
#include
+#include
#include
using namespace std;
@@ -71,31 +72,12 @@ Ice::Value::ice_getSlicedData() const
#else
-Value* Ice::upCast(Value* p) { return p; }
-
void
Ice::_icePatchValuePtr(ValuePtr& obj, const ValuePtr& v)
{
obj = v;
}
-bool
-Ice::Value::operator==(const Value& r) const
-{
- return this == &r;
-}
-
-bool
-Ice::Value::operator<(const Value& r) const
-{
- return this < &r;
-}
-
-void
-Ice::Value::ice_collectable(bool)
-{
-}
-
void
Ice::Value::ice_preMarshal()
{
diff --git a/cpp/src/Ice/msbuild/ice++11/ice++11.vcxproj b/cpp/src/Ice/msbuild/ice++11/ice++11.vcxproj
index e718a56b474..e0621acc13e 100644
--- a/cpp/src/Ice/msbuild/ice++11/ice++11.vcxproj
+++ b/cpp/src/Ice/msbuild/ice++11/ice++11.vcxproj
@@ -619,7 +619,6 @@
-
diff --git a/cpp/src/Ice/msbuild/ice++11/ice++11.vcxproj.filters b/cpp/src/Ice/msbuild/ice++11/ice++11.vcxproj.filters
index 6e362bd97bc..5a1e6bd3fe3 100644
--- a/cpp/src/Ice/msbuild/ice++11/ice++11.vcxproj.filters
+++ b/cpp/src/Ice/msbuild/ice++11/ice++11.vcxproj.filters
@@ -378,9 +378,6 @@
Source Files
-
- Source Files
-
Source Files
diff --git a/cpp/src/Ice/msbuild/ice/ice.vcxproj b/cpp/src/Ice/msbuild/ice/ice.vcxproj
index c5be624da84..2aeb6fd4e2b 100644
--- a/cpp/src/Ice/msbuild/ice/ice.vcxproj
+++ b/cpp/src/Ice/msbuild/ice/ice.vcxproj
@@ -624,7 +624,6 @@
-
diff --git a/cpp/src/Ice/msbuild/ice/ice.vcxproj.filters b/cpp/src/Ice/msbuild/ice/ice.vcxproj.filters
index 311813b0572..5e4488be9e2 100644
--- a/cpp/src/Ice/msbuild/ice/ice.vcxproj.filters
+++ b/cpp/src/Ice/msbuild/ice/ice.vcxproj.filters
@@ -377,9 +377,6 @@
Source Files
-
- Source Files
-
Source Files
diff --git a/cpp/src/IceStorm/Instrumentation.h b/cpp/src/IceStorm/Instrumentation.h
index 490a409c0d6..9a3a2b90cd5 100644
--- a/cpp/src/IceStorm/Instrumentation.h
+++ b/cpp/src/IceStorm/Instrumentation.h
@@ -26,7 +26,6 @@
#include
#include
#include
-#include
#include
#include
#include
diff --git a/cpp/src/IceUtil/Shared.cpp b/cpp/src/IceUtil/Shared.cpp
index a06ff11a5f6..2c8d1dfed5e 100644
--- a/cpp/src/IceUtil/Shared.cpp
+++ b/cpp/src/IceUtil/Shared.cpp
@@ -8,7 +8,7 @@ using namespace IceUtil;
//
// Flag constant used by the Shared class. Derived classes
-// such as GCValue define more flag constants.
+// can define more flag constants.
//
const unsigned char IceUtil::Shared::NoDelete = 1;
diff --git a/cpp/src/slice2cpp/Gen.cpp b/cpp/src/slice2cpp/Gen.cpp
index 4f68b0c1e17..9bf7f943e72 100644
--- a/cpp/src/slice2cpp/Gen.cpp
+++ b/cpp/src/slice2cpp/Gen.cpp
@@ -2588,15 +2588,7 @@ Slice::Gen::DeclVisitor::visitClassDecl(const ClassDeclPtr& p)
string scoped = fixKwd(p->scoped());
H << sp << nl << "class " << name << ';';
-
- //
- // upCast is not _upCast nor _iceUpCast for historical reasons. IceInternal::Handle
- // depends on this name
- //
- H << nl << "/// \\cond INTERNAL";
- H << nl << _dllExport << getUnqualified("::Ice::Value*", scope) << " upCast(" << name << "*);";
- H << nl << "/// \\endcond";
- H << nl << "typedef ::IceInternal::Handle< " << name << "> " << p->name() << "Ptr;";
+ H << nl << "using " << p->name() << "Ptr = ::Ice::SharedPtr<" << name << ">;";
//
// _ice prefix because this function is in the Slice module namespace, where the user
@@ -3145,8 +3137,6 @@ Slice::Gen::ObjectVisitor::visitClassDefStart(const ClassDefPtr& p)
ClassDefPtr base = p->base();
DataMemberList dataMembers = p->dataMembers();
DataMemberList allDataMembers = p->allDataMembers();
- bool basePreserved = p->inheritsMetaData("preserve-slice");
- bool preserved = basePreserved || p->hasMetaData("preserve-slice");
H << sp;
writeDocSummary(H, p);
@@ -3159,14 +3149,7 @@ Slice::Gen::ObjectVisitor::visitClassDefStart(const ClassDefPtr& p)
}
else
{
- H << "public virtual " << getUnqualified("::Ice::Value", scope);
- }
-
- bool override = p->canBeCyclic() && (!base || !base->canBeCyclic());
- bool hasGCValueBaseClass = basePreserved || override || preserved;
- if(!basePreserved && (override || preserved))
- {
- H << ", public ::IceInternal::GCValue";
+ H << "public " << getUnqualified("::Ice::Value", scope);
}
H.restoreIndent();
@@ -3227,11 +3210,6 @@ Slice::Gen::ObjectVisitor::visitClassDefStart(const ClassDefPtr& p)
H << nl << name << "(const " << name << "&) = default;";
H << nl << name << "& operator=(const " << name << "&) = default;";
- C << sp;
- C << nl << "/// \\cond INTERNAL";
- C << nl << _dllExport << "::Ice::Value* " << scope.substr(2) << "upCast(" << name << "* p) { return p; }" << nl;
- C << nl << "/// \\endcond";
-
//
// It would make sense to provide a covariant ice_clone(); unfortunately many compilers
// (including VS2010) generate bad code for covariant types that use virtual inheritance
@@ -3244,31 +3222,12 @@ Slice::Gen::ObjectVisitor::visitClassDefStart(const ClassDefPtr& p)
H << nl << " */";
H << nl << "virtual " << getUnqualified("::Ice::ValuePtr", scope) << " ice_clone() const;";
- if(hasGCValueBaseClass)
- {
- C.zeroIndent();
- C << sp;
- C << nl << "#if defined(_MSC_VER)";
- C << nl << "# pragma warning(push)";
- C << nl << "# pragma warning(disable:4589)";
- C << nl << "#endif";
- C.restoreIndent();
- }
C << nl << "::Ice::ValuePtr";
C << nl << scoped.substr(2) << "::ice_clone() const";
C << sb;
C << nl << getUnqualified("::Ice::Value*", scope) << " p = new " << name << "(*this);";
C << nl << "return p;";
-
C << eb;
- if(hasGCValueBaseClass)
- {
- C.zeroIndent();
- C << nl << "#if defined(_MSC_VER)";
- C << nl << "# pragma warning(pop)";
- C << nl << "#endif";
- C.restoreIndent();
- }
H << sp;
H << nl << "/**";
@@ -3298,8 +3257,6 @@ Slice::Gen::ObjectVisitor::visitClassDefStart(const ClassDefPtr& p)
C << nl << "return typeId;";
C << eb;
- emitGCFunctions(p);
-
return true;
}
@@ -3529,21 +3486,6 @@ Slice::Gen::ObjectVisitor::visitClassDefEnd(const ClassDefPtr& p)
C << eb;
C << nl << "/// \\endcond";
- H << sp;
- H << nl << "/// \\cond INTERNAL";
- H << nl << "inline bool operator==(const " << fixKwd(p->name()) << "& lhs, const " << fixKwd(p->name()) << "& rhs)";
- H << sb;
- H << nl << "return static_cast(lhs) == static_cast(rhs);";
- H << eb;
- H << sp;
- H << nl << "inline bool operator<(const " << fixKwd(p->name()) << "& lhs, const " << fixKwd(p->name()) << "& rhs)";
- H << sb;
- H << nl << "return static_cast(lhs) < static_cast(rhs);";
- H << eb;
- H << nl << "/// \\endcond";
-
_useWstring = resetUseWstring(_useWstringHist);
}
@@ -3563,143 +3505,6 @@ Slice::Gen::ObjectVisitor::emitDataMember(const DataMemberPtr& p)
<< name << ';';
}
-void
-Slice::Gen::ObjectVisitor::emitGCFunctions(const ClassDefPtr& p)
-{
- string scoped = fixKwd(p->scoped());
- string scope = fixKwd(p->scope());
- string name = fixKwd(p->name());
- ClassDefPtr base = p->base();
- DataMemberList dataMembers = p->dataMembers();
-
- //
- // A class can potentially be part of a cycle if it (recursively) contains class
- // members.
- //
- bool canBeCyclic = p->canBeCyclic();
- bool basePreserved = p->inheritsMetaData("preserve-slice");
- bool preserved = basePreserved || p->hasMetaData("preserve-slice");
-
- //
- // _iceGcVisit() is overridden by the basemost class that can be
- // cyclic, plus all classes derived from that class.
- //
- // We also override these methods for the initial preserved class in a
- // hierarchy, regardless of whether the class itself is cyclic.
- //
- if(canBeCyclic || (preserved && !basePreserved))
- {
- H << nl << "/// \\cond INTERNAL";
- H << nl << "virtual void _iceGcVisitMembers(::IceInternal::GCVisitor&);";
- H << nl << "/// \\endcond";
-
- C << sp << nl << "void" << nl << scoped.substr(2) << "::_iceGcVisitMembers(::IceInternal::GCVisitor& v_)";
- C << sb;
-
- bool hasCyclicBase = base && base->canBeCyclic();
- if(hasCyclicBase || basePreserved)
- {
- emitUpcall(base, "::_iceGcVisitMembers(v_);", scope);
- }
-
- if(preserved && !basePreserved)
- {
- C << nl << "if(_iceSlicedData)";
- C << sb;
- C << nl << "_iceSlicedData->_iceGcVisitMembers(v_);";
- C << eb;
- }
-
- for(DataMemberList::const_iterator i = dataMembers.begin(); i != dataMembers.end(); ++i)
- {
- if((*i)->type()->usesClasses())
- {
- if((*i)->optional())
- {
- C << nl << "if(" << fixKwd((*i)->name()) << ')';
- C << sb;
- emitGCVisitCode((*i)->type(), getDataMemberRef(*i), "", 0);
- C << eb;
- }
- else
- {
- emitGCVisitCode((*i)->type(), getDataMemberRef(*i), "", 0);
- }
- }
- }
- C << eb;
- }
-}
-
-void
-Slice::Gen::ObjectVisitor::emitGCVisitCode(const TypePtr& p, const string& prefix, const string& name, int level)
-{
- BuiltinPtr builtin = BuiltinPtr::dynamicCast(p);
- if((builtin &&
- (BuiltinPtr::dynamicCast(p)->kind() == Builtin::KindObject || BuiltinPtr::dynamicCast(p)->kind() == Builtin::KindValue)) ||
- ClassDeclPtr::dynamicCast(p))
- {
- C << nl << "if(" << prefix << name << ')';
- C << sb;
- ClassDeclPtr decl = ClassDeclPtr::dynamicCast(p);
- if(decl)
- {
- string scope = fixKwd(decl->scope());
- C << nl << "if((" << scope << "upCast(" << prefix << name << ".get())->_iceGcVisit(v_)))";
- }
- else
- {
- C << nl << "if((" << prefix << name << ".get())->_iceGcVisit(v_))";
- }
- C << sb;
- C << nl << prefix << name << " = 0;";
- C << eb;
- C << eb;
- }
- else if(StructPtr::dynamicCast(p))
- {
- StructPtr s = StructPtr::dynamicCast(p);
- DataMemberList dml = s->dataMembers();
- for(DataMemberList::const_iterator i = dml.begin(); i != dml.end(); ++i)
- {
- if((*i)->type()->usesClasses())
- {
- emitGCVisitCode((*i)->type(), prefix + name + ".", fixKwd((*i)->name()), ++level);
- }
- }
- }
- else if(DictionaryPtr::dynamicCast(p))
- {
- DictionaryPtr d = DictionaryPtr::dynamicCast(p);
- string scoped = fixKwd(d->scoped());
- ostringstream tmp;
- tmp << "_i" << level;
- string iterName = tmp.str();
- C << sb;
- C << nl << "for(" << scoped << "::iterator " << iterName << " = " << prefix + name
- << ".begin(); " << iterName << " != " << prefix + name << ".end(); ++" << iterName << ")";
- C << sb;
- emitGCVisitCode(d->valueType(), "", string("(*") + iterName + ").second", ++level);
- C << eb;
- C << eb;
- }
- else if(SequencePtr::dynamicCast(p))
- {
- SequencePtr s = SequencePtr::dynamicCast(p);
- string scoped = fixKwd(s->scoped());
- ostringstream tmp;
- tmp << "_i" << level;
- string iterName = tmp.str();
- C << sb;
- C << nl << "for(" << scoped << "::iterator " << iterName << " = " << prefix + name
- << ".begin(); " << iterName << " != " << prefix + name << ".end(); ++" << iterName << ")";
- C << sb;
- emitGCVisitCode(s->type(), string("(*") + iterName + ")", "", ++level);
- C << eb;
- C << eb;
- }
-}
-
bool
Slice::Gen::ObjectVisitor::emitBaseInitializers(const ClassDefPtr& p)
{
diff --git a/cpp/src/slice2cpp/Gen.h b/cpp/src/slice2cpp/Gen.h
index 52c3e629e92..4387d4c4f16 100644
--- a/cpp/src/slice2cpp/Gen.h
+++ b/cpp/src/slice2cpp/Gen.h
@@ -201,9 +201,6 @@ class Gen : private ::IceUtil::noncopyable
private:
void emitDataMember(const DataMemberPtr&);
- void emitGCFunctions(const ClassDefPtr&);
- void emitGCVisitCode(const TypePtr&, const std::string&, const std::string&, int);
- void emitGCClearCode(const TypePtr&, const std::string&, const std::string&, int);
bool emitBaseInitializers(const ClassDefPtr&);
void emitOneShotConstructor(const ClassDefPtr&);
void emitUpcall(const ClassDefPtr&, const std::string&, const std::string&);
diff --git a/cpp/test/Ice/gc/Client.cpp b/cpp/test/Ice/gc/Client.cpp
deleted file mode 100644
index 162042960a0..00000000000
--- a/cpp/test/Ice/gc/Client.cpp
+++ /dev/null
@@ -1,530 +0,0 @@
-//
-// Copyright (c) ZeroC, Inc. All rights reserved.
-//
-
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-
-using namespace std;
-using namespace Test;
-
-namespace
-{
-
-int num = 0;
-::IceUtil::Mutex* numMutex = 0;
-
-class Init
-{
-public:
-
- Init()
- {
- numMutex = new IceUtil::Mutex;
- }
-
- ~Init()
- {
- delete numMutex;
- numMutex = 0;
- }
-};
-
-Init init;
-
-}
-
-static void
-incNum()
-{
- IceUtilInternal::MutexPtrLock lock(numMutex);
- ++num;
-}
-
-static void
-decNum()
-{
- IceUtilInternal::MutexPtrLock lock(numMutex);
- --num;
-}
-
-static int
-getNum()
-{
- IceUtilInternal::MutexPtrLock lock(numMutex);
- return num;
-}
-
-struct N : public C
-{
- N()
- {
- incNum();
- }
-
- ~N()
- {
- decNum();
- }
-};
-
-typedef ::IceInternal::Handle NPtr;
-
-struct N2 : public C2
-{
- N2()
- {
- incNum();
- }
-
- ~N2()
- {
- decNum();
- }
-};
-
-typedef ::IceInternal::Handle N2Ptr;
-
-struct NN : public Node
-{
- NN()
- {
- incNum();
- }
-
- ~NN()
- {
- decNum();
- }
-};
-
-typedef ::IceInternal::Handle NNPtr;
-
-struct NL : public Leaf
-{
- NL()
- {
- incNum();
- }
-
- ~NL()
- {
- decNum();
- }
-};
-
-typedef ::IceInternal::Handle NLPtr;
-
-class TestHaveCycles : public IceInternal::GCVisitor
-{
-public:
-
- virtual bool visit(IceInternal::GCValue* obj)
- {
- if(obj->__hasFlag(IceInternal::GCValue::Visiting))
- {
- return false;
- }
- test(obj->__hasFlag(IceInternal::GCValue::CycleMember) && obj->__hasFlag(IceInternal::GCValue::Collectable));
-
- obj->__setFlag(IceInternal::GCValue::Visiting);
- obj->_iceGcVisitMembers(*this);
- obj->__clearFlag(IceInternal::GCValue::Visiting);
- return false;
- }
-};
-
-void
-allTests()
-{
- cout << "testing single instance... " << flush;
- {
- NPtr n = new N;
- test(getNum() == 1);
- }
- test(getNum() == 0);
- cout << "ok" << endl;
-
- cout << "testing single instance cycle... " << flush;
- {
- NPtr n = new N;
- n->left = n;
- test(getNum() == 1);
- n->ice_collectable(true);
- TestHaveCycles().visit(n.get());
- }
- test(getNum() == 0);
- cout << "ok" << endl;
-
- cout << "testing single instance cycle with double pointers... " << flush;
- {
- NPtr n = new N;
- n->left = n;
- n->right = n;
- n->ice_collectable(true);
- TestHaveCycles().visit(n.get());
- test(getNum() == 1);
- }
- test(getNum() == 0);
- cout << "ok" << endl;
-
- cout << "testing double instance cycle... " << flush;
- {
- NPtr n1 = new N;
- NPtr n2 = new N;
- n1->left = n2;
- n2->left = n1;
- n1->ice_collectable(true);
- TestHaveCycles().visit(n1.get());
- n1 = 0;
- test(n2->left->left == n2);
- test(getNum() == 2);
- }
- test(getNum() == 0);
- cout << "ok" << endl;
-
- cout << "testing double instance cycle with double pointers... " << flush;
- {
- NPtr n1 = new N;
- NPtr n2 = new N;
- n1->left = n2;
- n2->left = n1;
- n1->right = n2;
- n2->right = n1;
- n1->ice_collectable(true);
- TestHaveCycles().visit(n1.get());
- n1 = 0;
- test(n2->left->left == n2);
- test(getNum() == 2);
- }
- test(getNum() == 0);
- cout << "ok" << endl;
-
- cout << "testing double instance cycle with looped pointers... " << flush;
- {
- NPtr n1 = new N;
- NPtr n2 = new N;
- n1->left = n2;
- n2->left = n1;
- n1->right = n1;
- n2->right = n2;
- n1->ice_collectable(true);
- TestHaveCycles().visit(n1.get());
- test(getNum() == 2);
- n1 = 0;
- test(n2->left->left == n2);
- }
- test(getNum() == 0);
- cout << "ok" << endl;
-
- cout << "testing triple instance cycle... " << flush;
- {
- NPtr n1 = new N;
- NPtr n2 = new N;
- NPtr n3 = new N;
- n1->left = n2;
- n2->left = n3;
- n3->left = n1;
- n1->ice_collectable(true);
- TestHaveCycles().visit(n1.get());
- n1 = 0;
- test(n2->left->left->left == n2);
- test(getNum() == 3);
- }
- test(getNum() == 0);
- cout << "ok" << endl;
-
- cout << "testing triple instance cycle with double pointers... " << flush;
- {
- NPtr n1 = new N;
- NPtr n2 = new N;
- NPtr n3 = new N;
- n1->left = n2;
- n2->left = n3;
- n3->left = n1;
- n1->right = n2;
- n2->right = n3;
- n3->right = n1;
- test(getNum() == 3);
- n1->ice_collectable(true);
- TestHaveCycles().visit(n1.get());
- }
- test(getNum() == 0);
- cout << "ok" << endl;
-
- cout << "testing triple instance cycle with opposing pointers... " << flush;
- {
- NPtr n1 = new N;
- NPtr n2 = new N;
- NPtr n3 = new N;
- n1->left = n2;
- n2->left = n3;
- n3->left = n1;
- n1->right = n3;
- n2->right = n1;
- n3->right = n2;
- n1->ice_collectable(true);
- TestHaveCycles().visit(n1.get());
- test(getNum() == 3);
- }
- test(getNum() == 0);
- cout << "ok" << endl;
-
- cout << "testing cycle with trailing instances... " << flush;
- NPtr n;
- {
- NPtr n1 = new N;
- NPtr n2 = new N;
- NPtr n3 = new N;
- NPtr n4 = new N;
- n1->left = n2;
- n2->left = n1;
- n2->right = n3;
- n3->left = n4;
- n = n3;
- n1->ice_collectable(true);
- TestHaveCycles().visit(n1.get());
- test(getNum() == 4);
- }
- test(getNum() == 2);
- n = 0;
- test(getNum() == 0);
- cout << "ok" << endl;
-
- cout << "testing cycle with trailing instances and trailing cycle... " << flush;
- {
- NPtr n1 = new N;
- NPtr n2 = new N;
- NPtr n3 = new N;
- NPtr n4 = new N;
- NPtr n5 = new N;
- NPtr n6 = new N;
- n1->left = n2;
- n2->left = n1;
- n2->right = n3;
- n3->left = n4;
- n4->right = n5;
- n5->right = n6;
- n6->right = n5;
- n1->ice_collectable(true);
- TestHaveCycles().visit(n1.get());
- n = n4;
- test(getNum() == 6);
- }
- test(getNum() == 3);
- n = 0;
- test(getNum() == 0);
- cout << "ok" << endl;
-
- cout << "testing complex cycles... " << flush;
- {
- NPtr n1 = new N;
- NPtr n2 = new N;
- NPtr n3 = new N;
- NPtr n4 = new N;
- NPtr n5 = new N;
- NPtr n6 = new N;
- NPtr n7 = new N;
- NPtr n8 = new N;
-
- n1->left = n2;
- n2->left = n3;
- n2->right = n4;
- n3->left = n8;
- n3->right = n5;
- n4->left = n5;
- n5->left = n6;
- n6->left = n5;
- n6->right = n7;
- n7->left = n3;
- n8->left = n1;
- n1->ice_collectable(true);
- TestHaveCycles().visit(n1.get());
-
- n4->ice_collectable(false);
-
- n4->ice_collectable(true);
- TestHaveCycles().visit(n4.get());
-
- n = n4;
- test(getNum() == 8);
- }
- test(getNum() == 8);
- n = 0;
- test(getNum() == 0);
- cout << "ok" << endl;
-
- cout << "testing random graphs... " << flush;
- {
- for(int i = 10; i <= 150; i += 10) // random graphs with 10 to 150 nodes
- {
- {
- vector nodes;
- for(int j = 0; j < i; ++j)
- {
- nodes.push_back(new N());
- }
-
- for(int j = 0; j < i; ++j)
- {
- nodes[static_cast(j)]->left = nodes[IceUtilInternal::random(i)];
- nodes[static_cast(j)]->right = nodes[IceUtilInternal::random(i)];
- }
-
- for(int j = 0; j < i; ++j)
- {
- nodes[static_cast(j)]->ice_collectable(true);
- }
- test(getNum() == i);
- }
- test(getNum() == 0);
- }
- }
- cout << "ok" << endl;
-
- cout << "testing sequence element cycle... " << flush;
- {
- CSeq cs;
- cs.push_back(new N);
- cs.push_back(new N);
- cs[0]->left = cs[1];
- cs[1]->left = cs[0];
- cs[0]->ice_collectable(true);
- cs[1]->ice_collectable(true);
- test(getNum() == 2);
- }
- test(getNum() == 0);
- cout << "ok" << endl;
-
- cout << "testing dictionary element cycle... " << flush;
- {
- CDict cd;
- NPtr n1 = new N;
- NPtr n2 = new N;
- n1->left = n2;
- n2->left = n1;
- cd[0] = n1;
- cd[1] = n2;
- cd[0]->ice_collectable(true);
- cd[1]->ice_collectable(true);
- test(getNum() == 2);
- }
- test(getNum() == 0);
- cout << "ok" << endl;
-
- cout << "testing sequence of struct cycle... " << flush;
- {
- SSeq ss;
- S s;
-
- ss.push_back(s);
- ss.push_back(s);
- ss[0].theC = new N;
- ss[1].theC = new N;
- ss[0].theC->left = ss[1].theC;
- ss[1].theC->left = ss[0].theC;
- ss[0].theC->ice_collectable(true);
- ss[1].theC->ice_collectable(true);
- test(getNum() == 2);
- }
- test(getNum() == 0);
- cout << "ok" << endl;
-
- cout << "testing sequence of struct of dictionary cycle... " << flush;
- {
- N2Ptr n2 = new N2;
- S2 s2;
- n2->theS2Seq.push_back(s2);
- n2->theS2Seq.push_back(s2);
- n2->theS2Seq[0].theC2Dict[0] = n2;
- n2->theS2Seq[0].theC2Dict[1] = n2;
- n2->theS2Seq[1].theC2Dict[0] = n2;
- n2->theS2Seq[1].theC2Dict[1] = n2;
- n2->ice_collectable(true);
- test(getNum() == 1);
- }
- test(getNum() == 0);
- cout << "ok" << endl;
-
- cout << "testing leaf nodes... " << flush;
-
- {
- NNPtr nn = new NN;
- nn->l = new NL;
- test(getNum() == 2);
- }
- test(getNum() == 0);
-
- {
- NLPtr p;
- {
- NNPtr nn = new NN;
- p = new NL;
- nn->l = p;
- test(getNum() == 2);
- }
- test(getNum() == 1);
- }
- test(getNum() == 0);
-
- {
- NNPtr nn = new NN;
- NLPtr nl = new NL;
- nn->l = nl;
- nn->n = nn;
- nn->ice_collectable(true);
- TestHaveCycles().visit(nn.get());
- test(getNum() == 2);
- }
- test(getNum() == 0);
-
- {
- NNPtr nn1 = new NN;
- NNPtr nn2 = new NN;
- NLPtr nl = new NL;
- nn1->l = nl;
- nn1->n = nn2;
- nn2->l = nl;
- nn2->n = nn1;
- nn1->ice_collectable(true);
- TestHaveCycles().visit(nn1.get());
- test(getNum() == 3);
- }
- test(getNum() == 0);
-
- {
- NLPtr nl = new NL;
- test(getNum() == 1);
- }
- test(getNum() == 0);
-
- {
- NNPtr nn1 = new NN;
- nn1->n = new NN;
- test(getNum() == 2);
- }
- test(getNum() == 0);
-
- cout << "ok" << endl;
-}
-
-class Client : public Test::TestHelper
-{
-public:
-
- void run(int, char**);
-};
-
-void
-Client::run(int, char**)
-{
- allTests();
-}
-
-DEFINE_TEST(Client)
diff --git a/cpp/test/Ice/gc/Test.ice b/cpp/test/Ice/gc/Test.ice
deleted file mode 100644
index 4ecf4dcbb07..00000000000
--- a/cpp/test/Ice/gc/Test.ice
+++ /dev/null
@@ -1,185 +0,0 @@
-//
-// Copyright (c) ZeroC, Inc. All rights reserved.
-//
-
-#pragma once
-
-[["suppress-warning:deprecated"]]
-
-module Test
-{
-
-class C
-{
- C left;
- C right;
-}
-sequence CSeq;
-
-dictionary CDict;
-
-struct S
-{
- C theC;
-}
-sequence SSeq;
-
-class C2;
-dictionary C2Dict;
-
-struct S2
-{
- C2Dict theC2Dict;
-}
-
-sequence S2Seq;
-
-class C2
-{
- S2Seq theS2Seq;
-}
-
-class Leaf
-{
- int i;
-}
-
-class Node
-{
- Leaf l;
- Node n;
-}
-
-//
-// Remainder of definitions are there to test that the generated code compiles;
-// they are not used for the actual run-time tests.
-//
-
-// Sequence of classes defined above.
-
-// Sequence of structs defined above.
-
-sequence C2DictSeq; // Sequence of dictionary.
-
-sequence CSeqSeq; // Sequence of sequence.
-
-// Struct containing classes defined above.
-
-struct A // Struct containing sequence.
-{
- SSeq theSSeq;
-}
-
-// Struct containing dictionary defined above.
-
-struct B // Struct containing struct.
-{
- S theS;
-}
-
-// Dictionary of classes defined above.
-
-dictionary CSeqDict; // Dictionary containing sequence.
-
-dictionary SDict; // Dictionary containing struct.
-
-dictionary CDictDict; // Dictionary containing dictionary.
-
-class CTest
-{
- CSeq theCSeq;
- SSeq theSSeq;
- C2DictSeq theC2DictSeq;
- CSeqSeq theCSeqSeq;
- S theS;
- A theA;
- S2 theS2;
- B theB;
- CDict theCDict;
- CSeqDict theCSeqDict;
- SDict theSDict;
- CDictDict theCDictDict;
-}
-
-module AAA
-{
- class B;
-
- sequence BSeq;
- dictionary BDict;
- struct BStruct
- {
- B bMem;
- }
-
- class C
- {
- Object obj1;
- Object obj2;
- B b1;
- B b2;
- BSeq x;
- BDict y;
- BStruct z;
- }
-}
-
-module AAA
-{
- sequence CSeq;
- dictionary CDict;
- struct CStruct
- {
- C cMem;
- }
-
- class B
- {
- Object obj1;
- Object obj2;
- C c1;
- C c2;
- CSeq x;
- CDict y;
- CStruct z;
- }
-}
-
-module CCC
-{
- class Forward;
-}
-
-module CCC
-{
- class Forward
- {
- }
-}
-
-module DDD
-{
- interface I
- {
- void op();
- }
-
- class C
- {
- }
-
- class C2;
-
- class U
- {
- I* myIstar;
- C myC;
- C2 myC2;
- }
-
- class C2
- {
- }
-}
-
-}
diff --git a/cpp/test/Ice/gc/msbuild/client.vcxproj b/cpp/test/Ice/gc/msbuild/client.vcxproj
deleted file mode 100644
index 5308b73377c..00000000000
--- a/cpp/test/Ice/gc/msbuild/client.vcxproj
+++ /dev/null
@@ -1,340 +0,0 @@
-
-
-
-
-
-
- Cpp11-Debug
- Win32
-
-
- Cpp11-Debug
- x64
-
-
- Cpp11-Release
- Win32
-
-
- Cpp11-Release
- x64
-
-
- Debug
- Win32
-
-
- Release
- Win32
-
-
- Debug
- x64
-
-
- Release
- x64
-
-
-
- {FA42EA5F-FDBE-4F27-ACC7-7717E401C868}
-
-
-
-
-
- Application
- true
- $(DefaultPlatformToolset)
-
-
- Application
- true
- $(DefaultPlatformToolset)
-
-
- Application
- false
- $(DefaultPlatformToolset)
-
-
- Application
- false
- $(DefaultPlatformToolset)
-
-
- Application
- true
- $(DefaultPlatformToolset)
-
-
- Application
- true
- $(DefaultPlatformToolset)
-
-
- Application
- false
- $(DefaultPlatformToolset)
-
-
- Application
- false
- $(DefaultPlatformToolset)
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- ..\..;%(AdditionalIncludeDirectories)
-
-
-
-
- ..\..;%(AdditionalIncludeDirectories)
-
-
-
-
- ..\..;%(AdditionalIncludeDirectories)
-
-
-
-
- ..\..;%(AdditionalIncludeDirectories)
-
-
-
-
- ..\..;%(AdditionalIncludeDirectories)
-
-
-
-
- ..\..;%(AdditionalIncludeDirectories)
-
-
-
-
- ..\..;%(AdditionalIncludeDirectories)
-
-
-
-
- ..\..;%(AdditionalIncludeDirectories)
-
-
-
-
-
-
-
-
- true
- true
- true
- true
- true
- true
- true
- ..\Test.ice
-
-
- true
- true
- true
- true
- true
- true
- true
- ..\Test.ice
-
-
- true
- true
- true
- true
- true
- true
- true
- ..\Test.ice
-
-
- true
- true
- true
- true
- true
- true
- true
- ..\Test.ice
-
-
- true
- true
- true
- true
- true
- true
- true
- ..\Test.ice
-
-
- true
- true
- true
- true
- true
- true
- true
- ..\Test.ice
-
-
- true
- true
- true
- true
- true
- true
- true
- ..\Test.ice
-
-
- true
- true
- true
- true
- true
- true
- true
- ..\Test.ice
-
-
-
-
-
-
-
- true
- true
- true
- true
- true
- true
- true
- ..\Test.ice
-
-
- true
- true
- true
- true
- true
- true
- true
- ..\Test.ice
-
-
- true
- true
- true
- true
- true
- true
- true
- ..\Test.ice
-
-
- true
- true
- true
- true
- true
- true
- true
- ..\Test.ice
-
-
- true
- true
- true
- true
- true
- true
- true
- ..\Test.ice
-
-
- true
- true
- true
- true
- true
- true
- true
- ..\Test.ice
-
-
- true
- true
- true
- true
- true
- true
- true
- ..\Test.ice
-
-
- true
- true
- true
- true
- true
- true
- true
- ..\Test.ice
-
-
-
-
-
-
-
-
- This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/cpp/test/Ice/gc/msbuild/client.vcxproj.filters b/cpp/test/Ice/gc/msbuild/client.vcxproj.filters
deleted file mode 100644
index 7cf07c8b3db..00000000000
--- a/cpp/test/Ice/gc/msbuild/client.vcxproj.filters
+++ /dev/null
@@ -1,138 +0,0 @@
-
-
-
-
- Source Files
-
-
- Source Files\x64\Cpp11-Debug
-
-
- Source Files\Win32\Cpp11-Debug
-
-
- Source Files\x64\Debug
-
-
- Source Files\Win32\Debug
-
-
- Source Files\x64\Release
-
-
- Source Files\Win32\Release
-
-
- Source Files\x64\Cpp11-Release
-
-
- Source Files\Win32\Cpp11-Release
-
-
-
-
- {bf7a60ba-e6fa-462c-932e-67c925c2d724}
-
-
- {083c00bf-b12f-437b-8a67-d2b7269c382e}
-
-
- {d9ffdb0c-44f2-4e82-b60f-f5e5e0d9eef0}
- ice
-
-
- {c4b97d3f-b5d0-4a88-baa3-a5d25efa3cb6}
-
-
- {b7218a93-6a10-415c-8796-e2e39890761d}
-
-
- {965f15c3-2b39-4841-af59-9f2d1e0d409c}
-
-
- {27f22892-b456-4f1d-907a-f06175dc2e17}
-
-
- {13626163-49d2-4d4d-acd1-8f8231605e8c}
-
-
- {2adfe4b6-f156-441f-98ef-b125dc32c9e4}
-
-
- {5ad50c0d-11b4-426c-abb5-c760cab70c57}
-
-
- {4635efbe-1056-4112-a5c6-87885d991729}
-
-
- {816e8c3c-c473-42af-aa19-0ca6d1ce75cd}
-
-
- {109e5c21-6efb-4947-b933-e45a4a38a535}
-
-
- {8b2972a5-9bc7-485d-812b-8e71b54a00c3}
-
-
- {6a561b0d-f6fb-4176-82ed-6d77569bd3b0}
-
-
- {324be231-acdc-4927-9af9-5a4b92ef65ff}
-
-
- {551b01c1-f70d-480a-b329-fd9457a4e2cb}
-
-
- {81a31c95-d422-496c-90d1-b571f5889354}
-
-
- {647f3263-5a57-42e7-9a03-ff5fd03b977a}
-
-
- {f05a9a89-f8d1-4b72-9cae-c7b5bde62427}
-
-
- {f3a50158-d1bb-44e1-9aaa-b12d871c4676}
-
-
- {8ce16643-3d51-4550-98a7-2aab9e997e7e}
-
-
- {a3938de5-ab86-414b-83ec-06ad7cff5b45}
-
-
-
-
- Header Files\x64\Cpp11-Debug
-
-
- Header Files\Win32\Cpp11-Debug
-
-
- Header Files\x64\Debug
-
-
- Header Files\Win32\Debug
-
-
- Header Files\x64\Release
-
-
- Header Files\Win32\Release
-
-
- Header Files\x64\Cpp11-Release
-
-
- Header Files\Win32\Cpp11-Release
-
-
-
-
-
-
-
- Slice Files
-
-
-
\ No newline at end of file
diff --git a/cpp/test/Ice/gc/msbuild/packages.config b/cpp/test/Ice/gc/msbuild/packages.config
deleted file mode 100644
index a93e137eccd..00000000000
--- a/cpp/test/Ice/gc/msbuild/packages.config
+++ /dev/null
@@ -1,5 +0,0 @@
-
-
-
-
-
\ No newline at end of file
diff --git a/cpp/test/Ice/gc/test.py b/cpp/test/Ice/gc/test.py
deleted file mode 100644
index 3636632dd89..00000000000
--- a/cpp/test/Ice/gc/test.py
+++ /dev/null
@@ -1,6 +0,0 @@
-# -*- coding: utf-8 -*-
-#
-# Copyright (c) ZeroC, Inc. All rights reserved.
-#
-
-TestSuite(__name__, options = { "cpp11" : [False] })
diff --git a/cpp/test/Ice/objects/AllTests.cpp b/cpp/test/Ice/objects/AllTests.cpp
index 0786cd416d3..2148485a4af 100644
--- a/cpp/test/Ice/objects/AllTests.cpp
+++ b/cpp/test/Ice/objects/AllTests.cpp
@@ -205,11 +205,11 @@ allTests(Test::TestHelper* helper)
test(b2 != dynamic_pointer_cast(d));
test(c != dynamic_pointer_cast(d));
#else
- test(b1 != c);
- test(b1 != d);
- test(b2 != c);
- test(b2 != d);
- test(c != d);
+ test(b1 != BPtr::dynamicCast(c));
+ test(b1 != BPtr::dynamicCast(d));
+ test(b2 != BPtr::dynamicCast(c));
+ test(b2 != BPtr::dynamicCast(d));
+ test(c != CPtr::dynamicCast(d));
#endif
test(b1->theB == b1);
test(b1->theC == ICE_NULLPTR);
@@ -268,11 +268,11 @@ allTests(Test::TestHelper* helper)
test(d->theC == nullptr);
#else
test(b1 != b2);
- test(b1 != c);
- test(b1 != d);
- test(b2 != c);
- test(b2 != d);
- test(c != d);
+ test(b1 != BPtr::dynamicCast(c));
+ test(b1 != BPtr::dynamicCast(d));
+ test(b2 != BPtr::dynamicCast(c));
+ test(b2 != BPtr::dynamicCast(d));
+ test(c != CPtr::dynamicCast(d));
test(b1->theA == b2);
test(b1->theB == b1);
test(b1->theC == ICE_NULLPTR);
diff --git a/cpp/test/Ice/objects/Client.cpp b/cpp/test/Ice/objects/Client.cpp
index 48d9f25d8f4..fdee6ca803d 100644
--- a/cpp/test/Ice/objects/Client.cpp
+++ b/cpp/test/Ice/objects/Client.cpp
@@ -107,9 +107,6 @@ Client::run(int argc, char** argv)
{
Ice::PropertiesPtr properties = createTestProperties(argc, argv);
properties->setProperty("Ice.AcceptClassCycles", "1");
-#ifndef ICE_CPP11_MAPPING
- properties->setProperty("Ice.CollectObjects", "1");
-#endif
Ice::CommunicatorHolder communicator = initialize(argc, argv, properties);
#ifdef ICE_CPP11_MAPPING
diff --git a/cpp/test/Ice/objects/Collocated.cpp b/cpp/test/Ice/objects/Collocated.cpp
index c6ebff30319..e640de161bb 100644
--- a/cpp/test/Ice/objects/Collocated.cpp
+++ b/cpp/test/Ice/objects/Collocated.cpp
@@ -99,9 +99,6 @@ Collocated::run(int argc, char** argv)
{
Ice::PropertiesPtr properties = createTestProperties(argc, argv);
properties->setProperty("Ice.AcceptClassCycles", "1");
-#ifndef ICE_CPP11_MAPPING
- properties->setProperty("Ice.CollectObjects", "1");
-#endif
properties->setProperty("Ice.Warn.Dispatch", "0");
Ice::CommunicatorHolder communicator = initialize(argc, argv, properties);
diff --git a/cpp/test/Ice/objects/TestI.cpp b/cpp/test/Ice/objects/TestI.cpp
index 1864b0afbc6..582c1168f6c 100644
--- a/cpp/test/Ice/objects/TestI.cpp
+++ b/cpp/test/Ice/objects/TestI.cpp
@@ -79,13 +79,6 @@ InitialI::InitialI(const Ice::ObjectAdapterPtr& adapter) :
_e(new EI),
_f(new FI(_e))
{
-#ifndef ICE_CPP11_MAPPING
- _b1->ice_collectable(true);
- _b2->ice_collectable(true);
- _c->ice_collectable(true);
- _d->ice_collectable(true);
-#endif
-
_b1->theA = _b2; // Cyclic reference to another B
_b1->theB = _b1; // Self reference.
_b1->theC = 0; // Null reference.
@@ -108,8 +101,6 @@ InitialI::InitialI(const Ice::ObjectAdapterPtr& adapter) :
InitialI::~InitialI()
{
-#ifdef ICE_CPP11_MAPPING
- // No GC with the C++11 mapping
_b1->theA = ICE_NULLPTR;
_b1->theB = ICE_NULLPTR;
@@ -118,7 +109,6 @@ InitialI::~InitialI()
_b2->theC = ICE_NULLPTR;
_c->theB = ICE_NULLPTR;
-#endif
}
void
diff --git a/cpp/test/Ice/objects/TestI.h b/cpp/test/Ice/objects/TestI.h
index 417fa00fa98..5d91ca0387e 100644
--- a/cpp/test/Ice/objects/TestI.h
+++ b/cpp/test/Ice/objects/TestI.h
@@ -40,7 +40,7 @@ class EI : public Test::E
bool checkValues();
};
-ICE_DEFINE_PTR(EIPtr, EI);
+ICE_DEFINE_SHARED_PTR(EIPtr, EI);
class FI : public Test::F
{
@@ -51,7 +51,7 @@ class FI : public Test::F
bool checkValues();
};
-ICE_DEFINE_PTR(FIPtr, FI);
+ICE_DEFINE_SHARED_PTR(FIPtr, FI);
class InitialI : public Test::Initial
{
diff --git a/cpp/test/Ice/optional/AllTests.cpp b/cpp/test/Ice/optional/AllTests.cpp
index 168f2a60d02..47adea7a149 100644
--- a/cpp/test/Ice/optional/AllTests.cpp
+++ b/cpp/test/Ice/optional/AllTests.cpp
@@ -449,10 +449,6 @@ allTests(Test::TestHelper* helper, bool)
mo1->bos->push_back(true);
mo1->bos->push_back(false);
-#ifndef ICE_CPP11_MAPPING
- mo1->ice_collectable(true);
-#endif
-
MultiOptionalPtr mo2 = ICE_MAKE_SHARED(MultiOptional, *mo1);
MultiOptionalPtr mo3 = ICE_MAKE_SHARED(MultiOptional);
@@ -668,9 +664,6 @@ allTests(Test::TestHelper* helper, bool)
// Clear the second half of the optional parameters
MultiOptionalPtr mo8 = ICE_MAKE_SHARED(MultiOptional, *mo5);
-#ifndef ICE_CPP11_MAPPING
- mo8->ice_collectable(true);
-#endif
mo8->b = IceUtil::None;
mo8->d = IceUtil::None;
mo8->f = IceUtil::None;
@@ -768,17 +761,15 @@ allTests(Test::TestHelper* helper, bool)
factory->setEnabled(false);
}
-#ifdef ICE_CPP11_MAPPING
- mo1->k = shared_ptr();
- mo2->k = shared_ptr();
- mo3->k = shared_ptr();
- mo4->k = shared_ptr();
- mo5->k = shared_ptr();
- mo6->k = shared_ptr();
- mo7->k = shared_ptr();
- mo8->k = shared_ptr();
- mo9->k = shared_ptr();
-#endif
+ mo1->k = nullptr;
+ mo2->k = nullptr;
+ mo3->k = nullptr;
+ mo4->k = nullptr;
+ mo5->k = nullptr;
+ mo6->k = nullptr;
+ mo7->k = nullptr;
+ mo8->k = nullptr;
+ mo9->k = nullptr;
//
// Use the 1.0 encoding with operations whose only class parameters are optional.
@@ -1493,8 +1484,8 @@ allTests(Test::TestHelper* helper, bool)
out.write(1, Ice::make_optional(f));
out.write(2, Ice::make_optional(f->ae));
#else
- out.write(1, makeOptional(f));
- out.write(2, makeOptional(f->ae));
+ out.write(1, IceUtil::makeOptional(f));
+ out.write(2, IceUtil::makeOptional(f->ae));
#endif
out.endEncapsulation();
out.finished(inEncaps);
diff --git a/cpp/test/Ice/optional/Client.cpp b/cpp/test/Ice/optional/Client.cpp
index 4806e2f02cf..3537588b4b4 100644
--- a/cpp/test/Ice/optional/Client.cpp
+++ b/cpp/test/Ice/optional/Client.cpp
@@ -21,9 +21,6 @@ Client::run(int argc, char** argv)
{
Ice::PropertiesPtr properties = createTestProperties(argc, argv);
properties->setProperty("Ice.AcceptClassCycles", "1");
-#ifndef ICE_CPP11_MAPPING
- properties->setProperty("Ice.CollectObjects", "1");
-#endif
Ice::CommunicatorHolder communicator = initialize(argc, argv, properties);
InitialPrxPtr allTests(Test::TestHelper*, bool);
InitialPrxPtr initial = allTests(this, false);
diff --git a/cpp/test/Ice/optional/Server.cpp b/cpp/test/Ice/optional/Server.cpp
index a84d6694b7e..767ea2ec0c9 100644
--- a/cpp/test/Ice/optional/Server.cpp
+++ b/cpp/test/Ice/optional/Server.cpp
@@ -21,9 +21,6 @@ Server::run(int argc, char** argv)
{
Ice::PropertiesPtr properties = createTestProperties(argc, argv);
properties->setProperty("Ice.AcceptClassCycles", "1");
-#ifndef ICE_CPP11_MAPPING
- properties->setProperty("Ice.CollectObjects", "1");
-#endif
Ice::CommunicatorHolder communicator = initialize(argc, argv, properties);
communicator->getProperties()->setProperty("TestAdapter.Endpoints", getTestEndpoint());
Ice::ObjectAdapterPtr adapter = communicator->createObjectAdapter("TestAdapter");
diff --git a/cpp/test/Ice/optional/ServerAMD.cpp b/cpp/test/Ice/optional/ServerAMD.cpp
index f9d16fed20f..e51be87790d 100644
--- a/cpp/test/Ice/optional/ServerAMD.cpp
+++ b/cpp/test/Ice/optional/ServerAMD.cpp
@@ -20,9 +20,6 @@ ServerAMD::run(int argc, char** argv)
{
Ice::PropertiesPtr properties = createTestProperties(argc, argv);
properties->setProperty("Ice.AcceptClassCycles", "1");
-#ifndef ICE_CPP11_MAPPING
- properties->setProperty("Ice.CollectObjects", "1");
-#endif
Ice::CommunicatorHolder communicator = initialize(argc, argv, properties);
communicator->getProperties()->setProperty("TestAdapter.Endpoints", getTestEndpoint());
Ice::ObjectAdapterPtr adapter = communicator->createObjectAdapter("TestAdapter");
diff --git a/cpp/test/Ice/slicing/objects/AllTests.cpp b/cpp/test/Ice/slicing/objects/AllTests.cpp
index d06d50b3d78..831f46350ae 100644
--- a/cpp/test/Ice/slicing/objects/AllTests.cpp
+++ b/cpp/test/Ice/slicing/objects/AllTests.cpp
@@ -12,12 +12,10 @@ using namespace Test;
namespace
{
-#ifdef ICE_CPP11_MAPPING
-
-void breakCycles(shared_ptr);
+void breakCycles(Ice::ValuePtr);
template
-void breakCycles(const vector>& s)
+void breakCycles(const vector>& s)
{
for(auto e : s)
{
@@ -26,7 +24,7 @@ void breakCycles(const vector>& s)
}
template
-void breakCycles(const map>& d)
+void breakCycles(const map>& d)
{
for(auto e : d)
{
@@ -34,11 +32,11 @@ void breakCycles(const map>& d)
}
}
-void breakCycles(shared_ptr o)
+void breakCycles(ICE_SHARED_PTR o)
{
- if(dynamic_pointer_cast(o))
+ if(ICE_DYNAMIC_CAST(D1, o))
{
- auto d1 = dynamic_pointer_cast(o);
+ auto d1 = ICE_DYNAMIC_CAST(D1, o);
auto tmp = d1->pd1;
d1->pd1 = nullptr;
if(tmp != d1)
@@ -46,52 +44,52 @@ void breakCycles(shared_ptr o)
breakCycles(tmp);
}
}
- if(dynamic_pointer_cast(o))
+ if(ICE_DYNAMIC_CAST(D3, o))
{
- auto d3 = dynamic_pointer_cast(o);
+ auto d3 = ICE_DYNAMIC_CAST(D3, o);
d3->pd3 = nullptr;
}
- if(dynamic_pointer_cast(o))
+ if(ICE_DYNAMIC_CAST(B, o))
{
- auto b = dynamic_pointer_cast(o);
- if(b->pb != nullptr)
+ auto b = ICE_DYNAMIC_CAST(B, o);
+ if(b->pb)
{
b->pb->pb = nullptr;
}
b->pb = nullptr;
}
- if(dynamic_pointer_cast(o))
+ if(ICE_DYNAMIC_CAST(PDerived, o))
{
- auto p = dynamic_pointer_cast(o);
+ auto p = ICE_DYNAMIC_CAST(PDerived, o);
p->pb = nullptr;
}
- if(dynamic_pointer_cast(o))
+ if(ICE_DYNAMIC_CAST(CompactPDerived, o))
{
- auto p = dynamic_pointer_cast(o);
+ auto p = ICE_DYNAMIC_CAST(CompactPDerived, o);
p->pb = nullptr;
}
- if(dynamic_pointer_cast(o))
+ if(ICE_DYNAMIC_CAST(PCDerived, o))
{
- auto p = dynamic_pointer_cast(o);
+ auto p = ICE_DYNAMIC_CAST(PCDerived, o);
auto seq(p->pbs);
p->pbs.clear();
breakCycles(seq);
}
- if(dynamic_pointer_cast(o))
+ if(ICE_DYNAMIC_CAST(CompactPCDerived, o))
{
- auto p = dynamic_pointer_cast(o);
+ auto p = ICE_DYNAMIC_CAST(CompactPCDerived, o);
auto seq(p->pbs);
p->pbs.clear();
breakCycles(seq);
}
- if(dynamic_pointer_cast(o))
+ if(ICE_DYNAMIC_CAST(PCDerived3, o))
{
- auto p = dynamic_pointer_cast(o);
+ auto p = ICE_DYNAMIC_CAST(PCDerived3, o);
p->pcd3 = nullptr;
}
- if(dynamic_pointer_cast(o))
+ if(ICE_DYNAMIC_CAST(PNode, o))
{
- auto curr = dynamic_pointer_cast(o);
+ auto curr = ICE_DYNAMIC_CAST(PNode, o);
while(curr && o != curr->next)
{
auto next = curr->next;
@@ -99,31 +97,22 @@ void breakCycles(shared_ptr o)
curr = next;
}
}
- if(dynamic_pointer_cast(o))
+ if(ICE_DYNAMIC_CAST(SS1, o))
{
- auto s = dynamic_pointer_cast(o);
+ auto s = ICE_DYNAMIC_CAST(SS1, o);
breakCycles(s->s);
}
- if(dynamic_pointer_cast(o))
+ if(ICE_DYNAMIC_CAST(SS2, o))
{
- auto s = dynamic_pointer_cast