Interface used to communicate with the object manager, directly accessable through the OBJECT_MANAGER macro. More...
#include <IObjectManager.h>
Public Types | |
enum | PropertyTypes { NoProperties = 0, MultiContextProperties = 1, SharedProperties = 2, QtilitiesInternalProperties = 4, NonQtilitiesProperties = 8 } |
Possible property types. More... |
Signals | |
void | metaTypeActiveObjectsChanged (QList< QPointer< QObject > > objects, const QString &meta_type) |
Signal which is emitted when the setMetaTypeActiveObjects() is finished. | |
void | newObjectAdded (QObject *obj) |
Signal which is emitted when a new object is added to the global object pool. | |
void | objectRemoved (QObject *obj) |
Signal which is emitted when an object is removed from the global object pool. |
Public Member Functions | |
virtual QStringList | allFactoryNames () const =0 |
Provides a list with the names of all the factories registered in the object manager. | |
virtual QList< QPointer < QObject > > | metaTypeActiveObjects (const QString &meta_type) const =0 |
Returns the active object(s) for a specific meta type. If the meta type does not exist, an empty list is returned. | |
virtual bool | moveSubjects (QList< QObject * > objects, int source_observer_id, int destination_observer_id, QString *error_msg=0, bool silent=false)=0 |
A function which moves a list of objects from one observer to another observer. | |
virtual bool | moveSubjects (QList< QPointer< QObject > > objects, int source_observer_id, int destination_observer_i, QString *error_msg=0, bool silent=false)=0 |
Move subjects by providing the objects as a list with smart pointers. | |
virtual Observer * | objectPool ()=0 |
Function which returns a reference to the global object pool. | |
virtual Observer * | observerReference (int id) const =0 |
Gets the reference to an observer. | |
virtual IFactoryProvider * | referenceIFactoryProvider (const QString &factory_name) const =0 |
Provides a reference to the factory interface for a specific factory. | |
virtual QList< QObject * > | registeredInterfaces (const QString &iface) const =0 |
Returns all objects in the global object pool which implements the specified interface. | |
virtual void | registerFactoryInterface (FactoryInterface< QObject > *factory_interface, FactoryItemID iface_tag)=0 |
Registers a factory interface inside the Qtilities factory. | |
virtual bool | registerIFactoryProvider (IFactoryProvider *obj)=0 |
Registers a factory interface in the object manager. | |
virtual void | registerObject (QObject *obj, QtilitiesCategory category=QtilitiesCategory())=0 |
Registers an object to be included in the global object pool. | |
virtual int | registerObserver (Observer *observer)=0 |
Registers an observer in the observer manager. | |
virtual void | removeObject (QObject *obj)=0 |
Removes an object to from the global object pool. | |
virtual void | setMetaTypeActiveObjects (QList< QObject * > objects, const QString &meta_type)=0 |
Updates the active object(s) for a specific meta type. | |
virtual void | setMetaTypeActiveObjects (QList< QPointer< QObject > > objects, const QString &meta_type)=0 |
Update the active object(s) for a specific meta type by providing a list of smart pointers to the objects. | |
virtual QStringList | tagsForFactory (const QString &factory_name) const =0 |
Provides a list of all the tags registered in a specific factory. | |
Public Member Functions inherited from Qtilities::Core::Interfaces::IFactoryProvider | |
virtual QtilitiesCategory | categoryForTag (const QString &factory_name, const QString &factory_tag, bool *ok=0) const =0 |
Provides the category of the specified tag. | |
virtual QObject * | createInstance (const InstanceFactoryInfo &ifactory_data)=0 |
Constructs an instance in a specified factory and return it. | |
virtual QStringList | providedFactories () const =0 |
Provides the names of all the factories exposed through this interface. | |
virtual QStringList | providedFactoryTags (const QString &factory_name, const QtilitiesCategory &category_filter=QtilitiesCategory(), bool *ok=0) const =0 |
Provides the tags in a specific factory. | |
virtual QMap< QString, QtilitiesCategory > | tagCategoryMap (const QString &factory_name, bool *ok=0) const =0 |
Provides the full tag and category map for the given factory. | |
Public Member Functions inherited from Qtilities::Core::Interfaces::IObjectBase | |
virtual QObject * | objectBase ()=0 |
Returns the QObject* base of the interface. | |
virtual const QObject * | objectBase () const =0 |
Returns a const QObject* base of the interface. | |
QString | objectOriginID () const |
Allows interfaces to provide some sort of source identification. | |
void | setObjectOriginID (const QString &object_origin_id) |
Allows setting of the object source ID of this interface implementation. |
Interface used to communicate with the object manager, directly accessable through the OBJECT_MANAGER macro.
Possible property types.
NoProperties |
No properties. |
MultiContextProperties |
Multi context properties.
|
SharedProperties |
Shared properties.
|
QtilitiesInternalProperties |
Internal Qtilities properties properties.
|
NonQtilitiesProperties |
Normal QVariant properties added to objects using QObject::setProperty(). |
|
pure virtual |
Returns the active object(s) for a specific meta type. If the meta type does not exist, an empty list is returned.
For more information about see the Global object activity management section of the Object Management article.
Implemented in Qtilities::Core::ObjectManager.
|
pure virtual |
A function which moves a list of objects from one observer to another observer.
This function will attempt to move subjects from one observer context to another. If any of the subjects cannot be attached, it will be skipped and attempt to move the next subject in the list. If any of the subjects could not be attached, the function will return false. If all subjects was moved successfully the function will return true.
objects | The objects which must be moved. |
source_observer_id | The source observer ID. |
destination_observer_id | The destination observer ID. |
error_msg | When valid it will be populated with any error messages produced during the move operation. |
silent | When true the subjects must be moved without showing any dialogs. |
Implemented in Qtilities::Core::ObjectManager.
|
pure virtual |
Move subjects by providing the objects as a list with smart pointers.
This function will attempt to move subjects from one observer context to another. If any of the subjects cannot be attached, it will be skipped and attempt to move the next subject in the list. If any of the subjects could not be attached, the function will return false. If all subjects was moved successfully the function will return true.
objects | The objects which must be moved. |
source_observer_id | The source observer ID. |
destination_observer_id | The destination observer ID. |
error_msg | When valid it will be populated with any error messages produced during the move operation. |
silent | When true the subjects must be moved without showing any dialogs. |
Implemented in Qtilities::Core::ObjectManager.
|
pure virtual |
Function which returns a reference to the global object pool.
Care should be taken when using the object pool observer. You should for example not delete all the subjects in the pool unless you know what you are doing.
It is recommended to use registerObject() and registeredInterfaces() instead of the object pool directly, unless you require the use of additional functions on the object pool, like displaying it using an ObserverWidget.
Implemented in Qtilities::Core::ObjectManager.
|
pure virtual |
Gets the reference to an observer.
id | The observer id of the observer for which the reference must be fetched. |
Implemented in Qtilities::Core::ObjectManager.
|
pure virtual |
Provides a reference to the factory interface for a specific factory.
This function returns the IFactoryProvider interface which contains the specified factory.
Implemented in Qtilities::Core::ObjectManager.
|
pure virtual |
Returns all objects in the global object pool which implements the specified interface.
For example:
Implemented in Qtilities::Core::ObjectManager.
|
pure virtual |
Registers a factory interface in the object manager.
The object manager keeps track of all IFactoryProvider interfaces registered using this function. It is then possible to access the IFactoryProvider interface for a specific factory using the referenceIFactoryProvider() function.
The way that the object manager keeps track of factories and their respective IFactoryProvider interfaces is done in such a way that factory names exposed by IFactoryProvider must be unique for all IFactoryProvider interfaces registered using this function.
If a duplicate factory name is found, an error is printed and this function returns false.
Implemented in Qtilities::Core::ObjectManager.
|
pure virtual |
Registers an object to be included in the global object pool.
category | The category under which the object must be registered. This parameter can be left out in most cases, however it is usefull when visualizing the global object pool using the Qtilities::Plugins::Debug plugin for example. |
Implemented in Qtilities::Core::ObjectManager.
|
pure virtual |
Removes an object to from the global object pool.
This function will detach the object from the global object pool observer. It will not however delete the object, it will just detach it.
Implemented in Qtilities::Core::ObjectManager.
|
pure virtual |
Updates the active object(s) for a specific meta type.
For more information about see the Global object activity management section of the Object Management article.
Implemented in Qtilities::Core::ObjectManager.
Qtilities : Reference Documentation | Back to top |
Copyright © 2009-2013, Jaco Naudé
|