KJsEmbed
35 virtual ~PointerBase()
39 virtual void cleanup() = 0;
40 virtual const std::type_info &
type()
const = 0;
41 virtual void *voidStar() = 0;
44 template<
typename ValueType>
45 struct Pointer :
public PointerBase {
47 Pointer(ValueType *value) : ptr(value)
55 void cleanup()
override
61 const std::type_info &
type()
const override
63 return typeid(ValueType);
66 void *voidStar()
override
74 template<
typename ValueType>
75 struct Value :
public PointerBase {
77 Value(ValueType val) : value(val)
86 void cleanup()
override
91 const std::type_info &
type()
const override
93 return typeid(ValueType);
96 void *voidStar()
override
98 return (
void *)&value;
104 struct NullPtr :
public PointerBase {
105 NullPtr() : ptr(nullptr)
113 void cleanup()
override
118 const std::type_info &
type()
const override
120 return typeid(NullPtr);
123 void *voidStar()
override
132 template<
typename ValueType>
133 ValueType *pointer_cast(PointerBase *pointer)
136 if (
typeid(ValueType) != pointer->type()) {
139 Pointer<ValueType> *upcast =
static_cast< Pointer<ValueType> *
>(pointer);
145 Q_DECLARE_METATYPE(KJSEmbed::PointerBase *)
Type type(const QSqlDatabase &db)
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Sun Dec 10 2023 03:59:19 by
doxygen 1.8.17 written
by
Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.