## basic generators
-sub generate_accessor_method {
- Carp::cluck('The generate_accessor_method method has been made private.'
- . " The public version is deprecated and will be removed in a future release.\n");
- shift->_generate_accessor_method_basic;
-}
-
sub _generate_accessor_method_basic {
my $attr = (shift)->associated_attribute;
return sub {
};
}
-sub generate_reader_method {
- Carp::cluck('The generate_reader_method method has been made private.'
- . " The public version is deprecated and will be removed in a future release.\n");
- shift->_generate_reader_method_basic;
-}
-
sub _generate_reader_method_basic {
my $attr = (shift)->associated_attribute;
return sub {
};
}
-sub generate_writer_method {
- Carp::cluck('The generate_writer_method method has been made private.'
- . " The public version is deprecated and will be removed in a future release.\n");
- shift->_generate_writer_method_basic;
-}
-
sub _generate_writer_method_basic {
my $attr = (shift)->associated_attribute;
return sub {
};
}
-sub generate_predicate_method {
- Carp::cluck('The generate_predicate_method method has been made private.'
- . " The public version is deprecated and will be removed in a future release.\n");
- shift->_generate_predicate_method_basic;
-}
-
sub _generate_predicate_method_basic {
my $attr = (shift)->associated_attribute;
return sub {
};
}
-sub generate_clearer_method {
- Carp::cluck('The generate_clearer_method method has been made private.'
- . " The public version is deprecated and will be removed in a future release.\n");
- shift->_generate_clearer_method_basic;
-}
-
sub _generate_clearer_method_basic {
my $attr = (shift)->associated_attribute;
return sub {
$self->{'body'} = $self->_generate_constructor_method();
}
-
-sub generate_constructor_method {
- Carp::cluck('The generate_constructor_method method has been made private.'
- . " The public version is deprecated and will be removed in a future release.\n");
- shift->_generate_constructor_method;
-}
-
sub _generate_constructor_method {
my ($self) = @_;
extern SV *mop_method_metaclass;
extern SV *mop_associated_metaclass;
+extern SV *mop_associated_attribute;
extern SV *mop_wrap;
extern SV *mop_methods;
extern SV *mop_name;
BOOT:
INSTALL_SIMPLE_READER_WITH_KEY(Class, get_attribute_map, attributes);
- /* INSTALL_SIMPLE_READER_WITH_KEY(Class, _method_map, methods); */
INSTALL_SIMPLE_READER(Class, attribute_metaclass);
- INSTALL_SIMPLE_READER(Class, method_metaclass);
- INSTALL_SIMPLE_READER(Class, wrapped_method_metaclass);
INSTALL_SIMPLE_READER(Class, instance_metaclass);
INSTALL_SIMPLE_READER(Class, immutable_trait);
INSTALL_SIMPLE_READER(Class, constructor_name);
SV *mop_method_metaclass;
SV *mop_associated_metaclass;
+SV *mop_associated_attribute;
SV *mop_wrap;
SV *mop_methods;
SV *mop_name;
}
EXTERN_C XS(boot_Class__MOP__Package);
+EXTERN_C XS(boot_Class__MOP__Class);
EXTERN_C XS(boot_Class__MOP__Attribute);
-EXTERN_C XS(boot_Class__MOP__Method);
EXTERN_C XS(boot_Class__MOP__Instance);
+EXTERN_C XS(boot_Class__MOP__Method);
EXTERN_C XS(boot_Class__MOP__Method__Accessor);
EXTERN_C XS(boot_Class__MOP__Method__Constructor);
BOOT:
mop_method_metaclass = MAKE_KEYSV(method_metaclass);
- mop_wrap = MAKE_KEYSV(wrap);
mop_associated_metaclass = MAKE_KEYSV(associated_metaclass);
+ mop_associated_attribute = MAKE_KEYSV(associated_attribute);
+ mop_wrap = MAKE_KEYSV(wrap);
mop_methods = MAKE_KEYSV(methods);
mop_name = MAKE_KEYSV(name);
mop_body = MAKE_KEYSV(body);
mop_can = MAKE_KEYSV(can);
MOP_CALL_BOOT (boot_Class__MOP__Package);
+ MOP_CALL_BOOT (boot_Class__MOP__Class);
MOP_CALL_BOOT (boot_Class__MOP__Attribute);
MOP_CALL_BOOT (boot_Class__MOP__Instance);
MOP_CALL_BOOT (boot_Class__MOP__Method);
method_slot = *hv_fetch(map, method_name, method_name_len, TRUE);
if ( SvOK(method_slot) ) {
- SV *const body = mop_call0(aTHX_ method_slot, KEY_FOR(body)); /* $method_object->body() */
+ SV *const body = mop_call0(aTHX_ method_slot, mop_body); /* $method_object->body() */
if ( SvROK(body) && ((CV *) SvRV(body)) == cv ) {
continue;
}
mPUSHs(newRV_inc((SV *)cv));
PUSHs(mop_associated_metaclass);
PUSHs(self);
- PUSHs(KEY_FOR(package_name));
+ PUSHs(mop_package_name);
PUSHs(class_name);
- PUSHs(KEY_FOR(name));
+ PUSHs(mop_name);
mPUSHs(newSVpv(method_name, method_name_len));
PUTBACK;
SV *self
PREINIT:
HV *const obj = (HV *)SvRV(self);
- SV *const class_name = HeVAL( hv_fetch_ent(obj, KEY_FOR(package), 0, HASH_FOR(package)) );
+ SV *const class_name = HeVAL( hv_fetch_ent(obj, mop_package, 0, 0U) );
HV *const stash = gv_stashsv(class_name, 0);
UV current;
SV *cache_flag;
}
current = mop_check_package_cache_flag(aTHX_ stash);
- cache_flag = HeVAL( hv_fetch_ent(obj, KEY_FOR(package_cache_flag), TRUE, HASH_FOR(package_cache_flag)));
- map_ref = HeVAL( hv_fetch_ent(obj, KEY_FOR(methods), TRUE, HASH_FOR(methods)));
+ cache_flag = HeVAL( hv_fetch_ent(obj, mop_package_cache_flag, TRUE, 0U));
+ map_ref = HeVAL( hv_fetch_ent(obj, mop_methods, TRUE, 0U));
/* $self->{methods} does not yet exist (or got deleted) */
if ( !SvROK(map_ref) || SvTYPE(SvRV(map_ref)) != SVt_PVHV ) {