LCC/Backend.pm

filter: Statementstmt 33.3% 6 / 18 Branchbran 0.0% 0 / 4 Conditioncond 0.0% 0 / 2 MC/DCmcdc 0.0% 0 / 1 Subroutinesub 14.2% 1 / 7 Podpod 100% 2 / 2 totaltotal 26.4% 9 / 34 SCAR 23.7
CC
4
Cov
25%
_check_uns_complete
12.0
DESTROY
6.0
_new
2.0
CRAP 10.8
« LCC/UNS.pm ↑ Summary LCC/Documents.pm »
1 package LCC::Backend;
2  
3 # Make sure we do everything by the book
4 # Set modules to inherit from
5 # Set version information
6  
7 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
8 1 @LCC::Backend::ISA = qw(LCC);
9 1 $LCC::Backend::VERSION = '0.02';
10  
11 # Return true value for use
12  
13 1 1;
14  
15 #------------------------------------------------------------------------
16  
17 # The following methods are class methods
18  
19 #------------------------------------------------------------------------
20  
21 # IN: 1 class of object
22 # 2 instantiated LCC object
23 # 3 source specification
24 # 4 method => value pairs to be executed
25 # OUT: 1 instantiated LCC::Backend::xxx object
26  
27 sub _new {
28  
29 # Obtain the class
30 # Obtain the LCC object
31 # Obtain the source (a ref to a database handle, table name list)
32 # Create the object in the right way
33  
34 0 ▶ my $class = shift;
Subroutine _new: not called CC=1 SCAR=6.9
35 0 my $lcc = shift;
36 0 my $source = shift;
37 0 my $self = $class->SUPER::_new( $lcc,@_ );
38  
39 # Save the source specification
40 # Return the object
41  
42 0 $self->{'source'} = $source;
43 0 return $self;
44 } #_new
45  
46 #------------------------------------------------------------------------
47  
48 # The following methods change the object
49  
50 #------------------------------------------------------------------------
51  
52 # IN: 1 instantiated object
53 # 2 (optional) new value of auto_update flag
54 # OUT: 1 current/old value of auto_update flag
55  
56 0 ▶sub auto_update { shift->_variable( 'auto_update',@_ ) } #auto_update
Subroutine auto_update: not called CC=1 SCAR=6.9
Pod documented
57  
58 #------------------------------------------------------------------------
59  
60 # IN: 1 instantiated object
61  
62 0 ▶sub complete { shift->{'old'} = {} } #complete
Subroutine complete: not called CC=1 SCAR=6.9
Pod documented
63  
64 #------------------------------------------------------------------------
65  
66 # The following subroutines deal with standard Perl features
67  
68 #------------------------------------------------------------------------
69  
70 # IN: 1 instantiated object
71  
72 0 ▶sub DESTROY { shift->update if $_[0]->auto_update } #DESTROY
Subroutine DESTROY: not called CC=2 SCAR=17.9
Branch: 1 branch
BranchTrueFalseTotal
if $_[0]->auto_update 0 0 0
73  
74 #------------------------------------------------------------------------
75  
76 # The following subroutines are for internal use only
77  
78 #------------------------------------------------------------------------
79  
80 # OUT: 1..N names of additional fields that should be saved
81  
82 0 ▶sub _additional_fields { qw(fullset) } #_additional_fields
Subroutine _additional_fields: not called CC=1 SCAR=6.9
83  
84 #------------------------------------------------------------------------
85  
86 # IN: 1 instantiated object
87  
88 sub _check_uns_complete {
89  
90 # Obtain the object
91 # Make it a complete fetch if so required last time by the UNS
92  
93 0 ▶ my $self = shift;
Subroutine _check_uns_complete: not called CC=3 SCAR=24.8
94 0 ▶ $self->complete if $self->{'fullset'} || '';
Branch: 1 branch
BranchTrueFalseTotal
if $self->{"fullset"} or "" 0 0 0
Condition0%0/2
$self->{"fullset"} or ""
l!l
00
MC/DC0%0/1
$self->{"fullset"} or ""
$self->{"fullset"}
Truth table0%0/2
A
A= $self->{"fullset"}
Aresult
11
00
95 } #_check_uns_complete
96  
97 #------------------------------------------------------------------------
98  
99 __END__
« LCC/UNS.pm ↑ Summary LCC/Documents.pm »