Main Page   Compound List   File List   Compound Members   File Members  

lib/object.c File Reference

Common object type implementation. More...

#include "gobj/object.h"
#include "gobj/model.h"
#include "gobj/errors.h"
#include "gobj/lang.h"
#include "gobj/viewer.h"
#include "gobj/ids.h"
#include "gobj/utils.h"

Functions

Gj_ObjectGj_object_new (Gj_Ctx* ctx, Gj_Id* type, char* name)
 Create a new object. More...

Gj_ObjectGj_object_duplicate (Gj_Ctx* ctx, Gj_Object* obj)
 Create a new object as a copy of existing object. More...

Gj_ObjectGj_object_create (Gj_Ctx* ctx, Gj_Stream* stream, Gj_Object* update)
 Create a object form a stream. More...

int Gj_object_delete (Gj_Ctx* ctx, Gj_Object* ptr)
 Delete an object. More...

int Gj_object_deleteLocal (Gj_Ctx* ctx, Gj_Object* ptr)
 Delete an object without following links. More...

int Gj_object_write (Gj_Ctx* ctx, Gj_Object* obj, Gj_Stream* stream)
 Write an object to a stream. More...

int Gj_object_release (Gj_Ctx* ctx, Gj_Object* obj)
 Releases an object. More...

void Gj_object_markTemp (Gj_Object* obj)
 Mark the object as temporary. More...

Gj_Bool Gj_object_isTemp (Gj_Object* obj)
 Get the temp flag. More...

int Gj_object_getName (Gj_Ctx* ctx, Gj_Object* obj, char** name)
 Get the name of the object. More...

int Gj_object_setName (Gj_Ctx* ctx, Gj_Object* obj, char* name)
Gj_Nativetype Gj_object_getNativetype (Gj_Ctx* ctx, Gj_Object* obj)
int Gj_object_setByName (Gj_Ctx* ctx, Gj_Object* obj, char* name, Gj_Object* value)
int Gj_object_setByNumber (Gj_Ctx* ctx, Gj_Object* obj, int index, Gj_Object* value)
int Gj_object_getByName (Gj_Ctx* ctx, Gj_Object* obj, char* name, Gj_Object** value, Gj_Bool convert)
int Gj_object_getByNumber (Gj_Ctx* ctx, Gj_Object* obj, int index, Gj_Object** value, Gj_Bool convert)
int Gj_object_nextChild (Gj_Ctx* ctx, Gj_Object* obj, Gj_Object** last, Gj_Bool convert)
int Gj_object_getChildCount (Gj_Ctx* ctx, Gj_Object* obj)
int Gj_object_add (Gj_Ctx* ctx, Gj_Object* obj, Gj_Object* value)
int gj_object_add (Gj_Ctx* ctx, Gj_Object* obj, Gj_Object* value)
int Gj_object_removeByNumber (Gj_Ctx* ctx, Gj_Object* obj, int index)
Gj_ObjectGj_object_convert (Gj_Ctx* ctx, Gj_Object* obj, Gj_Id* type)
int Gj_object_addViewer (Gj_Ctx* ctx, Gj_Object* obj, Gj_Viewer* viewer)
int Gj_object_deleteViewers (Gj_Ctx* ctx, Gj_Object* obj)


Detailed Description

Common object type implementation.


Function Documentation

Gj_Object * Gj_object_new ( Gj_Ctx * ctx,
Gj_Id * type,
char * name )
 

Create a new object.

Parameters:
ctx   The context.
type   Model id.
name   Object name (is being DUPLICATED, may be 0).

Returns:
The pointer to the new object on success, 0 otherwise.

Gj_Object * Gj_object_duplicate ( Gj_Ctx * ctx,
Gj_Object * obj )
 

Create a new object as a copy of existing object.

Parameters:
ctx   The context.
obj   The source object.

Returns:
The pointer to the new object on success, 0 otherwise.

Gj_Object * Gj_object_create ( Gj_Ctx * ctx,
Gj_Stream * stream,
Gj_Object * update )
 

Create a object form a stream.

Parameters:
ctx   The context.
stream   The stream.
update   A pointer to the object that is to be called on update (may be 0).

Returns:
The pointer to the object on success, 0 otherwise.

int Gj_object_delete ( Gj_Ctx * ctx,
Gj_Object * ptr )
 

Delete an object.

Parameters:
ctx   The context.
ptr   The object.

Returns:
0 on success, -1 otherwise.

int Gj_object_deleteLocal ( Gj_Ctx * ctx,
Gj_Object * ptr )
 

Delete an object without following links.

Parameters:
ctx   The context.
ptr   The object.

Returns:
0 on success, -1 otherwise.

int Gj_object_write ( Gj_Ctx * ctx,
Gj_Object * obj,
Gj_Stream * stream )
 

Write an object to a stream.

Parameters:
ctx   The context.
obj   The object.
stream   The stream.

Returns:
0 on success, -1 otherwise.

int Gj_object_release ( Gj_Ctx * ctx,
Gj_Object * obj )
 

Releases an object.

Release one shared lock. Destroy the object if that was the last shared lock and it is temporary.

Parameters:
ctx   The context.
obj   The object.

Returns:
0 on success, -1 otherwise.

void Gj_object_markTemp ( Gj_Object * obj )
 

Mark the object as temporary.

Does not follow links.

Parameters:
obj   The object.

Gj_Bool Gj_object_isTemp ( Gj_Object * obj )
 

Get the temp flag.

Parameters:
obj   The object.

Returns:
Whether the object is temporary or not.

int Gj_object_getName ( Gj_Ctx * ctx,
Gj_Object * obj,
char ** name )
 

Get the name of the object.

Returns the name in *name, this value is STILL OWNED by the object.

Returns:
0 on success, -1 otherwise.


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