BDE 4.39.x Production Release
Loading...
Searching...
No Matches
s_baltst.h
Go to the documentation of this file.
1/// @file s_baltst.h
2///
3///
4/// @defgroup s_baltst Package s_baltst
5/// @brief
6/// @addtogroup Standalones
7/// @{
8/// @addtogroup s_baltst
9/// @{
10/// * <a href="#s_baltst-purpose"> Purpose</a>
11/// * <a href="#s_baltst-description"> Description </a>
12/// * <a href="#s_baltst-component-synopsis"> Component Synopsis </a>
13/// * <a href="#s_baltst-auto-generated-single-class-or-struct-per-component"> Auto-Generated: Single class or struct per Component </a>
14/// * <a href="#s_baltst-auto-generated-multiple-classes-merged-into-a-single-component"> Auto-generated: Multiple Classes Merged into a Single Component </a>
15/// * <a href="#s_baltst-hand-written-superficial-test-driver"> Hand-Written Superficial Test Driver </a>
16/// * <a href="#s_baltst-schema"> Schema </a>
17/// * <a href="#s_baltst-generation-script"> Generation Script </a>
18/// * <a href="#s_baltst-rats-nest"> Rats Nest </a>
19///
20/// # Purpose {#s_baltst-purpose}
21/// Private auto-generated classes for testing of other packages.
22///
23/// @see balber, baljsn, balxml
24///
25/// # Description {#s_baltst-description}
26/// The 's_baltst' package provides a number of classes for testing
27/// encoders and decoders in other packages.
28///
29/// ## Component Synopsis {#s_baltst-component-synopsis}
30///
31/// @ref s_baltst_address :
32/// Provide value-semantic attribute classes
33///
34/// @ref s_baltst_basicrecord :
35/// Provide value-semantic attribute classes
36///
37/// @ref s_baltst_basicschema :
38/// Provide value-semantic attribute classes
39///
40/// @ref s_baltst_basicschemautil :
41/// Provide utilities for 's_baltst::BasicSchema' objects.
42///
43/// @ref s_baltst_bigrecord :
44/// Provide value-semantic attribute classes
45///
46/// @ref s_baltst_customint :
47/// Provide value-semantic attribute classes
48///
49/// @ref s_baltst_customizedstring :
50/// Provide value-semantic attribute classes
51///
52/// @ref s_baltst_customstring :
53/// Provide value-semantic attribute classes
54///
55/// @ref s_baltst_employee :
56/// Provide value-semantic attribute classes
57///
58/// @ref s_baltst_enumerated :
59/// Provide value-semantic attribute classes
60///
61/// @ref s_baltst_featuretestmessage :
62/// Provide value-semantic attribute classes
63///
64/// @ref s_baltst_featuretestmessageutil :
65/// Provide utilities for testing codecs with feature-test messages.
66///
67/// @ref s_baltst_mychoice :
68/// Provide value-semantic attribute classes
69///
70/// @ref s_baltst_myenumeration :
71/// Provide value-semantic attribute classes
72///
73/// @ref s_baltst_mysequence :
74/// Provide value-semantic attribute classes
75///
76/// @ref s_baltst_mysequencewithanonymouschoice :
77/// Provide value-semantic attribute classes
78///
79/// @ref s_baltst_mysequencewitharray :
80/// Provide value-semantic attribute classes
81///
82/// @ref s_baltst_mysequencewithattributes :
83/// Provide value-semantic attribute classes
84///
85/// @ref s_baltst_mysequencewithchoice :
86/// Provide value-semantic attribute classes
87///
88/// @ref s_baltst_mysequencewithdecimalattribute :
89/// Provide value-semantic attribute classes
90///
91/// @ref s_baltst_mysequencewithdoubleattribute :
92/// Provide value-semantic attribute classes
93///
94/// @ref s_baltst_mysequencewithnillable :
95/// Provide value-semantic attribute classes
96///
97/// @ref s_baltst_mysequencewithnillables :
98/// Provide value-semantic attribute classes
99///
100/// @ref s_baltst_mysequencewithnullable :
101/// Provide value-semantic attribute classes
102///
103/// @ref s_baltst_mysequencewithnullables :
104/// Provide value-semantic attribute classes
105///
106/// @ref s_baltst_mysequencewithprecisiondecimalattribute :
107/// Provide value-semantic attribute classes
108///
109/// @ref s_baltst_mysimplecontent :
110/// Provide value-semantic attribute classes
111///
112/// @ref s_baltst_mysimpleintcontent :
113/// Provide value-semantic attribute classes
114///
115/// @ref s_baltst_ratsnest :
116/// Provide value-semantic attribute classes
117///
118/// @ref s_baltst_rawdata :
119/// Provide value-semantic attribute classes
120///
121/// @ref s_baltst_rawdataswitched :
122/// Provide value-semantic attribute classes
123///
124/// @ref s_baltst_rawdataunformatted :
125/// Provide value-semantic attribute classes
126///
127/// @ref s_baltst_request :
128/// Provide value-semantic attribute classes
129///
130/// @ref s_baltst_response :
131/// Provide value-semantic attribute classes
132///
133/// @ref s_baltst_sequencewithanonymity :
134/// Provide value-semantic attribute classes
135///
136/// @ref s_baltst_simplerequest :
137/// Provide value-semantic attribute classes
138///
139/// @ref s_baltst_sqrt :
140/// Provide value-semantic attribute classes
141///
142/// @ref s_baltst_sqrtf :
143/// Provide value-semantic attribute classes
144///
145/// @ref s_baltst_test :
146/// Provide a superficial test of all classes in 'baltst' package.
147///
148/// @ref s_baltst_timingrequest :
149/// Provide value-semantic attribute classes
150///
151/// @ref s_baltst_topchoice :
152/// Provide value-semantic attribute classes
153///
154/// @ref s_baltst_unsignedsequence :
155/// Provide value-semantic attribute classes
156///
157/// @ref s_baltst_voidsequence :
158/// Provide value-semantic attribute classes
159///
160/// ### Auto-Generated: Single class or struct per Component {#s_baltst-auto-generated-single-class-or-struct-per-component}
161///
162/// @code
163/// Component 'class' or 'struct'
164/// ---------------------------------------- ------------------------------------
165/// s_baltst_address Address
166/// s_baltst_basicrecord BasicRecord
167/// s_baltst_bigrecord BigRecord
168/// s_baltst_customint CustomInt
169/// s_baltst_customizedstring CustomString
170/// s_baltst_customstring CustomizedString
171/// s_baltst_employee Employee
172/// s_baltst_enumerated Enumerated
173/// s_baltst_mychoice MyChoice
174/// s_baltst_myenumeration MyEnumeration
175/// s_baltst_mysequence MySequence
176/// s_baltst_mysequencewithanonymouschoice MySequenceWithAnonymousChoice
177/// s_baltst_mysequencewitharray MySequenceWithArray
178/// s_baltst_mysequencewithattributes MySequenceWithAttributes
179/// s_baltst_mysequencewithnillable MySequenceWithNillable
180/// s_baltst_mysequencewithnillables MySequenceWithNillables
181/// s_baltst_mysequencewithnullable MySequenceWithNullable
182/// s_baltst_mysequencewithnullables MySequenceWithNullables
183/// s_baltst_mysimplecontent MySimpleContent
184/// s_baltst_mysimpleintcontent MySimpleIntContent
185/// s_baltst_rawdata RawData
186/// s_baltst_rawdataswitched RawDataSwitched
187/// s_baltst_rawdataunformatted RawDataUnformatted
188/// s_baltst_sqrt Sqrt
189/// s_baltst_sqrtf SqrtF
190/// s_baltst_timingrequest TimingRequest
191/// s_baltst_topchoice Topchoice
192/// @endcode
193///
194/// ### Auto-generated: Multiple Classes Merged into a Single Component {#s_baltst-auto-generated-multiple-classes-merged-into-a-single-component}
195///
196/// The nine components:
197/// @code
198/// s_baltst_ratsnest{choice{1,2,3},sequence{1,2,3,4,5,6}}
199/// @endcode
200/// define the nine classes:
201/// @code
202/// Choice1
203/// Choice2
204/// Choice3
205/// Sequence1
206/// Sequence2
207/// Sequence3
208/// Sequence4
209/// Sequence5
210/// Sequence6
211/// @endcode
212/// These nine auto-generated components must be merged into a single component,
213/// @ref s_baltst_ratsnest , after being generated. See instructions under {Rat's
214/// Nest}).
215///
216/// ### Hand-Written Superficial Test Driver {#s_baltst-hand-written-superficial-test-driver}
217///
218/// There is only one test driver in the package. All it has is a breathing test
219/// which default constructs every value type in the package, and ensures that
220/// 'operator==' and 'operator!=' exist and work and that 'operator<<' exists.
221/// @code
222/// s_baltst_test
223/// @endcode
224///
225/// ### Schema {#s_baltst-schema}
226///
227/// @code
228/// s_baltst.xsd
229/// @endcode
230///
231/// ### Generation Script {#s_baltst-generation-script}
232///
233/// @code
234/// s_baltst_codegen.sh
235/// @endcode
236/// To run this script, copy 'baltxt.xsd' and 's_baltst_codegen.sh' to an empty
237/// directory, and run the script there with no arguments.
238/// @code
239/// $ mkdir tmpDir
240/// $ cp s_baltst.xsd s_baltst_codegen.sh tmpDir
241/// $ cd tmpDir
242/// $ ./s_baltst_codegen.sh
243/// @endcode
244/// The script will refuse to run in the source directory where it lives, since
245/// that would write over the source there, most of which will probably not need
246/// to be changed.
247///
248/// The script will generate all the components listed in {Auto-Generated: Single
249/// 'class' or 'struct' per Component} above (but not @ref s_baltst_test ), which will
250/// not need any modification. If the changes you made to schema file
251/// 's_baltst.xsd' affect only classes in these components, you can just copy
252/// those components into your source directory, rebuild, and you are done.
253///
254/// ### Rats Nest {#s_baltst-rats-nest}
255///
256/// The file @ref s_baltst_ratsnest will NOT be auto-generated, instead the script
257/// will generate 9 rat's nest components, with one class apiece.
258/// @code
259/// s_baltst_ratsnestchoice1
260/// s_baltst_ratsnestchoice2
261/// s_baltst_ratsnestchoice3
262/// s_baltst_ratsnestsequence1
263/// s_baltst_ratsnestsequence2
264/// s_baltst_ratsnestsequence3
265/// s_baltst_ratsnestsequence4
266/// s_baltst_ratsnestsequence5
267/// s_baltst_ratsnestsequence6
268/// @endcode
269/// The classes in these components have a complex and sometimes circular set of
270/// dependencies, hence the name 'Rat's Nest' and the need for them to be in a
271/// single component, which shall be named @ref s_baltst_ratsnest .
272///
273/// To get the includes needed for 's_baltst_ratsnest.h', do:
274/// @code
275/// $ grep '#include' s_baltst_ratsnest*.h | sed -e 's/^.*[:]//' | sort -u
276/// @endcode
277/// and for 's_baltst_ratsnest.cpp', do:
278/// @code
279/// $ grep '#include' s_baltst_ratsnest*.cpp | sed -e 's/^.*[:]//' | sort -u
280/// @endcode
281/// However, BAS does not seem to be designed with circular dependencies in mind,
282/// and when putting classes into separate component, seems to have each component
283/// include include files from all the previously generated components, without
284/// regard to which dependencies actually exist.
285///
286/// This winds up being problematic, because a lot of other 's_baltst_*'
287/// components include 'baltst_ratsnest.h', which combined with the complex and
288/// circular dependences, results in compilation failures. But it turns out that
289/// the ONLY other 's_baltst' include files needed to be included by
290/// 's_baltst_ratsnest.h' are 's_baltst_customint.h', 's_baltst_customstring.h',
291/// and 's_baltst_enumerated.h'. Other than include files from other packages and
292/// the system, 's_baltst_ratsnest.cpp' does not need any include file other than
293/// 's_baltst_ratsnest.h'.
294///
295/// Forward declare all 9 classes at the beginning before defining them, but
296/// that's not enough, the order in which they are defined is important. Because
297/// of the dependencies, if they are defined in alphabetical order, very, very
298/// bizarre (apparently 'impossible') and hard to understand compiler errors are
299/// generated. An order of the class definitions that has been found to work is:
300/// @code
301///7. Choice1
302/// Choice2
303/// Sequence2
304/// Sequence3
305/// Sequence4
306/// Sequence5
307/// Sequence6
308/// Choice3
309/// Sequence1
310/// @endcode
311/// Define all the classes first and all definitions of inline and template
312/// functions should follow the last one.
313///
314/// The 's_baltst_ratsnest*.cpp' files can be merged into 's_baltst_ratsnest.cpp'
315/// through a similar means, though the ordering of things in that file is
316/// unimportant and can be in alphabetical order by class name.
317///
318/// If you just changed the schema for a subset of the rat's nest classes, you can
319/// hand-migrate your new work into 's_baltst_ratsnets.{h,cpp}'.
320///
321/// @}
322/** @} */