| 1 | package Class::XSAccessor::Compat; | ||
| 2 | 4 | ▶ | use 5.008; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 3 | 4 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 4 | 4 | ▶ | use warnings; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 5 | 4 | our $VERSION = '0.01'; | |
| 6 | 4 | ▶ | use Class::XSAccessor; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 7 | 4 | ▶ | use Class::Accessor::Fast; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 8 | 4 | our @ISA = qw(Class::Accessor::Fast); | |
| 9 | |||
| 10 | # The following is almost 100% the same as Ruslan Zakirov's code: | ||
| 11 | 8 | ▶ | sub make_ro_accessor { |
|
Subroutine
make_ro_accessor: called CC=1 SCAR=0.0
Pod
documented
| |||
| 12 | 8 | my($class, $field) = @_; | |
| 13 | |||
| 14 | 8 | my $sub = $class ."::__cxs_ro_". $field; | |
| 15 | # Do not copy this code. It's the only place where this internal function should be used: | ||
| 16 | 8 | Class::XSAccessor::newxs_getter($sub, $field); | |
| 17 | |||
| 18 | 4 | ▶ | no strict 'refs'; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 19 | 8 | return \&{$sub}; | |
| 20 | } | ||
| 21 | |||
| 22 | 8 | ▶ | sub make_wo_accessor { |
|
Subroutine
make_wo_accessor: called CC=1 SCAR=0.0
Pod
documented
| |||
| 23 | 8 | my($class, $field) = @_; | |
| 24 | |||
| 25 | 8 | my $sub = $class ."::__cxs_wo_". $field; | |
| 26 | # Do not copy this code. It's the only place where this internal function should be used: | ||
| 27 | 8 | Class::XSAccessor::_newxs_compat_setter($sub, $field); | |
| 28 | |||
| 29 | 4 | ▶ | no strict 'refs'; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 30 | 8 | return \&{$sub}; | |
| 31 | } | ||
| 32 | |||
| 33 | 11 | ▶ | sub make_accessor { |
|
Subroutine
make_accessor: called CC=1 SCAR=0.0
Pod
documented
| |||
| 34 | 11 | my($class, $field) = @_; | |
| 35 | |||
| 36 | 11 | my $sub = $class ."::__cxs_ac_". $field; | |
| 37 | # Do not copy this code. It's the only place where this internal function should be used: | ||
| 38 | 11 | Class::XSAccessor::_newxs_compat_accessor($sub, $field); | |
| 39 | |||
| 40 | 4 | ▶ | no strict 'refs'; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 41 | 11 | return \&{$sub}; | |
| 42 | } | ||
| 43 | |||
| 44 | |||
| 45 | |||
| 46 | |||
| 47 | 4 | 1; | |
| 48 | |||
| 49 | __END__ | ||