Files
fx/core/include/blue/core/object.h

34 lines
907 B
C
Raw Normal View History

#ifndef BLUE_CORE_OBJECT_H_
#define BLUE_CORE_OBJECT_H_
2025-08-16 16:03:55 +01:00
#include <blue/core/misc.h>
#include <blue/core/stringstream.h>
#include <blue/core/type.h>
2025-08-16 16:03:55 +01:00
#define B_OBJECT_MAGIC 0xDECAFC0C0ABEEF13ULL
#define B_OBJECT(p) ((b_object *)(p))
#define B_TYPE_OBJECT (b_object_get_type())
struct b_stream;
typedef struct _b_object b_object;
typedef struct _b_object_class {
void (*to_string)(b_object *, struct b_stream *);
} b_object_class;
BLUE_API b_type b_object_get_type(void);
BLUE_API void *b_object_get_private(b_object *object, b_type type);
BLUE_API void *b_object_get_protected(b_object *object, b_type type);
BLUE_API void *b_object_get_interface(b_object *object, b_type type);
2025-08-16 16:03:55 +01:00
BLUE_API b_object *b_object_ref(b_object *p);
BLUE_API void b_object_unref(b_object *p);
2025-08-16 16:03:55 +01:00
BLUE_API b_object *b_object_create(b_type type);
BLUE_API void b_object_to_string(b_object *p, struct b_stream *out);
#endif