libwreport
2.4
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
137
int
c04_bits
;
138
140
int
c04_meaning
;
141
143
Varcode
want_bitmap
;
144
151
unsigned
data_pos
;
152
153
154
Visitor
();
155
virtual
~
Visitor
();
156
161
Varinfo
get_varinfo
(
Varcode
code);
162
164
virtual
void
do_start_subset
(
unsigned
subset_no,
const
Subset
&
current_subset
);
165
173
virtual
void
do_start_repetition
(
unsigned
idx);
174
179
virtual
void
do_associated_field
(
unsigned
bit_count,
unsigned
significance) = 0;
180
185
virtual
void
do_attr
(
Varinfo
info,
unsigned
var_pos,
Varcode
attr_code) = 0;
186
190
virtual
void
do_var
(
Varinfo
info) = 0;
191
202
virtual
const
Var
&
do_semantic_var
(
Varinfo
info) = 0;
203
219
virtual
const
Var
&
do_bitmap
(
Varcode
code,
Varcode
rep_code,
Varcode
delayed_code,
const
Opcodes
& ops) = 0;
220
224
virtual
void
do_char_data
(
Varcode
code) = 0;
225
227
228
virtual
void
b_variable
(
Varcode
code);
229
virtual
void
c_modifier
(
Varcode
code);
230
virtual
void
c_change_data_width
(
Varcode
code,
int
change);
231
virtual
void
c_change_data_scale
(
Varcode
code,
int
change);
232
virtual
void
c_associated_field
(
Varcode
code,
Varcode
sig_code,
unsigned
nbits);
233
virtual
void
c_char_data
(
Varcode
code);
234
virtual
void
c_char_data_override
(
Varcode
code,
unsigned
new_length);
235
virtual
void
c_quality_information_bitmap
(
Varcode
code);
236
virtual
void
c_substituted_value_bitmap
(
Varcode
code);
237
virtual
void
c_substituted_value
(
Varcode
code);
238
virtual
void
c_local_descriptor
(
Varcode
code,
Varcode
desc_code,
unsigned
nbits);
239
virtual
void
r_replication
(
Varcode
code,
Varcode
delayed_code,
const
Opcodes
& ops);
241
};
242
248
struct
BaseVisitor
:
public
Visitor
249
{
251
Bulletin
&
bulletin
;
253
unsigned
current_subset_no
;
255
unsigned
current_var
;
256
258
BaseVisitor
(
Bulletin
&
bulletin
);
259
261
Var
&
get_var
();
263
Var
&
get_var
(
unsigned
var_pos)
const
;
264
265
virtual
void
do_start_subset
(
unsigned
subset_no,
const
Subset
&
current_subset
);
266
virtual
const
Var
&
do_bitmap
(
Varcode
code,
Varcode
rep_code,
Varcode
delayed_code,
const
Opcodes
& ops);
267
};
268
274
struct
ConstBaseVisitor
:
public
Visitor
275
{
277
const
Bulletin
&
bulletin
;
279
unsigned
current_subset_no
;
281
unsigned
current_var
;
282
284
ConstBaseVisitor
(
const
Bulletin
&
bulletin
);
285
287
const
Var
&
get_var
();
289
const
Var
&
get_var
(
unsigned
var_pos)
const
;
290
291
virtual
void
do_start_subset
(
unsigned
subset_no,
const
Subset
&
current_subset
);
292
virtual
const
Var
&
do_bitmap
(
Varcode
code,
Varcode
rep_code,
Varcode
delayed_code,
const
Opcodes
& ops);
293
};
294
295
}
296
}
297
298
#endif
Generated on Fri Mar 14 2014 12:37:28 for libwreport by
1.8.1.2