40 lines
957 B
C
40 lines
957 B
C
#ifndef _TYPE_H_
|
|
#define _TYPE_H_
|
|
|
|
#include <blue/core/btree.h>
|
|
#include <blue/object/type.h>
|
|
#include <stddef.h>
|
|
|
|
enum b_type_category {
|
|
B_TYPE_NONE = 0,
|
|
B_TYPE_CLASS,
|
|
B_TYPE_INTERFACE,
|
|
};
|
|
|
|
struct b_type_component {
|
|
struct b_btree_node c_node;
|
|
struct b_queue_entry c_entry;
|
|
const struct b_type_registration *c_type;
|
|
|
|
size_t c_class_data_offset, c_class_data_size;
|
|
size_t c_instance_private_data_offset, c_instance_private_data_size;
|
|
size_t c_instance_protected_data_offset, c_instance_protected_data_size;
|
|
};
|
|
|
|
struct b_type_registration {
|
|
enum b_type_category r_category;
|
|
struct b_btree_node r_node;
|
|
const b_type_info *r_info;
|
|
struct _b_class *r_class;
|
|
struct b_btree r_components;
|
|
struct b_queue r_class_hierarchy;
|
|
|
|
size_t r_instance_size, r_class_size;
|
|
};
|
|
|
|
extern struct b_type_registration *b_type_get_registration(b_type id);
|
|
extern struct b_type_component *b_type_get_component(
|
|
const b_btree *tree, const union b_type *key);
|
|
|
|
#endif
|