Main Page   Compound List   File List   Compound Members   File Members  

lib/gobj/modelmgr.h File Reference

Model manager. More...

#include <gobjconfig.h>
#include <gobj/context.h>
#include <gobj/id.h>
#include <gobj/model.h>
#include <gobj/stream.h>
#include <stdio.h>

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_writeModels (Gj_Ctx* ctx, Gj_Stream* stream)
 Write the model database to the given stream. More...

int Gj_modelmgr_readModels (Gj_Ctx* ctx, Gj_Stream* stream)
 Read model database entries form 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* name)
 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...

void Gj_modelmgr_createNamespace (Gj_Ctx* ctx, char* name)
 Create a new namespace. More...

void Gj_modelmgr_deleteNamespace (Gj_Ctx* ctx, char* name)
 Delete a namespace. More...

void Gj_modelmgr_dump (Gj_Ctx* ctx, FILE* stream)
 Print out information of this modelmgr to the given stream.


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_writeModels ( Gj_Ctx * ctx,
Gj_Stream * stream )
 

Write the model database to the given stream.

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_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.

void Gj_modelmgr_createNamespace ( Gj_Ctx * ctx,
char * name )
 

Create a new namespace.

NOT SUPPORTED YET.

void Gj_modelmgr_deleteNamespace ( Gj_Ctx * ctx,
char * name )
 

Delete a namespace.

NOT SUPPORTED YET.


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