28 #define prototype_push(this, data) dputil_list_push((DPUtilList)this, (DPUtilListData)data); 29 #define prototype_pull(this, data) dputil_list_pull((DPUtilList)this, (DPUtilListData)data); 30 #define prototype_pop(this) (PrototypeFactory)dputil_list_pop((DPUtilList)this); 32 #define PROTOTYPE_LOCK(this) DPUTIL_LOCK(this->lock); 33 #define PROTOTYPE_UNLOCK DPUTIL_UNLOCK 43 instance->
lock = malloc(
sizeof(*(instance->
lock)));
49 pthread_mutex_init(instance->
lock, NULL);
56 pthread_mutex_t *lock=NULL;
76 if(!
this || !base || base_length==0) {
81 factory = calloc(1,
sizeof(*factory));
95 factory->
lock=this->lock;
103 if(!
this || !factory) {
127 if(!
this || !cloned_data) {
PrototypeFactory methods interface definition, to set prototype_register.
PrototypeManager prototype_manager_new(int is_threadsafe)
Create PrototypeManager class.
PrototypeFactoryInstance instance
void prototype_unregister(PrototypeManager this, PrototypeFactory factory)
Unregister PrototypeFactory class.
PrototypeManager class member definition, defined in prototype_manager.c.
void prototype_factory_instance_free(PrototypeFactoryInstance this)
free
#define prototype_push(this, data)
void(* free)(EventInstance this)
void prototype_manager_free(PrototypeManager this)
free class handle
prototype_factory_instance, PrototypeFactory class instance definition
void * prototype_factory_instance_clone_data(PrototypeFactoryInstance this)
clone data
void prototype_factory_instance_free_data(PrototypeFactoryInstance this, void *data)
free data
PrototypeFactoryInstance prototype_factory_instance_new(void *base, size_t base_length, prototype_factory_method_t *factory_method)
new
PrototypeFactory prototype_register(PrototypeManager this, void *base, size_t base_length, prototype_factory_method_t *factory_method)
Register PrototypeFactory class.
This is API for PrototypeFactoryInstance class.
#define DEBUG_ERRPRINT(...)
#define prototype_pop(this)
#define PROTOTYPE_LOCK(this)
void * prototype_clone(PrototypeFactory this)
Clone base pointer by using PrototypeFactory class.
#define prototype_pull(this, data)
PrototypeFactory methods interface definition, to set prototype_register.
void prototype_free(PrototypeFactory this, void *cloned_data)
Free cloned pointer.