| 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 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 20 | 1 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 21 | |||||||||||
| 22 | 1 | ▶ | use Carp::Assert; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 23 | 1 | ▶ | use Exporter 'import'; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 24 | |||||||||||
| 25 | 1 | our( $VERSION, $REVISION, $STATE ); | |||||||||
| 26 | |||||||||||
| 27 | 1 | ▶ | BEGIN { | ||||||||
|
Subroutine
BEGIN: called CC=2 SCAR=7.0
| |||||||||||
| 28 | # This is THE version of the this package as a whole | ||||||||||
| 29 | 1 | $__PACKAGE__::VERSION = '2.13'; | |||||||||
| 30 | 1 | ($__PACKAGE__::STATE) = '$State: Exp $' =~ /:\s+(.+\S)\s+\$$/; | |||||||||
| 31 | |||||||||||
| 32 | # Sets local package version info | ||||||||||
| 33 | 1 | $VERSION = $__PACKAGE__::VERSION; | |||||||||
| 34 | 1 | ($REVISION) = '$Revision: 1.3.2.1 $' =~ /(\d+\.\d+)/; | |||||||||
| 35 | 1 | $STATE = $__PACKAGE__::STATE; | |||||||||
| 36 | |||||||||||
| 37 | 1 | ▶ | warn("WARNING: this code has been marked as being experimental.") if $STATE eq 'Exp'; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 38 | } | ||||||||||
| 39 | |||||||||||
| 40 | 1 | our @EXPORT_OK = qw( chain_start chain_end ); | |||||||||
| 41 | |||||||||||
| 42 | 0 | ▶ | sub chain_start { | ||||||||
|
Subroutine
chain_start: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||
| 43 | 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 ); | ||||||||
|
Branch: 1 branch
| |||||||||||
| 48 | |||||||||||
| 49 | 0 | return $result; | |||||||||
| 50 | } | ||||||||||
| 51 | |||||||||||
| 52 | 0 | ▶ | sub chain_end { | ||||||||
|
Subroutine
chain_end: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||
| 53 | 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 ); | ||||||||
|
Branch: 1 branch
| |||||||||||
| 58 | |||||||||||
| 59 | 0 | return $result; | |||||||||
| 60 | } | ||||||||||
| 61 | |||||||||||
| 62 | 1 | 1; | |||||||||
| 63 | |||||||||||
| 64 | __END__ | ||||||||||