line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
#!perl
|
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
# ########################################################################## #
|
4
|
|
|
|
|
|
|
# Title: Data Stream base package
|
5
|
|
|
|
|
|
|
# Creation date: 2007-03-05
|
6
|
|
|
|
|
|
|
# Author: Michael Zedeler
|
7
|
|
|
|
|
|
|
# Description: Base class for various DS objects. Holds version info as well.
|
8
|
|
|
|
|
|
|
# File: $Source: /data/cvs/lib/DSlib/lib/DS.pm,v $
|
9
|
|
|
|
|
|
|
# Repository: kronhjorten
|
10
|
|
|
|
|
|
|
# State: $State: Exp $
|
11
|
|
|
|
|
|
|
# Documentation: inline
|
12
|
|
|
|
|
|
|
# Recepient: -
|
13
|
|
|
|
|
|
|
# ########################################################################## #
|
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
#TODO Major caveat: it seems that only does lexicographical comparison of version strings when searching for the lastest available module. This is plain wrong and will result in annoying errors. Always specify which version to use when using only.pm.
|
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
package DS;
|
18
|
|
|
|
|
|
|
|
19
|
1
|
|
|
1
|
|
807
|
use strict;
|
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
43
|
|
20
|
1
|
|
|
1
|
|
5
|
use warnings;
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
35
|
|
21
|
|
|
|
|
|
|
|
22
|
1
|
|
|
1
|
|
1011
|
use Carp::Assert;
|
|
1
|
|
|
|
|
1544
|
|
|
1
|
|
|
|
|
7
|
|
23
|
1
|
|
|
1
|
|
156
|
use Exporter 'import';
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
159
|
|
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
our( $VERSION, $REVISION, $STATE );
|
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
BEGIN {
|
28
|
|
|
|
|
|
|
# This is THE version of the this package as a whole
|
29
|
1
|
|
|
1
|
|
2
|
$__PACKAGE__::VERSION = '2.13';
|
30
|
1
|
|
|
|
|
7
|
($__PACKAGE__::STATE) = '$State: Exp $' =~ /:\s+(.+\S)\s+\$$/;
|
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
# Sets local package version info
|
33
|
1
|
|
|
|
|
2
|
$VERSION = $__PACKAGE__::VERSION;
|
34
|
1
|
|
|
|
|
6
|
($REVISION) = '$Revision: 1.3.2.1 $' =~ /(\d+\.\d+)/;
|
35
|
1
|
|
|
|
|
2
|
$STATE = $__PACKAGE__::STATE;
|
36
|
|
|
|
|
|
|
|
37
|
1
|
50
|
|
|
|
268
|
warn("WARNING: this code has been marked as being experimental.") if $STATE eq 'Exp';
|
38
|
|
|
|
|
|
|
}
|
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
our @EXPORT_OK = qw( chain_start chain_end );
|
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
sub chain_start {
|
43
|
0
|
|
|
0
|
0
|
|
my( $target ) = @_;
|
44
|
|
|
|
|
|
|
|
45
|
0
|
|
|
|
|
|
assert( $target->isa('DS::Target'), 'Must provide a DS::Target object' );
|
46
|
0
|
|
|
|
|
|
my $result = $target;
|
47
|
0
|
|
|
|
|
|
$result = $result->source while( $result->source );
|
48
|
|
|
|
|
|
|
|
49
|
0
|
|
|
|
|
|
return $result;
|
50
|
|
|
|
|
|
|
}
|
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
sub chain_end {
|
53
|
0
|
|
|
0
|
0
|
|
my( $source ) = @_;
|
54
|
|
|
|
|
|
|
|
55
|
0
|
|
|
|
|
|
assert( $source->isa('DS::Source'), 'Must provide a DS::Source object' );
|
56
|
0
|
|
|
|
|
|
my $result = $source;
|
57
|
0
|
|
|
|
|
|
$result = $result->target while( $result->target );
|
58
|
|
|
|
|
|
|
|
59
|
0
|
|
|
|
|
|
return $result;
|
60
|
|
|
|
|
|
|
}
|
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
1;
|
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
__END__
|