| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
package MOP::Class; |
|
2
|
|
|
|
|
|
|
# ABSTRACT: A representation of a class |
|
3
|
|
|
|
|
|
|
|
|
4
|
11
|
|
|
11
|
|
246505
|
use strict; |
|
|
11
|
|
|
|
|
42
|
|
|
|
11
|
|
|
|
|
290
|
|
|
5
|
11
|
|
|
11
|
|
54
|
use warnings; |
|
|
11
|
|
|
|
|
18
|
|
|
|
11
|
|
|
|
|
266
|
|
|
6
|
|
|
|
|
|
|
|
|
7
|
11
|
|
|
11
|
|
54
|
use mro (); |
|
|
11
|
|
|
|
|
21
|
|
|
|
11
|
|
|
|
|
144
|
|
|
8
|
11
|
|
|
11
|
|
46
|
use Carp (); |
|
|
11
|
|
|
|
|
21
|
|
|
|
11
|
|
|
|
|
169
|
|
|
9
|
|
|
|
|
|
|
|
|
10
|
11
|
|
|
11
|
|
1165
|
use UNIVERSAL::Object::Immutable; |
|
|
11
|
|
|
|
|
6308
|
|
|
|
11
|
|
|
|
|
234
|
|
|
11
|
|
|
|
|
|
|
|
|
12
|
11
|
|
|
11
|
|
1510
|
use MOP::Role; |
|
|
11
|
|
|
|
|
23
|
|
|
|
11
|
|
|
|
|
256
|
|
|
13
|
11
|
|
|
11
|
|
64
|
use MOP::Method; |
|
|
11
|
|
|
|
|
23
|
|
|
|
11
|
|
|
|
|
203
|
|
|
14
|
11
|
|
|
11
|
|
47
|
use MOP::Slot; |
|
|
11
|
|
|
|
|
18
|
|
|
|
11
|
|
|
|
|
178
|
|
|
15
|
|
|
|
|
|
|
|
|
16
|
11
|
|
|
11
|
|
48
|
use MOP::Internal::Util; |
|
|
11
|
|
|
|
|
18
|
|
|
|
11
|
|
|
|
|
500
|
|
|
17
|
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
our $VERSION = '0.11'; |
|
19
|
|
|
|
|
|
|
our $AUTHORITY = 'cpan:STEVAN'; |
|
20
|
|
|
|
|
|
|
|
|
21
|
11
|
|
|
11
|
|
394
|
our @ISA; BEGIN { @ISA = 'UNIVERSAL::Object::Immutable' }; |
|
22
|
11
|
|
|
11
|
|
1861
|
our @DOES; BEGIN { @DOES = 'MOP::Role' }; # to be composed later ... |
|
23
|
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
UNITCHECK { |
|
25
|
|
|
|
|
|
|
# apply them roles ... |
|
26
|
|
|
|
|
|
|
MOP::Internal::Util::APPLY_ROLES( |
|
27
|
|
|
|
|
|
|
MOP::Role->new( name => __PACKAGE__ ), |
|
28
|
|
|
|
|
|
|
\@DOES, |
|
29
|
|
|
|
|
|
|
to => 'class' |
|
30
|
|
|
|
|
|
|
); |
|
31
|
|
|
|
|
|
|
} |
|
32
|
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
# superclasses |
|
34
|
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
sub superclasses { |
|
36
|
14
|
|
|
14
|
1
|
5179
|
my ($self) = @_; |
|
37
|
14
|
|
|
|
|
45
|
my $isa = MOP::Internal::Util::GET_GLOB_SLOT( $self->stash, 'ISA', 'ARRAY' ); |
|
38
|
14
|
100
|
|
|
|
64
|
return unless $isa; |
|
39
|
8
|
|
|
|
|
62
|
return @$isa; |
|
40
|
|
|
|
|
|
|
} |
|
41
|
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
sub set_superclasses { |
|
43
|
1
|
|
|
1
|
1
|
64
|
my ($self, @superclasses) = @_; |
|
44
|
1
|
50
|
|
|
|
3
|
Carp::croak('[ARGS] You must specify at least one superclass') |
|
45
|
|
|
|
|
|
|
if scalar( @superclasses ) == 0; |
|
46
|
1
|
|
|
|
|
4
|
MOP::Internal::Util::SET_GLOB_SLOT( $self->stash, 'ISA', \@superclasses ); |
|
47
|
1
|
|
|
|
|
3
|
return; |
|
48
|
|
|
|
|
|
|
} |
|
49
|
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
sub mro { |
|
51
|
13
|
|
|
13
|
1
|
745
|
my ($self) = @_; |
|
52
|
13
|
|
|
|
|
40
|
return mro::get_linear_isa( $self->name ); |
|
53
|
|
|
|
|
|
|
} |
|
54
|
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
1; |
|
56
|
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
__END__ |