Quick Links: |
Provide definitions for terms used throughout BDE documentation. More...
const
Thread-Safe [TS.2] ,-------------------------------------------------------------------------. | Topic | Term | Key | |-------------------------------------------------------------------------| | Exception Safety | | | | | Exception-Neutral | [ES.1 ] | | | Basic Guarantee | [ES.2 ] | | | Strong Guarantee | [ES.3 ] | | | No-Throw Guarantee | [ES.4 ] | | | Injected Exception | [ES.5 ] | |---------------------+-----------------------------------------+---------| | Thread Safety | | | | | Minimally Thread-Safe | [TS.1 ] | | | 'const' Thread-Safe | [TS.2 ] | | | Fully Thread-Safe | [TS.3 ] | | | Thread-Aware | [TS.4 ] | | | Thread-Enabled | [TS.5 ] | |---------------------+-----------------------------------------+---------| | Type Classification | | | | | Value-Semantic Type | [TC.1 ] | | | In-Core Value-Semantic Type | [TC.2 ] | | | Attribute Type | [TC.3 ] | | | Unconstrained Attribute Type | [TC.4 ] | | | Simply-Constrained Attribute Type | [TC.5 ] | | | Complex-Constrained Attribute Type | [TC.6 ] | | | Protocol | [TC.7 ] | | | Mechanism | [TC.8 ] | | | Utility Type | [TC.9 ] | | | Vocabulary Type | [TC.10] | |---------------------+-----------------------------------------+---------| | Value Semantics | | | | | Value-Semantic Operations | [VS.1 ] | |---------------------+-----------------------------------------+---------| | Uncategorized | | | | | Alias-Safe | [UC.1 ] | | | Guard | [UC.2 ] | | | Proctor | [UC.3 ] | `-------------------------------------------------------------------------'
A value-semantic type (see "Value-Semantic Type") is an attribute type if the type provides no primitive functionality other than standard value-semantic operations (e.g., equality comparison) along with manipulators and accessors to get and set the contained attribute fields.
operator==
). An attribute type (see "Attribute Type") is a complex-constrained attribute type if there are constraints on the values of one or more attributes, and the value of one attribute affects what values are valid for one or more other attributes.
operator==
) and provide no primitive functionality aside from the standard value-semantic operations with manipulators and accessors to get and set the contained attribute fields. A class is const
thread-safe if its accessors may be invoked concurrently from different threads, but it is not safe to access or modify an object of that class in one thread while another thread modifies the same object.
const
thread-safe unless documented otherwise. const
thread-safe is also minimally thread-safe. A class is exception-neutral if all of its methods are exception-neutral.
try
/catch
. A class is fully thread-safe if all non-creators (and any friend
functions) can safely execute concurrently.
const
thread-safe class that has no manipulators is fully thread-safe. A (scoped) guard is an object that maintains control over an associated resource (often acquired on construction) and releases that control when the guard is destroyed (typically at scope exit -- either normally or because an exception was thrown). The guard may provide an explicit release method, but -- unlike a Proctor (see [UC.3]) -- such a release method is not commonly used.
std::lock_guard
), which acquires a lock (typically on a mutex) at construction, and releases that lock upon the guard's destruction. A value-semantic type (see "Value-Semantic Type") is an in-core value-semantic type if the type's value is somehow tied to the current process, for example, if a salient attribute of the value is a reference to (i.e., the address of) some other autonomous (un-owned) object.
operator==
). throw
. For example, an exception may be injected by calling a method on a contained object (which, in turn, throws), or via a template parameter, virtual function call, or callback. A class is a mechanism if objects of the class maintain state, but have no sensible notion of value. Therefore, mechanisms do not provide standard value-semantic operations such as equality comparison, copy construction, or copy assignment.
A function provides the no-throw guarantee if it will not throw, or in any way propagate, an exception to the caller under any circumstances.
bslma::Allocator
may throw a memory-allocation exception. Additionally, a function may test its input to verify that it has been called in-contract (e.g., using bsls_assert
) and may throw an exception in cases where it is called out-of-contract (functions with any undefined behavior, by definition, cannot provide the no-throw guarantee). A proctor is a special kind of guard intended to restore a valid state under abnormal circumstances (e.g., a thrown exception), until a valid state is restored normally, after which the proctor's responsibility is explicitly released by its client. The proctor must provide a mechanism to release the resource from management, and -- unlike a standard Guard (see [UC.2]) -- its management responsibility is typically released prior to its destruction.
bslalg::AutoArrayDestructor
, which is used to implement exception safety while moving elements within an array, restoring a valid state in case of an exception, or doing nothing once its release
method is invoked (after a valid state has been reestablished). A protocol is an abstract base class defining only pure virtual functions, aside from the (non-pure virtual) destructor.
An attribute type (see "Attribute Type") is a simply-constrained attribute type if there are constraints on the values of one or more individual attributes, but the constraints are independent.
operator==
), and provide no primitive functionality aside from the standard value-semantic operations with manipulators and accessors to get and set the contained attribute fields. friend
function) that can safely execute concurrently on a single object by multiple threads. An attribute type (see "Attribute Type") is an unconstrained attribute type if every combination of individual attribute values is valid for the overall type.
operator==
) and provide no primitive functionality aside from the standard value-semantic operations with manipulators and accessors to get and set the contained attribute fields. struct
(or class
) serving as a namespace for a suite of C-style (static) functions. These types have no instance data members or instance methods. A standard set of operations provided by all value-semantic types (see "Value-Semantic Type"). A value-semantic type provides all of these operators unless otherwise documented:
ostream
Printing bslx
Serialization (optional) A class is a value-semantic type if objects of that type have a value. A type provides a value if and only if the class defines operator==
, and the value of an object of that class is defined in terms of operator==
: Two objects of a type have the same value if and only if operator==
, when applied to these objects, returns true
. In addition, types that define a value (i.e., provide operator==
) must have the following properties:
operator==
is commutative (i.e., A == B
if and only if B == A
). operator!=
is the inverse of operator==
(i.e., A != B
if and only if !(A == B)
). A vocabulary type is a type that holds a value or performs a service that is used widely in the interface of classes and/or free function (hence, it is part of the "vocabulary" used to communicate between types in the system).
bsl::string
is a vocabulary type because it is used in the interface of many types to communicate the value of a character string.