Boost C++ Libraries Home Libraries People FAQ More

PrevUpHomeNext

Mods

The mods supported by CXXD are simply those Boost libraries which have a C++ standard equivalent where the syntactical use of either is very largely the same except for the namespace involved.

The following table lists the mods supported by CXXD, in alphabetical order, and the appropriate information for each one. All header files are based off of the <boost/cxx_dual/> directory;

Table 1.1. Mods

Mod name

Header file

Namespace alias

array

array.hpp

cxxd_array_ns

atomic

atomic.hpp

cxxd_atomic_ns

bind

bind.hpp

cxxd_bind_ns

chrono

chrono.hpp

cxxd_chrono_ns

condition_variable

condition_variable.hpp

cxxd_condition_variable_ns

enable_shared_from_this

enable_shared_from_this.hpp

cxxd_enable_shared_from_this_ns

function

function.hpp

cxxd_function_ns

hash

hash.hpp

cxxd_hash_ns

make_shared

make_shared.hpp

cxxd_make_shared_ns

mem_fn

mem_fn.hpp

cxxd_mem_fn_ns

move

move.hpp

cxxd_move_ns

mutex

mutex.hpp

cxxd_mutex_ns

random

random.hpp

cxxd_random_ns

ratio

ratio.hpp

cxxd_ratio_ns

ref

ref.hpp

cxxd_ref_ns

regex

regex.hpp

cxxd_regex_ns

shared_mutex

shared_mutex.hpp

cxxd_shared_mutex_ns

shared_ptr

shared_ptr.hpp

cxxd_shared_ptr_ns

system_error

system_error.hpp

cxxd_system_error_ns

thread

thread.hpp

cxxd_thread_ns

tuple

tuple.hpp

cxxd_tuple_ns

type_index

type_index.hpp

cxxd_type_index_ns

type_traits

type_traits.hpp

cxxd_type_traits_ns

unordered_map

unordered_map.hpp

cxxd_unordered_map_ns

unordered_multimap

unordered_multimap.hpp

cxxd_unordered_multimap_ns

unordered_multiset

unordered_multiset.hpp

cxxd_unordered_multiset_ns

unordered_set

unordered_set.hpp

cxxd_unordered_set_ns

weak_ptr

weak_ptr.hpp

cxxd_weak_ptr_ns


The naming scheme for each mod follows simple common conventions:

Each of the mod headers above are separated from every other mod header in the functionality it provides for using either the Boost dual library or the C++ standard library for that mod in user code. Any number of individual mods can be used in a TU.

The shared_ptr mod is special

For the 'shared_ptr' mod a separate mod header called 'shared_ptr_all.hpp' also exists which includes the C++ header files for shared_ptr, weak_ptr, make_shared, and enable_shared_from_this for either the Boost dual library or the C++ standard dual library chosen. The 'cxxd_shared_ptr_ns' namespace can be used to program with any any of these individual C++ headers successfully. This mod header exists for convenience, since using shared_ptr functionality often involves the other libraries whose C++ header files are included by the 'shared_ptr_all.hpp' mod header, whether they are the Boost dual libraries or the C++ standard dual libraries.

If instead you use the normal 'shared_ptr.hpp' mod header only the C++ header file for shared_ptr is included and the 'cxxd_shared_ptr_ns' namespace alias should be used to program that mod. You can then separately include the mod headers for weak_ptr, make_shared, and enable_shared_from_this to use their respective functionality with the appropriate namespace alias for each one.

Both the normal 'shared_ptr.hpp' mod header and the extended 'shared_ptr_all.hpp' use the same 'cxxd_shared_ptr_ns' namespace alias, which works in either situation. There is no problem including both 'shared_ptr.hpp' and 'shared_ptr_all.hpp' in the same TU.

Mod identifiers

Each mod also has an identifier, called a "mod-ID", by which that mod is identified. The mod-ID is a VMD identifier. This means that it is registered and pre-detected so that CXXD can identify it in macro code.

The mod-IDs are not part of the individual mod headers and do not take part in the individual mod processing. Instead the mod-IDs are used in optional CXXD helper macros, which will be described later in the documentation, to allow the user of the particular macro to identify a particular mod. Each mod-ID is simply the name of the mod in upper case with 'CXXD_' prepended:

Table 1.2. Identifiers

Mod

Mod-ID

array

CXXD_ARRAY

atomic

CXXD_ATOMIC

bind

CXXD_BIND

chrono

CXXD_CHRONO

condition_variable

CXXD_CONDITION_VARIABLE

enable_shared_from_this

CXXD_ENABLE_SHARED_FROM_THIS

function

CXXD_FUNCTION

hash

CXXD_HASH

make_shared

CXXD_MAKE_SHARED

mem_fn

CXXD_MEM_FN

move

CXXD_MOVE

mutex

CXXD_MUTEX

random

CXXD_RANDOM

ratio

CXXD_RATIO

ref

CXXD_REF

regex

CXXD_REGEX

shared_mutex

CXXD_SHARED_MUTEX

shared_ptr

CXXD_SHARED_PTR

system_error

CXXD_SYSTEM_ERROR

thread

CXXD_THREAD

tuple

CXXD_TUPLE

type_index

CXXD_TYPE_INDEX

type_traits

CXXD_TYPE_TRAITS

unordered_map

CXXD_UNORDERED_MAP

unordered_multimap

CXXD_UNORDERED_MULTIMAP

unordered_multiset

CXXD_UNORDERED_MULTISET

unordered_set

CXXD_UNORDERED_SET

weak_ptr

CXXD_WEAK_PTR


The mod-IDs have their own header file:

#include <boost/cxx_dual/mod_ids.hpp>

We will see a use for these mod identifiers when I discuss optional helper macros which CXXD offers for the end-user later in the documentation. An end-user, who wishes to design his own macros to be used with CXXD, can use the mod-IDs as a means of specifying a particular mod by including the header file above in his own code.


PrevUpHomeNext