ALib C++ Library
by
Library Version:
2412 R0
Documentation generated by
Loading...
Searching...
No Matches
home
dev
A-Worx
ALib
src
alib
compatibility
qt_boxing.hpp
Go to the documentation of this file.
1
//==================================================================================================
2
/// \file
3
/// This header file is part of the \aliblong.
4
///
5
/// \emoji :copyright: 2013-2024 A-Worx GmbH, Germany.
6
/// Published under \ref mainpage_license "Boost Software License".
7
///
8
/// <b>Legal Notice:</b>
9
/// This is an optional extension header to provide compatibility between ALib and
10
/// the QT class library.
11
/// All information about QT is found at https://www.qt.io
12
/// ALib otherwise does not use or rely on QT.
13
/// The use of QT is bound to the QT license restrictions.
14
//==================================================================================================
15
#ifndef HPP_ALIB_COMPATIBILITY_BOXING_QT
16
#define HPP_ALIB_COMPATIBILITY_BOXING_QT 1
17
#pragma once
18
#if !defined(DOXYGEN)
19
# include "
alib/alib.hpp
"
20
#endif
21
22
ALIB_ASSERT_MODULE
(BOXING)
23
24
#if !defined(ALIB_QT_LIB_NOT_FOUND)
// this is only set in an automated test project
25
26
#if defined(__clang__)
27
#pragma clang diagnostic push
28
#pragma clang diagnostic ignored "-Wreserved-id-macro"
29
#pragma clang diagnostic ignored "-Wredundant-parens"
30
#pragma clang diagnostic ignored "-Wcovered-switch-default"
31
#pragma clang diagnostic ignored "-Wsign-conversion"
32
#pragma clang diagnostic ignored "-Wdeprecated"
33
#pragma clang diagnostic ignored "-Wunused-variable"
34
#pragma clang diagnostic ignored "-Wcomma"
35
#pragma clang diagnostic ignored "-Wduplicate-enum"
36
#endif
37
#include <QtCore/QString>
38
#include <QtCore/QVector>
39
40
#if defined(__clang__)
41
#pragma clang diagnostic pop
42
#endif
43
44
#if ALIB_CHARACTERS
45
# include "
alib/compatibility/qt_characters.hpp
"
46
#endif
47
#include "
alib/boxing/boxing.hpp
"
48
#include <functional>
49
50
namespace
alib::boxing::compatibility
{
51
/// This namespace documents compatibility features of \alib_boxing_nl and the
52
/// \https{QT Class Library,www.qt.io}.
53
namespace
qt {
54
55
56
57
void
BootstrapQTStringBoxing
();
58
/// Initializes \alib_boxing_nl in respect to boxing QT string-types.
59
///
60
/// This method is \b not automatically invoked with function \alib{Bootstrap}, because support
61
/// for boxing QT string-types is optional and provided with the inclusion of header
62
/// \alibheader{compatibility/qt_boxing.hpp}.
63
///
64
/// In general, boxing of QT string-types works well without the one-time invocation of
65
/// this function at the bootstrap section of a process.
66
/// This method registers box-function \alib{boxing;FAppend} for QT string
67
/// types when \ref alib_boxing_customizing_identity "custom boxing is bypassed" by wrapping the
68
/// types in \c std::reference_wrapper<T>.
69
/// The function is implemented with the help of \alib{boxing;FAppend::WrappedAppendable}
70
/// for wrapped types \b QByteArray, \b QQLatin1String and \b QString, each for character types
71
/// \b nchar and \b wchar.
72
///
73
/// \note
74
/// If invoked after bootstrap and module \alib_monomem_nl is included in the \alibdist,
75
/// mutex \alib{monomem;GLOBAL_ALLOCATOR_LOCK} has to be locked before an invocation.
76
inline
void
BootstrapQTStringBoxing
()
77
{
78
#if ALIB_STRINGS
79
alib::boxing::BootstrapRegister<boxing::FAppend<nchar, lang::HeapAllocator>
,
boxing::TMappedTo<::std::reference_wrapper<QByteArray>
>>(
boxing::FAppend<nchar, lang::HeapAllocator>::WrappedAppendable
<QByteArray> );
80
alib::boxing::BootstrapRegister<boxing::FAppend<wchar, lang::HeapAllocator>
,
boxing::TMappedTo<::std::reference_wrapper<QByteArray>
>>(
boxing::FAppend<wchar, lang::HeapAllocator>::WrappedAppendable
<QByteArray> );
81
alib::boxing::BootstrapRegister<boxing::FAppend<nchar, lang::HeapAllocator>
,
boxing::TMappedTo<::std::reference_wrapper<QLatin1String>
>>(
boxing::FAppend<nchar, lang::HeapAllocator>::WrappedAppendable
<QLatin1String> );
82
alib::boxing::BootstrapRegister<boxing::FAppend<wchar, lang::HeapAllocator>
,
boxing::TMappedTo<::std::reference_wrapper<QLatin1String>
>>(
boxing::FAppend<wchar, lang::HeapAllocator>::WrappedAppendable
<QLatin1String> );
83
alib::boxing::BootstrapRegister<boxing::FAppend<nchar, lang::HeapAllocator>
,
boxing::TMappedTo<::std::reference_wrapper<QString>
>>(
boxing::FAppend<nchar, lang::HeapAllocator>::WrappedAppendable
<QString> );
84
alib::boxing::BootstrapRegister<boxing::FAppend<wchar, lang::HeapAllocator>
,
boxing::TMappedTo<::std::reference_wrapper<QString>
>>(
boxing::FAppend<wchar, lang::HeapAllocator>::WrappedAppendable
<QString> );
85
#endif
86
}
87
}}
// namespace [alib::boxing::compatibility::qt]
88
89
#endif
// !defined(ALIB_QT_LIB_NOT_FOUND) // this is only set in an automated test project
90
91
#endif
// HPP_ALIB_COMPATIBILITY_BOXING_QT
92
alib.hpp
boxing.hpp
ALIB_ASSERT_MODULE
#define ALIB_ASSERT_MODULE(modulename)
Definition
alib.hpp:223
alib::boxing::compatibility::qt::BootstrapQTStringBoxing
void BootstrapQTStringBoxing()
Definition
qt_boxing.hpp:76
alib::boxing::compatibility
Definition
qt_boxing.hpp:50
alib::boxing::BootstrapRegister
void BootstrapRegister(typename TFDecl::Signature function)
Definition
boxing.hpp:112
qt_characters.hpp
alib::boxing::FAppend
Definition
functions.inl:410
alib::boxing::TMappedTo
Definition
typetraits.inl:68