Revision history for Class::Accessor::Grouped.
+ - Changed the way Class::XSAccessor is invoked if available
+ (recommended by C::XSA author)
+
0.09003 Fri Apr 23 23:00:19 2010
- use Class::XSAccessor if available for 'simple' accessors, except on
MSWin32, with documentation
my $alias = "_${name}_accessor";
my $full_name = join('::', $class, $name);
my $full_alias = join('::', $class, $alias);
-
if ( $hasXS && $group eq 'simple' ) {
require Class::XSAccessor;
- Class::XSAccessor::newxs_accessor("${class}::${name}", $field, 0);
- Class::XSAccessor::newxs_accessor("${class}::${alias}", $field, 0);
-
- # XXX: is the alias accessor really necessary?
+ Class::XSAccessor->import({
+ replace => 1,
+ class => $class,
+ accessors => {
+ $name => $field,
+ $alias => $field,
+ },
+ });
}
else {
my $accessor = $self->$maker($group, $field);