Pure Perl accessors into XS
gfx [Wed, 22 Jul 2009 00:55:29 +0000 (09:55 +0900)]
lib/Class/MOP/Method/Constructor.pm
lib/Class/MOP/Method/Generated.pm
lib/Class/MOP/Method/Inlined.pm
xs/Method.xs

index 36fce28..e8313c4 100644 (file)
@@ -67,8 +67,8 @@ sub _new {
 
 ## accessors
 
-sub options              { (shift)->{'options'}              }
-sub associated_metaclass { (shift)->{'associated_metaclass'} }
+#sub options              { (shift)->{'options'}              }
+#sub associated_metaclass { (shift)->{'associated_metaclass'} }
 
 ## cached values ...
 
index e9b4ed3..292d790 100644 (file)
@@ -20,9 +20,8 @@ sub new {
     confess __PACKAGE__ . " is an abstract base class, you must provide a constructor.";
 }
 
-sub is_inline { $_[0]{is_inline} }
-
-sub definition_context { $_[0]{definition_context} }
+#sub is_inline { $_[0]{is_inline} }
+#sub definition_context { $_[0]{definition_context} }
 
 sub _initialize_body {
     confess "No body to initialize, " . __PACKAGE__ . " is an abstract base class";
index fa68ebe..3621a8a 100644 (file)
@@ -12,7 +12,7 @@ our $AUTHORITY = 'cpan:STEVAN';
 
 use base 'Class::MOP::Method::Generated';
 
-sub _expected_method_class { $_[0]{_expected_method_class} }
+#sub _expected_method_class { $_[0]{_expected_method_class} }
 
 sub _uninlined_body {
     my $self = shift;
index 02a5f5c..90c3e9f 100644 (file)
@@ -12,3 +12,20 @@ BOOT:
     INSTALL_SIMPLE_READER(Method, original_method);
 
     INSTALL_SIMPLE_WRITER_WITH_KEY(Method, _set_original_method, original_method);
+
+MODULE = Class::MOP::Method   PACKAGE = Class::MOP::Method::Constructor
+
+BOOT:
+    INSTALL_SIMPLE_READER(Method::Constructor, options);
+    INSTALL_SIMPLE_READER(Method::Constructor, associated_metaclass);
+
+MODULE = Class::MOP::Method   PACKAGE = Class::MOP::Method::Generated
+
+BOOT:
+    INSTALL_SIMPLE_READER(Method::Generated, is_inline);
+    INSTALL_SIMPLE_READER(Method::Generated, definition_context);
+
+MODULE = Class::MOP::Method   PACKAGE = Class::MOP::Method::Inlined
+
+BOOT:
+    INSTALL_SIMPLE_READER(Method::Inlined, _expected_method_class);