File based synchronous/asynchrounous ORM. More...
#include "mh5fileorm.h"
#include "mh5stream.h"
#include "mh5memory.h"
#include "mh5debug.h"
#include "mh5profile.h"
#include "mh5object.h"
#include "mh5queue.h"
#include "mh5gate.h"
#include "mh5misc.h"
#include "mh5control.h"
#include <string.h>
#include "glue_queue.h"
#include "glue_main.h"
#include "glue_timers.h"
#include "glue_dsmcc.h"
Classes | |
struct | CiMessageContext_struct |
struct | sOrmFuncs |
struct | sOrmGetRequest |
struct | sOrmPostRequest |
struct | sOrmRequest |
Typedefs | |
typedef struct CiMessageContext_struct | CiMessageContext |
typedef struct sOrmRequest * | P_OrmRequest |
typedef struct sOrmFuncs | S_OrmFuncs |
typedef struct sOrmGetRequest | S_OrmGetRequest |
typedef struct sOrmPostRequest | S_OrmPostRequest |
typedef struct sOrmRequest | S_OrmRequest |
Functions | |
void | MHEG5FileOrmInit (void) |
Initialise the file ORM module. More... | |
void | MHEG5FileOrmReset (MHEG5FileOrmResetMode resetMode) |
Reset the ORM module. This function supports two modes: More... | |
BOOLEAN | MHEG5FileOrmIsReset (MHEG5FileOrmResetMode *resetMode) |
Tell whether the ORM module is currently being reset. If it is, the function also returns the current reset mode. This information is required in order to decide whether to generate an EngineEvent when a file load fails. If a file cannot be loaded (doesn't exist, timeout) then an event is required, but if a file load "fails" because the ORM module is being reset, then no event should be generated. resetMode is an optional parameter, and it can also be NULL. More... | |
BOOLEAN | MHEG5FileOrmProcess (void) |
Check for any file requests that have arrived since this function was last called. For each arrived file the callback will be called. The function may have to be called more than once in case a file the arrived affects other files as well. More... | |
void | MHEG5FileOrmClear (void *orm_ref) |
Remove outstanding file request for the given handle. More... | |
void * | MHEG5FileOrmGet (MHEG5String name, U16BIT priority, void *userData, F_CB_Good cbGood, F_CB_Fail cbFail) |
Get a file. The file will be loaded and one of the callback functions called when request is resolved. When file system acceleration is available, this may retrieve the file from NVM cache. More... | |
void * | MHEG5FileOrmRetrieve (E_FS_ORIGIN origin, S_STRING location, S_STRING name, U16BIT priority, void *userData, F_CB_Good cbGood, F_CB_Fail cbFail) |
Retrieve of a file. The file will be loaded and one of the callback functions called when request is resolved. This is intended to be used by the File System Acceleration code. More... | |
void | MHEG5FileOrmPreloadHint (MHEG5String name) |
Provide a preload hint to DSM-CC that the specified file may be required in the future. DSM-CC could (but is not required to) acquire the file into cache. More... | |
File based synchronous/asynchrounous ORM.
#define ORM_STATE_STRING | ( | r | ) |
void MHEG5FileOrmClear | ( | void * | orm_ref | ) |
Remove outstanding file request for the given handle.
Aborts a request for file.
orm_ref | Handle given back by MHEG5FileOrmGet |
void* MHEG5FileOrmGet | ( | MHEG5String | name, |
U16BIT | priority, | ||
void * | userData, | ||
F_CB_Good | cbGood, | ||
F_CB_Fail | cbFail | ||
) |
Get a file. The file will be loaded and one of the callback functions called when request is resolved. When file system acceleration is available, this may retrieve the file from NVM cache.
name | Name of file to retrieve. This will be expanded using the rules specified by the UK1 profile. |
priority | Cache priority with which to fetch the object. |
userData | User data to be returned in callback functions. |
cbGood | Pointer to callback function that will be called when the file is retreived. |
cbFail | Pointer to callback function that will be called when the file cannot be retrieved. |
void MHEG5FileOrmInit | ( | void | ) |
Initialise the file ORM module.
BOOLEAN MHEG5FileOrmIsReset | ( | MHEG5FileOrmResetMode * | resetMode | ) |
Tell whether the ORM module is currently being reset. If it is, the function also returns the current reset mode. This information is required in order to decide whether to generate an EngineEvent when a file load fails. If a file cannot be loaded (doesn't exist, timeout) then an event is required, but if a file load "fails" because the ORM module is being reset, then no event should be generated. resetMode is an optional parameter, and it can also be NULL.
resetMode | Reset mode (if return value is TRUE) |
void MHEG5FileOrmPreloadHint | ( | MHEG5String | name | ) |
Provide a preload hint to DSM-CC that the specified file may be required in the future. DSM-CC could (but is not required to) acquire the file into cache.
name | Name of file to preload |
BOOLEAN MHEG5FileOrmProcess | ( | void | ) |
Check for any file requests that have arrived since this function was last called. For each arrived file the callback will be called. The function may have to be called more than once in case a file the arrived affects other files as well.
void MHEG5FileOrmReset | ( | MHEG5FileOrmResetMode | resetMode | ) |
Reset the ORM module. This function supports two modes:
resetMode | Reset mode |
void* MHEG5FileOrmRetrieve | ( | E_FS_ORIGIN | origin, |
S_STRING | location, | ||
S_STRING | name, | ||
U16BIT | priority, | ||
void * | userData, | ||
F_CB_Good | cbGood, | ||
F_CB_Fail | cbFail | ||
) |
Retrieve of a file. The file will be loaded and one of the callback functions called when request is resolved. This is intended to be used by the File System Acceleration code.
origin | Origin of file to retrieve. |
location | Path location of file to retrieve. |
name | Name of file to retrieve. |
priority | Cache priority with which to fetch the object. |
userData | User data to be returned in callback functions. |
cbGood | Pointer to callback function that will be called when the file is retreived. |
cbFail | Pointer to callback function that will be called when the file cannot be retrieved. |