52 #ifndef Patternist_CppCastingHelper_H 53 #define Patternist_CppCastingHelper_H 55 #include <QtCore/QtGlobal> 96 template<
typename TSubClass>
113 template<
typename TCastTarget>
114 inline const TCastTarget *
as()
const 116 #if defined(Patternist_DEBUG) && !defined(Q_CC_XLC) 118 Q_ASSERT_X(dynamic_cast<const TCastTarget *>(static_cast<const TSubClass *>(
this)),
120 "The cast is invalid. This class does not inherit the cast target.");
122 return static_cast<const TCastTarget *
>(
static_cast<const TSubClass *
>(
this));
137 template<
typename TCastTarget>
138 inline TCastTarget *
as()
140 #if defined(Patternist_DEBUG) && !defined(Q_CC_XLC) 142 Q_ASSERT_X(dynamic_cast<TCastTarget *>(static_cast<TSubClass *>(
this)),
144 "The cast is invalid. This class does not inherit the cast target.");
146 return static_cast<TCastTarget *
>(
static_cast<TSubClass *
>(
this));
#define QT_END_NAMESPACE
This macro expands to.
Provides convenience methods for performing static casts between C++ classes.
#define QT_BEGIN_NAMESPACE
This macro expands to.
const TCastTarget * as() const
The namespace for the internal API of QtXmlPatterns.
#define Q_ASSERT_X(cond, where, what)