This section describes the library's namespace conventions.
Namespace tbb contains public identifiers defined by the library that you can reference in your program.
Namespace tbb::flow contains public identifiers defined by the library that you can reference in your program.
related to the flow graph Community Preview Feature. See Flow Graph for more information .
Namespaces of the form tbb::interfacex define public identifiers that the library injects into namespace tbb. The numeral x corresponds to an internal version number that serves to prevent accidental linkage of incompatible definitions. Your code should never directly reference namespaces prefixed with tbb::interfacex. Instead, reference names via namespace tbb.
For example the header tbb/concurrent_hash_map.h defines the template concurrent_hashmap<Key,T> as tbb::version4::concurrent_hashmap<Key,T> and employs a using directive to inject it into namespace tbb. Your source code should reference it as tbb::concurrent_hashmap<Key,T>.
Namespace tbb::internal serves a role similar to tbb::interfacex. It is retained for backwards compatibility with older versions of the library. Your code should never directly reference namespace tbb::internal. Indirect reference via a public typedef provided by the header files is permitted.
The library uses the namespace tbb::deprecated for deprecated identifiers that have different default meanings in namespace tbb. Compiling with TBB_DEPRECATED=1 causes such identifiers to replace their counterpart in namespace tbb.
For example, tbb::concurrent_queue underwent changes in Intel® Threading Building Blocks (Intel® TBB) 2.2 that split its functionality into tbb::concurrent_queue and tbb::concurrent_bounded_queue and changed the name of some methods. For sake of legacy code, the old Intel® TBB 2.1 functionality is retained in tbb::deprecated::concurrent_queue, which is injected into namespace tbb when compiled with TBB_DEPRECATED=1.
The library uses the namespace tbb::strict_ppl for identifiers that are put in namespace Concurrency when tbb/compat/ppl.h is included.
The library implements some C++11 features in namespace std. The library version can be used by including the corresponding header in the following table.
Header |
Identifiers Added to std:: |
Section |
---|---|---|
tbb/compat/condition_variable |
defer_lock_t try_to_lock_t adopt_lock_t defer_lock try_to_lock adopt_lock lock_guard unique_lock swap condition_variable cv_status timeout no_timeout |
|
tbb/compat/thread |
thread this_thread |
To prevent accidental linkage with other implementations of these C++ library features, the library defines the identifiers in other namespaces and injects them into namespace std::. This way the “mangled name” seen by the linker will differ from the “mangled name” generated by other implementations.