}
sub _initialize_object{
- my($self, $object, $args) = @_;
+ my($self, $object, $args, $ignore_triggers) = @_;
my @triggers_queue;
}
}
- foreach my $trigger_and_value(@triggers_queue){
- my($trigger, $value) = @{$trigger_and_value};
- $trigger->($object, $value);
+ if(!$ignore_triggers){
+ foreach my $trigger_and_value(@triggers_queue){
+ my($trigger, $value) = @{$trigger_and_value};
+ $trigger->($object, $value);
+ }
}
if($self->is_anon_class){
}
void
-mouse_class_initialize_object(pTHX_ SV* const meta, SV* const object, HV* const args, bool const invoke_triggers) {
- AV* const xc = mouse_get_xc(aTHX_ meta);
-
- // TODO
+mouse_class_initialize_object(pTHX_ SV* const meta, SV* const object, HV* const args, bool const ignore_triggers) {
+ AV* const xc = mouse_get_xc(aTHX_ meta);
+ AV* const attrs = MOUSE_xc_attrall(xc);
+ I32 const len = AvFILLp(attrs) + 1;
+ I32 i;
+ AV* const triggers_queue = (invoke_triggers ? newAV_mortal() : NULL);
+ for(i = 0; i < len; i++){
+ AV* const = mouse_get_xa(aTHX_ AvARRAY(attrs)[i]);
+ }
}
MODULE = Mouse PACKAGE = Mouse
{
HV* const args = mouse_build_args(aTHX_ meta, NULL, 1, items, ax);
AV* const xc = mouse_get_xc(aTHX_ meta);
+
RETVAL = mouse_instance_create(aTHX_ MOUSE_xc_stash(xc));
- mouse_class_initialize_object(aTHX_ meta, RETVAL, args, TRUE);
+ mouse_class_initialize_object(aTHX_ meta, RETVAL, args, FALSE);
}
void
-_initialize_object_(SV* meta, SV* object, HV* args, bool invoke_triggers = TRUE)
+_initialize_object_(SV* meta, SV* object, HV* args, bool ignore_triggers = FALSE)
CODE:
{
- mouse_class_initialize_object(aTHX_ meta, object, args, invoke_triggers);
+ mouse_class_initialize_object(aTHX_ meta, object, args, ignore_triggers);
}
MODULE = Mouse PACKAGE = Mouse::Meta::Role