swift
Loading...
Searching...
No Matches
corefacade.cpp
1// SPDX-FileCopyrightText: Copyright (C) 2013 swift Project Community / Contributors
2// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-swift-pilot-client-1
3
4#include "core/corefacade.h"
5
6#include <QDBusConnection>
7#include <QElapsedTimer>
8#include <QMap>
9#include <QObject>
10#include <QString>
11#include <QStringBuilder>
12#include <QtGlobal>
13
29#include "misc/dbusserver.h"
30#include "misc/identifier.h"
31#include "misc/loghistory.h"
32#include "misc/logmessage.h"
35#include "misc/statusmessage.h"
36#include "misc/stringutils.h"
37#include "misc/verify.h"
38
39using namespace swift::misc;
40using namespace swift::misc::aviation;
41using namespace swift::misc::simulation;
42using namespace swift::core::data;
43using namespace swift::core::context;
44
45namespace swift::core
46{
48 {
49 this->init();
50 }
51
53 {
54 if (m_shuttingDown)
55 {
56 return { this, CStatusMessage::SeverityInfo, u"Shutdown" };
57 }
58 if (!m_config.requiresDBusConnection())
59 {
60 return { this, CStatusMessage::SeverityInfo, u"Not DBus based" };
61 }
62 const QString dBusAddress = this->getDBusAddress();
63 if (dBusAddress.isEmpty())
64 {
65 return { this, CStatusMessage::SeverityInfo, u"Not DBus based, no address" };
66 }
67 QString connectMsg;
68 if (!CContextApplicationProxy::isContextResponsive(dBusAddress, connectMsg))
69 {
70 return { this, CStatusMessage::SeverityError,
71 u"Cannot connect DBus at '" % dBusAddress % u"', reason: " % connectMsg };
72 }
73
74 // re-init
75 m_initalized = false;
76 this->init();
77
78 // success
79 return CStatusMessage(this, CStatusMessage::SeverityInfo, u"Re-initialized via '%1'") << dBusAddress;
80 }
81
82 void CCoreFacade::init()
83 {
84 if (m_initalized || m_shuttingDown)
85 {
86 return;
87 }
88
90 QElapsedTimer time;
92
93 // either use explicit setting or last value
94 const QString dbusAddress = this->getDBusAddress();
95 m_launcherSetup.setProperty(CLauncherSetup::IndexDBusAddress, dbusAddress);
96
97 // DBus
98 time.start();
99 if (m_config.requiresDBusSever())
100 {
101 this->initDBusServer(dbusAddress);
102 }
103 if (m_config.requiresDBusConnection())
104 {
105 this->initDBusConnection(dbusAddress);
106 if (!m_dbusConnection.isConnected())
107 {
108 const QString e = m_dbusConnection.lastError().message();
109 SWIFT_VERIFY_X(false, "CRuntime::init DBus problem", e.toUtf8().constData());
110 CLogMessage(this).error(u"DBus connection failed: '%1'") << e;
111 return;
112 }
113 }
114 times.insert("DBus", time.restart());
115
116 // shared state infrastructure
117 m_dataLinkDBus = new shared_state::CDataLinkDBus(this);
118 switch (m_config.getMode())
119 {
121 case CCoreFacadeConfig::Local: m_dataLinkDBus->initializeLocal(nullptr); break;
122 case CCoreFacadeConfig::LocalInDBusServer: m_dataLinkDBus->initializeLocal(m_dbusServer); break;
124 m_dataLinkDBus->initializeRemote(m_dbusConnection, CDBusServer::coreServiceName(m_dbusConnection));
125 break;
126 default: qFatal("Invalid application context mode");
127 }
128
129 // shared log history
130 m_logHistorySource = new CLogHistorySource(this);
131 m_logHistorySource->initialize(m_dataLinkDBus);
132 if (m_config.getMode() == CCoreFacadeConfig::Local ||
133 m_config.getMode() == CCoreFacadeConfig::LocalInDBusServer)
134 {
135 m_logHistory = new CLogHistory(this);
136 m_logHistory->initialize(m_dataLinkDBus);
137 }
138
139 if (m_config.getMode() == CCoreFacadeConfig::NotUsed)
140 {
141 m_initalized = true;
142 return;
143 }
144
145 // contexts
146 if (m_contextApplication)
147 {
148 m_contextApplication->deleteLater();
149 }
150 m_contextApplication = IContextApplication::create(this, m_config.getMode(), m_dbusServer, m_dbusConnection);
151 times.insert("Application", time.restart());
152
153 if (m_contextAudio)
154 {
155 m_contextAudio->deleteLater();
156 }
157 m_contextAudio = qobject_cast<CContextAudioBase *>(
158 IContextAudio::create(this, m_config.getMode(), m_dbusServer, m_dbusConnection));
159 times.insert("Audio", time.restart());
160
161 if (m_contextOwnAircraft)
162 {
163 m_contextOwnAircraft->deleteLater();
164 }
165 m_contextOwnAircraft = IContextOwnAircraft::create(this, m_config.getMode(), m_dbusServer, m_dbusConnection);
166 times.insert("Own aircraft", time.restart());
167
168 if (m_contextSimulator)
169 {
170 m_contextSimulator->deleteLater();
171 }
172 m_contextSimulator = IContextSimulator::create(this, m_config.getMode(), m_dbusServer, m_dbusConnection);
173 times.insert("Simulator", time.restart());
174
175 // depends on own aircraft and simulator context, which is bad style
176 if (m_contextNetwork)
177 {
178 m_contextNetwork->deleteLater();
179 }
180 m_contextNetwork = IContextNetwork::create(this, m_config.getMode(), m_dbusServer, m_dbusConnection);
181 times.insert("Network", time.restart());
182
183 // checks --------------
184 // 1. own aircraft and simulator should reside in same location
185 Q_ASSERT(!m_contextSimulator || (m_contextOwnAircraft->isUsingImplementingObject() ==
186 m_contextSimulator->isUsingImplementingObject()));
187
188 // 2. own aircraft and network should reside in same location
189 Q_ASSERT(!m_contextNetwork ||
190 (m_contextOwnAircraft->isUsingImplementingObject() == m_contextNetwork->isUsingImplementingObject()));
191
192 // post inits, wiring things among context (e.g. signal slots)
193 time.restart();
194 this->initPostSetup(times);
195 times.insert("Post setup", time.restart());
196 CLogMessage(this).info(u"Init times: %1") << qmapToString(times);
197
198 // flag
199 m_initalized = true;
200 }
201
207
208 bool CCoreFacade::parseCommandLine(const QString &commandLine, const CIdentifier &originator)
209 {
210 bool handled = false;
211 // audio can be empty depending on whre it runs
212 if (this->getIContextAudio() && !this->getIContextAudio()->isEmptyObject())
213 {
214 handled = this->getIContextAudio()->parseCommandLine(commandLine, originator);
215 }
216 if (this->getIContextNetwork())
217 {
218 handled = handled || this->getIContextNetwork()->parseCommandLine(commandLine, originator);
219 }
220 if (this->getIContextOwnAircraft())
221 {
222 handled = handled || this->getIContextOwnAircraft()->parseCommandLine(commandLine, originator);
223 }
224 if (this->getIContextSimulator())
225 {
226 handled = handled || this->getIContextSimulator()->parseCommandLine(commandLine, originator);
227 }
228 return handled;
229 }
230
231 void CCoreFacade::initDBusServer(const QString &dBusAddress)
232 {
233 Q_ASSERT(!dBusAddress.isEmpty());
234 if (m_dbusServer)
235 {
236 m_dbusServer->deleteLater();
237 } // delete if there was an existing one
238 m_dbusServer = new CDBusServer(dBusAddress, this);
239 CLogMessage(this).info(u"DBus server on address: '%1'") << dBusAddress;
240 }
241
242 void CCoreFacade::initPostSetup(QMap<QString, qint64> &times)
243 {
244 bool c = false;
245 Q_UNUSED(c) // for release version
246 QElapsedTimer time;
247 time.start();
248
249 times.insert("Post setup, connects first", time.restart());
250
251 // local simulator?
252 if (m_contextSimulator && m_contextSimulator->isUsingImplementingObject())
253 {
254 // only connect if network runs locally, no round trips
255 // remark: from a design perspective it would be nice if those could be avoided (seperation of concerns)
256 // those connects here reprent cross context dependencies
257 if (m_contextNetwork && m_contextNetwork->isUsingImplementingObject())
258 {
259 Q_ASSERT_X(this->getCContextNetwork(), Q_FUNC_INFO, "No local network object");
260 Q_ASSERT_X(this->getCContextNetwork()->airspace(), Q_FUNC_INFO, "No airspace object");
261
263 &CContextSimulator::xCtxTextMessagesReceived, Qt::QueuedConnection);
264 Q_ASSERT(c);
265
266 // use readyForModelMatching instead of CAirspaceMonitor::addedAircraft, as it contains client
267 // information ready for model matching is sent delayed when all information are available
269 &CContextSimulator::xCtxAddedRemoteAircraftReadyForModelMatching, Qt::QueuedConnection);
270 Q_ASSERT(c);
271 c = connect(m_contextNetwork, &IContextNetwork::removedAircraft, this->getCContextSimulator(),
272 &CContextSimulator::xCtxRemovedRemoteAircraft, Qt::QueuedConnection);
273 Q_ASSERT(c);
275 this->getCContextSimulator(), &CContextSimulator::xCtxChangedRemoteAircraftModel,
277 Q_ASSERT(c);
279 this->getCContextSimulator(), &CContextSimulator::xCtxChangedRemoteAircraftEnabled,
281 Q_ASSERT(c);
283 &CContextSimulator::xCtxNetworkConnectionStatusChanged, Qt::QueuedConnection);
284 Q_ASSERT(c);
285 c = connect(this->getCContextNetwork()->airspace(), &CAirspaceMonitor::requestedNewAircraft,
286 this->getCContextSimulator(), &CContextSimulator::xCtxNetworkRequestedNewAircraft,
288 Q_ASSERT(c);
290 this->getCContextNetwork(), &CContextNetwork::xCtxSimulatorRenderRestrictionsChanged,
292 Q_ASSERT(c);
294 this->getCContextNetwork(), &CContextNetwork::xCtxSimulatorStatusChanged,
296 Q_ASSERT(c);
297
298 // set provider
300 }
301
302 // only if own aircraft runs locally
303 if (m_contextOwnAircraft && m_contextOwnAircraft->isUsingImplementingObject())
304 {
305 c = connect(m_contextOwnAircraft, &IContextOwnAircraft::changedAircraftCockpit,
306 this->getCContextSimulator(), &CContextSimulator::xCtxUpdateSimulatorCockpitFromContext);
307 Q_ASSERT(c);
308 c = connect(m_contextOwnAircraft, &IContextOwnAircraft::changedSelcal, this->getCContextSimulator(),
309 &CContextSimulator::xCtxUpdateSimulatorSelcalFromContext);
310 Q_ASSERT(c);
311
312 // relay changed aircraft to own aircraft provider but with identifier
313 // identifier is needed because own aircraft context also reports changed aircraft to
314 // xCtxChangedOwnAircraftModel and we avoid roundtrips
315 c = connect(this->getCContextSimulator(), &CContextSimulator::ownAircraftModelChanged,
316 this->getCContextOwnAircraft(), [=, this](const CAircraftModel &changedModel) {
317 if (!this->getIContextOwnAircraft())
318 {
319 return;
320 }
321 if (!this->getCContextSimulator())
322 {
323 return;
324 }
325 this->getCContextOwnAircraft()->xCtxChangedSimulatorModel(
326 changedModel, this->getCContextSimulator()->identifier());
327 });
328
329 Q_ASSERT(c);
330 c = connect(this->getCContextSimulator(), &CContextSimulator::simulatorStatusChanged,
331 this->getCContextOwnAircraft(), &CContextOwnAircraft::xCtxChangedSimulatorStatus);
332 Q_ASSERT(c);
333
334 // this is used if the value in own aircraft is changed, to callback simulator
335 c = connect(this->getCContextOwnAircraft(), &CContextOwnAircraft::ps_changedModel,
336 this->getCContextSimulator(), &CContextSimulator::xCtxChangedOwnAircraftModel);
337 Q_ASSERT(c);
338 }
339
340 // times
341 times.insert("Post setup, sim.connects", time.restart());
342 }
343
344 // connection status of network changed
345 // with AFV no longer use m_contextAudio->isUsingImplementingObject() as audio can run on both sides
346 if (this->getCContextAudioBase() && m_contextNetwork)
347 {
348 Q_ASSERT(m_contextApplication);
350 &CContextAudio::xCtxNetworkConnectionStatusChanged, Qt::QueuedConnection);
351 Q_ASSERT(c);
352 times.insert("Post setup, connects audio", time.restart());
353 }
354 }
355
357 {
358 QString dbusAddress;
359 if (m_config.hasDBusAddress())
360 {
361 dbusAddress = m_config.getDBusAddress();
362 }
363 else
364 {
365 const CLauncherSetup setup = m_launcherSetup.get();
366 dbusAddress = setup.getDBusAddress();
367 }
368 return dbusAddress;
369 }
370
372 {
373 if (!m_initalized)
374 {
375 return;
376 }
377 if (m_shuttingDown)
378 {
379 return;
380 }
381 m_shuttingDown = true;
382
383 // disable all signals towards runtime
384 disconnect(this);
385
386 // tear down shared state infrastructure
387 delete m_logHistory;
388 m_logHistory = nullptr;
389 delete m_logHistorySource;
390 m_logHistorySource = nullptr;
391 delete m_dataLinkDBus;
392 m_dataLinkDBus = nullptr;
393
394 // unregister all from DBus
395 if (m_dbusServer)
396 {
397 m_dbusServer->removeAllObjects();
398 }
399
400 // handle contexts
401
402 if (this->getCContextAudioBase())
403 {
404 // there is no empty audio context since AFV
407 this->getIContextAudio()->deleteLater();
408 m_contextAudio = nullptr;
409 }
410
411 // log off from network, if connected
412 if (this->getIContextNetwork())
413 {
416 if (m_contextNetwork->isUsingImplementingObject())
417 {
418 this->getCContextNetwork()->gracefulShutdown(); // for threads
419 }
421 // replace by dummy object avoiding nullptr issues during shutdown phase
422 QDBusConnection defaultConnection("default");
423 m_contextNetwork = IContextNetwork::create(this, CCoreFacadeConfig::NotUsed, nullptr, defaultConnection);
424 }
425
426 if (this->getIContextSimulator())
427 {
429 if (this->getIContextSimulator()->isUsingImplementingObject())
430 {
431 // shutdown the plugins
433 }
435 QDBusConnection defaultConnection("default");
436 m_contextSimulator =
437 IContextSimulator::create(this, CCoreFacadeConfig::NotUsed, nullptr, defaultConnection);
438 }
439
440 if (this->getIContextOwnAircraft())
441 {
444 QDBusConnection defaultConnection("default");
445 m_contextOwnAircraft =
446 IContextOwnAircraft::create(this, CCoreFacadeConfig::NotUsed, nullptr, defaultConnection);
447 }
448
449 if (this->getIContextApplication())
450 {
453 QDBusConnection defaultConnection("default");
454 m_contextApplication =
455 IContextApplication::create(this, CCoreFacadeConfig::NotUsed, nullptr, defaultConnection);
456 }
457 }
458
459 void CCoreFacade::initDBusConnection(const QString &address)
460 {
461 if (m_initDBusConnection)
462 {
463 return;
464 }
465 if (address.isEmpty() || address == CDBusServer::sessionBusAddress())
466 {
467 QDBusConnection::disconnectFromBus(m_dbusConnection.name());
468 m_dbusConnection = QDBusConnection::sessionBus();
469 }
470 else if (address == CDBusServer::systemBusAddress())
471 {
472 QDBusConnection::disconnectFromBus(m_dbusConnection.name());
473 m_dbusConnection = QDBusConnection::systemBus();
474 }
475 else
476 {
477 const QString name(CDBusServer::p2pConnectionName() + " " + address);
479 m_dbusConnection = QDBusConnection::connectToPeer(address, name);
480 }
481 }
482
483 const IContextApplication *CCoreFacade::getIContextApplication() const { return m_contextApplication; }
484
486
487 IContextAudio *CCoreFacade::getIContextAudio() { return m_contextAudio; }
488
489 const IContextAudio *CCoreFacade::getIContextAudio() const { return m_contextAudio; }
490
492
493 const CContextAudioBase *CCoreFacade::getCContextAudioBase() const { return m_contextAudio; }
494
495 IContextNetwork *CCoreFacade::getIContextNetwork() { return m_contextNetwork; }
496
497 const IContextNetwork *CCoreFacade::getIContextNetwork() const { return m_contextNetwork; }
498
500
501 const IContextOwnAircraft *CCoreFacade::getIContextOwnAircraft() const { return m_contextOwnAircraft; }
502
503 const IContextSimulator *CCoreFacade::getIContextSimulator() const { return m_contextSimulator; }
504
505 IContextSimulator *CCoreFacade::getIContextSimulator() { return m_contextSimulator; }
506
508 {
509 Q_ASSERT_X(m_contextAudio && m_contextAudio->isUsingImplementingObject(), "CCoreRuntime",
510 "Cannot downcast to local object");
511 return static_cast<CContextAudio *>(m_contextAudio);
512 }
513
515 {
516 Q_ASSERT_X(m_contextAudio && m_contextAudio->isUsingImplementingObject(), "CCoreRuntime",
517 "Cannot downcast to local object");
518 return static_cast<CContextAudio *>(m_contextAudio);
519 }
520
522 {
523 Q_ASSERT_X(m_contextApplication && m_contextApplication->isUsingImplementingObject(), "CCoreRuntime",
524 "Cannot downcast to local object");
525 return static_cast<CContextApplication *>(m_contextApplication);
526 }
527
529 {
530 Q_ASSERT_X(m_contextApplication && m_contextApplication->isUsingImplementingObject(), "CCoreRuntime",
531 "Cannot downcast to local object");
532 return static_cast<CContextApplication *>(m_contextApplication);
533 }
534
536 {
537 Q_ASSERT_X(m_contextNetwork && m_contextNetwork->isUsingImplementingObject(), "CCoreRuntime",
538 "Cannot downcast to local object");
539 return static_cast<CContextNetwork *>(m_contextNetwork);
540 }
541
543 {
544 Q_ASSERT_X(m_contextNetwork && m_contextNetwork->isUsingImplementingObject(), "CCoreRuntime",
545 "Cannot downcast to local object");
546 return static_cast<CContextNetwork *>(m_contextNetwork);
547 }
548
550 {
551 Q_ASSERT_X(m_contextOwnAircraft && m_contextOwnAircraft->isUsingImplementingObject(), "CCoreRuntime",
552 "Cannot downcast to local object");
553 return static_cast<CContextOwnAircraft *>(m_contextOwnAircraft);
554 }
555
557 {
558 Q_ASSERT_X(m_contextOwnAircraft && m_contextOwnAircraft->isUsingImplementingObject(), "CCoreRuntime",
559 "Cannot downcast to local object");
560 return static_cast<CContextOwnAircraft *>(m_contextOwnAircraft);
561 }
562
564 {
565 Q_ASSERT_X(m_contextSimulator && m_contextSimulator->isUsingImplementingObject(), "CCoreRuntime",
566 "Cannot downcast to local object");
567 return static_cast<CContextSimulator *>(m_contextSimulator);
568 }
569
571 {
572 Q_ASSERT_X(m_contextSimulator && m_contextSimulator->isUsingImplementingObject(), "CCoreRuntime",
573 "Cannot downcast to local object");
574 return static_cast<CContextSimulator *>(m_contextSimulator);
575 }
576} // namespace swift::core
Configuration object for the contexts.
bool requiresDBusSever() const
Requires server (at least one in server)?
bool requiresDBusConnection() const
Requires DBus connection (at least one remote)?
@ NotUsed
during shutdown or not used at all
@ Local
context runs in same process
@ Remote
context runs in a different process.
@ LocalInDBusServer
context runs in same process.
context::CContextSimulator * getCContextSimulator()
Context for simulator.
void gracefulShutdown()
Clean up (will be connected to signal QCoreApplication::aboutToQuit).
context::IContextAudio * getIContextAudio()
Context for audio.
context::IContextOwnAircraft * getIContextOwnAircraft()
Context for own aircraft.
context::IContextApplication * getIContextApplication()
Context for application.
QString getDBusAddress() const
DBus address if any.
context::IContextNetwork * getIContextNetwork()
Context for network.
bool parseCommandLine(const QString &commandLine, const swift::misc::CIdentifier &originator)
Parse command line in all contexts.
CCoreFacade(const CCoreFacadeConfig &config, QObject *parent=nullptr)
Constructor.
context::CContextAudio * getCContextAudio()
Context for audio.
context::IContextSimulator * getIContextSimulator()
Context for simulator.
context::CContextApplication * getCContextApplication()
Context for application.
swift::misc::CStatusMessage tryToReconnectWithDBus()
In case connection between DBus parties is lost, try to reconnect.
context::CContextNetwork * getCContextNetwork()
Context for network.
context::CContextOwnAircraft * getCContextOwnAircraft()
Context for own aircraft.
static void registerMetadata()
Register metadata.
context::CContextAudioBase * getCContextAudioBase()
Context for audio.
static bool isContextResponsive(const QString &dbusAddress, QString &msg, int timeoutMs=1500)
Used to test if there is a core running?
void gracefulShutdown()
Graceful shutdown.
Audio context implementation.
Network context implementation.
void gracefulShutdown()
Gracefully shut down, e.g. for thread safety.
void setSimulationEnvironmentProvider(swift::misc::simulation::ISimulationEnvironmentProvider *provider)
Set the provider.
Own aircraft context implementation. Central instance of data for.
Network simulator concrete implementation.
void gracefulShutdown()
Gracefully shut down, e.g. for plugin unloading.
static IContextApplication * create(CCoreFacade *parent, CCoreFacadeConfig::ContextMode mode, swift::misc::CDBusServer *server, QDBusConnection &connection)
Factory method.
Audio context interface.
static IContextAudio * create(CCoreFacade *runtime, CCoreFacadeConfig::ContextMode mode, swift::misc::CDBusServer *server, QDBusConnection &connection)
Factory method.
bool isUsingImplementingObject() const
Using local implementing object?
Definition context.h:45
virtual bool parseCommandLine(const QString &commandLine, const swift::misc::CIdentifier &originator)=0
Parse a given command line.
virtual swift::misc::CStatusMessage disconnectFromNetwork()=0
Disconnect from network.
void changedRemoteAircraftModel(const swift::misc::simulation::CSimulatedAircraft &aircraft, const swift::misc::CIdentifier &originator)
Aircraft model was changed.
void textMessagesReceived(const swift::misc::network::CTextMessageList &textMessages)
Text messages received (also private chat messages, radio channel messages).
static IContextNetwork * create(CCoreFacade *parent, CCoreFacadeConfig::ContextMode mode, swift::misc::CDBusServer *server, QDBusConnection &connection)
Factory method.
void changedRemoteAircraftEnabled(const swift::misc::simulation::CSimulatedAircraft &aircraft)
Aircraft enabled / disabled.
void connectionStatusChanged(const swift::misc::network::CConnectionStatus &from, const swift::misc::network::CConnectionStatus &to)
Connection status changed.
void readyForModelMatching(const swift::misc::simulation::CSimulatedAircraft &renderedAircraft)
Read for model matching.
void removedAircraft(const swift::misc::aviation::CCallsign &callsign)
An aircraft disappeared.
static IContextOwnAircraft * create(CCoreFacade *parent, CCoreFacadeConfig::ContextMode mode, swift::misc::CDBusServer *server, QDBusConnection &connection)
Factory method.
void changedAircraftCockpit(const swift::misc::simulation::CSimulatedAircraft &aircraft, const swift::misc::CIdentifier &originator)
Aircraft cockpit update.
void changedSelcal(const swift::misc::aviation::CSelcal &selcal, const swift::misc::CIdentifier &originator)
Changed SELCAL code.
static IContextSimulator * create(CCoreFacade *parent, CCoreFacadeConfig::ContextMode mode, swift::misc::CDBusServer *server, QDBusConnection &connection)
Factory method.
void renderRestrictionsChanged(bool restricted, bool enabled, int maxAircraft, const swift::misc::physical_quantities::CLength &maxRenderedDistance)
Render restrictions have been changed.
void simulatorStatusChanged(int status)
Simulator combined status.
const QString & getDBusAddress() const
Destructor.
Custom DBusServer.
Definition dbusserver.h:34
static const QString & systemBusAddress()
Address denoting a system bus server.
static const QString & sessionBusAddress()
Address denoting a session bus server.
static const QString & p2pConnectionName()
P2P connection name.
static const QString & coreServiceName()
Default service name.
Value object encapsulating information identifying a component of a modular distributed swift process...
Definition identifier.h:29
Class for emitting a log message.
Definition logmessage.h:27
Derived & error(const char16_t(&format)[N])
Set the severity to error, providing a format string.
Derived & info(const char16_t(&format)[N])
Set the severity to info, providing a format string.
Streamable status message, e.g.
static constexpr auto SeverityInfo
Status severities.
static constexpr auto SeverityError
Status severities.
Core data traits (aka cached values) and classes.
Backend services of the swift project, like dealing with the network or the simulators.
Definition actionbind.cpp:7
void registerMetadata()
Register all relevant metadata in swift::core.
Free functions in swift::misc.
void registerMetadata()
Register all relevant metadata in Misc.
QString qmapToString(const QMap< K, V > &map)
A map converted to string.
const char * constData() const const
QDBusConnection connectToPeer(const QString &address, const QString &name)
void disconnectFromBus(const QString &name)
void disconnectFromPeer(const QString &name)
bool isConnected() const const
QDBusError lastError() const const
QString name() const const
QDBusConnection sessionBus()
QDBusConnection systemBus()
QString message() const const
qint64 restart()
QMap< Key, T >::iterator insert(QMap< Key, T >::const_iterator pos, const Key &key, const T &value)
QObject(QObject *parent)
QMetaObject::Connection connect(const QObject *sender, PointerToMemberFunction signal, Functor functor)
void deleteLater()
bool disconnect(const QMetaObject::Connection &connection)
QObject * parent() const const
T qobject_cast(QObject *object)
bool isEmpty() const const
QByteArray toUtf8() const const
QueuedConnection
#define SWIFT_VERIFY_X(COND, WHERE, WHAT)
A weaker kind of assert.
Definition verify.h:26