Implement of Prototype library API, defined in prototype.h.
More...
#include <stdlib.h>
#include "dp_util.h"
#include "prototype_factory.h"
Go to the source code of this file.
Implement of Prototype library API, defined in prototype.h.
Definition in file prototype_manager.c.
◆ PROTOTYPE_LOCK
#define PROTOTYPE_LOCK |
( |
|
this | ) |
DPUTIL_LOCK(this->lock); |
◆ prototype_pop
◆ prototype_pull
◆ prototype_push
◆ PROTOTYPE_UNLOCK
◆ prototype_clone()
Clone base pointer by using PrototypeFactory class.
- Parameters
-
[in] | this | PrototypeFactory instance returned at prototype_register. |
- Returns
- cloned data or NULL
Definition at line 114 of file prototype_manager.c.
◆ prototype_free()
Free cloned pointer.
- Parameters
-
[in] | this | PrototypeFactory instance returned at prototype_register. |
[in] | cloned_data | free data returned at prototype_clone. |
- Returns
- none
Definition at line 126 of file prototype_manager.c.
◆ prototype_manager_free()
free class handle
- Parameters
-
[in] | this | PrototypeManager instance returned at prototype_manager_new, |
- Returns
- none
Definition at line 55 of file prototype_manager.c.
◆ prototype_manager_new()
Create PrototypeManager class.
- Parameters
-
[in] | is_threadsafe | if !=0, ensure threadsafe to create new class instace |
- Return values
-
!=NULL | this class handle |
NULL | error |
Definition at line 35 of file prototype_manager.c.
◆ prototype_register()
Register PrototypeFactory class.
- Parameters
-
[in] | this | PrototypeManager instance returned at prototype_manager_new, |
[in] | base | base data. |
[in] | base_length | base data length |
[in] | factory_method | factory method ( if NULL or member is NULL, use default. It's better to use free_basedata) |
- Return values
-
!NULL | PrototypeFactory instance |
NULL | error |
- Note
- Please keep instance of base. This will free into prototype_unregister API by using free_basedata
Definition at line 74 of file prototype_manager.c.
◆ prototype_unregister()
Unregister PrototypeFactory class.
- Parameters
-
[in] | this | PrototypeManager instance returned at prototype_manager_new, |
[in] | factory | PrototypeFactory instance returned at prototype_register, |
- Returns
- none
Definition at line 102 of file prototype_manager.c.