CX Framework
Cross-platform C utility framework
Loading...
Searching...
No Matches
objclass.h File Reference

Class definitions and instance management for the object system. More...

Go to the source code of this file.

Data Structures

struct  ObjClassInfo
 
struct  ClassSet
 
struct  ObjInst
 
struct  ObjInst_WeakRef
 

Macros

#define objClassInfoName(cname)   cname##_clsinfo
 
#define Weak(clsname)   clsname##_WeakRef
 
#define ObjInst(inst)   ((ObjInst*)(unused_noeval(&((inst)->_is_ObjInst)), (inst)))
 
#define ObjInst_WeakRef(ref)    ((ObjInst_WeakRef*)(unused_noeval(&((ref)->_is_ObjInst_WeakRef)), (ref)))
 
#define objInstBase(inst)   ObjInst(inst)
 
#define objWeakRefBase(ref)   ObjInst_WeakRef(ref)
 
#define objClsInfo(inst)   (inst->_clsinfo)
 
#define objAcquire(inst)   (_objAcquire(objInstBase(inst)), (inst))
 
#define objRelease(pinst)    (unused_noeval(&((*(pinst))->_is_ObjInst)), _objRelease((ObjInst**)(pinst)))
 
#define objClassIf(clsname, ifname)    ((ifname*)_objClassIf(&objClassInfoName(clsname), objIfBase(&objIfTmplName(ifname))))
 
#define objInstIf(inst, ifname)    ((ifname*)_objInstIf(objInstBase(inst), objIfBase(&objIfTmplName(ifname))))
 
#define objGetWeak(clsname, inst)   ((Weak(clsname)*)_objGetWeak((ObjInst*)clsname(inst)))
 
#define objCloneWeak(ref)   (_objCloneWeak(objWeakRefBase(ref)))
 
#define objDestroyWeak(pref)    (unused_noeval(&((*(pref))->_is_ObjInst_WeakRef)), _objDestroyWeak((ObjInst_WeakRef**)(pref)))
 
#define objAcquireFromWeak(clsname, ref)    ((clsname*)_objAcquireFromWeak((ObjInst_WeakRef*)Weak(clsname)(ref)))
 
#define objDynCast(clsname, inst)    ((clsname*)_objDynCast(objInstBase(inst), &objClassInfoName(clsname)))
 
#define objAcquireFromWeakDyn(clsname, ref)    ((clsname*)_objAcquireFromWeakDyn(objWeakRefBase(ref), &objClassInfoName(clsname)))
 

Typedefs

typedef struct ObjClassInfo ObjClassInfo
 
typedef struct ObjInst ObjInst
 
typedef struct ClassSet ClassSet
 
typedef struct ObjInst_WeakRef ObjInst_WeakRef
 

Functions

ObjClassInfoclassSetFind (const ClassSet *cs, strref name)
 
void _objDestroy (ObjInst *inst)
 

Detailed Description

Class definitions and instance management for the object system.

Definition in file objclass.h.