libwreport
2.9
Main Page
Related Pages
Namespaces
Data Structures
Files
File List
Globals
wreport
bulletin
internals.h
1
/*
2
* wreport/bulletin/internals - Bulletin implementation helpers
3
*
4
* Copyright (C) 2005--2011 ARPA-SIM <urpsim@smr.arpa.emr.it>
5
*
6
* This program is free software; you can redistribute it and/or modify
7
* it under the terms of the GNU General Public License as published by
8
* the Free Software Foundation; either version 2 of the License.
9
*
10
* This program is distributed in the hope that it will be useful,
11
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
* GNU General Public License for more details.
14
*
15
* You should have received a copy of the GNU General Public License
16
* along with this program; if not, write to the Free Software
17
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18
*
19
* Author: Enrico Zini <enrico@enricozini.com>
20
*/
21
22
#ifndef WREPORT_BULLETIN_INTERNALS_H
23
#define WREPORT_BULLETIN_INTERNALS_H
24
25
#include <
wreport/varinfo.h
>
26
#include <
wreport/opcode.h
>
27
#include <vector>
28
29
namespace
wreport {
30
struct
Var;
31
struct
Subset;
32
struct
Bulletin;
33
34
namespace
bulletin {
35
39
struct
Bitmap
40
{
42
const
Var
*
bitmap
;
43
48
std::vector<unsigned>
refs
;
49
56
std::vector<unsigned>::const_reverse_iterator
iter
;
57
69
unsigned
old_anchor
;
70
71
Bitmap
();
72
~
Bitmap
();
73
78
void
reset
();
79
91
void
init
(
const
Var
&
bitmap
,
const
Subset
& subset,
unsigned
anchor);
92
97
bool
eob
()
const
;
98
103
unsigned
next
();
104
};
105
110
struct
Visitor
:
public
opcode::Visitor
111
{
113
const
Vartable
*
btable
;
114
116
const
Subset
*
current_subset
;
117
119
Bitmap
bitmap
;
120
122
int
c_scale_change
;
123
125
int
c_width_change
;
126
131
int
c_string_len_override
;
132
134
int
c_scale_ref_width_increase
;
135
140
int
c04_bits
;
141
143
int
c04_meaning
;
144
146
Varcode
want_bitmap
;
147
154
unsigned
data_pos
;
155
156
157
Visitor
();
158
virtual
~
Visitor
();
159
164
Varinfo
get_varinfo
(
Varcode
code);
165
167
virtual
void
do_start_subset
(
unsigned
subset_no,
const
Subset
&
current_subset
);
168
176
virtual
void
do_start_repetition
(
unsigned
idx);
177
182
virtual
void
do_associated_field
(
unsigned
bit_count,
unsigned
significance) = 0;
183
188
virtual
void
do_attr
(
Varinfo
info,
unsigned
var_pos,
Varcode
attr_code) = 0;
189
193
virtual
void
do_var
(
Varinfo
info) = 0;
194
205
virtual
const
Var
&
do_semantic_var
(
Varinfo
info) = 0;
206
222
virtual
const
Var
&
do_bitmap
(
Varcode
code,
Varcode
rep_code,
Varcode
delayed_code,
const
Opcodes
& ops) = 0;
223
227
virtual
void
do_char_data
(
Varcode
code) = 0;
228
230
virtual
void
b_variable
(
Varcode
code);
232
virtual
void
c_modifier
(
Varcode
code);
233
virtual
void
c_change_data_width
(
Varcode
code,
int
change);
234
virtual
void
c_change_data_scale
(
Varcode
code,
int
change);
235
virtual
void
c_associated_field
(
Varcode
code,
Varcode
sig_code,
unsigned
nbits);
236
virtual
void
c_char_data
(
Varcode
code);
237
virtual
void
c_char_data_override
(
Varcode
code,
unsigned
new_length);
238
virtual
void
c_quality_information_bitmap
(
Varcode
code);
239
virtual
void
c_substituted_value_bitmap
(
Varcode
code);
240
virtual
void
c_substituted_value
(
Varcode
code);
241
virtual
void
c_local_descriptor
(
Varcode
code,
Varcode
desc_code,
unsigned
nbits);
242
virtual
void
r_replication
(
Varcode
code,
Varcode
delayed_code,
const
Opcodes
& ops);
243
virtual
void
c_increase_scale_ref_width
(
Varcode
code,
int
change);
245
};
246
252
struct
BaseVisitor
:
public
Visitor
253
{
255
Bulletin
&
bulletin
;
257
unsigned
current_subset_no
;
259
unsigned
current_var
;
260
262
BaseVisitor
(
Bulletin
&
bulletin
);
263
265
Var
&
get_var
();
267
Var
&
get_var
(
unsigned
var_pos)
const
;
268
269
virtual
void
do_start_subset
(
unsigned
subset_no,
const
Subset
&
current_subset
);
270
virtual
const
Var
&
do_bitmap
(
Varcode
code,
Varcode
rep_code,
Varcode
delayed_code,
const
Opcodes
& ops);
271
};
272
278
struct
ConstBaseVisitor
:
public
Visitor
279
{
281
const
Bulletin
&
bulletin
;
283
unsigned
current_subset_no
;
285
unsigned
current_var
;
286
288
ConstBaseVisitor
(
const
Bulletin
&
bulletin
);
289
291
const
Var
&
get_var
();
293
const
Var
&
get_var
(
unsigned
var_pos)
const
;
294
295
virtual
void
do_start_subset
(
unsigned
subset_no,
const
Subset
&
current_subset
);
296
virtual
const
Var
&
do_bitmap
(
Varcode
code,
Varcode
rep_code,
Varcode
delayed_code,
const
Opcodes
& ops);
297
};
298
299
}
300
}
301
302
#endif
Generated on Wed Oct 23 2013 08:51:49 for libwreport by
1.8.4