[gst-cvs] qt-gstreamer: Remove the now unused CanConvertFrom<T> and CanConvertTo<T>:: from(Type).
George Kiagiadakis
gkiagia at kemper.freedesktop.org
Fri Nov 26 07:18:05 PST 2010
Module: qt-gstreamer
Branch: master
Commit: 58c271022ffe25696ef6350198a8bb2f619e3207
URL: http://cgit.freedesktop.org/gstreamer/qt-gstreamer/commit/?id=58c271022ffe25696ef6350198a8bb2f619e3207
Author: George Kiagiadakis <george.kiagiadakis at collabora.co.uk>
Date: Fri Nov 26 14:18:45 2010 +0200
Remove the now unused CanConvertFrom<T> and CanConvertTo<T>::from(Type).
---
src/QGlib/type.h | 29 ++++-------------------------
src/QGst/global.h | 11 -----------
2 files changed, 4 insertions(+), 36 deletions(-)
diff --git a/src/QGlib/type.h b/src/QGlib/type.h
index 850666a..a5ffa03 100644
--- a/src/QGlib/type.h
+++ b/src/QGlib/type.h
@@ -209,39 +209,18 @@ inline Type GetType()
namespace Private {
-/* These are used in RefPointer::dynamicCast and ValueBase::set / ValueBase::get
- * to retrieve if it is possible to convert from a given Type to the type T
- * or vice versa. It is provided as a template to be able to be specialized
+/* This is used from RefPointer::dynamicCast.
+ * It Checks if it is possible to convert from the given instance
+ * to the type T. It is provided as a template to be able to be specialized
* for strange cases like the GstMessage subclasses, where the subclasses
* have the same GType as their superclass.
- * The names "from" and "to" are just to be able to type this in a nice syntax:
- * CanConvertTo<T>::from(mytype) or CanConvertFrom<T>::to(mytype)
*/
-
template <typename T>
struct CanConvertTo
{
- /* This is used from RefPointer::dynamicCast only.
- * It takes an instance so that specializations can actually query the instance itself. */
static inline bool from(void *instance)
{
- return from(Type::fromInstance(instance));
- }
-
- /* This is used from ValueBase::get only. */
- static inline bool from(Type t)
- {
- return t.isA(GetType<T>());
- }
-};
-
-template <typename T>
-struct CanConvertFrom
-{
- /* This is used from ValueBase::set only. */
- static inline bool to(Type t)
- {
- return GetType<T>().isA(t);
+ return Type::fromInstance(instance).isA(GetType<T>());
}
};
diff --git a/src/QGst/global.h b/src/QGst/global.h
index 5a2d7ad..ed7da36 100644
--- a/src/QGst/global.h
+++ b/src/QGst/global.h
@@ -45,17 +45,6 @@
QGst::BASECLASS##Ptr::wrap(static_cast<Gst##BASECLASS *>(instance))->type() \
== QGst::BASECLASS##TYPE); \
} \
- /* NO 'static inline bool from(Type t)' to disallow usage from Value::get */ \
- /* ValueBase::get is not supposed to provide dynamic_cast capabilities */ \
- }; \
- \
- template <> \
- struct CanConvertFrom<QGst::TYPE##BASECLASS##Ptr> \
- { \
- static inline bool to(Type t) \
- { \
- return GetType<QGst::BASECLASS>().isA(t); \
- } \
}; \
} /* namespace Private */ \
} /* namespace QGlib */
More information about the Gstreamer-commits
mailing list