BDE 4.39.x Production Release
Loading...
Searching...
No Matches
balber.h
Go to the documentation of this file.
1/// @file balber.h
2///
3///
4/// @defgroup balber Package balber
5/// @brief Basic Application Library BER (balber)
6/// @addtogroup bal
7/// @{
8/// @addtogroup balber
9/// @{
10/// * <a href="#balber-purpose"> Purpose</a>
11/// * <a href="#balber-mnemonic"> Mnemonic </a>
12/// * <a href="#balber-description"> Description </a>
13/// * <a href="#balber-hierarchical-synopsis"> Hierarchical Synopsis </a>
14/// * <a href="#balber-component-synopsis"> Component Synopsis </a>
15///
16/// # Purpose {#balber-purpose}
17/// Provide encoding/decoding of data per the (binary) BER rules.
18///
19/// # Mnemonic {#balber-mnemonic}
20/// Basic Application Library BER (balber)
21///
22/// # Description {#balber-description}
23/// The `balber` ("Basic Application BER") package defines classes
24/// that can encode and decode data per the X.690 BER (Basic Encoding Rules)
25/// specification. These classes can be used only for types supported by the
26/// `bdlat` framework. Typical usage is illustrated in
27/// [balber_berdecoder](@ref balber_berdecoder-example-1-decoding-an-employee-record)
28/// and
29/// [balber_berencoder](@ref balber_berencoder-example-1-encoding-an-employee-record) .
30///
31/// There are 2 sets of the encoding/decoding member functions:
32///
33/// 1. `encode` & `decode`, and
34/// 2. `encodeAny` & `decodeAny` (referred as "any-functions" below).
35///
36/// The first set uses templates and compile-time metaprogramming to generate the
37/// encoding/decoding C++ code. The second set uses the runtime dispatch
38/// approach - base classes and virtual functions - to provide the same
39/// functionality. The result does not depend on the functions you use - their
40/// functionality is absolutely identical. The difference is not in **what**
41/// they do, but in **how** they do it.
42///
43/// As usual, the compile-time approach can be faster, but generates a lot of
44/// code. And since this code is in the headers, this causes big load on the
45/// compiler and linker - the generated code is in each translation unit and in
46/// the object file generated from it. As a result, slow compilation, huge
47/// memory and CPU consumption during the compilation and linking, and a larger
48/// resulting executable file size.
49///
50/// All the above mentioned shortcomings (except the final runtime performance)
51/// can be mitigated by using the "any-functions", at the cost of a small runtime
52/// slowdown. All the encoding/decoding code is pre-compiled and located in one
53/// place - the BDE library (archive) files. But how big is the execution
54/// slowdown? Our benchmarks show that the slowdown is less than 10%.
55///
56/// ## Hierarchical Synopsis {#balber-hierarchical-synopsis}
57///
58/// The 'balber' package currently has 8 components having 4 levels of physical
59/// dependency. The list below shows the hierarchical ordering of the components.
60/// The order of components within each level is not architecturally significant,
61/// just alphabetical.
62/// @code
63/// 4. balber_berdecoder
64///
65/// 3. balber_berencoder
66///
67/// 2. balber_berencoderoptionsutil
68/// balber_beruniversaltagnumber
69/// balber_berutil
70///
71/// 1. balber_berconstants
72/// balber_berdecoderoptions
73/// balber_berencoderoptions
74/// @endcode
75///
76/// ## Component Synopsis {#balber-component-synopsis}
77///
78/// @ref balber_berconstants :
79/// Provide namespace for BER-related constants.
80///
81/// @ref balber_berdecoder :
82/// Provide a BER decoder class.
83///
84/// @ref balber_berdecoderoptions :
85/// Provide an attribute class for specifying BER decoding options.
86///
87/// @ref balber_berencoder :
88/// Provide a BER encoder class.
89///
90/// @ref balber_berencoderoptions :
91/// Provide value-semantic attribute classes
92///
93/// @ref balber_berencoderoptionsutil :
94/// Provide a utility for configuring `balber::BerEncoderOptions`.
95///
96/// @ref balber_beruniversaltagnumber :
97/// Enumerate the set of BER universal tag numbers.
98///
99/// @ref balber_berutil :
100/// Provide functions to encode and decode simple types in BER format.
101///
102/// @}
103/** @} */