|
libqi-api
2.1.0.18
|
Various macros for qi. (deprecated, export API, disallow copy, ..) More...
#include <qi/preproc.hpp>Go to the source code of this file.
Defines | |
| #define | QI_API_DEPRECATED |
| Compiler flags to mark a function as deprecated. It will generate a compiler warning. | |
| #define | QI_NORETURN |
| #define | QI_HAS_VARIABLE_LENGTH_ARRAY 0 |
| #define | QI_LIB_API(libname) _QI_LIB_API(BOOST_PP_CAT(libname, _EXPORTS), BOOST_PP_CAT(libname, _STATIC_BUILD)) |
| #define | _QI_LIB_API(IS_BUILDING_LIB, IS_LIB_STATIC_BUILD) QI_LIB_API_NORMALIZED(_QI_IS_ONE_OR_EMPTY(BOOST_PP_CAT(_ , IS_BUILDING_LIB)), _QI_IS_ONE_OR_EMPTY(BOOST_PP_CAT(_, IS_LIB_STATIC_BUILD))) |
| #define | QI_IMPORT_API |
| Compiler flags to import a function or a class. | |
| #define | QI_EXPORT_API |
| Compiler flags to export a function or a class. | |
| #define | QI_LIB_API_NORMALIZED(a, b) |
| #define | QI_COMPILER_WARNING(x) QI_MSG_PRAGMA("Warning: " #x) |
| Generate a compiler warning. | |
| #define | QI_DEPRECATED_HEADER(x) |
| Generate a compiler warning stating a header is deprecated. | |
| #define | QI_DEPRECATE_MACRO(name) QI_COMPILER_WARNING(name macro is deprecated.) |
| A macro used to deprecate another macro. Generate a compiler warning when the given macro is used. | |
| #define | QI_DISALLOW_COPY_AND_ASSIGN(type) |
| A macro to disallow copy constructor and operator=. | |
| #define | QI_WARN_UNUSED_RESULT |
| #define | QI_ATTR_UNUSED |
| #define | QI_UNUSED(x) |
| This macro tags a parameter as unused. | |
| #define | _QI_UNIQ_DEF_LEVEL2(A, B) A ## __uniq__ ## B |
| #define | _QI_UNIQ_DEF_LEVEL1(A, B) _QI_UNIQ_DEF_LEVEL2(A, B) |
| #define | QI_UNIQ_DEF(A) _QI_UNIQ_DEF_LEVEL1(A, __LINE__) |
Various macros for qi. (deprecated, export API, disallow copy, ..)
dll import/export and compiler message
* This header file contains various macros for qi. * * - import/export symbol (:cpp:macro:`QI_IMPORT_API`, * :cpp:macro:`QI_EXPORT_API`) * - mark function and header as deprecated (:cpp:macro:`QI_DEPRECATED_HEADER`, * :cpp:macro:`QI_API_DEPRECATED`) * - generate compiler warning (:cpp:macro:`QI_COMPILER_WARNING`) * - disallow copy and assign (:cpp:macro:`QI_DISALLOW_COPY_AND_ASSIGN`) *
Definition in file macro.hpp.
| #define _QI_LIB_API | ( | IS_BUILDING_LIB, | |
| IS_LIB_STATIC_BUILD | |||
| ) | QI_LIB_API_NORMALIZED(_QI_IS_ONE_OR_EMPTY(BOOST_PP_CAT(_ , IS_BUILDING_LIB)), _QI_IS_ONE_OR_EMPTY(BOOST_PP_CAT(_, IS_LIB_STATIC_BUILD))) |
| #define _QI_UNIQ_DEF_LEVEL1 | ( | A, | |
| B | |||
| ) | _QI_UNIQ_DEF_LEVEL2(A, B) |
| #define _QI_UNIQ_DEF_LEVEL2 | ( | A, | |
| B | |||
| ) | A ## __uniq__ ## B |
| #define QI_API_DEPRECATED |
| #define QI_ATTR_UNUSED |
| #define QI_COMPILER_WARNING | ( | x | ) | QI_MSG_PRAGMA("Warning: " #x) |
| #define QI_DEPRECATE_MACRO | ( | name | ) | QI_COMPILER_WARNING(name macro is deprecated.) |
| #define QI_DEPRECATED_HEADER | ( | x | ) |
| #define QI_DISALLOW_COPY_AND_ASSIGN | ( | type | ) |
QI_DEPRECATE_MACRO(QI_DISALLOW_COPY_AND_ASSIGN) \ type(type const &); \ void operator=(type const &); \ typedef int _qi_not_clonable; \ template<typename U> friend struct ::qi::IsClonable
A macro to disallow copy constructor and operator=.
* Example:
*
* .. code-block:: cpp
*
* class Foo : private boost::nonpyable
* {};
* | type | The class name of which we want to forbid copy. |
* .. note::
* This macro should always be in the private (or protected) section of a
* class.
*
* Example:
*
* .. code-block:: cpp
*
* class Foo {
* Foo();
* private:
* QI_DISALLOW_COPY_AND_ASSIGN(Foo);
* };
* | #define QI_EXPORT_API |
| #define QI_HAS_VARIABLE_LENGTH_ARRAY 0 |
| #define QI_IMPORT_API |
| #define QI_LIB_API | ( | libname | ) | _QI_LIB_API(BOOST_PP_CAT(libname, _EXPORTS), BOOST_PP_CAT(libname, _STATIC_BUILD)) |
| libname | the name of your library. This macro will use two preprocessor defines: libname_EXPORTS (cmake convention) and libname_STATIC_BUILD. Those macro can be unset or set to 0 to mean false, or set to empty or 1 to mean true. The first one must be true if the current compilation unit is within the library. The second must be true if the library was built as a static archive. The proper way to use this macro is to:
|
| #define QI_LIB_API_NORMALIZED | ( | a, | |
| b | |||
| ) |
| #define QI_NORETURN |
| #define QI_UNIQ_DEF | ( | A | ) | _QI_UNIQ_DEF_LEVEL1(A, __LINE__) |
| #define QI_UNUSED | ( | x | ) |
| #define QI_WARN_UNUSED_RESULT |