Permalink
Find file
Fetching contributors…
Cannot retrieve contributors at this time
59 lines (39 sloc) 1.16 KB
#ifndef __MOP_CLASS_H__
#define __MOP_CLASS_H__
#define MOP_MAX_INSTANCE_METACLASS_LENGTH 256
#define MOP_MAX_METHOD_METACLASS_LENGTH 256
struct _mop_class {
mop_state *state;
char *name;
mop_attribute **attributes;
unsigned int attributes_size;
unsigned int attributes_max;
mop_method **methods;
unsigned int methods_size;
unsigned int methods_max;
char instance_metaclass[MOP_MAX_INSTANCE_METACLASS_LENGTH];
HV *method_map; /* is there a lighter way to do this? */
mop_instance *meta_instance;
char method_metaclass[MOP_MAX_METHOD_METACLASS_LENGTH];
};
SV *
mop_class_create(char *name, size_t name_len);
void
mop_class_destroy(mop_class *c);
SV *
mop_class_get_metaclass_by_name(char *name);
void
mop_class_add_method(mop_class *c, char *name, SV *sv);
SV *
mop_class_associate_metaclass( mop_class *c, char *name );
void
mop_class_superclasses( mop_class *c, AV *isa );
SV *
mop_class_construct_instance(mop_class *c, HV *params);
mop_instance *
mop_class_get_meta_instance( mop_class *c );
AV *
mop_class_linearized_isa( mop_class *c );
HV *
mop_class_get_method_map( mop_class *c );
#endif /* __MOP_CLASS_H__ */