Typedefs | |
typedef xf_instance_s | xf_instance_t |
Instance Class. | |
typedef xf_buffer_s | xf_buffer_t |
Buffer for serializing to memory. | |
Functions | |
xf_instance_t * | xf_instance_new (void *pobj, xf_refl_t *prefl) |
Constructor. | |
void * | xf_instance_cloneobj (xf_instance_t *pinst) |
object clone of instance | |
void * | xf_instance_rcloneobj (xf_instance_t *pinst) |
recursive object clone of instance | |
int | xf_instance_cpobj (void *ptarget, xf_instance_t *pinst) |
object copy of instance to memory area | |
int | xf_instance_rcpobj (void *ptarget, xf_instance_t *pinst) |
recursive object copy of instance to memory | |
int | xf_instance_free (xf_instance_t *pinst) |
Destructor. | |
int | xf_instance_rfree (xf_instance_t *pinst) |
Destructor. | |
int | xf_instance_obj_free (xf_instance_t *pinst) |
Destructor. | |
int | xf_instance_obj_ofree (xf_instance_t *pinst) |
Destructor. | |
int | xf_instance_obj_rfree (xf_instance_t *pinst) |
Destructor. | |
int | xf_instance_obj_dfree (xf_instance_t *pinst) |
Destructor. | |
int | xf_instance_obj_drfree (xf_instance_t *pinst) |
Destructor. | |
int | xf_instance_setuserdata (xf_instance_t *pinst, void *userdata) |
set userdata | |
void * | xf_instance_getuserdata (xf_instance_t *pinst) |
get userdata | |
xf_refl_t * | xf_instance_getrefl (xf_instance_t *pinst) |
get reflection | |
void * | xf_instance_getobj (xf_instance_t *pinst) |
get instance object | |
void * | xf_instance_setobj (xf_instance_t *pinst, void *pobj) |
set instance obj | |
xf_buffer_t * | xf_buffer_new (char *adr, int size) |
Constructor. | |
void | xf_buffer_free (xf_buffer_t *pb) |
Destructor. | |
char * | xf_buffer_getadr (xf_buffer_t *pb) |
return memory adress of buffer | |
int | xf_buffer_reset (xf_buffer_t *pb) |
get length | |
int | xf_instance_write (xf_instance_t *pinst, int fd, xf_buffer_t *pbuf, int openflag, int closeflag) |
serializes an object according to its reflection to stream or buffer |
typedef struct xf_buffer_s xf_buffer_t |
Buffer for serializing to memory.
A buffer for serializing an instance to memory
typedef struct xf_instance_s xf_instance_t |
Instance Class.
instance of an object consisting of object memory, some arbritrary userdata and class reflection
void xf_buffer_free | ( | xf_buffer_t * | pb | ) |
Destructor.
frees the buffer object
pb | handle to buffer object |
char* xf_buffer_getadr | ( | xf_buffer_t * | pb | ) |
return memory adress of buffer
pb | handle to buffer object |
xf_buffer_t* xf_buffer_new | ( | char * | adr, | |
int | size | |||
) |
Constructor.
adr | pointer to memory for buffer size of memory buffer |
int xf_buffer_reset | ( | xf_buffer_t * | pb | ) |
get length
get the length of used buffer object and resets it to zero for reuse
pb | handle to buffer object |
void* xf_instance_cloneobj | ( | xf_instance_t * | pinst | ) |
object clone of instance
clones an object and all resources due to reflection given by instance
pinst | Instance to clone |
int xf_instance_cpobj | ( | void * | ptarget, | |
xf_instance_t * | pinst | |||
) |
object copy of instance to memory area
copy an object given by instance to a memory region, references in the instance object are allocated and cloned on heap
ptarget | Memory where instance object is copied | |
pinst | Instance to copy |
int xf_instance_free | ( | xf_instance_t * | pinst | ) |
Destructor.
frees only memory of instance, not of object
pinst | Instance to free |
void* xf_instance_getobj | ( | xf_instance_t * | pinst | ) |
get instance object
pinst | Instance to get Object from |
xf_refl_t* xf_instance_getrefl | ( | xf_instance_t * | pinst | ) |
get reflection
pinst | Instance to get the reflection from |
void* xf_instance_getuserdata | ( | xf_instance_t * | pinst | ) |
get userdata
pinst | Instance to get Userdata from |
xf_instance_t* xf_instance_new | ( | void * | pobj, | |
xf_refl_t * | prefl | |||
) |
Constructor.
creates an instance of object pobj and its reflection
pobj | Object of instance | |
prefl | Reflection of instantiated class |
int xf_instance_obj_dfree | ( | xf_instance_t * | pinst | ) |
Destructor.
frees all resources depending on object according to its reflection but not the given instance or object itself
pinst | Instance to free |
int xf_instance_obj_drfree | ( | xf_instance_t * | pinst | ) |
Destructor.
frees all resources depending on object according to its reflection and recursively all depending object instances and their resources but not the given instance or object itself
pinst | Instance to free |
int xf_instance_obj_free | ( | xf_instance_t * | pinst | ) |
Destructor.
frees object and all object resources according to its reflection but not the instance itself
pinst | Instance to free |
int xf_instance_obj_ofree | ( | xf_instance_t * | pinst | ) |
Destructor.
frees object of instance without depending resources or instances
pinst | Instance to free |
int xf_instance_obj_rfree | ( | xf_instance_t * | pinst | ) |
Destructor.
frees object and all object resources according to its reflection and recursively all depending object instances and their resources but not the given instance itself
pinst | Instance to free |
void* xf_instance_rcloneobj | ( | xf_instance_t * | pinst | ) |
recursive object clone of instance
clones an object and all resources due to reflection and recursively all members which are instances itself, i.e. of type object given by instance
pinst | Instance to clone |
int xf_instance_rcpobj | ( | void * | ptarget, | |
xf_instance_t * | pinst | |||
) |
recursive object copy of instance to memory
copy an object given by instance to a memory region, references in the instance object are allocated and cloned on heap
ptarget | Memory where instance object is copied | |
pinst | Instance to copy |
int xf_instance_rfree | ( | xf_instance_t * | pinst | ) |
Destructor.
frees all memory related to instance, object and recursively depending other instances
pinst | Instance to free |
void* xf_instance_setobj | ( | xf_instance_t * | pinst, | |
void * | pobj | |||
) |
set instance obj
pinst | Instance to set object for | |
pobject | pointer to object |
int xf_instance_setuserdata | ( | xf_instance_t * | pinst, | |
void * | userdata | |||
) |
set userdata
pinst | Instance to set userdata to | |
userdata | Userdata |
int xf_instance_write | ( | xf_instance_t * | pinst, | |
int | fd, | |||
xf_buffer_t * | pbuf, | |||
int | openflag, | |||
int | closeflag | |||
) |
serializes an object according to its reflection to stream or buffer
pinst | Instance to serialize | |
fd | Filedescriptor to write to | |
pbuf | Buffer to write to, if equal null write to stream | |
openflag | set true for first object written to stream | |
closeflag | set true for last object written to stream |