Alias always bringing the latest version of ant::class_factory into scope.
More...
#include <class_factory.h>
Inherits adtf::ucom::catwo::object< IClassFactory >.
|
| | class_factory () |
| |
| virtual | ~class_factory () |
| |
| virtual tResult | CreateInstance (const char *strCID, iobject_ptr< IObject > &oObject, const tChar *strNameOfObject="") const |
| |
| 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.
|
| |
| tResult | GetInterface (const char *i_strIID, void *&o_pInterface) override |
| | Query interfaces on an object.
|
| |
| tResult | GetInterface (const char *i_strIID, const void *&o_pInterface) const override |
| | Provides const correct interface querying.
|
| |
| void | Destroy () const override |
| | Switch from non-virtual destructor to virtual destructor.
|
| |
| tResult | GetInterface (const char *i_strIID, void *&o_pInterface) override |
| | Query interfaces on an object.
|
| |
| tResult | GetInterface (const char *i_strIID, const void *&o_pInterface) const override |
| | Provides const correct interface querying.
|
| |
| void | Destroy () const override |
| | Switch from non-virtual destructor to virtual destructor.
|
| |
| tResult | GetInterface (const char *i_strIID, void *&o_pInterface) override |
| | Query interfaces on an object.
|
| |
| tResult | GetInterface (const char *i_strIID, const void *&o_pInterface) const override |
| | Provides const correct interface querying.
|
| |
| void | Destroy () const override |
| | Switch from non-virtual destructor to virtual destructor.
|
| |
| | ADTF_IID (IObject, "object.ant.ucom.adtf.iid") |
| |
|
|
| ~IObject ()=default |
| | Protected destructor --> Only the final implementation can be destroyed!
|
| |
template<typename ... Classes>
class adtf::ucom::class_factory< Classes >
Alias always bringing the latest version of ant::class_factory into scope.
The class class_factory provides a template based implementation of the IClassFactory interface, that can create exactly one kind of object for the class
- Parameters
-
- Template Parameters
-
| 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. |
◆ class_factory()
template<typename ... Classes>
The Constructor create the class factory for exactly one object.
◆ ~class_factory()
template<typename ... Classes>
standard DTOR for the class factory.
◆ CreateInstance()
template<typename ... Classes>
Creates a new instance. The CreateInstance method creates a single uninitialized object of the class associated with a specified class identifier.
- Parameters
-
| [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. |
- Returns
- Returns a standard result code.
- Return values
-
| 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 . |
| 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. |
◆ GetClasses()
template<typename ... Classes>
Enumerates all classes supported by the class factory and pushes it to lstOfClasses This method should be used for debugging or testing purposes only.
- Parameters
-
- Returns
- Returns a standard result code.
- See also
- object_list, object_vector.
This function will fill the iobject_enum with only one ucom::IClassInfo Object for the class given a template parameter
The documentation for this class was generated from the following file: