line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
#!/usr/bin/perl |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
package KiokuDB::Class; |
4
|
|
|
|
|
|
|
|
5
|
3
|
|
|
3
|
|
8207
|
use strict; |
|
3
|
|
|
|
|
6
|
|
|
3
|
|
|
|
|
116
|
|
6
|
3
|
|
|
3
|
|
14
|
use warnings; |
|
3
|
|
|
|
|
3
|
|
|
3
|
|
|
|
|
88
|
|
7
|
|
|
|
|
|
|
|
8
|
3
|
|
|
3
|
|
13
|
use Moose (); |
|
3
|
|
|
|
|
4
|
|
|
3
|
|
|
|
|
48
|
|
9
|
3
|
|
|
3
|
|
14
|
use Moose::Exporter; |
|
3
|
|
|
|
|
4
|
|
|
3
|
|
|
|
|
23
|
|
10
|
3
|
|
|
3
|
|
103
|
use Moose::Util::MetaRole; |
|
3
|
|
|
|
|
6
|
|
|
3
|
|
|
|
|
81
|
|
11
|
|
|
|
|
|
|
|
12
|
3
|
|
|
3
|
|
972
|
use KiokuDB::Meta::Instance; |
|
3
|
|
|
|
|
6
|
|
|
3
|
|
|
|
|
95
|
|
13
|
3
|
|
|
3
|
|
1094
|
use KiokuDB::Meta::Attribute::Lazy; |
|
3
|
|
|
|
|
10
|
|
|
3
|
|
|
|
|
105
|
|
14
|
|
|
|
|
|
|
|
15
|
3
|
|
|
3
|
|
16
|
use namespace::clean -except => 'meta'; |
|
3
|
|
|
|
|
5
|
|
|
3
|
|
|
|
|
13
|
|
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
Moose::Exporter->setup_import_methods( also => 'Moose' ); |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
sub init_meta { |
20
|
3
|
|
|
3
|
0
|
264
|
my ( $class, %args ) = @_; |
21
|
|
|
|
|
|
|
|
22
|
3
|
|
|
|
|
5
|
my $for_class = $args{for_class}; |
23
|
|
|
|
|
|
|
|
24
|
3
|
|
|
|
|
14
|
Moose->init_meta(%args); |
25
|
|
|
|
|
|
|
|
26
|
3
|
|
|
|
|
15600
|
Moose::Util::MetaRole::apply_metaclass_roles( |
27
|
|
|
|
|
|
|
for_class => $for_class, |
28
|
|
|
|
|
|
|
instance_metaclass_roles => [qw(KiokuDB::Meta::Instance)], |
29
|
|
|
|
|
|
|
); |
30
|
|
|
|
|
|
|
|
31
|
0
|
|
|
|
|
|
return Class::MOP::get_metaclass_by_name($for_class); |
32
|
|
|
|
|
|
|
} |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
__PACKAGE__ |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
__END__ |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
=pod |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
=head1 NAME |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
KiokuDB::Class - L<KiokuDB> specific metaclass |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
=head1 SYNOPSIS |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
package Foo; |
47
|
|
|
|
|
|
|
use KiokuDB::Class; # instead of Moose |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
has bar => ( |
50
|
|
|
|
|
|
|
traits => [qw(KiokuDB::Lazy)], |
51
|
|
|
|
|
|
|
... |
52
|
|
|
|
|
|
|
); |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
=head1 DESCRIPTION |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
This L<Moose> wrapper provides some metaclass extensions in order to more |
57
|
|
|
|
|
|
|
tightly integrate your class with L<KiokuDB>. |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
Currently only L<KiokuDB::Meta::Attribute::Lazy> is set up (by extending |
60
|
|
|
|
|
|
|
L<Moose::Meta::Instance> with a custom role to support it), but in the future |
61
|
|
|
|
|
|
|
indexing, identity, and various optimizations will be supported by this. |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
=cut |
64
|
|
|
|
|
|
|
|