line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package MOP::Class; |
2
|
|
|
|
|
|
|
# ABSTRACT: A representation of a class |
3
|
|
|
|
|
|
|
|
4
|
11
|
|
|
11
|
|
244147
|
use strict; |
|
11
|
|
|
|
|
53
|
|
|
11
|
|
|
|
|
257
|
|
5
|
11
|
|
|
11
|
|
45
|
use warnings; |
|
11
|
|
|
|
|
17
|
|
|
11
|
|
|
|
|
224
|
|
6
|
|
|
|
|
|
|
|
7
|
11
|
|
|
11
|
|
44
|
use mro (); |
|
11
|
|
|
|
|
21
|
|
|
11
|
|
|
|
|
127
|
|
8
|
11
|
|
|
11
|
|
39
|
use Carp (); |
|
11
|
|
|
|
|
18
|
|
|
11
|
|
|
|
|
206
|
|
9
|
|
|
|
|
|
|
|
10
|
11
|
|
|
11
|
|
1566
|
use MOP::Role; |
|
11
|
|
|
|
|
18
|
|
|
11
|
|
|
|
|
228
|
|
11
|
11
|
|
|
11
|
|
49
|
use MOP::Method; |
|
11
|
|
|
|
|
21
|
|
|
11
|
|
|
|
|
184
|
|
12
|
11
|
|
|
11
|
|
38
|
use MOP::Slot; |
|
11
|
|
|
|
|
15
|
|
|
11
|
|
|
|
|
191
|
|
13
|
|
|
|
|
|
|
|
14
|
11
|
|
|
11
|
|
44
|
use MOP::Internal::Util; |
|
11
|
|
|
|
|
15
|
|
|
11
|
|
|
|
|
344
|
|
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
our $VERSION = '0.14'; |
17
|
|
|
|
|
|
|
our $AUTHORITY = 'cpan:STEVAN'; |
18
|
|
|
|
|
|
|
|
19
|
11
|
|
|
11
|
|
45
|
use parent 'UNIVERSAL::Object::Immutable'; |
|
11
|
|
|
|
|
16
|
|
|
11
|
|
|
|
|
42
|
|
20
|
|
|
|
|
|
|
|
21
|
11
|
|
|
11
|
|
2562
|
our @DOES; BEGIN { @DOES = 'MOP::Role' }; # to be composed later ... |
22
|
|
|
|
|
|
|
UNITCHECK { |
23
|
|
|
|
|
|
|
# apply them roles ... |
24
|
|
|
|
|
|
|
MOP::Internal::Util::APPLY_ROLES( |
25
|
|
|
|
|
|
|
MOP::Role->new( name => __PACKAGE__ ), |
26
|
|
|
|
|
|
|
\@DOES, |
27
|
|
|
|
|
|
|
to => 'class' |
28
|
|
|
|
|
|
|
); |
29
|
|
|
|
|
|
|
} |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
# superclasses |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
sub superclasses { |
34
|
14
|
|
|
14
|
1
|
4203
|
my ($self) = @_; |
35
|
14
|
|
|
|
|
38
|
my $isa = MOP::Internal::Util::GET_GLOB_SLOT( $self->stash, 'ISA', 'ARRAY' ); |
36
|
14
|
100
|
|
|
|
52
|
return unless $isa; |
37
|
8
|
|
|
|
|
51
|
return @$isa; |
38
|
|
|
|
|
|
|
} |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
sub set_superclasses { |
41
|
1
|
|
|
1
|
1
|
63
|
my ($self, @superclasses) = @_; |
42
|
1
|
50
|
|
|
|
4
|
Carp::confess('[ARGS] You must specify at least one superclass') |
43
|
|
|
|
|
|
|
if scalar( @superclasses ) == 0; |
44
|
1
|
|
|
|
|
3
|
MOP::Internal::Util::SET_GLOB_SLOT( $self->stash, 'ISA', \@superclasses ); |
45
|
1
|
|
|
|
|
2
|
return; |
46
|
|
|
|
|
|
|
} |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
sub mro { |
49
|
13
|
|
|
13
|
1
|
432
|
my ($self) = @_; |
50
|
13
|
|
|
|
|
34
|
return mro::get_linear_isa( $self->name ); |
51
|
|
|
|
|
|
|
} |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
1; |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
__END__ |