The IObjectFactory interface. More...
#include "murl_resource_i_object_factory.h"
Public Member Functions | |
virtual Bool | Init ()=0 |
Initialize the factory. More... | |
virtual Bool | DeInit ()=0 |
Deinitialize the factory. More... | |
virtual IObject * | CreateObjectFromFile (IEnums::ResourceType type, const IAttributes *params, const String &id, const String &fileName, IEnums::FileCategory fileCategory, Result &result) const =0 |
Create a single resource object from a given file. More... | |
virtual IObject * | CreateObjectFromMemory (IEnums::ResourceType type, const IAttributes *params, const String &id, const String &fileName, IEnums::FileCategory fileCategory, const ConstData &data, Bool &dataCanBeDisposed, Result &result) const =0 |
Create a single resource object from a given block of memory. More... | |
virtual Bool | DestroyObject (IObject *&object) const =0 |
Destroy a previously created resource object. More... | |
virtual Bool | QueryObjectFromFile (const String &fileName, IEnums::FileCategory fileCategory, Bool *isDataValid, Bool *isVersionValid) const =0 |
Query information about an object file. More... | |
virtual Bool | QueryObjectFromFile (const String &fileName, IEnums::FileCategory fileCategory, IEnums::ResourceType *resourceType, IEnums::FileType *fileType, Bool *isDataValid, Bool *isVersionValid) const =0 |
Query information about an object file. More... | |
virtual Bool | QueryObjectFromMemory (const ConstData &data, const String &fileName, Bool *isDataValid, Bool *isVersionValid) const =0 |
Query information about an object in memory. More... | |
virtual Bool | QueryObjectFromMemory (const ConstData &data, const String &fileName, IEnums::ResourceType *resourceType, IEnums::FileType *fileType, Bool *isDataValid, Bool *isVersionValid) const =0 |
Query information about an object in memory. More... | |
virtual const IFactory * | GetResourceFactory () const =0 |
Get the main resource factory. More... | |
Public Member Functions inherited from Murl::IFactoryObject< IObjectFactory > | |
~IFactoryObject () override | |
The destructor. | |
virtual const ClassInfo * | GetObjectClassInfo () const=0 |
Get the object instance's class info, if present. More... | |
virtual void | ResetObjectProperties ()=0 |
Reset the object instance's properties to their default values. | |
Public Member Functions inherited from Murl::Resource::IObjectFactoryRegistry | |
virtual Bool | RegisterObjectClass (const IObject::ClassInfo &classInfo)=0 |
Register an object class. More... | |
virtual Bool | UnregisterObjectClass (const IObject::ClassInfo &classInfo)=0 |
Unregister a previously registered object class. More... | |
virtual SInt32 | GetRegisteredObjectClassInfoIndex (const IObject::ClassInfo &classInfo) const =0 |
Query the index of a registered object class, by its ClassInfo structure. More... | |
virtual SInt32 | GetRegisteredObjectClassInfoIndex (const String &className) const =0 |
Query the index of a registered object class, by its class name. More... | |
virtual UInt32 | GetNumberOfRegisteredObjectClassInfos () const =0 |
Get the total number of registered object classes. More... | |
virtual const IObject::ClassInfo * | GetRegisteredObjectClassInfo (UInt32 index) const =0 |
Get the ClassInfo structure of a registered object class. More... | |
Additional Inherited Members | |
Public Types inherited from Murl::IFactoryObject< IObjectFactory > | |
using | ClassInfoArray = Array< const ClassInfo * > |
Definition of an array of ClassInfo objects. | |
Static Public Member Functions inherited from Murl::IFactoryObject< IObjectFactory > | |
static const PropertyInfo * | GetPropertyInfo () |
Get the class' property info struct. More... | |
static const AttributeInfo * | GetAttributeInfo () |
Get the class' attribute info struct. More... | |
static void | ResetProperties (IFactoryObject< IObjectFactory > *object) |
Reset an object instance's properties to their default values. More... | |
Detailed Description
The IObjectFactory interface.
Member Function Documentation
◆ Init()
|
pure virtual |
Initialize the factory.
- Returns
- true if successful.
◆ DeInit()
|
pure virtual |
Deinitialize the factory.
- Returns
- true if successful.
◆ CreateObjectFromFile()
|
pure virtual |
Create a single resource object from a given file.
To automatically detect the actual type of resource represented by the given file, specify the IEnums::RESOURCE_TYPE_DEFAULT type. If it is desired to create a raw binary resource, use IEnums::RESOURCE_TYPE_BINARY. If the object should be represented as a compressed binary, IEnums::RESOURCE_TYPE_ARCHIVE can be used.
- Parameters
-
type The desired resource type. params An optional pointer to user-defined parameters used during creation. id The object ID. fileName The file name, relative to the file category below. fileCategory The file category to search the file in. result The object to receive the result of the operation.
- Returns
- A pointer to the newly created resource object, or null if failed.
◆ CreateObjectFromMemory()
|
pure virtual |
Create a single resource object from a given block of memory.
- Parameters
-
type The desired resource type. params An optional pointer to user-defined parameters used during creation. id The object ID. fileName The optional file name used for internal purposes, may be empty. fileCategory The optional file category. data A data object holding the data for the resource to create. dataCanBeDisposed A reference to a boolean variable receiving true when it is safe to destroy the given data object right after resource creation. If false, the data object must be kept until the object was successfully destroyed via DestroyObject(). result The object to receive the result of the operation.
- Returns
- A pointer to the newly created resource object, or null if failed.
◆ DestroyObject()
Destroy a previously created resource object.
- Parameters
-
object A reference to a pointer holding the object to destroy.
- Returns
- true if successful.
◆ QueryObjectFromFile() [1/2]
|
pure virtual |
Query information about an object file.
- Parameters
-
fileName The name of the object file, relative to the given file category below. fileCategory The file system category where to look for the given file. isDataValid An optional pointer to receive the result of the overall data validity check. isVersionValid An optional pointer to receive the result of the version check.
- Returns
- true if the object could be loaded in the first place.
◆ QueryObjectFromFile() [2/2]
|
pure virtual |
Query information about an object file.
- Parameters
-
fileName The name of the object file, relative to the given file category below. fileCategory The file system category where to look for the given file. resourceType An optional pointer to receive the object resource type. fileType An optional pointer to receive the object file type. isDataValid An optional pointer to receive the result of the overall data validity check. isVersionValid An optional pointer to receive the result of the version check.
- Returns
- true if the object could be loaded in the first place.
◆ QueryObjectFromMemory() [1/2]
|
pure virtual |
Query information about an object in memory.
- Parameters
-
data The binary object data. fileName The name of the object file. isDataValid An optional pointer to receive the result of the overall data validity check. isVersionValid An optional pointer to receive the result of the version check.
- Returns
- true if the object could be loaded in the first place.
◆ QueryObjectFromMemory() [2/2]
|
pure virtual |
Query information about an object in memory.
- Parameters
-
data The binary object data. fileName The name of the object file. resourceType An optional pointer to receive the object resource type. fileType An optional pointer to receive the object file type. isDataValid An optional pointer to receive the result of the overall data validity check. isVersionValid An optional pointer to receive the result of the version check.
- Returns
- true if the object could be loaded in the first place.
◆ GetResourceFactory()
|
pure virtual |
Get the main resource factory.
- Returns
- A pointer to the main resource factory.
The documentation for this interface was generated from the following file:
- murl_resource_i_object_factory.h