Murl::ILoader Interface Referenceabstract

The loader interface. More...

#include "murl_i_loader.h"

Inherited by Murl::Core::Loader.

Public Types

enum  LoadMode { LOAD_MODE_STARTUP , LOAD_MODE_BACKGROUND , LOAD_MODE_ON_DEMAND , NUM_LOAD_MODES }
 Definition of the load operation modes. More...
 

Public Member Functions

virtual Bool AddProcessor (Logic::IProcessorPtr processor)=0
 Add a logic processor without a package. More...
 
virtual Bool RemoveProcessor (Logic::IProcessorPtr processor)=0
 Remove a logic processor added by AddProcessor(). More...
 
virtual IPackageAddPackage (const String &packageName, LoadMode mode)=0
 Create and register a package by name. More...
 
virtual IPackageAddPackage (const String &packageName, LoadMode mode, Logic::IProcessorPtr processor)=0
 Create and register a package by name and a corresponding logic processor. More...
 
virtual IPackageAddPackage (const String &packageName, IEnums::FileCategory category, LoadMode mode)=0
 Create and register a package by name and category. More...
 
virtual IPackageAddPackage (const String &packageName, IEnums::FileCategory category, LoadMode mode, Logic::IProcessorPtr processor)=0
 Create and register a package by name, category and a corresponding logic processor. More...
 
virtual Bool RemovePackage (const String &packageName)=0
 Remove a registered package by name. More...
 
virtual IPackageGetPackage (const String &packageName) const =0
 Get a registered package of a specified package name. More...
 
virtual IPackageGetPackage (Logic::IProcessorPtr processor) const =0
 Get a registered package connected to a given processor. More...
 
virtual Bool QueryPackage (const String &packageName, String *id, UInt32 *revision, Bool *isDataValid, Bool *isVersionValid, Bool *isChecksumValid) const =0
 Query a registered package. More...
 
virtual Bool LoadPackage (const String &packageName) const =0
 Load a registered package. More...
 
virtual Bool UnloadPackage (const String &packageName) const =0
 Load a registered package. More...
 

Detailed Description

The loader interface.

The loader is a thread which provides functionality for loading and unloading resource packages parallel to the engine's logic and rendering processing.

The IEngineConfiguration::SetResourceFileCategory() setting specifies the working directory for the loader.

The ILoader object is provided by the IAppState and the Logic::IState object.

Member Enumeration Documentation

◆ LoadMode

Definition of the load operation modes.

Enumerator
LOAD_MODE_STARTUP 

Load the package before engine startup.

LOAD_MODE_BACKGROUND 

Load the package immediately in background.

LOAD_MODE_ON_DEMAND 

Load the package on demand using the IPackage.

Member Function Documentation

◆ AddProcessor()

virtual Bool Murl::ILoader::AddProcessor ( Logic::IProcessorPtr  processor)
pure virtual

Add a logic processor without a package.

Logic processors without a package can be added before startup only.

Parameters
processorThe logic processor to add.
Returns
true if successful.

◆ RemoveProcessor()

virtual Bool Murl::ILoader::RemoveProcessor ( Logic::IProcessorPtr  processor)
pure virtual

Remove a logic processor added by AddProcessor().

Parameters
processorThe logic processor to remove.
Returns
true if successful.

◆ AddPackage() [1/4]

virtual IPackage* Murl::ILoader::AddPackage ( const String packageName,
LoadMode  mode 
)
pure virtual

Create and register a package by name.

Parameters
packageNameThe name of the package.
modeThe load mode.
Returns
The package object or null if creating the package failed.

◆ AddPackage() [2/4]

virtual IPackage* Murl::ILoader::AddPackage ( const String packageName,
LoadMode  mode,
Logic::IProcessorPtr  processor 
)
pure virtual

Create and register a package by name and a corresponding logic processor.

Parameters
packageNameThe name of the package.
modeThe load mode.
processorThe corresponding logic processor.
Returns
The package object or null if creating the package failed.

◆ AddPackage() [3/4]

virtual IPackage* Murl::ILoader::AddPackage ( const String packageName,
IEnums::FileCategory  category,
LoadMode  mode 
)
pure virtual

Create and register a package by name and category.

Parameters
packageNameThe name of the package.
categoryThe file category.
modeThe load mode.
Returns
The package object or null if creating the package failed.

◆ AddPackage() [4/4]

virtual IPackage* Murl::ILoader::AddPackage ( const String packageName,
IEnums::FileCategory  category,
LoadMode  mode,
Logic::IProcessorPtr  processor 
)
pure virtual

Create and register a package by name, category and a corresponding logic processor.

Parameters
packageNameThe name of the package.
categoryThe file category.
modeThe load mode.
processorThe corresponding logic processor.
Returns
The package object or null if creating the package failed.

◆ RemovePackage()

virtual Bool Murl::ILoader::RemovePackage ( const String packageName)
pure virtual

Remove a registered package by name.

A package can be removed only if package is unloaded.

Parameters
packageNameThe name of the package to remove.
Returns
true if successful.

◆ GetPackage() [1/2]

virtual IPackage* Murl::ILoader::GetPackage ( const String packageName) const
pure virtual

Get a registered package of a specified package name.

Parameters
packageNameThe name of the package.
Returns
The package object or null if the package name is not registered.

◆ GetPackage() [2/2]

virtual IPackage* Murl::ILoader::GetPackage ( Logic::IProcessorPtr  processor) const
pure virtual

Get a registered package connected to a given processor.

Parameters
processorThe processor to query.
Returns
The package object or null if no package is connected to the processor.

◆ QueryPackage()

virtual Bool Murl::ILoader::QueryPackage ( const String packageName,
String id,
UInt32 revision,
Bool isDataValid,
Bool isVersionValid,
Bool isChecksumValid 
) const
pure virtual

Query a registered package.

This method takes a number of pointers to individual variables that receive the results of the query. It is allowed to pass null pointers to any of these variables in case the specific item is not of interest.

Parameters
packageNameThe name of the package.
idA pointer to a String object receiving the internal package ID.
revisionA pointer to a UInt32 variable receiving the package revision.
isDataValidA pointer to a Bool variable receiving the general validity of the package data.
isVersionValidA pointer to a Bool variable receiving the result of the file format version check.
isChecksumValidA pointer to a Bool variable receiving the result of the CRC32 checksum validation.
Returns
true if the package was recognized by any of the available loader modules. If no loader module can handle the data stream, false is returned.

◆ LoadPackage()

virtual Bool Murl::ILoader::LoadPackage ( const String packageName) const
pure virtual

Load a registered package.

Parameters
packageNameThe name of the package.
Returns
The result of IPackage::Load() or false if the package name is not registered.

◆ UnloadPackage()

virtual Bool Murl::ILoader::UnloadPackage ( const String packageName) const
pure virtual

Load a registered package.

Parameters
packageNameThe name of the package.
Returns
The result of IPackage::Unload() or false if the package name is not registered.

The documentation for this interface was generated from the following file:
  • murl_i_loader.h


Copyright © 2011-2024 Spraylight GmbH.