line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Hub::Data::SortedHash; |
2
|
1
|
|
|
1
|
|
5
|
use strict; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
28
|
|
3
|
1
|
|
|
1
|
|
5
|
use Hub qw/:lib/; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
4
|
|
4
|
|
|
|
|
|
|
our $AUTOLOAD = ''; |
5
|
|
|
|
|
|
|
our $VERSION = '4.00043'; |
6
|
|
|
|
|
|
|
our @EXPORT = qw//; |
7
|
|
|
|
|
|
|
our @EXPORT_OK = qw//; |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
sub new { |
10
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
11
|
0
|
|
0
|
|
|
|
my $classname = ref($self) || $self; |
12
|
0
|
|
|
|
|
|
my $obj = bless {}, $classname; |
13
|
0
|
|
|
|
|
|
tie %$obj, 'Hub::Knots::TiedObject', 'Hub::Knots::SortedHash'; |
14
|
0
|
|
|
|
|
|
return $obj; |
15
|
|
|
|
|
|
|
} |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
sub set_sort_order { |
18
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
19
|
0
|
0
|
|
|
|
|
croak "Illegal call to instance method" unless ref($self); |
20
|
0
|
|
|
|
|
|
my $sort_order = shift; |
21
|
0
|
0
|
|
|
|
|
croak "Provide an array reference" unless isa($sort_order, 'ARRAY'); |
22
|
0
|
|
|
|
|
|
$self->{'*tied'}->set_sort_keys(@$sort_order); |
23
|
|
|
|
|
|
|
} |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
# ------------------------------------------------------------------------------ |
26
|
|
|
|
|
|
|
1; |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
__END__ |