[prev in list] [next in list] [prev in thread] [next in thread]
List: gstreamer-cvs
Subject: [gst-cvs] qt-gstreamer: Remove the now unused CanConvertFrom<T> and
From: gkiagia () kemper ! freedesktop ! org (George Kiagiadakis)
Date: 2010-11-26 15:18:05
Message-ID: 20101126151805.2D95310058 () kemper ! freedesktop ! org
[Download RAW message or body]
Module: qt-gstreamer
Branch: master
Commit: 58c271022ffe25696ef6350198a8bb2f619e3207
URL: http://cgit.freedesktop.org/gstreamer/qt-gstreamer/commit/?id=58c271022ffe25696ef6350198a8bb2f619e3207
Author: George Kiagiadakis <george.kiagiadakis@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 */
------------------------------------------------------------------------------
Increase Visibility of Your 3D Game App & Earn a Chance To Win $500!
Tap into the largest installed PC base & get more eyes on your game by
optimizing for Intel(R) Graphics Technology. Get started today with the
Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs.
http://p.sf.net/sfu/intelisp-dev2dev
_______________________________________________
gstreamer-cvs mailing list
gstreamer-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gstreamer-cvs
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic