python-on-a-chip online compiler
class.c File Reference
Class Object Type. More...
Go to the source code of this file.
Functions | |
PmReturn_t | class_new (pPmObj_t pattrs, pPmObj_t pbases, pPmObj_t pname, pPmObj_t *r_pclass) |
Creates a new Class object from the methods dict, bases tuple, and name string. | |
PmReturn_t | class_instantiate (pPmObj_t pclass, pPmObj_t *r_pobj) |
Returns an instance of the given class. | |
PmReturn_t | class_autobox (pPmObj_t *pobj) |
Autoboxes an object in place. | |
PmReturn_t | class_method (pPmObj_t pinstance, pPmObj_t pfunc, pPmObj_t *r_pmeth) |
Returns a method based on the given inputs. | |
PmReturn_t | class_getAttr (pPmObj_t pobj, pPmObj_t pname, pPmObj_t *r_pobj) |
Returns the first attribute named __init__ in the class' inheritance tree. | |
uint8_t | class_isSubclass (pPmObj_t ptest_class, pPmObj_t pbase_class) |
Returns a C boolean if the base class is found in the inheritance tree of the test class. |
Detailed Description
Class Object Type.
Class object type operations.
Definition in file class.c.
Function Documentation
PmReturn_t class_autobox | ( | pPmObj_t * | pobj ) |
PmReturn_t class_getAttr | ( | pPmObj_t | pobj, |
pPmObj_t | pname, | ||
pPmObj_t * | r_pobj | ||
) |
PmReturn_t class_instantiate | ( | pPmObj_t | pclass, |
pPmObj_t * | r_pobj | ||
) |
Returns a C boolean if the base class is found in the inheritance tree of the test class.
NOTE: This function is recursive.
- Parameters:
-
ptest_class ptr to class whose inheritance tree is searched pbase_class ptr to class to look for
- Returns:
- Returns C_TRUE if pbase_class is found in the inheritance tree; C_FALSE otherwise.
PmReturn_t class_method | ( | pPmObj_t | pinstance, |
pPmObj_t | pfunc, | ||
pPmObj_t * | r_pmeth | ||
) |
PmReturn_t class_new | ( | pPmObj_t | pmeths, |
pPmObj_t | pbases, | ||
pPmObj_t | pname, | ||
pPmObj_t * | r_pclass | ||
) |
Generated on Tue Jul 12 2022 23:13:47 by 1.7.2