line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Data::Grid::Container; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
7
|
use warnings FATAL => 'all'; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
42
|
|
4
|
1
|
|
|
1
|
|
6
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
31
|
|
5
|
|
|
|
|
|
|
|
6
|
1
|
|
|
1
|
|
6
|
use Scalar::Util (); |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
17
|
|
7
|
1
|
|
|
1
|
|
6
|
use Carp (); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
45
|
|
8
|
|
|
|
|
|
|
|
9
|
1
|
|
|
1
|
|
7
|
use overload '""' => \&as_string; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
13
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
=head1 NAME |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
Data::Grid::Container - Generic superclass for Data::Grid containers |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
=head1 VERSION |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
Version 0.01_01 |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
=cut |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
our $VERSION = '0.01_01'; |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
=head1 SYNOPSIS |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
package Data::Grid::Foo; |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
use base 'Data::Grid::Container'; |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
# Now code some specific stuff... |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
=head1 DESCRIPTION |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
The data grid in L is modeled as an ordered tree of |
35
|
|
|
|
|
|
|
tables, rows and cells, all contained inside a bundle. This module |
36
|
|
|
|
|
|
|
encapsulates the common behaviour of these components. |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
=head1 METHODS |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
=head2 new $parent, $position [, $proxy ] |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
This basic constructor takes three arguments: the parent object, a |
43
|
|
|
|
|
|
|
numeric position amongst its siblings, beginning with 0, and an |
44
|
|
|
|
|
|
|
optional proxy object to manipulate directly, if it is necessary or |
45
|
|
|
|
|
|
|
advantageous to do so. |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
=cut |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
sub new { |
50
|
0
|
|
|
0
|
1
|
|
my ($class, $parent, $position, $proxy) = @_; |
51
|
0
|
|
|
|
|
|
my $self = bless { |
52
|
|
|
|
|
|
|
parent => $parent, |
53
|
|
|
|
|
|
|
position => $position, |
54
|
|
|
|
|
|
|
proxy => $proxy, |
55
|
|
|
|
|
|
|
}, $class; |
56
|
0
|
0
|
|
|
|
|
Scalar::Util::weaken($self->{parent}) |
57
|
|
|
|
|
|
|
unless Scalar::Util::isweak($self->{parent}); |
58
|
0
|
|
|
|
|
|
$self; |
59
|
|
|
|
|
|
|
} |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
=head2 parent |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
Retrieve the parent object. |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
=cut |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
sub parent { |
68
|
0
|
|
|
0
|
1
|
|
$_[0]->{parent}; |
69
|
|
|
|
|
|
|
} |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
=head2 position |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
Retrieve the absolute position of the object, as it was passed in from |
74
|
|
|
|
|
|
|
the constructor. |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
=cut |
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
sub position { |
79
|
0
|
|
|
0
|
1
|
|
$_[0]->{position}; |
80
|
|
|
|
|
|
|
} |
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
=head2 proxy |
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
Retrieve the proxy object (for internal manipulation). |
85
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
=cut |
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
sub proxy { |
89
|
0
|
|
|
0
|
1
|
|
$_[0]->{proxy}; |
90
|
|
|
|
|
|
|
} |
91
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
=head2 as_string |
93
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
This is a I to hook up a serialization method to the string |
95
|
|
|
|
|
|
|
overload. Fill it in at your leisure, otherwise it is a no-op. |
96
|
|
|
|
|
|
|
|
97
|
|
|
|
|
|
|
=cut |
98
|
|
|
|
|
|
|
|
99
|
|
|
|
|
|
|
sub as_string { |
100
|
0
|
|
|
0
|
1
|
|
$_[0]; |
101
|
|
|
|
|
|
|
} |
102
|
|
|
|
|
|
|
|
103
|
|
|
|
|
|
|
=head1 AUTHOR |
104
|
|
|
|
|
|
|
|
105
|
|
|
|
|
|
|
Dorian Taylor, C<< >> |
106
|
|
|
|
|
|
|
|
107
|
|
|
|
|
|
|
=head1 BUGS |
108
|
|
|
|
|
|
|
|
109
|
|
|
|
|
|
|
Please report any bugs or feature requests to C, or through |
110
|
|
|
|
|
|
|
the web interface at L. I will be notified, and then you'll |
111
|
|
|
|
|
|
|
automatically be notified of progress on your bug as I make changes. |
112
|
|
|
|
|
|
|
|
113
|
|
|
|
|
|
|
|
114
|
|
|
|
|
|
|
|
115
|
|
|
|
|
|
|
|
116
|
|
|
|
|
|
|
=head1 SUPPORT |
117
|
|
|
|
|
|
|
|
118
|
|
|
|
|
|
|
You can find documentation for this module with the perldoc command. |
119
|
|
|
|
|
|
|
|
120
|
|
|
|
|
|
|
perldoc Data::Grid::Container |
121
|
|
|
|
|
|
|
|
122
|
|
|
|
|
|
|
|
123
|
|
|
|
|
|
|
You can also look for information at: |
124
|
|
|
|
|
|
|
|
125
|
|
|
|
|
|
|
=over 4 |
126
|
|
|
|
|
|
|
|
127
|
|
|
|
|
|
|
=item * RT: CPAN's request tracker |
128
|
|
|
|
|
|
|
|
129
|
|
|
|
|
|
|
L |
130
|
|
|
|
|
|
|
|
131
|
|
|
|
|
|
|
=item * AnnoCPAN: Annotated CPAN documentation |
132
|
|
|
|
|
|
|
|
133
|
|
|
|
|
|
|
L |
134
|
|
|
|
|
|
|
|
135
|
|
|
|
|
|
|
=item * CPAN Ratings |
136
|
|
|
|
|
|
|
|
137
|
|
|
|
|
|
|
L |
138
|
|
|
|
|
|
|
|
139
|
|
|
|
|
|
|
=item * Search CPAN |
140
|
|
|
|
|
|
|
|
141
|
|
|
|
|
|
|
L |
142
|
|
|
|
|
|
|
|
143
|
|
|
|
|
|
|
=back |
144
|
|
|
|
|
|
|
|
145
|
|
|
|
|
|
|
=head1 SEE ALSO |
146
|
|
|
|
|
|
|
|
147
|
|
|
|
|
|
|
L, L, L, |
148
|
|
|
|
|
|
|
L |
149
|
|
|
|
|
|
|
|
150
|
|
|
|
|
|
|
=head1 LICENSE AND COPYRIGHT |
151
|
|
|
|
|
|
|
|
152
|
|
|
|
|
|
|
Copyright 2010 Dorian Taylor. |
153
|
|
|
|
|
|
|
|
154
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify it |
155
|
|
|
|
|
|
|
under the terms of either: the GNU General Public License as published |
156
|
|
|
|
|
|
|
by the Free Software Foundation; or the Artistic License. |
157
|
|
|
|
|
|
|
|
158
|
|
|
|
|
|
|
See http://dev.perl.org/licenses/ for more information. |
159
|
|
|
|
|
|
|
|
160
|
|
|
|
|
|
|
|
161
|
|
|
|
|
|
|
=cut |
162
|
|
|
|
|
|
|
|
163
|
|
|
|
|
|
|
1; # End of Data::Grid::Row |