![]() |
Murl Engine API
Version 2018.3
|
The resource collection interface. More...
#include <murl_resource_i_collection.h>
The resource collection interface.
A resource collection provides methods to manage individual Resource::IPackage objects, which contain a number of individual Resource::IObject instances. The resource collection also provides methods to retrieve individual objects via a package/object identifier pair in the form "packageId:objectId", as in GetObject() and related methods.
Public Member Functions | |
virtual ICollection * | GetCollectionInterface ()=0 |
Get the mutable ICollection interface. More... | |
virtual const ICollection * | GetCollectionInterface () const =0 |
Get the constant ICollection interface. More... | |
virtual const ICollectionFactory * | GetCreator () const =0 |
Get the factory object used to create this collection. More... | |
virtual Bool | Init ()=0 |
Initialize this collection. More... | |
virtual Bool | DeInit ()=0 |
De-initialize this collection. More... | |
virtual Bool | RegisterPackageData (const String &name, const ConstData &data)=0 |
Register a specific package from a block of memory. More... | |
virtual Bool | UnregisterPackageData (const String &name)=0 |
Unregister a package previously registered through RegisterPackageData(). More... | |
virtual const IPackage * | CreatePackageFromFile (const String &id, const ICondition *condition, const String &fileName, IEnums::FileCategory fileCategory, Result &result)=0 |
Create a resource package from a file. More... | |
virtual const IPackage * | CreatePackageFromMemory (const String &id, const ICondition *condition, const String &fileName, IEnums::FileCategory fileCategory, const ConstData &data, Bool &dataCanBeDisposed, Result &result)=0 |
Create a resource package from a block of memory. More... | |
virtual const IPackage * | CreatePackageReference (const IPackage *referencedPackage, const String &id, const ICondition *condition)=0 |
Create a reference to an existing resource package. More... | |
virtual Bool | DestroyPackage (const IPackage *&package)=0 |
Destroy a previously created package. More... | |
virtual Bool | QueryPackageFromFile (const String &fileName, IEnums::FileCategory fileCategory, String *id, UInt32 *revision, Bool *isDataValid, Bool *isVersionValid, Bool *isChecksumValid) const =0 |
Query information about a package file. More... | |
virtual Bool | QueryPackageFromMemory (const ConstData &data, String *id, UInt32 *revision, Bool *isDataValid, Bool *isVersionValid, Bool *isChecksumValid) const =0 |
Query information about a package in memory. More... | |
virtual UInt32 | GetNumberOfPackages () const =0 |
Get the total number of packages in this collection. More... | |
virtual const IPackage * | GetPackage (UInt32 index) const =0 |
Get the package at a given index. More... | |
virtual const ICondition * | GetPackageCondition (UInt32 index) const =0 |
Get the condition of a package at a given index. More... | |
virtual const IPackage * | GetPackage (const String &id) const =0 |
Get a package by its ID. More... | |
virtual const IObject * | GetObject (const String &id) const =0 |
Get a single generic resource object by its package/object ID. More... | |
virtual const IBinary * | GetBinary (const String &id) const =0 |
Get a single object as a specialized Resource::IBinary. More... | |
virtual const IGraph * | GetGraph (const String &id) const =0 |
Get a single object as a specialized Resource::IGraph. More... | |
virtual const IImage * | GetImage (const String &id) const =0 |
Get a single object as a specialized Resource::IImage. More... | |
virtual const IMesh * | GetMesh (const String &id) const =0 |
Get a single object as a specialized Resource::IMesh. More... | |
virtual const IFont * | GetFont (const String &id) const =0 |
Get a single object as a specialized Resource::IFont. More... | |
virtual const IShader * | GetShader (const String &id) const =0 |
Get a single object as a specialized Resource::IShader. More... | |
virtual const IAudio * | GetAudio (const String &id) const =0 |
Get a single object as a specialized Resource::IAudio. More... | |
virtual const IAnimation * | GetAnimation (const String &id) const =0 |
Get a single object as a specialized Resource::IAnimation. More... | |
virtual const IAtlas * | GetAtlas (const String &id) const =0 |
Get a single object as a specialized Resource::IAtlas. More... | |
virtual const IArchive * | GetArchive (const String &id) const =0 |
Get a single object as a specialized Resource::IArchive. More... | |
virtual const IVideo * | GetVideo (const String &id) const =0 |
Get a single object as a specialized Resource::IVideo. More... | |
virtual const IScript * | GetScript (const String &id) const =0 |
Get a single object as a specialized Resource::IScript. More... | |
virtual const IDictionary * | GetDictionary (const String &id) const =0 |
Get a single object as a specialized Resource::IDictionary. More... | |
virtual const IGrid * | GetGrid (const String &id) const =0 |
Get a single object as a specialized Resource::IGrid. More... | |
virtual const IText * | GetText (const String &id) const =0 |
Get a single text resource. More... | |
virtual Bool | SetParentPackage (const IPackage *parentPackage)=0 |
Set the optional parent package this collection belongs to. More... | |
virtual const IPackage * | GetParentPackage () const =0 |
Get the optional parent package this collection belongs to. More... | |
virtual Bool | SetParentCollection (const ICollection *parentCollection)=0 |
Set the optional parent collection. More... | |
virtual const ICollection * | GetParentCollection () const =0 |
Get the optional parent collection. More... | |
virtual UInt32 | GetNumberOfAllocatedResourceBytes () const =0 |
Query the total number of allocated resource bytes in this collection. 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. | |
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< ICollection > *object) |
Reset an object instance's properties to their default values. More... | |
|
pure virtual |
Get the mutable ICollection interface.
|
pure virtual |
Get the constant ICollection interface.
|
pure virtual |
Get the factory object used to create this collection.
|
pure virtual |
Initialize this collection.
|
pure virtual |
De-initialize this collection.
|
pure virtual |
Register a specific package from a block of memory.
This method can be used to register a package from memory as if it was a file on disk. Internally, the CreatePackageFromFile() first checks if any package with the given file name was registered through this method before actually searching the file system.
name | The file name to register. |
data | A Data object containing the binary package. |
Unregister a package previously registered through RegisterPackageData().
name | The file name to unregister. |
|
pure virtual |
Create a resource package from a file.
id | The internal package ID. |
condition | An optional condition interface to check. |
fileName | The name of the package file, relative to the given file category below. |
fileCategory | The file system category where to look for the given file. |
result | The object to receive the result of the operation. |
|
pure virtual |
Create a resource package from a block of memory.
id | The internal package ID. |
condition | An optional condition interface to check. |
fileName | The file name of the package, relative to which any individual file sub-resources/-packages are accessed from the file system. |
fileCategory | The file system category to prepend to the file name. |
data | The binary package data. |
dataCanBeDisposed | A reference to a Bool variable receiving true whenever it is safe to delete the input data right after package creation. If this value receives false, the input data must be kept until the package is destroyed using DestroyPackage(). |
result | The object to receive the result of the operation. |
|
pure virtual |
Create a reference to an existing resource package.
referencedPackage | The package to refer to. |
id | The internal package ID. |
condition | An optional condition interface to check. |
Destroy a previously created package.
package | A reference to a pointer holding the package to destroy. |
|
pure virtual |
Query information about a package file.
fileName | The name of the package file, relative to the given file category below. |
fileCategory | The file system category where to look for the given file. |
id | An optional pointer to receive the package ID, if present. |
revision | An optional pointer to receive the user-defined package revision, if present. |
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. |
isChecksumValid | An optional pointer to receive the result of the checksum comparison, if the package does include one. |
|
pure virtual |
Query information about a package in memory.
data | The binary package data. |
id | An optional pointer to receive the package ID, if present. |
revision | An optional pointer to receive the user-defined package revision, if present. |
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. |
isChecksumValid | An optional pointer to receive the result of the checksum comparison, if the package does include one. |
|
pure virtual |
Get the total number of packages in this collection.
Get the package at a given index.
index | The index of the package, from 0 to GetNumberOfPackages()-1. |
|
pure virtual |
Get the condition of a package at a given index.
index | The index of the package, from 0 to GetNumberOfPackages()-1. |
|
pure virtual |
Get a package by its ID.
id | The package ID to query. |
|
pure virtual |
Get a single generic resource object by its package/object ID.
The given ID must be in the form "/packageId/objectId", to reference an object in a specific loaded package. If the package contains sub-packages, the resource may be referenced via e.g. "/packageId/subPackageId/objectId".
id | The ID of the object to retrieve. |
|
pure virtual |
Get a single object as a specialized Resource::IBinary.
See GetObject().
id | The ID of the object to retrieve. |
Get a single object as a specialized Resource::IGraph.
See GetObject().
id | The ID of the object to retrieve. |
Get a single object as a specialized Resource::IImage.
See GetObject().
id | The ID of the object to retrieve. |
Get a single object as a specialized Resource::IMesh.
See GetObject().
id | The ID of the object to retrieve. |
Get a single object as a specialized Resource::IFont.
See GetObject().
id | The ID of the object to retrieve. |
|
pure virtual |
Get a single object as a specialized Resource::IShader.
See GetObject().
id | The ID of the object to retrieve. |
Get a single object as a specialized Resource::IAudio.
See GetObject().
id | The ID of the object to retrieve. |
|
pure virtual |
Get a single object as a specialized Resource::IAnimation.
See GetObject().
id | The ID of the object to retrieve. |
Get a single object as a specialized Resource::IAtlas.
See GetObject().
id | The ID of the object to retrieve. |
|
pure virtual |
Get a single object as a specialized Resource::IArchive.
See GetObject().
id | The ID of the object to retrieve. |
Get a single object as a specialized Resource::IVideo.
See GetObject().
id | The ID of the object to retrieve. |
|
pure virtual |
Get a single object as a specialized Resource::IScript.
See GetObject().
id | The ID of the object to retrieve. |
|
pure virtual |
Get a single object as a specialized Resource::IDictionary.
See GetObject().
id | The ID of the object to retrieve. |
Get a single object as a specialized Resource::IGrid.
See GetObject().
id | The ID of the object to retrieve. |
Get a single text resource.
See GetObject().
id | The ID of the text to retrieve. |
|
pure virtual |
Set the optional parent package this collection belongs to.
parentPackage | The containing package, or null for removing. |
|
pure virtual |
Get the optional parent package this collection belongs to.
|
pure virtual |
Set the optional parent collection.
An optional parent collection can be defined to perform an additional search for a resource (via package and object ID) if it cannot be found in this collection.
parentCollection | The parent collection, or null for removing. |
|
pure virtual |
Get the optional parent collection.
|
pure virtual |
Query the total number of allocated resource bytes in this collection.