line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
#!/usr/bin/perl |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
package KiokuDB::Set::Loaded; |
4
|
12
|
|
|
12
|
|
53
|
use Moose; |
|
12
|
|
|
|
|
18
|
|
|
12
|
|
|
|
|
62
|
|
5
|
|
|
|
|
|
|
|
6
|
12
|
|
|
12
|
|
58740
|
use Carp qw(croak); |
|
12
|
|
|
|
|
24
|
|
|
12
|
|
|
|
|
570
|
|
7
|
|
|
|
|
|
|
|
8
|
12
|
|
|
12
|
|
59
|
use namespace::clean -except => 'meta'; |
|
12
|
|
|
|
|
21
|
|
|
12
|
|
|
|
|
101
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
with qw(KiokuDB::Set::Storage); |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
extends qw(KiokuDB::Set::Base); |
13
|
|
|
|
|
|
|
|
14
|
0
|
|
|
0
|
0
|
|
sub loaded { 1 } |
15
|
|
|
|
|
|
|
|
16
|
0
|
|
|
0
|
0
|
|
sub includes { shift->_objects->includes(@_) } |
17
|
0
|
|
|
0
|
0
|
|
sub remove { shift->_objects->remove(@_) } |
18
|
0
|
|
|
0
|
0
|
|
sub members { shift->_objects->members } |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
sub insert { |
21
|
0
|
|
|
0
|
0
|
|
my ( $self, @objects ) = @_; |
22
|
0
|
0
|
|
|
|
|
croak "Can't insert non reference into a KiokuDB::Set" if grep { not ref } @objects; |
|
0
|
|
|
|
|
|
|
23
|
0
|
|
|
|
|
|
$self->_objects->insert(@objects) |
24
|
|
|
|
|
|
|
} |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
sub _set_ids { |
27
|
0
|
|
|
0
|
|
|
my ( $self, $id_set ) = @_; |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
# replace the object set with the ID set |
30
|
0
|
|
|
|
|
|
$self->_set_objects( $id_set ); |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
# and go back to being deferred |
33
|
0
|
|
|
|
|
|
bless $self, "KiokuDB::Set::Deferred"; |
34
|
|
|
|
|
|
|
} |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
__PACKAGE__->meta->make_immutable; |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
__PACKAGE__ |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
__END__ |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
=pod |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
=head1 NAME |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
KiokuDB::Set::Loaded - Implementation of loaded sets |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
=head1 SYNOPSIS |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
# created automatically when deferred sets are vivified |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
=head1 DESCRIPTION |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
This is the implementation of a loaded set. A L<KiokuDB::Set::Deferred> |
55
|
|
|
|
|
|
|
automatically upgrades into a loaded set when its set members are retrieved. |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
=cut |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
|