The IObjectFactory interface. More...

#include "murl_resource_i_object_factory.h"

Inheritance diagram for Murl::Resource::IObjectFactory:

Public Member Functions

virtual Bool Init ()=0
 Initialize the factory. More...
 
virtual Bool DeInit ()=0
 Deinitialize the factory. More...
 
virtual IObjectCreateObjectFromFile (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 IObjectCreateObjectFromMemory (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 IFactoryGetResourceFactory () 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::ClassInfoGetRegisteredObjectClassInfo (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 PropertyInfoGetPropertyInfo ()
 Get the class' property info struct. More...
 
static const AttributeInfoGetAttributeInfo ()
 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()

virtual Bool Murl::Resource::IObjectFactory::Init ( )
pure virtual

Initialize the factory.

Returns
true if successful.

◆ DeInit()

virtual Bool Murl::Resource::IObjectFactory::DeInit ( )
pure virtual

Deinitialize the factory.

Returns
true if successful.

◆ CreateObjectFromFile()

virtual IObject* Murl::Resource::IObjectFactory::CreateObjectFromFile ( IEnums::ResourceType  type,
const IAttributes params,
const String id,
const String fileName,
IEnums::FileCategory  fileCategory,
Result result 
) const
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
typeThe desired resource type.
paramsAn optional pointer to user-defined parameters used during creation.
idThe object ID.
fileNameThe file name, relative to the file category below.
fileCategoryThe file category to search the file in.
resultThe object to receive the result of the operation.
Returns
A pointer to the newly created resource object, or null if failed.

◆ CreateObjectFromMemory()

virtual IObject* Murl::Resource::IObjectFactory::CreateObjectFromMemory ( IEnums::ResourceType  type,
const IAttributes params,
const String id,
const String fileName,
IEnums::FileCategory  fileCategory,
const ConstData data,
Bool dataCanBeDisposed,
Result result 
) const
pure virtual

Create a single resource object from a given block of memory.

See CreateObjectFromFile().

Parameters
typeThe desired resource type.
paramsAn optional pointer to user-defined parameters used during creation.
idThe object ID.
fileNameThe optional file name used for internal purposes, may be empty.
fileCategoryThe optional file category.
dataA data object holding the data for the resource to create.
dataCanBeDisposedA 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().
resultThe object to receive the result of the operation.
Returns
A pointer to the newly created resource object, or null if failed.

◆ DestroyObject()

virtual Bool Murl::Resource::IObjectFactory::DestroyObject ( IObject *&  object) const
pure virtual

Destroy a previously created resource object.

Parameters
objectA reference to a pointer holding the object to destroy.
Returns
true if successful.

◆ QueryObjectFromFile() [1/2]

virtual Bool Murl::Resource::IObjectFactory::QueryObjectFromFile ( const String fileName,
IEnums::FileCategory  fileCategory,
Bool isDataValid,
Bool isVersionValid 
) const
pure virtual

Query information about an object file.

Parameters
fileNameThe name of the object file, relative to the given file category below.
fileCategoryThe file system category where to look for the given file.
isDataValidAn optional pointer to receive the result of the overall data validity check.
isVersionValidAn 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]

virtual Bool Murl::Resource::IObjectFactory::QueryObjectFromFile ( const String fileName,
IEnums::FileCategory  fileCategory,
IEnums::ResourceType resourceType,
IEnums::FileType fileType,
Bool isDataValid,
Bool isVersionValid 
) const
pure virtual

Query information about an object file.

Parameters
fileNameThe name of the object file, relative to the given file category below.
fileCategoryThe file system category where to look for the given file.
resourceTypeAn optional pointer to receive the object resource type.
fileTypeAn optional pointer to receive the object file type.
isDataValidAn optional pointer to receive the result of the overall data validity check.
isVersionValidAn 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]

virtual Bool Murl::Resource::IObjectFactory::QueryObjectFromMemory ( const ConstData data,
const String fileName,
Bool isDataValid,
Bool isVersionValid 
) const
pure virtual

Query information about an object in memory.

Parameters
dataThe binary object data.
fileNameThe name of the object file.
isDataValidAn optional pointer to receive the result of the overall data validity check.
isVersionValidAn 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]

virtual Bool Murl::Resource::IObjectFactory::QueryObjectFromMemory ( const ConstData data,
const String fileName,
IEnums::ResourceType resourceType,
IEnums::FileType fileType,
Bool isDataValid,
Bool isVersionValid 
) const
pure virtual

Query information about an object in memory.

Parameters
dataThe binary object data.
fileNameThe name of the object file.
resourceTypeAn optional pointer to receive the object resource type.
fileTypeAn optional pointer to receive the object file type.
isDataValidAn optional pointer to receive the result of the overall data validity check.
isVersionValidAn optional pointer to receive the result of the version check.
Returns
true if the object could be loaded in the first place.

◆ GetResourceFactory()

virtual const IFactory* Murl::Resource::IObjectFactory::GetResourceFactory ( ) const
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


Copyright © 2011-2023 Spraylight GmbH.