BDE 4.14.0 Production release
Loading...
Searching...
No Matches
bsldoc_glossary.h
Go to the documentation of this file.
1
/// @file bsldoc_glossary.h
2
///
3
/// The content of this file has been pre-processed for Doxygen.
4
///
5
6
7
// bsldoc_glossary.h -*-C++-*-
8
#ifndef INCLUDED_BSLDOC_GLOSSARY
9
#define INCLUDED_BSLDOC_GLOSSARY
10
11
#include <
bsls_ident.h
>
12
BSLS_IDENT
(
"$Id: $"
)
13
14
/// @defgroup bsldoc_glossary bsldoc_glossary
15
/// @brief Provide definitions for terms used throughout BDE documentation.
16
/// @addtogroup bsl
17
/// @{
18
/// @addtogroup bsldoc
19
/// @{
20
/// @addtogroup bsldoc_glossary
21
/// @{
22
///
23
/// <h1> Outline </h1>
24
/// * <a href="#bsldoc_glossary-purpose"> Purpose</a>
25
/// * <a href="#bsldoc_glossary-classes"> Classes </a>
26
/// * <a href="#bsldoc_glossary-description"> Description </a>
27
/// * <a href="#bsldoc_glossary-terminology"> Terminology (in Alphabetic Order) </a>
28
/// * <a href="#bsldoc_glossary-alias-safe"> Alias-Safe [UC.1] </a>
29
/// * <a href="#bsldoc_glossary-attribute-type"> Attribute Type [TC.3] </a>
30
/// * <a href="#bsldoc_glossary-basic-guarantee"> Basic Guarantee [ES.2] </a>
31
/// * <a href="#bsldoc_glossary-complex-constrained-attribute-type"> Complex-Constrained Attribute Type [TC.6] </a>
32
/// * <a href="#bsldoc_glossary-const-thread-safe"> const Thread-Safe [TS.2] </a>
33
/// * <a href="#bsldoc_glossary-exception-neutral"> Exception-Neutral [ES.1] </a>
34
/// * <a href="#bsldoc_glossary-fully-thread-safe"> Fully Thread-Safe [TS.3] </a>
35
/// * <a href="#bsldoc_glossary-guard"> Guard [UC.2] </a>
36
/// * <a href="#bsldoc_glossary-in-core-value-semantic-type"> In-Core Value-Semantic Type [TC.2] </a>
37
/// * <a href="#bsldoc_glossary-injected-exception"> Injected Exception [ES.5] </a>
38
/// * <a href="#bsldoc_glossary-mechanism"> Mechanism [TC.8] </a>
39
/// * <a href="#bsldoc_glossary-minimally-thread-safe"> Minimally Thread-Safe [TS.1] </a>
40
/// * <a href="#bsldoc_glossary-no-throw-guarantee"> No-Throw Guarantee [ES.4] </a>
41
/// * <a href="#bsldoc_glossary-proctor"> Proctor [UC.3] </a>
42
/// * <a href="#bsldoc_glossary-protocol"> Protocol [TC.7] </a>
43
/// * <a href="#bsldoc_glossary-simply-constrained-attribute-type"> Simply-Constrained Attribute Type [TC.5] </a>
44
/// * <a href="#bsldoc_glossary-strong-guarantee"> Strong Guarantee [ES.3] </a>
45
/// * <a href="#bsldoc_glossary-thread-aware"> Thread-Aware [TS.4] </a>
46
/// * <a href="#bsldoc_glossary-thread-enabled"> Thread-Enabled [TS.5] </a>
47
/// * <a href="#bsldoc_glossary-unconstrained-attribute-type"> Unconstrained Attribute Type [TC.4] </a>
48
/// * <a href="#bsldoc_glossary-utility-type"> Utility Type [TC.9] </a>
49
/// * <a href="#bsldoc_glossary-value-semantic-operations"> Value-Semantic Operations [VS.1] </a>
50
/// * <a href="#bsldoc_glossary-value-semantic-type"> Value-Semantic Type [TC.1] </a>
51
/// * <a href="#bsldoc_glossary-vocabulary-type"> Vocabulary Type [TC.10] </a>
52
///
53
/// # Purpose {#bsldoc_glossary-purpose}
54
/// Provide definitions for terms used throughout BDE documentation.
55
///
56
/// # Classes {#bsldoc_glossary-classes}
57
///
58
///
59
/// # Description {#bsldoc_glossary-description}
60
/// This component documents common terminology that is used
61
/// throughout the rest of BDE component documentation. The terminology is
62
/// broken into the following sections:
63
/// @code
64
/// ,-------------------------------------------------------------------------.
65
/// | Topic | Term | Key |
66
/// |-------------------------------------------------------------------------|
67
/// | Exception Safety | | |
68
/// | | Exception-Neutral | [ES.1 ] |
69
/// | | Basic Guarantee | [ES.2 ] |
70
/// | | Strong Guarantee | [ES.3 ] |
71
/// | | No-Throw Guarantee | [ES.4 ] |
72
/// | | Injected Exception | [ES.5 ] |
73
/// |---------------------+-----------------------------------------+---------|
74
/// | Thread Safety | | |
75
/// | | Minimally Thread-Safe | [TS.1 ] |
76
/// | | 'const' Thread-Safe | [TS.2 ] |
77
/// | | Fully Thread-Safe | [TS.3 ] |
78
/// | | Thread-Aware | [TS.4 ] |
79
/// | | Thread-Enabled | [TS.5 ] |
80
/// |---------------------+-----------------------------------------+---------|
81
/// | Type Classification | | |
82
/// | | Value-Semantic Type | [TC.1 ] |
83
/// | | In-Core Value-Semantic Type | [TC.2 ] |
84
/// | | Attribute Type | [TC.3 ] |
85
/// | | Unconstrained Attribute Type | [TC.4 ] |
86
/// | | Simply-Constrained Attribute Type | [TC.5 ] |
87
/// | | Complex-Constrained Attribute Type | [TC.6 ] |
88
/// | | Protocol | [TC.7 ] |
89
/// | | Mechanism | [TC.8 ] |
90
/// | | Utility Type | [TC.9 ] |
91
/// | | Vocabulary Type | [TC.10] |
92
/// |---------------------+-----------------------------------------+---------|
93
/// | Value Semantics | | |
94
/// | | Value-Semantic Operations | [VS.1 ] |
95
/// |---------------------+-----------------------------------------+---------|
96
/// | Uncategorized | | |
97
/// | | Alias-Safe | [UC.1 ] |
98
/// | | Guard | [UC.2 ] |
99
/// | | Proctor | [UC.3 ] |
100
/// `-------------------------------------------------------------------------'
101
/// @endcode
102
///
103
/// ## Terminology (in Alphabetic Order) {#bsldoc_glossary-terminology}
104
///
105
///
106
///
107
/// ### Alias-Safe [UC.1] {#bsldoc_glossary-alias-safe}
108
///
109
///
110
/// * A *function* is *alias-safe* if it behaves as advertized in its contract,
111
/// even when multiple arguments are aliases for the same object or
112
/// overlapping regions of memory.
113
/// * A *class* is alias-safe if all of its methods are alias-safe.
114
///
115
/// ### Attribute Type [TC.3] {#bsldoc_glossary-attribute-type}
116
///
117
///
118
/// * A value-semantic type (see "Value-Semantic Type") is an *attribute*
119
/// *type* if the type provides no primitive functionality other than
120
/// standard value-semantic operations (e.g., equality comparison) along with
121
/// manipulators and accessors to get and set the contained attribute fields.
122
/// - Attribute types are a subset of value-semantic types. Therefore, an
123
/// attribute type must provide a notion of value (i.e., provide
124
/// `operator==`).
125
/// - See "Value-Semantic Operations" for a list of standard value-semantic
126
/// operations.
127
///
128
/// ### Basic Guarantee [ES.2] {#bsldoc_glossary-basic-guarantee}
129
///
130
///
131
/// * A *class* provides the *basic* *guarantee* if objects of that type emerge
132
/// in some valid, but otherwise unspecified, state should one of its methods
133
/// terminate as the result of an injected exception (irrespective of the
134
/// exception source).
135
///
136
/// ### Complex-Constrained Attribute Type [TC.6] {#bsldoc_glossary-complex-constrained-attribute-type}
137
///
138
///
139
/// * An attribute type (see "Attribute Type") is a *complex-constrained*
140
/// *attribute* *type* if there are constraints on the values of one or more
141
/// attributes, and the value of one attribute affects what values are valid
142
/// for one or more other attributes.
143
/// - Complex-constrained attribute types are a subset of attribute types,
144
/// which, in turn, are a subset of value-semantic types. Therefore, a
145
/// complex-constrained attribute type must have a notion of value (i.e.,
146
/// define `operator==`) and provide no primitive functionality aside from
147
/// the standard value-semantic operations with manipulators and accessors
148
/// to get and set the contained attribute fields.
149
///
150
/// ### const Thread-Safe [TS.2] {#bsldoc_glossary-const-thread-safe}
151
///
152
///
153
/// * A *class* is *`const`* *thread-safe* if its accessors may be invoked
154
/// concurrently from different threads, but it is not safe to access or
155
/// modify an object of that class in one thread while another thread
156
/// modifies the same object.
157
/// - This is the default, and is generally true of classes without either
158
/// static or mutable data members.
159
/// - BDE components are assumed to be `const` thread-safe unless documented
160
/// otherwise.
161
/// - A class that is `const` thread-safe is also minimally thread-safe.
162
///
163
/// ### Exception-Neutral [ES.1] {#bsldoc_glossary-exception-neutral}
164
///
165
///
166
/// * A *function* is *exception-neutral* if it safely propagates to its caller
167
/// externally injected exceptions (e.g., via lower-level code, template
168
/// parameters, virtual functions, or callbacks).
169
/// * A *class* is exception-neutral if all of its methods are
170
/// exception-neutral.
171
/// - A class is exception-neutral if it provides at least the *basic*
172
/// *guarantee*, and propagates injected exceptions.
173
/// - BDE components use RAII to provide exception neutrality, not
174
/// `try`/`catch`.
175
///
176
/// ### Fully Thread-Safe [TS.3] {#bsldoc_glossary-fully-thread-safe}
177
///
178
///
179
/// * A *class* is *fully* *thread-safe* if all non-creators (and any `friend`
180
/// functions) can safely execute concurrently.
181
/// - A class that is fully thread-safe and has at least one manipulator is
182
/// also thread-aware.
183
/// - A `const` thread-safe class that has no manipulators is fully
184
/// thread-safe.
185
/// - Notably it is not safe to destroy an object before before all functions
186
/// called on the object have completed. Typically some form of
187
/// synchronization (external to the object itself) is need to ensure that
188
/// the object can be safely destroyed.
189
///
190
/// ### Guard [UC.2] {#bsldoc_glossary-guard}
191
///
192
///
193
/// * A (scoped) guard is an object that maintains control over an associated
194
/// resource (often acquired on construction) and releases that control when
195
/// the guard is destroyed (typically at scope exit -- either normally or
196
/// because an exception was thrown). The guard *may* provide an explicit
197
/// release method, but -- unlike a Proctor (see [UC.3]) -- such a release
198
/// method is not commonly used.
199
/// - A canonical example is a lock guard (e.g., `std::lock_guard`), which
200
/// acquires a lock (typically on a mutex) at construction, and releases
201
/// that lock upon the guard's destruction.
202
///
203
/// ### In-Core Value-Semantic Type [TC.2] {#bsldoc_glossary-in-core-value-semantic-type}
204
///
205
///
206
/// * A value-semantic type (see "Value-Semantic Type") is an *in-core*
207
/// *value-semantic* *type* if the type's value is somehow tied to the
208
/// current process, for example, if a *salient* *attribute* of the value is
209
/// a reference to (i.e., the address of) some other autonomous (un-owned)
210
/// object.
211
/// - In-core value-semantic types are a subset of value-semantic types.
212
/// Therefore, an in-core value-semantic type must have a notion of value
213
/// (i.e., provide `operator==`).
214
/// - Because an in-core value-semantic type's notion of value is tied to the
215
/// current process, that "value" (by itself) is not externalizable.
216
///
217
/// ### Injected Exception [ES.5] {#bsldoc_glossary-injected-exception}
218
///
219
///
220
/// * An *injected* *exception* is any exception generated within a method of
221
/// an object without the explicit use of `throw`. For example, an exception
222
/// may be injected by calling a method on a contained object (which, in
223
/// turn, throws), or via a template parameter, virtual function call, or
224
/// callback.
225
///
226
/// ### Mechanism [TC.8] {#bsldoc_glossary-mechanism}
227
///
228
///
229
/// * A *class* is a *mechanism* if objects of the class maintain state, but
230
/// have no sensible notion of value. Therefore, mechanisms do not provide
231
/// standard value-semantic operations such as equality comparison,
232
/// copy construction, or copy assignment.
233
/// - For example, memory allocators and thread pools are mechanisms.
234
///
235
/// ### Minimally Thread-Safe [TS.1] {#bsldoc_glossary-minimally-thread-safe}
236
///
237
///
238
/// * A *class* is *minimally* *thread-safe* if two threads can safely operate
239
/// on two distinct objects of the class.
240
///
241
/// ### No-Throw Guarantee [ES.4] {#bsldoc_glossary-no-throw-guarantee}
242
///
243
///
244
/// * A *function* provides the *no-throw* *guarantee* if it will not throw, or
245
/// in any way propagate, an exception to the caller under any circumstances.
246
/// - The no-throw guarantee is exceedingly rare in BDE libraries. Any
247
/// memory allocation performed using a type derived from
248
/// `bslma::Allocator` may throw a memory-allocation exception.
249
/// Additionally, a function may test its input to verify that it has been
250
/// called in-contract (e.g., using @ref bsls_assert ) and may throw an
251
/// exception in cases where it is called out-of-contract (functions with
252
/// any undefined behavior, by definition, cannot provide the no-throw
253
/// guarantee).
254
///
255
/// ### Proctor [UC.3] {#bsldoc_glossary-proctor}
256
///
257
///
258
/// * A proctor is a special kind of guard intended to restore a valid state
259
/// under abnormal circumstances (e.g., a thrown exception), until a valid
260
/// state is restored normally, after which the proctor's responsibility is
261
/// explicitly released by its client. The proctor *must* provide a
262
/// mechanism to release the resource from management, and -- unlike a
263
/// standard Guard (see [UC.2]) -- its management responsibility is
264
/// typically released prior to its destruction.
265
/// - A canonical example is `bslalg::AutoArrayDestructor`, which is used to
266
/// implement exception safety while moving elements within an array,
267
/// restoring a valid state in case of an exception, or doing nothing once
268
/// its `release` method is invoked (after a valid state has been
269
/// reestablished).
270
///
271
/// ### Protocol [TC.7] {#bsldoc_glossary-protocol}
272
///
273
///
274
/// * A *protocol* is an abstract base class defining only pure virtual
275
/// functions, aside from the (non-pure virtual) destructor.
276
/// - Protocol is a more precisely defined term for what is frequently
277
/// referred to as an "interface".
278
///
279
/// ### Simply-Constrained Attribute Type [TC.5] {#bsldoc_glossary-simply-constrained-attribute-type}
280
///
281
///
282
/// * An attribute type (see "Attribute Type") is a *simply-constrained*
283
/// *attribute* *type* if there are constraints on the values of one or more
284
/// individual attributes, but the constraints are independent.
285
/// - Simply-constrained attribute types are a subset of attribute types,
286
/// which, in turn, are a subset of value-semantic types. Therefore, a
287
/// simply-constrained attribute type must have a notion of value (i.e.,
288
/// define `operator==`), and provide no primitive functionality aside from
289
/// the standard value-semantic operations with manipulators and accessors
290
/// to get and set the contained attribute fields.
291
///
292
/// ### Strong Guarantee [ES.3] {#bsldoc_glossary-strong-guarantee}
293
///
294
///
295
/// * A *class* provides the *strong* *guarantee* if objects of that type
296
/// emerge with all of their (observable) state unchanged (e.g., all
297
/// iterators on the object will remain valid), and none of its output
298
/// parameters modified, should one of its methods terminate as the result of
299
/// an injected exception (irrespective of the exception source). Note that
300
/// it is not generally possible to ensure that all global state, or optional
301
/// modifiable parameters (e.g., allocators), will be entirely unaffected.
302
///
303
/// ### Thread-Aware [TS.4] {#bsldoc_glossary-thread-aware}
304
///
305
///
306
/// * A *class* that is *thread-aware* is designed with multithreading in mind
307
/// and provides at least one manipulator (or `friend` function) that can
308
/// safely execute concurrently on a single object by multiple threads.
309
///
310
/// ### Thread-Enabled [TS.5] {#bsldoc_glossary-thread-enabled}
311
///
312
///
313
/// * A *class* that is *thread-enabled* is designed to directly interact with
314
/// threads, and cannot function correctly in a non-multithreading
315
/// environment (e.g., a thread pool is thread-enabled, so *must* be used in
316
/// a multithreading environment). Typically a *thread-enabled* class
317
/// creates or joins threads.
318
///
319
/// ### Unconstrained Attribute Type [TC.4] {#bsldoc_glossary-unconstrained-attribute-type}
320
///
321
///
322
/// * An attribute type (see "Attribute Type") is an *unconstrained*
323
/// *attribute* *type* if every combination of individual attribute values is
324
/// valid for the overall type.
325
/// - Unconstrained attribute types are a subset of attribute types, which,
326
/// in turn, are a subset of value-semantic types. Therefore, an
327
/// unconstrained attribute type must have a notion of value (i.e., define
328
/// `operator==`) and provide no primitive functionality aside from the
329
/// standard value-semantic operations with manipulators and accessors to
330
/// get and set the contained attribute fields.
331
///
332
/// ### Utility Type [TC.9] {#bsldoc_glossary-utility-type}
333
///
334
///
335
/// * A *utility* *type* is a `struct` (or `class`) serving as a namespace for
336
/// a suite of C-style (static) functions. These types have no instance data
337
/// members or instance methods.
338
///
339
/// ### Value-Semantic Operations [VS.1] {#bsldoc_glossary-value-semantic-operations}
340
///
341
///
342
/// * A standard set of operations provided by all value-semantic types (see
343
/// "Value-Semantic Type"). A value-semantic type provides all of these
344
/// operators unless otherwise documented:
345
/// - Equality and Non-Equality Comparisons
346
/// - Copy Construction
347
/// - Copy Assignment
348
/// - Default Construction
349
/// - `ostream` Printing
350
/// - `bslx` Serialization (optional)
351
///
352
/// ### Value-Semantic Type [TC.1] {#bsldoc_glossary-value-semantic-type}
353
///
354
///
355
/// * A *class* is a *value-semantic* *type* if objects of that type have a
356
/// value. A type provides a value if and only if the class defines
357
/// `operator==`, and the value of an object of that class is defined in
358
/// terms of `operator==`: Two objects of a type *have* *the* *same* *value*
359
/// if and only if `operator==`, when applied to these objects, returns
360
/// `true`. In addition, types that define a value (i.e., provide
361
/// `operator==`) *must* have the following properties:
362
/// 1. `operator==` is commutative (i.e., `A == B` if and only if `B == A`).
363
/// 2. `operator!=` is the inverse of `operator==` (i.e., `A != B` if and only
364
/// if `!(A == B)`).
365
/// 3. Two object of the type have the same value if and only if the values of
366
/// each of the *salient* *attributes* -- i.e., those attributes (each a
367
/// value-semantic type) that comprise the value -- respectively compare
368
/// equal.
369
/// 4. There is *no* sequence of operations that, when separately applied to
370
/// two objects of the type having the same value, cause them to assume
371
/// different values.
372
/// 5. The value of an object of the type is independent of any modifiable
373
/// state that is not owned exclusively by that object.
374
/// 6. There exists a programmatic means, independent of the equality
375
/// operator, to determine if two objects of the type have the same value.
376
/// * A value-semantic class is exception-neutral (see "Exception-Neutral") and
377
/// provides a standard set of operations (see "Value-Semantic Operations")
378
/// unless otherwise documented.
379
///
380
/// ### Vocabulary Type [TC.10] {#bsldoc_glossary-vocabulary-type}
381
///
382
///
383
/// * A *vocabulary* *type* is a type that holds a value or performs a service
384
/// that is used widely *in* *the* *interface* of classes and/or free
385
/// function (hence, it is part of the "vocabulary" used to communicate
386
/// between types in the system).
387
/// - `bsl::string` is a vocabulary type because it is used in the interface
388
/// of many types to communicate the value of a character string.
389
/// @}
390
/** @} */
391
/** @} */
392
393
/** @addtogroup bsl
394
* @{
395
*/
396
/** @addtogroup bsldoc
397
* @{
398
*/
399
/** @addtogroup bsldoc_glossary
400
* @{
401
*/
402
403
#include <bslscm_version.h>
404
405
#endif
406
407
// ----------------------------------------------------------------------------
408
// Copyright 2013 Bloomberg Finance L.P.
409
//
410
// Licensed under the Apache License, Version 2.0 (the "License");
411
// you may not use this file except in compliance with the License.
412
// You may obtain a copy of the License at
413
//
414
// http://www.apache.org/licenses/LICENSE-2.0
415
//
416
// Unless required by applicable law or agreed to in writing, software
417
// distributed under the License is distributed on an "AS IS" BASIS,
418
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
419
// See the License for the specific language governing permissions and
420
// limitations under the License.
421
// ----------------------------- END-OF-FILE ----------------------------------
422
423
/** @} */
424
/** @} */
425
/** @} */
bsls_ident.h
BSLS_IDENT
#define BSLS_IDENT(str)
Definition
bsls_ident.h:195
doxygen_input
bde
groups
bsl
bsldoc
bsldoc_glossary.h
Generated by
1.9.8