Provide functions to return BDEX version information for types.
More...
Namespaces |
namespace | bslx |
Detailed Description
- Outline
-
-
- Purpose:
- Provide functions to return BDEX version information for types.
-
- Classes:
-
-
- Description:
- This component provides a namespace,
bslx::VersionFunctions
, that contains functions for determining the BDEX version number for types.
- This namespace defines the
maxSupportedBdexVersion
function, which is overloaded to return a predetermined value, k_NO_VERSION
, also defined in this namespace, for each of the fundamental types, enum
types, and bsl::string
. For bsl::vector
, the maxSupportedBdexVersion
function returns 1 if the vector is parameterized on one of the three types mentioned above. Otherwise, the version number returned is the same as that returned for bsl::vector::value_type
. For BDEX-compliant types, the function returns the BDEX version number returned by the maxSupportedBdexVersion
method provided by that type.
- In general, this component is used by higher-level
bslx
components to query the version number for types.
-
- Usage:
- This section illustrates intended use of this component.
-
- Example 1: Querying BDEX Version:
- This component may be used by clients to query the version number for types in a convenient manner. First, define an
enum
, my_Enum
: enum my_Enum {
ENUM_VALUE1,
ENUM_VALUE2,
ENUM_VALUE3,
ENUM_VALUE4
};
Then, define a BDEX-compliant class, my_Class
: Finally, verify the value returned by maxSupportedBdexVersion
for some fundamental types, my_Enum
, and my_Class
with an arbitrary versionSelector
: