BarryServer : Git

All the code for all my projects
// BarryServer : Git / Nucleus / blob / db9a0c170420002cff8cade7e3e598ac9d6fb25a / include / nucleus / object.h

// Related

Nucleus

Barry Basic object manager 5201ba5 (3 years, 3 months ago)
#ifndef _NUCLEUS_OBJECT_H
#define _NUCLEUS_OBJECT_H

typedef struct ObjectType ObjectType;
typedef struct Object Object;

/* Object Type */
struct ObjectType {
	unsigned int count;
	unsigned int usage;
	void *(*new)(void);
	void (*delete)(Object *);
};

/* Object */
struct Object {
	ObjectType *type;
	unsigned int usage;
};

void *get(void *addr);
void put(void *addr);
void *new(ObjectType *type);

#endif