BarryServer : Git

All the code for all my projects
// BarryServer : Git / Nucleus / blob / 5201ba5bba23ff80513a8e177eb05be613f85e88 / 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