From: gfx Date: Mon, 31 Aug 2009 07:46:59 +0000 (+0900) Subject: Merge branch 'topic/unified-method-generation-w-xs' of gitmo@moose.perl.org:Class... X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=ef027418243ba3ddc5b78c96bb1e629be11aab1c;p=gitmo%2FClass-MOP.git Merge branch 'topic/unified-method-generation-w-xs' of gitmo@moose.perl.org:Class-MOP into topic/unified-method-generation-w-xs Conflicts: lib/Class/MOP/Class.pm lib/Class/MOP/Instance.pm lib/Class/MOP/Method/Accessor.pm lib/Class/MOP/Method/Constructor.pm xs/Class.xs xs/MOP.xs --- ef027418243ba3ddc5b78c96bb1e629be11aab1c diff --cc lib/Class/MOP/Method/Accessor.pm index 1c7b8cd,b81169e..fca0e8e --- a/lib/Class/MOP/Method/Accessor.pm +++ b/lib/Class/MOP/Method/Accessor.pm @@@ -98,67 -104,73 +98,130 @@@ sub _generate_accessor_method } return $self->_generate_accessor_method_basic(); ++<<<<<<< HEAD:lib/Class/MOP/Method/Accessor.pm + } + + sub _generate_reader_method { + my ($self) = @_; + + if(my $xs = $self->associated_metaclass->instance_metaclass->can_xs()){ + return $self->_generate_reader_method_xs($xs); + } + + if($self->is_inline){ + return $self->_generate_reader_method_inline(); + } + + return $self->_generate_reader_method_basic(); + } + + sub _generate_writer_method { + my ($self) = @_; + + if(my $xs = $self->associated_metaclass->instance_metaclass->can_xs()){ + return $self->_generate_writer_method_xs($xs); + } + + if($self->is_inline){ + return $self->_generate_writer_method_inline(); + } + + return $self->_generate_writer_method_basic(); + } + + sub _generate_clearer_method { + my ($self) = @_; + + if(my $xs = $self->associated_metaclass->instance_metaclass->can_xs()){ + return $self->_generate_clearer_method_xs($xs); + } + + if($self->is_inline){ + return $self->_generate_clearer_method_inline(); + } + + return $self->_generate_clearer_method_basic(); + } + + sub _generate_predicate_method { + my ($self) = @_; + + if(my $xs = $self->associated_metaclass->instance_metaclass->can_xs()){ + return $self->_generate_predicate_method_xs($xs); + } + + if($self->is_inline){ + return $self->_generate_predicate_method_inline(); + } + + return $self->_generate_predicate_method_basic(); + } + + + ## 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_reader_method { + my ($self) = @_; + + if(my $xs = $self->associated_metaclass->instance_metaclass->can_xs()){ + return $self->_generate_reader_method_xs($xs); + } + + if($self->is_inline){ + return $self->_generate_reader_method_inline(); + } + + return $self->_generate_reader_method_basic(); +} + +sub _generate_writer_method { + my ($self) = @_; + + if(my $xs = $self->associated_metaclass->instance_metaclass->can_xs()){ + return $self->_generate_writer_method_xs($xs); + } + + if($self->is_inline){ + return $self->_generate_writer_method_inline(); + } + + return $self->_generate_writer_method_basic(); } +sub _generate_clearer_method { + my ($self) = @_; + + if(my $xs = $self->associated_metaclass->instance_metaclass->can_xs()){ + return $self->_generate_clearer_method_xs($xs); + } + + if($self->is_inline){ + return $self->_generate_clearer_method_inline(); + } + + return $self->_generate_clearer_method_basic(); +} + +sub _generate_predicate_method { + my ($self) = @_; + + if(my $xs = $self->associated_metaclass->instance_metaclass->can_xs()){ + return $self->_generate_predicate_method_xs($xs); + } + + if($self->is_inline){ + return $self->_generate_predicate_method_inline(); + } + + return $self->_generate_predicate_method_basic(); +} + + +## basic generators + sub _generate_accessor_method_basic { my $attr = (shift)->associated_attribute; return sub { diff --cc lib/Class/MOP/Method/Constructor.pm index 9706e3e,7a37f50..01d6d51 --- a/lib/Class/MOP/Method/Constructor.pm +++ b/lib/Class/MOP/Method/Constructor.pm @@@ -85,6 -104,13 +85,7 @@@ sub _initialize_body $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) = @_;