![]() |
Murl Engine API
Version 2018.3
|
The IObjectFactory interface. More...
#include <murl_resource_i_object_factory.h>
The IObjectFactory interface.
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... | |
![]() | |
virtual | ~IFactoryObject () |
The destructor. More... | |
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. | |
![]() | |
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 | |
![]() | |
typedef Array< const ClassInfo *> | ClassInfoArray |
Definition of an array of ClassInfo objects. More... | |
![]() | |
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... | |
|
pure virtual |
Initialize the factory.
|
pure virtual |
Deinitialize the factory.
|
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.
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. |
|
pure virtual |
Create a single resource object from a given block of memory.
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. |
Destroy a previously created resource object.
object | A reference to a pointer holding the object to destroy. |
|
pure virtual |
Query information about an object file.
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. |
|
pure virtual |
Query information about an object file.
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. |
|
pure virtual |
Query information about an object in memory.
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. |
|
pure virtual |
Query information about an object in memory.
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. |
|
pure virtual |
Get the main resource factory.