return;
}
+sub inline_get {
+ my $self = shift;
+ my ($instance) = @_;
+
+ return $self->associated_class->get_meta_instance->inline_get_slot_value(
+ $instance, $self->slots );
+}
+
+sub inline_access {
+ my $self = shift;
+ my ($instance) = @_;
+
+ return $self->associated_class->get_meta_instance->inline_slot_access(
+ $instance, $self->slots );
+}
+
+sub inline_has {
+ my $self = shift;
+ my ($instance) = @_;
+
+ $self->associated_class->get_meta_instance->inline_is_slot_initialized(
+ $instance, $self->slots );
+}
+
+sub inline_store {
+ my $self = shift;
+ my ( $instance, $value ) = @_;
+
+ my $mi = $self->associated_class->get_meta_instance;
+
+ my $code
+ = $mi->inline_set_slot_value( $instance, $self->slots, $value ) . ";";
+ $code
+ .= $mi->inline_weaken_slot_value( $instance, $self->slots, $value )
+ . ";"
+ if $self->is_weak_ref;
+
+ return $code;
+}
+
sub install_delegation {
my $self = shift;
This method overrides the parent to also remove delegation methods.
+=item B<< $attr->inline_get >>
+
+=item B<< $attr->inline_access >>
+
+=item B<< $attr->inline_has >>
+
+=item B<< $attr->inline_store >>
+
=item B<< $attr->install_delegation >>
This method adds its delegation methods to the attribute's associated
}
sub _inline_store {
- my ($self, $instance, $value) = @_;
- my $attr = $self->associated_attribute;
-
- my $mi = $attr->associated_class->get_meta_instance;
+ my ( $self, $instance, $value ) = @_;
- my $code = $mi->inline_set_slot_value($instance, $attr->slots, $value) . ";";
- $code .= $mi->inline_weaken_slot_value($instance, $attr->slots, $value) . ";"
- if $attr->is_weak_ref;
- return $code;
+ return $self->associated_attribute->inline_store( $instance, $value );
}
sub _inline_get_old_value_for_trigger {
my $attr = $self->associated_attribute;
return '' unless $attr->has_trigger;
- my $mi = $attr->associated_class->get_meta_instance;
- my $pred = $mi->inline_is_slot_initialized($instance, $attr->name);
-
return
'my @old = '
- . $pred . q{ ? }
+ . $self->_inline_has($instance) . q{ ? }
. $self->_inline_get($instance) . q{ : ()} . ";\n";
}
sub _inline_get {
my ($self, $instance) = @_;
- my $attr = $self->associated_attribute;
- my $mi = $attr->associated_class->get_meta_instance;
-
- return $mi->inline_get_slot_value($instance, $attr->slots);
+ return $self->associated_attribute->inline_get($instance);
}
sub _inline_access {
my ($self, $instance) = @_;
- my $attr = $self->associated_attribute;
-
- my $mi = $attr->associated_class->get_meta_instance;
- return $mi->inline_slot_access($instance, $attr->slots);
+ return $self->associated_attribute->inline_access($instance);
}
sub _inline_has {
my ($self, $instance) = @_;
- my $attr = $self->associated_attribute;
-
- my $mi = $attr->associated_class->get_meta_instance;
- return $mi->inline_is_slot_initialized($instance, $attr->slots);
+ return $self->associated_attribute->inline_has($instance);
}
sub _inline_auto_deref {