OODuck
0.5
C Oriented Object framework with duck-typing support
|
Classic C types encapsulation. More...
Public Member Functions | |
void * | __constructor__ (void *self, void *ptr, size_t size) |
Build new value from pointer. More... | |
void | get (const void *self, void *dest, size_t size) |
Copy encapsulated object to dest . More... | |
void | set (void *self, void *src, size_t size) |
Encapsulate new object from src . More... | |
Public Member Functions inherited from Object | |
void * | ref (void *self) |
Increment object's reference counter. More... | |
void | unref (void *self) |
Decrement object's reference counter, if equals 0, delete the object. More... | |
bool | equal (const void *self, const void *other) |
Check objects equality. More... | |
Classic C types encapsulation.
Using memcpy()
to copy memory of C object to OODuck object. Using memcmp()
to determine equality.
void * __constructor__ | ( | void * | self, |
void * | ptr, | ||
size_t | size | ||
) |
Build new value from pointer.
self | Value instance. |
ptr | Pointer to the C object to copy. |
size | Size of the C object to copy. |
Calls Value::set()
.
void get | ( | const void * | self, |
void * | dest, | ||
size_t | size | ||
) |
Copy encapsulated object to dest
.
self | Value instance. |
dest | Destination (must be pre-allocated). |
size | Size of the C object. |
void set | ( | void * | self, |
void * | src, | ||
size_t | size | ||
) |
Encapsulate new object from src
.
self | Value instance. |
src | C object to copy. |
size | Size of the C object. |