32#ifndef _QX_FACTORY_X_H_
33#define _QX_FACTORY_X_H_
46#include <QtCore/qhash.h>
47#include <QtCore/qmutex.h>
55inline qx::any
create(
const QString & sKey,
bool bRawPointer =
false);
71 friend inline qx::any create(
const QString & sKey,
bool bRawPointer);
72 template <
typename T>
friend inline T *
create_nude_ptr(
const QString & sKey);
94 const std::type_info &
typeInfo(
const QString & sKey)
const;
Common interface for all classes that can be created dynamically using the class name.
#define QX_DLL_EXPORT_QX_SINGLETON_HPP(x)
Concrete class to define a thread-safe singleton of QxOrm library.
qx::QxClassX : list of all classes registered into QxOrm context (this container is a singleton)
qx::QxFactoryX : list of all classes registered with QxOrm library factory pattern to create object i...
void * createObjectNudePtr(const QString &sKey) const
friend T * create_nude_ptr(const QString &sKey)
Return a nude pointer (be careful with memory leak) of type T associated by key sKey,...
qx::any createObject(const QString &sKey, bool bRawPointer=false) const
QMutex m_oMutexFactoryX
Mutex -> 'QxFactoryX' is thread-safe.
void unregisterFactory(const QString &sKey)
void registerFactory(const QString &sKey, IxFactory *pFactory)
friend qx::any create(const QString &sKey, bool bRawPointer)
Return a smart-pointer new instance of object (std::shared_ptr<T>) associated by key sKey using qx::a...
static const std::type_info & getTypeInfo(const QString &sKey)
friend void * create_void_ptr(const QString &sKey)
Return a void * pointer (be careful with memory leak) associated by key sKey, or return NULL if sKey ...
static void * createInstanceNudePtr(const QString &sKey)
static qx::any createInstance(const QString &sKey, bool bRawPointer=false)
const std::type_info & typeInfo(const QString &sKey) const
QHash< QString, IxFactory * > m_mapFactoryX
Collection of all 'IxFactory' pointer.
QHash< QString, IxFactory * > * getAllFactory()
QxSingleton(const QString &sKey)
static QxFactoryX * getSingleton()
T * create_nude_ptr(const QString &sKey)
Return a nude pointer (be careful with memory leak) of type T associated by key sKey,...
qx::any create(const QString &sKey, bool bRawPointer=false)
Return a smart-pointer new instance of object (std::shared_ptr<T>) associated by key sKey using qx::a...
void * create_void_ptr(const QString &sKey)
Return a void * pointer (be careful with memory leak) associated by key sKey, or return NULL if sKey ...
Root namespace for all QxOrm library features.