Server 0.0.1
HTTP/REST server implementation

include/class/interface/class.h

Go to the documentation of this file.
00001 
00026 #ifndef __CLASS_INTERFACE_CLASS_H__
00027 #define __CLASS_INTERFACE_CLASS_H__
00028 
00029 #include <stdarg.h>
00030 
00031 #include "class/class.h"
00032 #include "class/interface.h"
00033 
00034 typedef int  (* fptr_ctor)(void *, va_list *);
00035 typedef void (* fptr_dtor)(void *);
00036 typedef void (* fptr_clone)(void *, void * const);
00037 
00038 extern const struct interface i_Class;
00039 
00040 struct i_Class {
00041         const struct interface * const _;
00042         fptr_ctor                      ctor;
00043         fptr_dtor                      dtor;
00044         fptr_clone                     clone;
00045 };
00046 
00047 extern void * classNew(class_ptr, ...);
00048 extern void   classDelete(void **);
00049 extern void * classClone(void *);
00050 
00051 #define new(class,...)          classNew(_##class, ##__VA_ARGS__)
00052 #define delete(object)          classDelete((void **)&(object))
00053 #define clone(object)           classClone((void *)(object))
00054 
00055 #endif // __CLASS_INTERFACE_CLASS_H__
00056 
00057 // vim: set ts=4 sw=4:
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines