2021-09-08 21:25:52 +08:00
|
|
|
#include "PikaObj.h"
|
|
|
|
|
2021-09-10 17:49:56 +08:00
|
|
|
void _UpdateHandle(PikaObj* self) {
|
|
|
|
// override the handle function here
|
2021-09-08 21:25:52 +08:00
|
|
|
}
|
|
|
|
|
2021-09-10 17:49:56 +08:00
|
|
|
void _beforDinit(PikaObj* self) {
|
|
|
|
/* override in user code */
|
2021-09-08 21:25:52 +08:00
|
|
|
}
|
|
|
|
|
2021-09-10 17:49:56 +08:00
|
|
|
PikaObj* New_TinyObj(Args* args) {
|
|
|
|
PikaObj* self = pikaMalloc(sizeof(PikaObj));
|
2021-09-08 21:25:52 +08:00
|
|
|
|
2021-09-10 17:49:56 +08:00
|
|
|
/* List */
|
|
|
|
self->attributeList = New_args(NULL);
|
2021-09-08 21:25:52 +08:00
|
|
|
|
2021-09-10 17:49:56 +08:00
|
|
|
/* attribute */
|
|
|
|
obj_setPtr(self, "_ctx", self);
|
|
|
|
obj_setStr(self, "_n", "root");
|
2021-09-08 21:25:52 +08:00
|
|
|
|
2021-09-10 17:49:56 +08:00
|
|
|
/* load */
|
|
|
|
if (NULL != args) {
|
|
|
|
obj_load(self, args, "_n");
|
|
|
|
obj_load(self, args, "_ctx");
|
|
|
|
}
|
2021-09-08 21:25:52 +08:00
|
|
|
|
2021-09-10 17:49:56 +08:00
|
|
|
/* hard attribute */
|
|
|
|
return self;
|
2021-09-08 21:25:52 +08:00
|
|
|
}
|