• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdeedu API Reference
  • KDE Home
  • Contact Us
 

step/stepcore

  • sources
  • kde-4.12
  • kdeedu
  • step
  • stepcore
object.h
Go to the documentation of this file.
1 /* This file is part of StepCore library.
2  Copyright (C) 2007 Vladimir Kuznetsov <ks.vladimir@gmail.com>
3 
4  StepCore library is free software; you can redistribute it and/or modify
5  it under the terms of the GNU General Public License as published by
6  the Free Software Foundation; either version 2 of the License, or
7  (at your option) any later version.
8 
9  StepCore library is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY; without even the implied warranty of
11  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  GNU General Public License for more details.
13 
14  You should have received a copy of the GNU General Public License
15  along with StepCore; if not, write to the Free Software
16  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
17 */
18 
23 #ifndef STEPCORE_OBJECT_H
24 #define STEPCORE_OBJECT_H
25 
26 #include <QString>
27 #include <QVariant>
28 #include <QBitArray>
29 #include <Eigen/Core> // for EIGEN_MAKE_ALIGNED_OPERATOR_NEW
30 
31 #include "util.h"
32 
33 namespace StepCore {
34 
35 class MetaObject;
36 class MetaProperty;
37 
38 #define STEPCORE_OBJECT_NA(_className) \
39  private: \
40  typedef _className _thisType; \
41  static const StepCore::MetaObject _metaObject; \
42  static const StepCore::MetaObject* _superClasses[]; \
43  static const StepCore::MetaProperty _classProperties[]; \
44  public: \
45  static const StepCore::MetaObject* staticMetaObject() { return &_metaObject; } \
46  virtual const StepCore::MetaObject* metaObject() const { return &_metaObject; } \
47  private:
48 
49 #define STEPCORE_OBJECT(_className) \
50  public: \
51  EIGEN_MAKE_ALIGNED_OPERATOR_NEW \
52  STEPCORE_OBJECT_NA(_className)
53 
57 class Object
58 {
59  STEPCORE_OBJECT(Object)
60 
61 public:
62  explicit Object(const QString& name = QString()): _name(name) {}
63  virtual ~Object() {}
64 
66  const QString& name() const { return _name; }
68  void setName(const QString& name) { _name = name; }
69 
70 protected:
71  QString _name;
72 };
73 
77 class MetaProperty
78 {
79 public:
80  enum {
81  READABLE = 1,
82  WRITABLE = 2,
83  STORED = 4,
84  DYNAMIC = 32,
85  SIDEEFFECTS = 64
86  };
89 
90 public:
91  MetaProperty():
92  _name(""), _units(QString()), _description(""),
93  _flags(0), _userTypeId(0), _readVariant(0), _writeVariant(0),
94  _readString(0), _writeString(0), _initialized(false) {}
95 
96  /*MetaProperty(const MetaProperty& p):
97  _name(p._name), _units(p._units), _flags(p.flags), _userTypeId(p._userTypeId),
98  _readVariant(p._readVariant), _writeVariant(p._writeVariant),
99  _readString(p._readString), _writeString(p._writeString) {}*/
100 
101  MetaProperty(const QString& name, const QString& units,
102  const QString& description, int flags, int userType,
103  QVariant (*const readVariant)(const Object*),
104  bool (*const writeVariant)(Object* obj, const QVariant& v),
105  QString (*const readString)(const Object* obj),
106  bool (*const writeString)(Object* obj, const QString& v))
107  : _name(name), _units(units), _description(description),
108  _flags(flags), _userTypeId(userType),
109  _readVariant(readVariant), _writeVariant(writeVariant),
110  _readString(readString), _writeString(writeString), _initialized(false) {}
111 
113  const QString& name() const { return _name; }
115  const QString& units() const { return _units; }
117  const QString& description() const { return _description; }
119  int flags() const { return _flags; }
120 
122  const QString& nameTr() const { tryInit(); return _nameTr; }
124  const QString& unitsTr() const { tryInit(); return _unitsTr; }
126  const QString& descriptionTr() const { tryInit(); return _descriptionTr; }
127 
129  int userTypeId() const { return _userTypeId; }
131  QVariant readVariant(const Object* obj) const { return _readVariant(obj); }
133  bool writeVariant(Object* obj, const QVariant& v) const { return _writeVariant(obj, v); }
134 
136  QString readString(const Object* obj) const { return _readString(obj); }
138  bool writeString(Object* obj, const QString& s) const { return _writeString(obj, s); }
139 
141  bool isReadable() const { return _flags & READABLE; }
143  bool isWritable() const { return _flags & WRITABLE; }
145  bool isStored() const { return _flags & STORED; }
147  bool isDynamic() const { return _flags & DYNAMIC; }
150  bool hasSideEffects() const { return _flags & SIDEEFFECTS; }
151 
152 public:
153  const QString _name;
154  const QString _units;
155  const QString _description;
156  const int _flags;
157  const int _userTypeId;
158  QVariant (*const _readVariant)(const Object* obj);
159  bool (*const _writeVariant)(Object* obj, const QVariant& v);
160  QString (*const _readString)(const Object* obj);
161  bool (*const _writeString)(Object* obj, const QString& v);
162 
163  mutable bool _initialized;
164  mutable QString _nameTr;
165  mutable QString _unitsTr;
166  mutable QString _descriptionTr;
167 
168 public:
169  void init() const;
170  void tryInit() const { if(!_initialized) init(); }
171 };
172 
176 class MetaObject
177 {
178 public:
179  enum {
180  ABSTRACT = 1
181  };
182 
183 public:
185  const QString& className() const { return _className; }
187  const QString& description() const { return _description; }
188 
190  const QString& classNameTr() const { tryInit(); return _classNameTr; }
192  const QString& descriptionTr() const { tryInit(); return _descriptionTr; }
193 
195  int classId() const { tryInit(); return _classId; }
196 
198  bool isAbstract() const { return _flags & ABSTRACT; }
200  Object* newObject() const { return _newObject(); }
202  Object* cloneObject(const Object& obj) const { return _cloneObject(obj); }
203 
205  int superClassCount() const { return _superClassCount; }
207  const MetaObject* superClass(int n) const { return _superClasses[n]; }
209  bool inherits(const MetaObject* obj) const;
211  template<class T> bool inherits() const { return inherits(T::staticMetaObject()); }
213  template<class T> bool inherits(T*) const { return inherits(T::staticMetaObject()); }
217  bool inherits(const char* name) const;
218 
220  int classPropertyCount() const { return _classPropertyCount; }
222  const MetaProperty* classProperty(int n) const { return &_classProperties[n]; }
223 
225  int propertyCount() const { tryInit(); return _allPropertyCount; }
227  const MetaProperty* property(int n) const { tryInit(); return _allProperties[n]; }
229  const MetaProperty* property(const QString& name) const;
230 
231 public:
232  void init() const;
233  void tryInit() const { if(!_initialized) init(); }
234  void copyProperties(const MetaProperty** dest) const;
235 
236  const QString _className;
237  const QString _description;
238  const int _flags;
239  Object* (*const _newObject)();
240  Object* (*const _cloneObject)(const Object&);
241 
242  const MetaObject** const _superClasses;
243  const int _superClassCount;
244  const MetaProperty* const _classProperties;
245  const int _classPropertyCount;
246 
247  mutable bool _initialized;
248  mutable const MetaProperty** _allProperties;
249  mutable int _allPropertyCount;
250 
251  mutable int _classId;
252  mutable QBitArray _allSuperClassIds;
253 
254  mutable QString _classNameTr;
255  mutable QString _descriptionTr;
256 
257  static int s_classIdCount;
258 };
259 
261 template<class _Dst, class _Src> // XXX: implement it better
262 _Dst stepcore_cast(_Src src) {
263  if(!src || !src->metaObject()->template inherits(_Dst())) return NULL;
264  return static_cast<_Dst>(src);
265 }
266 
267 /* Helper functions TODO: namespace of class ? */
268 
269 template<typename T> inline QString typeToString(const T& v) {
270  return QVariant::fromValue(v).toString();
271 }
272 
273 template<typename T> inline T stringToType(const QString& s, bool* ok) {
274  QVariant v(s); *ok = v.convert((QVariant::Type) qMetaTypeId<T>());
275  return v.value<T>();
276 }
277 
278 template<typename T> inline QVariant typeToVariant(const T& v) {
279  return QVariant::fromValue(v);
280 }
281 
282 template<typename T> inline T variantToType(const QVariant& v, bool* ok) {
283  if(v.userType() == qMetaTypeId<T>()) { *ok = true; return v.value<T>(); }
284  QVariant vc(v); *ok = vc.convert((QVariant::Type)qMetaTypeId<T>());
285  return vc.value<T>();
286 }
287 
288 template<class C, typename T>
289 struct MetaPropertyHelper {
290 
291  /* read */
292  template<T (C::*_read)() const> static QVariant read(const Object* obj) {
293  return typeToVariant<T>((dynamic_cast<const C*>(obj)->*_read)());
294  }
295  template<const T& (C::*_read)() const> static QVariant read(const Object* obj) {
296  return typeToVariant<T>((dynamic_cast<const C*>(obj)->*_read)());
297  }
298 
299  /* write */
300  template<void (C::*_write)(T)> static bool write(Object* obj, const QVariant& v) {
301  bool ok; T tv = variantToType<T>(v, &ok); if(!ok) return false;
302  (dynamic_cast<C*>(obj)->*_write)(tv); return true;
303  }
304  template<void (C::*_write)(const T&)> static bool write(Object* obj, const QVariant& v) {
305  bool ok; T tv = variantToType<T>(v, &ok); if(!ok) return false;
306  (dynamic_cast<C*>(obj)->*_write)(tv); return true;
307  }
308  template<bool (C::*_write)(T)> static bool write(Object* obj, const QVariant& v) {
309  bool ok; T tv = variantToType<T>(v, &ok); if(!ok) return false;
310  return (dynamic_cast<C*>(obj)->*_write)(tv);
311  }
312  template<bool (C::*_write)(const T&)> static bool write(Object* obj, const QVariant& v) {
313  bool ok; T tv = variantToType<T>(v, &ok); if(!ok) return false;
314  return (dynamic_cast<C*>(obj)->*_write)(tv);
315  }
316 
317  /* readString */
318  template<T (C::*_read)() const> static QString readString(const Object* obj) {
319  return typeToString<T>((dynamic_cast<const C*>(obj)->*_read)());
320  }
321  template<const T& (C::*_read)() const> static QString readString(const Object* obj) {
322  return typeToString<T>((dynamic_cast<const C*>(obj)->*_read)());
323  }
324 
325  /* writeString */
326  template<void (C::*_write)(T)> static bool writeString(Object* obj, const QString& s) {
327  bool ok; T tv = stringToType<T>(s, &ok); if(!ok) return false;
328  (dynamic_cast<C*>(obj)->*_write)(tv); return true;
329  }
330  template<void (C::*_write)(const T&)> static bool writeString(Object* obj, const QString& s) {
331  bool ok; T tv = stringToType<T>(s, &ok); if(!ok) return false;
332  (dynamic_cast<C*>(obj)->*_write)(tv); return true;
333  }
334  template<bool (C::*_write)(T)> static bool writeString(Object* obj, const QString& s) {
335  bool ok; T tv = stringToType<T>(s, &ok); if(!ok) return false;
336  return (dynamic_cast<C*>(obj)->*_write)(tv);
337  }
338  template<bool (C::*_write)(const T&)> static bool writeString(Object* obj, const QString& s) {
339  bool ok; T tv = stringToType<T>(s, &ok); if(!ok) return false;
340  return (dynamic_cast<C*>(obj)->*_write)(tv);
341  }
342 
343  static QVariant readNull(const Object* obj) { return QVariant(); }
344  static QString readStringNull(const Object* obj) { return QString(); }
345  static bool writeNull(Object* obj, const QVariant& v) { Q_UNUSED(obj) Q_UNUSED(v) return false; }
346  static bool writeStringNull(Object* obj, const QString& s) { Q_UNUSED(obj) Q_UNUSED(s) return false; }
347 };
348 
349 template<typename Class, int N>
350 struct MetaObjectHelper {
351  static Object* newObjectHelper() { return new Class(); }
352  static Object* cloneObjectHelper(const Object& obj) {
353  return new Class(static_cast<const Class&>(obj));
354  }
355 };
356 
357 template<class Class>
358 struct MetaObjectHelper<Class, MetaObject::ABSTRACT> {
359  static Object* newObjectHelper() { return NULL; }
360  static Object* cloneObjectHelper(const Object& obj) { Q_UNUSED(obj) return NULL; }
361 };
362 
363 #define STEPCORE_FROM_UTF8(str) QString::fromUtf8(str)
364 
365 #define STEPCORE_UNITS_NULL QString()
366 #define STEPCORE_UNITS_1 QString("")
367 
368 #define _STEPCORE_PROPERTY_NULL StepCore::MetaProperty()
369 
370 #define STEPCORE_META_OBJECT(_className, _classNameNoop, _description, _flags, __superClasses, __properties) \
371  const StepCore::MetaProperty _className::_classProperties[] = { _STEPCORE_PROPERTY_NULL, __properties }; \
372  const StepCore::MetaObject* _className::_superClasses[] = { 0, __superClasses }; \
373  const StepCore::MetaObject _className::_metaObject = { \
374  QString(STEPCORE_STRINGIFY(_className)), QString(_description), _flags, \
375  StepCore::MetaObjectHelper<_className, _flags & StepCore::MetaObject::ABSTRACT>::newObjectHelper, \
376  StepCore::MetaObjectHelper<_className, _flags & StepCore::MetaObject::ABSTRACT>::cloneObjectHelper, \
377  _superClasses+1, sizeof(_superClasses)/sizeof(*_superClasses)-1, \
378  _classProperties+1, sizeof(_classProperties)/sizeof(*_classProperties)-1, false, 0, 0, 0, QBitArray(), "", "" };
379 
380 #define STEPCORE_SUPER_CLASS(_className) _className::staticMetaObject(),
381 
382 #define STEPCORE_PROPERTY_RF(_type, _name, _nameNoop, _units, _description, _flags, _read) \
383  StepCore::MetaProperty( STEPCORE_STRINGIFY(_name), _units, _description, \
384  StepCore::MetaProperty::READABLE | _flags, qMetaTypeId<_type>(), \
385  StepCore::MetaPropertyHelper<_thisType, _type>::read<&_thisType::_read>, \
386  StepCore::MetaPropertyHelper<_thisType, _type>::writeNull, \
387  StepCore::MetaPropertyHelper<_thisType, _type>::readString<&_thisType::_read>, \
388  StepCore::MetaPropertyHelper<_thisType, _type>::writeStringNull ),
389 
390 #define STEPCORE_PROPERTY_RWF(_type, _name, _nameNoop, _units, _description, _flags, _read, _write) \
391  StepCore::MetaProperty( STEPCORE_STRINGIFY(_name), _units, _description, \
392  StepCore::MetaProperty::READABLE | StepCore::MetaProperty::WRITABLE | _flags, \
393  qMetaTypeId<_type>(), \
394  StepCore::MetaPropertyHelper<_thisType, _type>::read<&_thisType::_read>, \
395  StepCore::MetaPropertyHelper<_thisType, _type>::write<&_thisType::_write>, \
396  StepCore::MetaPropertyHelper<_thisType, _type>::readString<&_thisType::_read>, \
397  StepCore::MetaPropertyHelper<_thisType, _type>::writeString<&_thisType::_write> ),
398 
399 #define STEPCORE_PROPERTY_R(_type, _name, _nameNoop, _units, _description, _read) \
400  STEPCORE_PROPERTY_RF(_type, _name, _nameNoop, _units, _description, 0, _read)
401 
402 #define STEPCORE_PROPERTY_RW(_type, _name, _nameNoop, _units, _description, _read, _write) \
403  STEPCORE_PROPERTY_RWF(_type, _name, _nameNoop, _units, _description, \
404  StepCore::MetaProperty::STORED, _read, _write)
405 
406 #define STEPCORE_PROPERTY_R_D(_type, _name, _nameNoop, _units, _description, _read) \
407  STEPCORE_PROPERTY_RF(_type, _name, _nameNoop, _units, _description, StepCore::MetaProperty::DYNAMIC, _read)
408 
409 #define STEPCORE_PROPERTY_RW_D(_type, _name, _nameNoop, _units, _description, _read, _write) \
410  STEPCORE_PROPERTY_RWF(_type, _name, _nameNoop, _units, _description, \
411  StepCore::MetaProperty::STORED | StepCore::MetaProperty::DYNAMIC, _read, _write)
412 
413 } // namespace StepCore
414 
415 #endif
416 
StepCore::MetaObject::className
const QString & className() const
Returns class name.
Definition: object.h:185
StepCore::MetaProperty::readString
QString readString(const Object *obj) const
Read property as string.
Definition: object.h:136
StepCore::MetaObject::_superClassCount
const int _superClassCount
Definition: object.h:243
StepCore::MetaObject::superClassCount
int superClassCount() const
Returns number of direct bases.
Definition: object.h:205
StepCore::MetaProperty::tryInit
void tryInit() const
Definition: object.h:170
StepCore::MetaObject::newObject
Object * newObject() const
Creates new object of this class.
Definition: object.h:200
StepCore::MetaProperty::_unitsTr
QString _unitsTr
Definition: object.h:165
StepCore::MetaProperty::_flags
const int _flags
Definition: object.h:156
StepCore::MetaObject::_classProperties
const MetaProperty *const _classProperties
Definition: object.h:244
StepCore::MetaProperty::_initialized
bool _initialized
Definition: object.h:163
StepCore::MetaObject::_cloneObject
Object *(*const _cloneObject)(const Object &)
Definition: object.h:240
StepCore::MetaProperty::_userTypeId
const int _userTypeId
Definition: object.h:157
StepCore::MetaObject::isAbstract
bool isAbstract() const
Returns true if class is abstract.
Definition: object.h:198
StepCore::MetaProperty::STORED
Property should be stored in file.
Definition: object.h:83
StepCore::MetaProperty::isStored
bool isStored() const
Returns true if this property should be stored.
Definition: object.h:145
StepCore::MetaObject::_classNameTr
QString _classNameTr
Definition: object.h:254
StepCore::MetaObject::propertyCount
int propertyCount() const
Returns property count.
Definition: object.h:225
StepCore::MetaProperty::description
const QString & description() const
Returns property description.
Definition: object.h:117
StepCore::MetaProperty::_nameTr
QString _nameTr
Definition: object.h:164
StepCore::Object
Root of the StepCore classes hierarchy.
Definition: object.h:57
StepCore::MetaObject::descriptionTr
const QString & descriptionTr() const
Returns translated class description.
Definition: object.h:192
StepCore::MetaProperty::SIDEEFFECTS
Changing this property has side-effects (changes in other dynamic or non-dynamic properties) ...
Definition: object.h:85
StepCore::MetaObject::_allPropertyCount
int _allPropertyCount
Definition: object.h:249
StepCore::MetaObject::_allSuperClassIds
QBitArray _allSuperClassIds
Definition: object.h:252
StepCore::MetaPropertyHelper
Definition: object.h:289
StepCore::MetaProperty::readVariant
QVariant readVariant(const Object *obj) const
Read property as QVariant.
Definition: object.h:131
StepCore::MetaPropertyHelper::readNull
static QVariant readNull(const Object *obj)
Definition: object.h:343
StepCore::MetaObject::inherits
bool inherits() const
Returns true if this class inherits class T.
Definition: object.h:211
StepCore::MetaObjectHelper
Definition: object.h:350
StepCore::MetaProperty::writeVariant
bool writeVariant(Object *obj, const QVariant &v) const
Write property as QVariant.
Definition: object.h:133
StepCore::MetaProperty::READABLE
Property is readable.
Definition: object.h:81
StepCore::MetaObject::inherits
bool inherits(T *) const
Returns true if this class inherits class T.
Definition: object.h:213
StepCore::MetaPropertyHelper::write
static bool write(Object *obj, const QVariant &v)
Definition: object.h:300
StepCore::MetaObject::_initialized
bool _initialized
Definition: object.h:247
StepCore::MetaObject::classNameTr
const QString & classNameTr() const
Returns translated class name.
Definition: object.h:190
StepCore::MetaPropertyHelper::read
static QVariant read(const Object *obj)
Definition: object.h:292
StepCore::MetaProperty::hasSideEffects
bool hasSideEffects() const
Returns true if this property has side-effects (changes in other dynamic or non-dynamic properties) ...
Definition: object.h:150
StepCore::variantToType
T variantToType(const QVariant &v, bool *ok)
Definition: object.h:282
StepCore::MetaProperty::isReadable
bool isReadable() const
Returns true if this property is readable.
Definition: object.h:141
StepCore::MetaProperty::_units
const QString _units
Definition: object.h:154
StepCore::Object::~Object
virtual ~Object()
Definition: object.h:63
StepCore::MetaObject::property
const MetaProperty * property(int n) const
Returns property by index.
Definition: object.h:227
StepCore::MetaProperty::_writeVariant
bool(*const _writeVariant)(Object *obj, const QVariant &v)
Definition: object.h:159
StepCore::MetaProperty::writeString
bool writeString(Object *obj, const QString &s) const
Write property as string.
Definition: object.h:138
StepCore::MetaPropertyHelper::writeStringNull
static bool writeStringNull(Object *obj, const QString &s)
Definition: object.h:346
StepCore::MetaProperty::units
const QString & units() const
Returns property units (if appropriate)
Definition: object.h:115
StepCore::MetaProperty::isDynamic
bool isDynamic() const
Returns true if this property is dynamic (changes during simulation)
Definition: object.h:147
StepCore::MetaProperty::WRITABLE
Property is writable.
Definition: object.h:82
StepCore::MetaProperty::_readString
QString(*const _readString)(const Object *obj)
Definition: object.h:160
StepCore::MetaProperty::nameTr
const QString & nameTr() const
Returns translated property name.
Definition: object.h:122
StepCore::MetaObject::_flags
const int _flags
Definition: object.h:238
StepCore::MetaObject::_classId
int _classId
Definition: object.h:251
StepCore::typeToVariant
QVariant typeToVariant(const T &v)
Definition: object.h:278
StepCore::MetaObject::_newObject
Object *(*const _newObject)()
Definition: object.h:239
StepCore::MetaObjectHelper::newObjectHelper
static Object * newObjectHelper()
Definition: object.h:351
StepCore::MetaObject::_description
const QString _description
Definition: object.h:237
StepCore::MetaObject::_superClasses
const MetaObject **const _superClasses
Definition: object.h:242
StepCore::MetaObject::ABSTRACT
Class is abstract.
Definition: object.h:180
StepCore::MetaObject::_classPropertyCount
const int _classPropertyCount
Definition: object.h:245
StepCore::stepcore_cast
_Dst stepcore_cast(_Src src)
Casts between pointers to Object.
Definition: object.h:262
StepCore::typeToString
QString typeToString(const T &v)
Definition: object.h:269
util.h
Internal file.
StepCore::MetaProperty::MetaProperty
MetaProperty(const QString &name, const QString &units, const QString &description, int flags, int userType, QVariant(*const readVariant)(const Object *), bool(*const writeVariant)(Object *obj, const QVariant &v), QString(*const readString)(const Object *obj), bool(*const writeString)(Object *obj, const QString &v))
Definition: object.h:101
StepCore::Object::name
const QString & name() const
Returns name of the object.
Definition: object.h:66
StepCore::Object::Object
Object(const QString &name=QString())
Definition: object.h:62
StepCore::MetaPropertyHelper::readString
static QString readString(const Object *obj)
Definition: object.h:318
StepCore::MetaProperty::name
const QString & name() const
Returns property name.
Definition: object.h:113
StepCore::MetaObject::s_classIdCount
static int s_classIdCount
Definition: object.h:257
StepCore::MetaProperty::DYNAMIC
Variable changes during simulation or changes of other properties.
Definition: object.h:84
StepCore::MetaObjectHelper::cloneObjectHelper
static Object * cloneObjectHelper(const Object &obj)
Definition: object.h:352
StepCore::MetaProperty::descriptionTr
const QString & descriptionTr() const
Returns translated property description.
Definition: object.h:126
StepCore::MetaProperty::userTypeId
int userTypeId() const
Returns property userType (see QMetaProperty)
Definition: object.h:129
StepCore::MetaProperty::_description
const QString _description
Definition: object.h:155
StepCore::MetaPropertyHelper::readStringNull
static QString readStringNull(const Object *obj)
Definition: object.h:344
StepCore::Object::_name
QString _name
Definition: object.h:71
StepCore::MetaProperty::MetaProperty
MetaProperty()
Definition: object.h:91
StepCore::MetaObject::_allProperties
const MetaProperty ** _allProperties
Definition: object.h:248
StepCore::MetaProperty::unitsTr
const QString & unitsTr() const
Returns translated property units (if appropriate)
Definition: object.h:124
StepCore::MetaProperty::_descriptionTr
QString _descriptionTr
Definition: object.h:166
StepCore::MetaProperty::flags
int flags() const
Returns property flags.
Definition: object.h:119
StepCore::MetaObjectHelper< Class, MetaObject::ABSTRACT >::newObjectHelper
static Object * newObjectHelper()
Definition: object.h:359
StepCore::MetaObject::tryInit
void tryInit() const
Definition: object.h:233
StepCore::MetaObjectHelper< Class, MetaObject::ABSTRACT >::cloneObjectHelper
static Object * cloneObjectHelper(const Object &obj)
Definition: object.h:360
StepCore::stringToType
T stringToType(const QString &s, bool *ok)
Definition: object.h:273
StepCore::MetaProperty::_readVariant
QVariant(*const _readVariant)(const Object *obj)
Definition: object.h:158
StepCore::MetaObject::_descriptionTr
QString _descriptionTr
Definition: object.h:255
StepCore::Object::setName
void setName(const QString &name)
Set name of the object.
Definition: object.h:68
StepCore::MetaObject::superClass
const MetaObject * superClass(int n) const
Returns direct base.
Definition: object.h:207
StepCore::MetaObject::classPropertyCount
int classPropertyCount() const
Returns number of non-inherited properties.
Definition: object.h:220
StepCore::MetaObject::init
void init() const
Definition: object.cc:43
StepCore::MetaObject::description
const QString & description() const
Returns class description.
Definition: object.h:187
StepCore::MetaProperty::init
void init() const
Definition: object.cc:116
StepCore::MetaObject::cloneObject
Object * cloneObject(const Object &obj) const
Creates a copy of given object.
Definition: object.h:202
StepCore::MetaObject
Meta-information about class.
Definition: object.h:176
StepCore::MetaProperty
Meta-information about property.
Definition: object.h:77
StepCore::MetaObject::copyProperties
void copyProperties(const MetaProperty **dest) const
StepCore::MetaObject::classProperty
const MetaProperty * classProperty(int n) const
Returns non-inherited property.
Definition: object.h:222
StepCore::MetaObject::classId
int classId() const
Returns class id.
Definition: object.h:195
STEPCORE_OBJECT
#define STEPCORE_OBJECT(_className)
Definition: object.h:49
StepCore::MetaProperty::_writeString
bool(*const _writeString)(Object *obj, const QString &v)
Definition: object.h:161
StepCore::MetaPropertyHelper::writeString
static bool writeString(Object *obj, const QString &s)
Definition: object.h:326
StepCore::MetaProperty::_name
const QString _name
Definition: object.h:153
StepCore::MetaObject::_className
const QString _className
Definition: object.h:236
StepCore::MetaPropertyHelper::writeNull
static bool writeNull(Object *obj, const QVariant &v)
Definition: object.h:345
StepCore::MetaProperty::isWritable
bool isWritable() const
Returns true if this property is writable.
Definition: object.h:143
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:43:06 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

step/stepcore

Skip menu "step/stepcore"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Modules
  • Related Pages

kdeedu API Reference

Skip menu "kdeedu API Reference"
  • Analitza
  •     lib
  • kalgebra
  • kalzium
  •   libscience
  • kanagram
  • kig
  •   lib
  • klettres
  • kstars
  • libkdeedu
  •   keduvocdocument
  • marble
  • parley
  • rocs
  •   App
  •   RocsCore
  •   VisualEditor
  •   stepcore

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal