You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
30 lines
734 B
30 lines
734 B
#ifndef __INTERFACE_CLASS_H__
|
|
#define __INTERFACE_CLASS_H__
|
|
|
|
#include <stdarg.h>
|
|
|
|
#include "class.h"
|
|
#include "interface.h"
|
|
|
|
typedef void (* fptr_ctor)(void *, va_list *);
|
|
typedef void (* fptr_dtor)(void *);
|
|
typedef void (* fptr_clone)(void *, const void * const);
|
|
|
|
extern const struct interface i_Class;
|
|
|
|
struct i_Class {
|
|
const struct interface * const _;
|
|
fptr_ctor ctor;
|
|
fptr_dtor dtor;
|
|
fptr_clone clone;
|
|
};
|
|
|
|
extern inline void * classNew(class_ptr, ...);
|
|
extern inline void classDelete(void **);
|
|
|
|
#define new(class,...) classNew(_##class, __VA_ARGS__)
|
|
#define delete(object) classDelete((void **)(object))
|
|
|
|
#endif // __INTERFACE_CLASS_H__
|
|
|
|
// vim: set ts=4 sw=4:
|