29 #ifndef __ARCSLIBTOOLKIT_H__
30 #define __ARCSLIBTOOLKIT_H__
48 #include <QMetaObject>
50 #include <arcs/arcsabstractfamily.h>
51 #include <arcs/arcsnativecomponent.h>
66 virtual QMetaObject getDescription();
89 virtual QString
toString(QVariant v) = 0;
123 virtual QString
toString(QVariant v);
128 virtual X
parse(QString s) = 0;
141 #define DLL_EXPORT __declspec(dllexport)
142 template class DLL_EXPORT QHash<QString,ARCSNativeComponent*>;
143 template class DLL_EXPORT QHash<QString,ARCSAbstractFamily*>;
145 template class DLL_EXPORT QHash<QString,ARCSTypeFactory*>;
157 typedef QHash<QString,ARCSAbstractFamily*> ARCSFamilyMap;
159 typedef QHash<QString,ARCSTypeFactory*> ARCSTypeMap;
169 return (
new X(parent));
176 X* xobj =
dynamic_cast<X*
>(obj);
186 setType((X::staticMetaObject).className());
187 return X::staticMetaObject;
201 return serialize(v.value<X>());
208 var.setValue(parse(s));
213 #endif //__ARCSLIBTOOLKIT_H__
virtual QString toString(QVariant v)=0
Should return a string representation of data.
virtual bool isInternal() const
Tells wether the factory is internal or not (false by default).
virtual QString getTypeName() const =0
Should return the name of the type factory.
virtual QString getTypeName() const =0
Should return the name of the type factory.
Template class to implement type factories.
virtual QString serialize(X obj)=0
This function serializes an X object to a string.
virtual QObject * createObject(QObject *parent)
virtual void destroyObject(QObject *obj)
Dirty (Kids, don't do this at home !)
virtual ARCSNativeComponent * genuineClone()
Kage bunshin no jutsu !
virtual QVariant parseString(QString s)=0
Should create data from their string representation.
virtual QVariant parseString(QString s)
Should create data from their string representation.
virtual QString toString(QVariant v)
Should return a string representation of data.
Generic class describing how type factories should be implemented.
Generic factories for each new native component type.
virtual X parse(QString s)=0
This function should return a X object according to its string representation.
Component representation of ARCS Native components.