![]() |
Template class to implement type factories. More...
#include <arcslibtoolkit.h>
Public Member Functions | |
virtual QString | getTypeName () const =0 |
Should return the name of the type factory. | |
virtual QString | toString (QVariant v) |
Should return a string representation of data. | |
virtual QVariant | parseString (QString s) |
Should create data from their string representation. | |
![]() | |
virtual bool | isInternal () const |
Tells wether the factory is internal or not (false by default). | |
Protected Member Functions | |
virtual X | parse (QString s)=0 |
This function should return a X object according to its string representation. | |
virtual QString | serialize (X obj)=0 |
This function serializes an X object to a string. | |
Template class to implement type factories.
This class adds two more methods to implement. Usually, in order to make a new type available to ARCS, one need to derive from this template and reimplement the methods getTypeName(), parse() and serialize(). If you use the automated process, the name of your derived class should conform to the following syntax: ARCSTypeFactoryTemplate_<yourtypeclass>
. As an example here is partly how the type factory for integers is declared inside of ARCS.
Definition at line 119 of file arcslibtoolkit.h.