ADTF
|
The class class_factory provides a template based implementation of the IClassFactory interface, that can create exactly one kind of object for the class. More...
Classes | |
struct | dispatch |
struct | dispatch< Class, InnerClasses... > |
Public Member Functions | |
class_factory () | |
The Constructor create the class factory for exactly one object. | |
virtual | ~class_factory () |
standard DTOR for the class factory. | |
virtual tResult | CreateInstance (const char *strCID, iobject_ptr< IObject > &oObject, const tChar *strNameOfObject="") const |
Creates a new instance. More... | |
tResult | GetClasses (iobject_enum< const IClassInfo > &lstOfClasses) const |
Enumerates all classes supported by the class factory and pushes it to lstOfClasses This method should be used for debugging or testing purposes only. More... | |
Public Member Functions inherited from object< IClassFactory > | |
tResult | GetInterface (const char *i_strIID, void *&o_pInterface) override |
Query interfaces on an object. More... | |
tResult | GetInterface (const char *i_strIID, const void *&o_pInterface) const override |
Provides const correct interface querying. More... | |
void | Destroy () const override |
Destruct and deallocate instantiations of type IObject . More... | |
Public Member Functions inherited from IObject | |
ADTF_IID (IObject, "object.ant.ucom.adtf.iid") | |
Marks the IObject to be castable with the ucom_cast() More... | |
Private Member Functions | |
class_factory (const class_factory &)=delete | |
class_factory (class_factory &&)=delete | |
class_factory & | operator= (const class_factory &)=delete |
class_factory & | operator= (class_factory &&)=delete |
Additional Inherited Members | |
Protected Member Functions inherited from IObject | |
~IObject ()=default | |
Protected destructor --> Use implemented Destroy() instead of delete! | |
The class class_factory provides a template based implementation of the IClassFactory interface, that can create exactly one kind of object for the class.
T. |
T | Class of the Object to create. |
EXPLICIT_INTERFACE | If the class implementation T has ambiguous conversion to the IObject use EXPLICIT_INTERFACE to define an explicit cast. |
Definition at line 25 of file class_factory.h.
|
inlinevirtual |
Creates a new instance.
The CreateInstance method creates a single uninitialized object of the class associated with a specified class identifier.
[in] | strCID | Class identifier of the object to create! |
[in] | strNameOfObject | ObjectName identifier (will be relevant only if the ClassFactory can handle this). |
[in,out] | oObject | Object to create to be used to communicate with the object. |
ERR_ERR_INVALID_LICENSE | no valid license found |
Return | Value of iobject_ptr<IObject>::Reset() Implements the ucom::IClassFactory::CreateInstance. This Function will create an instance for given parameter class <T>
|
ERR_INVALID_ARG | strCID is empty |
ERR_MEMORY | the object will be created on heap. out of memory. |
ERR_NO_CLASS | Given strCID is not supported by this class factory. |
ERR_INVALID_INTERFACE | oObject.Get() is empty after Reseting. This could be possible if the oObject expect another interface. |
Definition at line 125 of file class_factory.h.
References RETURN_ERROR_DESC, and RETURN_IF_POINTER_NULL.
|
inline |
Enumerates all classes supported by the class factory and pushes it to lstOfClasses This method should be used for debugging or testing purposes only.
[in,out] | lstOfClasses | List to return the class information to. Use object_list or object_vector. |
This function will fill the iobject_enum with only one ucom::IClassInfo Object for the class given a template parameter
Definition at line 149 of file class_factory.h.
References RETURN_NOERROR.