line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package MOP::Class; |
2
|
|
|
|
|
|
|
# ABSTRACT: A representation of a class |
3
|
|
|
|
|
|
|
|
4
|
11
|
|
|
11
|
|
284568
|
use strict; |
|
11
|
|
|
|
|
61
|
|
|
11
|
|
|
|
|
311
|
|
5
|
11
|
|
|
11
|
|
64
|
use warnings; |
|
11
|
|
|
|
|
22
|
|
|
11
|
|
|
|
|
380
|
|
6
|
|
|
|
|
|
|
|
7
|
11
|
|
|
11
|
|
273
|
use mro (); |
|
11
|
|
|
|
|
25
|
|
|
11
|
|
|
|
|
250
|
|
8
|
11
|
|
|
11
|
|
64
|
use Carp (); |
|
11
|
|
|
|
|
26
|
|
|
11
|
|
|
|
|
201
|
|
9
|
|
|
|
|
|
|
|
10
|
11
|
|
|
11
|
|
1765
|
use UNIVERSAL::Object::Immutable; |
|
11
|
|
|
|
|
9451
|
|
|
11
|
|
|
|
|
275
|
|
11
|
|
|
|
|
|
|
|
12
|
11
|
|
|
11
|
|
2046
|
use MOP::Role; |
|
11
|
|
|
|
|
32
|
|
|
11
|
|
|
|
|
319
|
|
13
|
11
|
|
|
11
|
|
75
|
use MOP::Method; |
|
11
|
|
|
|
|
25
|
|
|
11
|
|
|
|
|
277
|
|
14
|
11
|
|
|
11
|
|
64
|
use MOP::Slot; |
|
11
|
|
|
|
|
29
|
|
|
11
|
|
|
|
|
263
|
|
15
|
|
|
|
|
|
|
|
16
|
11
|
|
|
11
|
|
73
|
use MOP::Internal::Util; |
|
11
|
|
|
|
|
25
|
|
|
11
|
|
|
|
|
672
|
|
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
our $VERSION = '0.12'; |
19
|
|
|
|
|
|
|
our $AUTHORITY = 'cpan:STEVAN'; |
20
|
|
|
|
|
|
|
|
21
|
11
|
|
|
11
|
|
497
|
our @ISA; BEGIN { @ISA = 'UNIVERSAL::Object::Immutable' }; |
22
|
11
|
|
|
11
|
|
2468
|
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
|
6251
|
my ($self) = @_; |
37
|
14
|
|
|
|
|
53
|
my $isa = MOP::Internal::Util::GET_GLOB_SLOT( $self->stash, 'ISA', 'ARRAY' ); |
38
|
14
|
100
|
|
|
|
83
|
return unless $isa; |
39
|
8
|
|
|
|
|
66
|
return @$isa; |
40
|
|
|
|
|
|
|
} |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
sub set_superclasses { |
43
|
1
|
|
|
1
|
1
|
131
|
my ($self, @superclasses) = @_; |
44
|
1
|
50
|
|
|
|
7
|
Carp::confess('[ARGS] You must specify at least one superclass') |
45
|
|
|
|
|
|
|
if scalar( @superclasses ) == 0; |
46
|
1
|
|
|
|
|
5
|
MOP::Internal::Util::SET_GLOB_SLOT( $self->stash, 'ISA', \@superclasses ); |
47
|
1
|
|
|
|
|
5
|
return; |
48
|
|
|
|
|
|
|
} |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
sub mro { |
51
|
13
|
|
|
13
|
1
|
540
|
my ($self) = @_; |
52
|
13
|
|
|
|
|
54
|
return mro::get_linear_isa( $self->name ); |
53
|
|
|
|
|
|
|
} |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
1; |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
__END__ |