line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
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
|
|
|
1
|
|
6
|
use strict; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
177
|
|
8
|
|
|
|
|
|
|
@LCC::Backend::ISA = qw(LCC); |
9
|
|
|
|
|
|
|
$LCC::Backend::VERSION = '0.02'; |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
# Return true value for use |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
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
|
|
|
0
|
|
|
my $class = shift; |
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
|
|
|
0
|
1
|
|
sub auto_update { shift->_variable( 'auto_update',@_ ) } #auto_update |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
#------------------------------------------------------------------------ |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
# IN: 1 instantiated object |
61
|
|
|
|
|
|
|
|
62
|
0
|
|
|
0
|
1
|
|
sub complete { shift->{'old'} = {} } #complete |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
#------------------------------------------------------------------------ |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
# The following subroutines deal with standard Perl features |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
#------------------------------------------------------------------------ |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
# IN: 1 instantiated object |
71
|
|
|
|
|
|
|
|
72
|
0
|
0
|
|
0
|
|
|
sub DESTROY { shift->update if $_[0]->auto_update } #DESTROY |
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
|
|
|
0
|
|
|
sub _additional_fields { qw(fullset) } #_additional_fields |
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
|
|
|
0
|
|
|
my $self = shift; |
94
|
0
|
0
|
0
|
|
|
|
$self->complete if $self->{'fullset'} || ''; |
95
|
|
|
|
|
|
|
} #_check_uns_complete |
96
|
|
|
|
|
|
|
|
97
|
|
|
|
|
|
|
#------------------------------------------------------------------------ |
98
|
|
|
|
|
|
|
|
99
|
|
|
|
|
|
|
__END__ |