class.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016 #ifndef __CLASS_H__
00017 #define __CLASS_H__
00018
00031 typedef struct PmClass_s
00032 {
00034 PmObjDesc_t od;
00035
00037 pPmDict_t cl_attrs;
00038
00040 pPmTuple_t cl_bases;
00041 } PmClass_t,
00042 *pPmClass_t;
00043
00045 typedef struct PmInstance_s
00046 {
00048 PmObjDesc_t od;
00049
00051 pPmClass_t cli_class;
00052
00054 pPmDict_t cli_attrs;
00055 } PmInstance_t,
00056 *pPmInstance_t;
00057
00059 typedef struct PmMethod_s
00060 {
00062 PmObjDesc_t od;
00063
00065 pPmInstance_t m_instance;
00066
00068 pPmFunc_t m_func;
00069
00071 pPmDict_t m_attrs;
00072 } PmMethod_t,
00073 *pPmMethod_t;
00074
00075
00086 PmReturn_t class_new(pPmObj_t pmeths, pPmObj_t pbases, pPmObj_t pname,
00087 pPmObj_t *r_pclass);
00088
00095 PmReturn_t class_instantiate(pPmObj_t pclass, pPmObj_t *r_pobj);
00096
00105 PmReturn_t class_method(pPmObj_t pinstance, pPmObj_t pfunc, pPmObj_t *r_pmeth);
00106
00115 PmReturn_t class_getAttr(pPmObj_t pobj, pPmObj_t pname, pPmObj_t *r_pobj);
00116
00126 uint8_t class_isSubclass(pPmObj_t ptest_class, pPmObj_t pbase_class);
00127
00128 #endif