![]() |
Workspace 7.0.2
|
Base class for all data type factories. More...
#include <Workspace/DataExecution/DataObjects/datafactory.h>
Classes | |
struct | SharedInfo |
Public Member Functions | |
DataFactory () | |
virtual | ~DataFactory () |
bool | addAdaptorFactory (const TypeAdaptorFactory &adaptor) |
virtual void | assignDataObject (const DataObject &src, DataObject &dest) const =0 |
virtual DataObject * | cloneDataObject (const DataObject &obj) const =0 |
virtual bool | compareDataObjects (const DataObject &lhs, const DataObject &rhs) const =0 |
virtual bool | compareDataObjects (const DataObject &lhs, const DataObject &rhs, int &relationOut) const =0 |
virtual DataObject * | createDataObject () const =0 |
virtual void | destroyDataObject (DataObject *obj) const =0 |
const TypeAdaptorFactory * | getAdaptorFactory (const DataFactory &destType) const |
virtual void | getEnumMap (QMap< int, QString > &map) const =0 |
virtual QStringList | getEnumNames () const =0 |
QString | getHeaderPath () const |
virtual const Application::WorkspacePlugin & | getPlugin () const =0 |
DataFactory & | getSharedDataFactory () |
const DataFactory & | getSharedDataFactory () const |
virtual SharedInfo | getSharedInfo () const |
virtual QString | getSourceTreeTop () const =0 |
virtual QString | getTypeName () const =0 |
virtual bool | isAssignable () const =0 |
virtual bool | isClonable () const =0 |
virtual bool | isComparable () const =0 |
virtual bool | isEnum () const =0 |
virtual bool | isObjectGroup () const =0 |
virtual bool | isSerializable () const =0 |
virtual bool | isSortable () const =0 |
void | removeAdaptorFactory (const TypeAdaptorFactory &adaptor) |
virtual bool | sharesData (const DataObject &a, const DataObject &b) const =0 |
void | unloadPlugin (const Application::WorkspacePlugin &plugin) |
Each data factory is responsible for creating, cloning, assigning and destroying each instance of the particular data type it manages. The factory can handle raw data types or DataObject wrappers around those types.
All data factories should be Singletons or else the type adaptation mechanism (polymorphism, type conversion, etc.) will fail.
The TypedDataFactory template should be used to simplify the creation of type factories.
DataFactory | ( | ) |
|
virtual |
bool addAdaptorFactory | ( | const TypeAdaptorFactory & | adaptor | ) |
adaptor | The TypeAdaptorFactory to add to this DataFactory. The source data factory of adaptor should be this factory (the one the adaptor is being added to). If it isn't, the adaptor will not be added. The data factory does not take ownership of the adaptor. |
|
pure virtual |
src | The source object to copy. |
dest | The destination object to assign to. |
If assignment is not supported by this data type, then a call to this function normally does nothing. Callers should check the result of isAssignable() before using this function.
Implemented in TypedDataFactory< T >.
|
pure virtual |
obj | The object to clone. |
The subclass implementation must check if obj is of the same type as what the factory manages. If it is not, it must forward the call to obj's data factory.
Implemented in TypedDataFactory< T >.
|
pure virtual |
lhs | The first operand |
rhs | The second operand |
If comparison is not supported by this data type, then a call to this function is guaranteed to return false.
Implemented in TypedDataFactory< T >.
|
pure virtual |
lhs | The first operand |
rhs | The second operand |
relationOut | The identified relationship between the two objects. If the return value is true (i.e. the items are the same), relationOut will be 0. If the return value is false, relationOut will be -1 if lhs < rhs, and 1 if lhs > rhs. |
If sorting is not supported by this data type, then a call to this function is guaranteed to return false.
Implemented in TypedDataFactory< T >.
|
pure virtual |
delete
operator. Implemented in TypedDataFactory< T >.
|
pure virtual |
obj | The DataObject to delete. It must have been created by a call to createDataObject() with this factory. |
delete
command. Implemented in TypedDataFactory< T >.
const TypeAdaptorFactory * getAdaptorFactory | ( | const DataFactory & | destType | ) | const |
destType | The DataFactory of the type to convert to. |
|
pure virtual |
map | Map object that maps enum values to enum names. |
Implemented in TypedDataFactory< T >.
|
pure virtual |
Implemented in TypedDataFactory< T >.
QString getHeaderPath | ( | ) | const |
This function calls getRawHeaderPath() and modifies what it returns to form a more compact path. Typically this involves stripping off some portion of the start of an absolute path to leave a minimal path relative to either the top of the source tree or the directory above that. The result of getRawHeaderPath() will be returned unchanged if no leading part could be stripped off.
|
pure virtual |
Implemented in TypedDataFactory< T >, TypedDataFactory< T >, TypedDataFactory< T >, TypedDataFactory< T >, TypedDataFactory< T >, TypedDataFactory< T >, TypedDataFactory< T >, TypedDataFactory< T >, TypedDataFactory< T >, TypedDataFactory< T >, TypedDataFactory< T >, TypedDataFactory< T >, TypedDataFactory< T >, TypedDataFactory< T >, TypedDataFactory< T >, TypedDataFactory< T >, TypedDataFactory< T >, TypedDataFactory< T >, TypedDataFactory< T >, TypedDataFactory< T >, TypedDataFactory< T >, TypedDataFactory< T >, TypedDataFactory< T >, TypedDataFactory< T >, TypedDataFactory< T >, TypedDataFactory< T >, TypedDataFactory< T >, TypedDataFactory< T >, TypedDataFactory< T >, TypedDataFactory< T >, TypedDataFactory< T >, TypedDataFactory< T >, TypedDataFactory< T >, TypedDataFactory< T >, TypedDataFactory< T >, TypedDataFactory< T >, TypedDataFactory< T >, TypedDataFactory< T >, TypedDataFactory< T >, TypedDataFactory< T >, TypedDataFactory< T >, TypedDataFactory< T >, TypedDataFactory< T >, TypedDataFactory< T >, TypedDataFactory< T >, TypedDataFactory< T >, TypedDataFactory< T >, TypedDataFactory< T >, TypedDataFactory< T >, TypedDataFactory< T >, TypedDataFactory< T >, TypedDataFactory< T >, TypedDataFactory< T >, TypedDataFactory< T >, TypedDataFactory< T >, TypedDataFactory< T >, TypedDataFactory< T >, TypedDataFactory< T >, TypedDataFactory< T >, and TypedDataFactory< T >.
|
inline |
const DataFactory & getSharedDataFactory | ( | ) | const |
|
virtual |
If a data type is defined by a third party library, it is possible the type may be added to Workspace by different plugins. Workspace may generate adaptor between them as long as they provide a non-empty identical string and the name of the type are identical as well. Recommend to use the name of third party library with it's version name to make them compatible.
Reimplemented in TypedDataFactory< T >, TypedDataFactory< T >, TypedDataFactory< T >, TypedDataFactory< T >, TypedDataFactory< T >, TypedDataFactory< T >, TypedDataFactory< T >, TypedDataFactory< T >, TypedDataFactory< T >, TypedDataFactory< T >, TypedDataFactory< T >, TypedDataFactory< T >, TypedDataFactory< T >, TypedDataFactory< T >, TypedDataFactory< T >, TypedDataFactory< T >, TypedDataFactory< T >, TypedDataFactory< T >, TypedDataFactory< T >, TypedDataFactory< T >, TypedDataFactory< T >, TypedDataFactory< T >, TypedDataFactory< T >, TypedDataFactory< T >, TypedDataFactory< T >, TypedDataFactory< T >, TypedDataFactory< T >, TypedDataFactory< T >, TypedDataFactory< T >, TypedDataFactory< T >, TypedDataFactory< T >, TypedDataFactory< T >, TypedDataFactory< T >, TypedDataFactory< T >, TypedDataFactory< T >, TypedDataFactory< T >, TypedDataFactory< T >, TypedDataFactory< T >, TypedDataFactory< T >, TypedDataFactory< T >, TypedDataFactory< T >, TypedDataFactory< T >, TypedDataFactory< T >, TypedDataFactory< T >, TypedDataFactory< T >, TypedDataFactory< T >, TypedDataFactory< T >, TypedDataFactory< T >, TypedDataFactory< T >, TypedDataFactory< T >, TypedDataFactory< T >, TypedDataFactory< T >, TypedDataFactory< T >, TypedDataFactory< T >, TypedDataFactory< T >, TypedDataFactory< T >, TypedDataFactory< T >, TypedDataFactory< T >, TypedDataFactory< T >, and TypedDataFactory< T >.
|
pure virtual |
Implemented in TypedDataFactory< T >.
|
pure virtual |
Implemented in TypedDataFactory< T >, TypedDataFactory< T >, TypedDataFactory< T >, TypedDataFactory< T >, TypedDataFactory< T >, TypedDataFactory< T >, TypedDataFactory< T >, TypedDataFactory< T >, TypedDataFactory< T >, TypedDataFactory< T >, TypedDataFactory< T >, TypedDataFactory< T >, TypedDataFactory< T >, TypedDataFactory< T >, TypedDataFactory< T >, TypedDataFactory< T >, TypedDataFactory< T >, TypedDataFactory< T >, TypedDataFactory< T >, TypedDataFactory< T >, TypedDataFactory< T >, TypedDataFactory< T >, TypedDataFactory< T >, TypedDataFactory< T >, TypedDataFactory< T >, TypedDataFactory< T >, TypedDataFactory< T >, TypedDataFactory< T >, TypedDataFactory< T >, TypedDataFactory< T >, TypedDataFactory< T >, TypedDataFactory< T >, TypedDataFactory< T >, TypedDataFactory< T >, TypedDataFactory< T >, TypedDataFactory< T >, TypedDataFactory< T >, TypedDataFactory< T >, TypedDataFactory< T >, TypedDataFactory< T >, TypedDataFactory< T >, TypedDataFactory< T >, TypedDataFactory< T >, TypedDataFactory< T >, TypedDataFactory< T >, TypedDataFactory< T >, TypedDataFactory< T >, TypedDataFactory< T >, TypedDataFactory< T >, TypedDataFactory< T >, TypedDataFactory< T >, TypedDataFactory< T >, TypedDataFactory< T >, TypedDataFactory< T >, TypedDataFactory< T >, TypedDataFactory< T >, TypedDataFactory< T >, TypedDataFactory< T >, TypedDataFactory< T >, and TypedDataFactory< T >.
|
pure virtual |
Implemented in TypedDataFactory< T >.
|
pure virtual |
Implemented in TypedDataFactory< T >.
|
pure virtual |
Implemented in TypedDataFactory< T >.
|
pure virtual |
Implemented in TypedDataFactory< T >.
|
pure virtual |
Implemented in TypedDataFactory< T >.
|
pure virtual |
Implemented in TypedDataFactory< T >.
|
pure virtual |
Implemented in TypedDataFactory< T >.
void removeAdaptorFactory | ( | const TypeAdaptorFactory & | adaptor | ) |
adaptor | The TypeAdaptorFactory to remove from this DataFactory. |
If adaptor is not in the list of adaptors for this DataFactory, the function does nothing and reports no error. Thus, it is always safe for a TypeAdaptorFactory to call removeAdaptorFactory() just before it is deleted or unloaded as long as it is known that its source DataFactory still exists.
|
pure virtual |
Implemented in TypedDataFactory< T >.
void unloadPlugin | ( | const Application::WorkspacePlugin & | plugin | ) |