line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Lingua::Ogmios::Annotations::LogProcessing; |
2
|
|
|
|
|
|
|
|
3
|
16
|
|
|
16
|
|
70
|
use strict; |
|
16
|
|
|
|
|
29
|
|
|
16
|
|
|
|
|
336
|
|
4
|
16
|
|
|
16
|
|
78
|
use warnings; |
|
16
|
|
|
|
|
22
|
|
|
16
|
|
|
|
|
346
|
|
5
|
|
|
|
|
|
|
|
6
|
16
|
|
|
16
|
|
75
|
use Lingua::Ogmios::Annotations::Element; |
|
16
|
|
|
|
|
32
|
|
|
16
|
|
|
|
|
18452
|
|
7
|
|
|
|
|
|
|
our @ISA = qw(Lingua::Ogmios::Annotations::Element); |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
sub new { |
10
|
0
|
|
|
0
|
0
|
|
my ($class, $fields) = @_; |
11
|
|
|
|
|
|
|
|
12
|
0
|
|
|
|
|
|
my @refTypes = ('list_modified_level'); |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
# warn join(":", keys %$fields) . "\n"; |
15
|
|
|
|
|
|
|
# warn join(":", values %$fields) . "\n"; |
16
|
|
|
|
|
|
|
|
17
|
0
|
0
|
|
|
|
|
if (!defined $fields->{'log_id'}) { |
18
|
0
|
|
|
|
|
|
$fields->{'log_id'} = -1; |
19
|
|
|
|
|
|
|
} |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
my $log_processing = { |
22
|
0
|
|
|
|
|
|
'log_id' => $fields->{'log_id'}, |
23
|
|
|
|
|
|
|
'next' => undef, |
24
|
|
|
|
|
|
|
'previous' => undef, |
25
|
|
|
|
|
|
|
}; |
26
|
|
|
|
|
|
|
|
27
|
0
|
|
|
|
|
|
bless ($log_processing, $class); |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
######################################################################## |
30
|
|
|
|
|
|
|
# my $i = 0; |
31
|
|
|
|
|
|
|
# my $reference_name; |
32
|
|
|
|
|
|
|
# my $ref; |
33
|
|
|
|
|
|
|
# foreach $ref (@refTypes) { |
34
|
|
|
|
|
|
|
# if (exists $fields->{$ref}) { |
35
|
|
|
|
|
|
|
# $reference_name = $ref; |
36
|
|
|
|
|
|
|
# last; |
37
|
|
|
|
|
|
|
# } |
38
|
|
|
|
|
|
|
# $i++; |
39
|
|
|
|
|
|
|
# } |
40
|
|
|
|
|
|
|
# if ($i == scalar(@refTypes)) { |
41
|
|
|
|
|
|
|
# warn ("reference (list) is not defined"); |
42
|
|
|
|
|
|
|
# } else { |
43
|
|
|
|
|
|
|
# $log_processing->list_modified_level($reference_name, $fields->{$reference_name}); |
44
|
|
|
|
|
|
|
# } |
45
|
|
|
|
|
|
|
######################################################################## |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
|
48
|
0
|
0
|
|
|
|
|
if (defined $fields->{'software_name'}) { |
49
|
0
|
|
|
|
|
|
$log_processing->setSoftwareName($fields->{'software_name'}); |
50
|
|
|
|
|
|
|
} else { |
51
|
0
|
|
|
|
|
|
$log_processing->{'software_name'} = undef; |
52
|
|
|
|
|
|
|
} |
53
|
0
|
0
|
|
|
|
|
if (defined $fields->{'command_line'}) { |
54
|
0
|
|
|
|
|
|
$log_processing->setCommandLine($fields->{'command_line'}); |
55
|
|
|
|
|
|
|
} else { |
56
|
0
|
|
|
|
|
|
$log_processing->{'command_line'} = undef; |
57
|
|
|
|
|
|
|
} |
58
|
0
|
0
|
|
|
|
|
if (defined $fields->{'stamp'}) { |
59
|
0
|
|
|
|
|
|
$log_processing->setStamp($fields->{'stamp'}); |
60
|
|
|
|
|
|
|
} else { |
61
|
0
|
|
|
|
|
|
$log_processing->{'stamp'} = undef; |
62
|
|
|
|
|
|
|
} |
63
|
0
|
0
|
|
|
|
|
if (defined $fields->{'tagset'}) { |
64
|
0
|
|
|
|
|
|
$log_processing->setTagset($fields->{'tagset'}); |
65
|
|
|
|
|
|
|
} else { |
66
|
0
|
|
|
|
|
|
$log_processing->{'tagset'} = undef; |
67
|
|
|
|
|
|
|
} |
68
|
0
|
0
|
|
|
|
|
if (defined $fields->{'comments'}) { |
69
|
0
|
|
|
|
|
|
$log_processing->setComments($fields->{'comments'}); |
70
|
|
|
|
|
|
|
} else { |
71
|
0
|
|
|
|
|
|
$log_processing->{'comments'} = undef; |
72
|
|
|
|
|
|
|
} |
73
|
0
|
0
|
|
|
|
|
if (defined $fields->{'list_modified_level'}) { |
74
|
0
|
|
|
|
|
|
$log_processing->list_modified_level('list_modified_level', $fields->{'list_modified_level'}); |
75
|
|
|
|
|
|
|
} |
76
|
|
|
|
|
|
|
|
77
|
0
|
|
|
|
|
|
return($log_processing); |
78
|
|
|
|
|
|
|
} |
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
sub list_modified_level { |
81
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
82
|
0
|
|
|
|
|
|
my $ref; |
83
|
|
|
|
|
|
|
my $elt; |
84
|
|
|
|
|
|
|
|
85
|
0
|
0
|
0
|
|
|
|
if ((@_) && (scalar @_ == 2)) { |
86
|
0
|
|
|
|
|
|
$self->{'reference'} = shift; |
87
|
0
|
|
|
|
|
|
$self->{$self->{'reference'}} = []; |
88
|
0
|
|
|
|
|
|
$ref = shift; |
89
|
0
|
|
|
|
|
|
foreach $elt (@$ref) { |
90
|
0
|
|
|
|
|
|
push @{$self->{$self->{'reference'}}}, $elt; |
|
0
|
|
|
|
|
|
|
91
|
|
|
|
|
|
|
} |
92
|
|
|
|
|
|
|
} |
93
|
0
|
|
|
|
|
|
return($self->{$self->{'reference'}}); |
94
|
|
|
|
|
|
|
} |
95
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
sub next { |
97
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
98
|
|
|
|
|
|
|
|
99
|
0
|
0
|
|
|
|
|
$self->{'next'} = shift if @_; |
100
|
0
|
|
|
|
|
|
return($self->{'next'}); |
101
|
|
|
|
|
|
|
} |
102
|
|
|
|
|
|
|
|
103
|
|
|
|
|
|
|
sub previous { |
104
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
105
|
|
|
|
|
|
|
|
106
|
0
|
0
|
|
|
|
|
$self->{'previous'} = shift if @_; |
107
|
0
|
|
|
|
|
|
return($self->{'previous'}); |
108
|
|
|
|
|
|
|
} |
109
|
|
|
|
|
|
|
|
110
|
|
|
|
|
|
|
sub setId { |
111
|
0
|
|
|
0
|
0
|
|
my($self, $id) = @_; |
112
|
|
|
|
|
|
|
# $id is a reference of an array |
113
|
|
|
|
|
|
|
|
114
|
0
|
|
|
|
|
|
$self->{'log_id'} = $id; |
115
|
|
|
|
|
|
|
} |
116
|
|
|
|
|
|
|
|
117
|
|
|
|
|
|
|
sub getId { |
118
|
0
|
|
|
0
|
0
|
|
my($self) = @_; |
119
|
|
|
|
|
|
|
# id field is a reference of an array |
120
|
|
|
|
|
|
|
|
121
|
0
|
|
|
|
|
|
return($self->{'log_id'}); |
122
|
|
|
|
|
|
|
} |
123
|
|
|
|
|
|
|
|
124
|
|
|
|
|
|
|
sub setComments { |
125
|
0
|
|
|
0
|
0
|
|
my($self, $Comments) = @_; |
126
|
|
|
|
|
|
|
# $Comments is a reference of an array |
127
|
|
|
|
|
|
|
|
128
|
0
|
|
|
|
|
|
$self->{'comments'} = $Comments; |
129
|
|
|
|
|
|
|
} |
130
|
|
|
|
|
|
|
|
131
|
|
|
|
|
|
|
sub getComments { |
132
|
0
|
|
|
0
|
0
|
|
my($self) = @_; |
133
|
|
|
|
|
|
|
# comments field is a reference of an array |
134
|
|
|
|
|
|
|
|
135
|
0
|
|
|
|
|
|
return($self->{'comments'}); |
136
|
|
|
|
|
|
|
} |
137
|
|
|
|
|
|
|
|
138
|
|
|
|
|
|
|
sub setTagset { |
139
|
0
|
|
|
0
|
0
|
|
my($self, $Tagset) = @_; |
140
|
|
|
|
|
|
|
# $Tagset is a reference of an array |
141
|
|
|
|
|
|
|
|
142
|
0
|
|
|
|
|
|
$self->{'tagset'} = $Tagset; |
143
|
|
|
|
|
|
|
} |
144
|
|
|
|
|
|
|
sub getTagset { |
145
|
0
|
|
|
0
|
0
|
|
my($self) = @_; |
146
|
|
|
|
|
|
|
# tagset field is a reference of an array |
147
|
|
|
|
|
|
|
|
148
|
0
|
|
|
|
|
|
return($self->{'tagset'}); |
149
|
|
|
|
|
|
|
} |
150
|
|
|
|
|
|
|
|
151
|
|
|
|
|
|
|
sub setStamp { |
152
|
0
|
|
|
0
|
0
|
|
my($self, $Stamp) = @_; |
153
|
|
|
|
|
|
|
|
154
|
0
|
|
|
|
|
|
$self->{'stamp'} = $Stamp; |
155
|
|
|
|
|
|
|
} |
156
|
|
|
|
|
|
|
|
157
|
|
|
|
|
|
|
sub getStamp { |
158
|
0
|
|
|
0
|
0
|
|
my($self) = @_; |
159
|
|
|
|
|
|
|
|
160
|
0
|
|
|
|
|
|
return($self->{'stamp'}); |
161
|
|
|
|
|
|
|
} |
162
|
|
|
|
|
|
|
|
163
|
|
|
|
|
|
|
sub setCommandLine { |
164
|
0
|
|
|
0
|
0
|
|
my($self, $CommandLine) = @_; |
165
|
|
|
|
|
|
|
|
166
|
0
|
|
|
|
|
|
$self->{'command_line'} = $CommandLine; |
167
|
|
|
|
|
|
|
} |
168
|
|
|
|
|
|
|
|
169
|
|
|
|
|
|
|
sub getCommandLine { |
170
|
0
|
|
|
0
|
0
|
|
my($self) = @_; |
171
|
|
|
|
|
|
|
|
172
|
0
|
|
|
|
|
|
return($self->{'command_line'}); |
173
|
|
|
|
|
|
|
} |
174
|
|
|
|
|
|
|
|
175
|
|
|
|
|
|
|
sub setSoftwareName { |
176
|
0
|
|
|
0
|
0
|
|
my($self, $SoftwareName) = @_; |
177
|
|
|
|
|
|
|
|
178
|
0
|
|
|
|
|
|
$self->{'software_name'} = $SoftwareName; |
179
|
|
|
|
|
|
|
} |
180
|
|
|
|
|
|
|
|
181
|
|
|
|
|
|
|
sub getSoftwareName { |
182
|
0
|
|
|
0
|
0
|
|
my($self) = @_; |
183
|
|
|
|
|
|
|
|
184
|
0
|
|
|
|
|
|
return($self->{'software_name'}); |
185
|
|
|
|
|
|
|
} |
186
|
|
|
|
|
|
|
|
187
|
|
|
|
|
|
|
sub print { |
188
|
0
|
|
|
0
|
0
|
|
my ($self, $fh) = @_; |
189
|
0
|
0
|
|
|
|
|
if (!defined $fh) { |
190
|
0
|
|
|
|
|
|
$fh = \*STDERR |
191
|
|
|
|
|
|
|
} |
192
|
0
|
|
|
|
|
|
my $field; |
193
|
0
|
|
|
|
|
|
foreach $field (keys %$self) { |
194
|
0
|
0
|
|
|
|
|
if (defined $self->{$field}) { |
195
|
0
|
|
|
|
|
|
print $fh "$field => " . $self->{$field} . "\n"; |
196
|
|
|
|
|
|
|
} |
197
|
|
|
|
|
|
|
} |
198
|
0
|
|
|
|
|
|
return(0); |
199
|
|
|
|
|
|
|
} |
200
|
|
|
|
|
|
|
|
201
|
|
|
|
|
|
|
sub _getField { |
202
|
0
|
|
|
0
|
|
|
my ($self, $field) = @_; |
203
|
|
|
|
|
|
|
|
204
|
0
|
|
|
|
|
|
return($self->{$field}); |
205
|
|
|
|
|
|
|
} |
206
|
|
|
|
|
|
|
|
207
|
|
|
|
|
|
|
|
208
|
|
|
|
|
|
|
sub _xmldecode { # to be optimized |
209
|
0
|
|
|
0
|
|
|
my ($self, $string) = @_; |
210
|
|
|
|
|
|
|
|
211
|
0
|
|
|
|
|
|
$string =~ s/&/&/go; |
212
|
0
|
|
|
|
|
|
$string =~ s/"/\"/og; |
213
|
0
|
|
|
|
|
|
$string =~ s/'/\'/og; |
214
|
0
|
|
|
|
|
|
$string =~ s/</
|
215
|
0
|
|
|
|
|
|
$string =~ s/>/>/og; |
216
|
|
|
|
|
|
|
|
217
|
0
|
|
|
|
|
|
return($string); |
218
|
|
|
|
|
|
|
} |
219
|
|
|
|
|
|
|
|
220
|
|
|
|
|
|
|
sub _xmlencode { # to be optimized |
221
|
0
|
|
|
0
|
|
|
my ($self, $string) = @_; |
222
|
|
|
|
|
|
|
|
223
|
0
|
|
|
|
|
|
$string =~ s/&/&/og; |
224
|
0
|
|
|
|
|
|
$string =~ s/\"/"/og; |
225
|
0
|
|
|
|
|
|
$string =~ s/\'/'/og; |
226
|
0
|
|
|
|
|
|
$string =~ s/</og; |
227
|
0
|
|
|
|
|
|
$string =~ s/>/>/og; |
228
|
|
|
|
|
|
|
|
229
|
0
|
|
|
|
|
|
return($string); |
230
|
|
|
|
|
|
|
} |
231
|
|
|
|
|
|
|
|
232
|
|
|
|
|
|
|
|
233
|
|
|
|
|
|
|
sub XMLout { |
234
|
0
|
|
|
0
|
0
|
|
my ($self, $order) = @_; |
235
|
|
|
|
|
|
|
# my $field; |
236
|
|
|
|
|
|
|
|
237
|
0
|
|
|
|
|
|
return($self->SUPER::XMLout("log_processing", $order)); |
238
|
|
|
|
|
|
|
|
239
|
|
|
|
|
|
|
# my $str; |
240
|
|
|
|
|
|
|
|
241
|
|
|
|
|
|
|
# $str = "\t\n"; |
242
|
|
|
|
|
|
|
# foreach $field (@$order) { |
243
|
|
|
|
|
|
|
# if (defined $self->_getField($field)) { |
244
|
|
|
|
|
|
|
# $str .= "\t\t<$field>" . $self->_xmlencode($self->_getField($field)) . "$field>\n"; |
245
|
|
|
|
|
|
|
# } |
246
|
|
|
|
|
|
|
# } |
247
|
|
|
|
|
|
|
# $str .= "\t\n"; |
248
|
|
|
|
|
|
|
# return($str); |
249
|
|
|
|
|
|
|
} |
250
|
|
|
|
|
|
|
|
251
|
|
|
|
|
|
|
sub reference { |
252
|
0
|
|
|
0
|
0
|
|
my ($self) = @_; |
253
|
|
|
|
|
|
|
|
254
|
0
|
|
|
|
|
|
return([]); |
255
|
|
|
|
|
|
|
} |
256
|
|
|
|
|
|
|
|
257
|
|
|
|
|
|
|
|
258
|
|
|
|
|
|
|
1; |
259
|
|
|
|
|
|
|
|
260
|
|
|
|
|
|
|
__END__ |