Main Page   Compound List   File List   Compound Members   File Members  

lib/modelmgr.c File Reference

Model manager. More...

#include "gobj/modelmgr.h"
#include "gobj/model.h"
#include "gobj/lang.h"
#include "gobj/errors.h"
#include "gobj/utils.h"

Compounds

struct  gj_Regmodel_struct
struct  Gj_Modelmgr_struct

Typedefs

typedef struct gj_Regmodel_struct gj_Regmodel
 Regmodel structure typedef.


Functions

void Gj_modelmgr_new (Gj_Ctx* ctx)
 Create a new model manager.

int Gj_modelmgr_create (Gj_Ctx* ctx, Gj_Stream* stream)
 Create a model manager from a stream. More...

int Gj_modelmgr_write (Gj_Ctx* ctx, Gj_Stream* stream)
 Write the model manager to a stream. More...

int Gj_modelmgr_delete (Gj_Ctx* ctx)
 Destroy the model manager. More...

int Gj_modelmgr_readModels (Gj_Ctx* ctx, Gj_Stream* stream)
 Read model database entries form the given stream. More...

int Gj_modelmgr_writeModels (Gj_Ctx* ctx, Gj_Stream* stream)
 Write the model database to the given stream. More...

int Gj_modelmgr_clearModels (Gj_Ctx* ctx)
 Clear the model database. More...

Gj_IdGj_modelmgr_getModelId (Gj_Ctx* ctx, Gj_Path* path)
 Get the model id of a model given by its path. More...

Gj_ModelGj_modelmgr_getModel (Gj_Ctx* ctx, Gj_Id* id)
 Get a model ptr for a given id. More...

void Gj_modelmgr_releaseModel (Gj_Ctx* ctx, Gj_Model* model)
 Release a model.

int Gj_modelmgr_registerModel (Gj_Ctx* ctx, Gj_Model* model)
 Register a new model. More...

Gj_ModelGj_modelmgr_unregisterModel (Gj_Ctx* ctx, Gj_Id* id)
 Unregister a model. More...


Detailed Description

Model manager.


Function Documentation

int Gj_modelmgr_create ( Gj_Ctx * ctx,
Gj_Stream * stream )
 

Create a model manager from a stream.

Returns:
0 on success, -1 otherwise.

int Gj_modelmgr_write ( Gj_Ctx * ctx,
Gj_Stream * stream )
 

Write the model manager to a stream.

Returns:
0 on success, -1 otherwise.

int Gj_modelmgr_delete ( Gj_Ctx * ctx )
 

Destroy the model manager.

Returns:
0 on success, -1 otherwise.

int Gj_modelmgr_readModels ( Gj_Ctx * ctx,
Gj_Stream * stream )
 

Read model database entries form the given stream.

Read models are added to the database.

Returns:
0 on success, -1 otherwise.

int Gj_modelmgr_writeModels ( Gj_Ctx * ctx,
Gj_Stream * stream )
 

Write the model database to the given stream.

Returns:
0 on success, -1 otherwise.

int Gj_modelmgr_clearModels ( Gj_Ctx * ctx )
 

Clear the model database.

Attention:
This function works like _delete functions, i.e. it deletes all models even if errors occur.

Returns:
0 on success, -1 otherwise.

Gj_Id * Gj_modelmgr_getModelId ( Gj_Ctx * ctx,
Gj_Path * path )
 

Get the model id of a model given by its path.

The returned id is STILL OWNED by the manager.

Returns:
The id ptr on success, 0 otherwise.

Gj_Model * Gj_modelmgr_getModel ( Gj_Ctx * ctx,
Gj_Id * id )
 

Get a model ptr for a given id.

The returned model is STILL OWNED by the manager.

Returns:
the model ptr on success, 0 otherwise.

int Gj_modelmgr_registerModel ( Gj_Ctx * ctx,
Gj_Model * model )
 

Register a new model.

The model is NOT DUPLICATED, the modelmgr overtakes the OWNERSHIP of it.

Returns:
0 on success, -1 otherwise.

Gj_Model * Gj_modelmgr_unregisterModel ( Gj_Ctx * ctx,
Gj_Id * id )
 

Unregister a model.

The model itsself will not be deleted, rather a pointer to it is returned.

Returns:
The pointer to the model success, 0 otherwise.


Generated at Fri Aug 17 18:28:58 2001 for Gobj by doxygen1.2.1 written by Dimitri van Heesch, © 1997-2000