server 0.0.1
basicserverinfrastructure

include/interface/class.h

Go to the documentation of this file.
00001 #ifndef __INTERFACE_CLASS_H__
00002 #define __INTERFACE_CLASS_H__
00003 
00004 #include <stdarg.h>
00005 
00006 #include "class.h"
00007 #include "interface.h"
00008 
00009 typedef void (* fptr_ctor)(void *, va_list *);
00010 typedef void (* fptr_dtor)(void *);
00011 typedef void (* fptr_clone)(void *, void * const);
00012 
00013 extern const struct interface i_Class;
00014 
00015 struct i_Class {
00016         const struct interface * const _;
00017         fptr_ctor                      ctor;
00018         fptr_dtor                      dtor;
00019         fptr_clone                     clone;
00020 };
00021 
00022 extern void * classNew(class_ptr, ...);
00023 extern void   classDelete(void **);
00024 extern void * classClone(void *);
00025 
00026 #define new(class,...)          classNew(_##class, ##__VA_ARGS__)
00027 #define delete(object)          classDelete((void **)(object))
00028 #define clone(object)           classClone((void *)(object))
00029 
00030 #endif // __INTERFACE_CLASS_H__
00031 
00032 // vim: set ts=4 sw=4:
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Defines