mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-11 23:05:34 +08:00
refactor: clang-format
This commit is contained in:
@@ -11,4 +11,4 @@ namespace swift::misc::shared_state
|
||||
{
|
||||
return m_requestHandler(param);
|
||||
}
|
||||
}
|
||||
} // namespace swift::misc::shared_state
|
||||
|
||||
@@ -6,13 +6,15 @@
|
||||
#ifndef SWIFT_MISC_SHAREDSTATE_ACTIVEMUTATOR_H
|
||||
#define SWIFT_MISC_SHAREDSTATE_ACTIVEMUTATOR_H
|
||||
|
||||
#include "misc/sharedstate/passivemutator.h"
|
||||
#include "misc/variant.h"
|
||||
#include "misc/swiftmiscexport.h"
|
||||
#include <QObject>
|
||||
#include <QFuture>
|
||||
#include <functional>
|
||||
|
||||
#include <QFuture>
|
||||
#include <QObject>
|
||||
|
||||
#include "misc/sharedstate/passivemutator.h"
|
||||
#include "misc/swiftmiscexport.h"
|
||||
#include "misc/variant.h"
|
||||
|
||||
namespace swift::misc::shared_state
|
||||
{
|
||||
/*!
|
||||
@@ -46,6 +48,6 @@ namespace swift::misc::shared_state
|
||||
private:
|
||||
const std::function<QFuture<CVariant>(const CVariant &)> m_requestHandler;
|
||||
};
|
||||
}
|
||||
} // namespace swift::misc::shared_state
|
||||
|
||||
#endif
|
||||
|
||||
@@ -23,4 +23,4 @@ namespace swift::misc::shared_state
|
||||
if (lock) { callback(reply.result()); }
|
||||
});
|
||||
}
|
||||
}
|
||||
} // namespace swift::misc::shared_state
|
||||
|
||||
@@ -6,13 +6,14 @@
|
||||
#ifndef SWIFT_MISC_SHAREDSTATE_ACTIVEOBSERVER_H
|
||||
#define SWIFT_MISC_SHAREDSTATE_ACTIVEOBSERVER_H
|
||||
|
||||
#include "misc/sharedstate/passiveobserver.h"
|
||||
#include "misc/promise.h"
|
||||
#include "misc/variant.h"
|
||||
#include "misc/swiftmiscexport.h"
|
||||
#include <QObject>
|
||||
#include <QSharedPointer>
|
||||
|
||||
#include "misc/promise.h"
|
||||
#include "misc/sharedstate/passiveobserver.h"
|
||||
#include "misc/swiftmiscexport.h"
|
||||
#include "misc/variant.h"
|
||||
|
||||
namespace swift::misc::shared_state
|
||||
{
|
||||
/*!
|
||||
@@ -50,6 +51,6 @@ namespace swift::misc::shared_state
|
||||
//! Emitted by request and requestAsync.
|
||||
void requestPosted(const swift::misc::CVariant ¶m, swift::misc::CPromise<swift::misc::CVariant> o_reply);
|
||||
};
|
||||
}
|
||||
} // namespace swift::misc::shared_state
|
||||
|
||||
#endif
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
//! \file
|
||||
|
||||
#include "misc/sharedstate/datalink.h"
|
||||
|
||||
#include "misc/promise.h"
|
||||
#include "misc/variant.h"
|
||||
|
||||
@@ -33,4 +34,4 @@ namespace swift::misc::shared_state
|
||||
const QString name = object->parent()->objectName();
|
||||
return name.isEmpty() ? QString(info) : (info % QLatin1Char(':') % name);
|
||||
}
|
||||
}
|
||||
} // namespace swift::misc::shared_state
|
||||
|
||||
@@ -6,14 +6,15 @@
|
||||
#ifndef SWIFT_MISC_SHAREDSTATE_DATALINK_H
|
||||
#define SWIFT_MISC_SHAREDSTATE_DATALINK_H
|
||||
|
||||
#include "misc/swiftmiscexport.h"
|
||||
#include "misc/promise.h"
|
||||
#include "misc/variant.h"
|
||||
#include <QObject>
|
||||
#include <QMetaObject>
|
||||
#include <QMetaClassInfo>
|
||||
#include <QMetaObject>
|
||||
#include <QObject>
|
||||
#include <QStringBuilder>
|
||||
|
||||
#include "misc/promise.h"
|
||||
#include "misc/swiftmiscexport.h"
|
||||
#include "misc/variant.h"
|
||||
|
||||
/*!
|
||||
* \defgroup shared_state Shared state
|
||||
* Utilities for sharing state between multiple objects
|
||||
@@ -97,7 +98,7 @@ namespace swift::misc::shared_state
|
||||
private:
|
||||
CDataLinkConnectionWatcher m_watcher;
|
||||
};
|
||||
}
|
||||
} // namespace swift::misc::shared_state
|
||||
|
||||
Q_DECLARE_INTERFACE(swift::misc::shared_state::IDataLink, "swift::misc::shared_state::IDataLink")
|
||||
Q_DECLARE_METATYPE(swift::misc::CPromise<swift::misc::CVariant>)
|
||||
|
||||
@@ -4,14 +4,16 @@
|
||||
//! \file
|
||||
|
||||
#include "misc/sharedstate/datalinkdbus.h"
|
||||
#include "misc/sharedstate/dbus/hub.h"
|
||||
|
||||
#include <QDBusConnection>
|
||||
#include <QDBusServiceWatcher>
|
||||
|
||||
#include "misc/dbusserver.h"
|
||||
#include "misc/sharedstate/activemutator.h"
|
||||
#include "misc/sharedstate/activeobserver.h"
|
||||
#include "misc/sharedstate/dbus/duplex.h"
|
||||
#include "misc/sharedstate/dbus/duplexproxy.h"
|
||||
#include "misc/sharedstate/activeobserver.h"
|
||||
#include "misc/sharedstate/activemutator.h"
|
||||
#include "misc/dbusserver.h"
|
||||
#include <QDBusServiceWatcher>
|
||||
#include <QDBusConnection>
|
||||
#include "misc/sharedstate/dbus/hub.h"
|
||||
|
||||
using namespace swift::misc::shared_state::dbus;
|
||||
|
||||
@@ -211,4 +213,4 @@ namespace swift::misc::shared_state
|
||||
{
|
||||
return getChannel(getChannelName(object));
|
||||
}
|
||||
}
|
||||
} // namespace swift::misc::shared_state
|
||||
|
||||
@@ -6,11 +6,12 @@
|
||||
#ifndef SWIFT_MISC_SHAREDSTATE_DATALINKDBUS_H
|
||||
#define SWIFT_MISC_SHAREDSTATE_DATALINKDBUS_H
|
||||
|
||||
#include <QSharedPointer>
|
||||
|
||||
#include "misc/identifier.h"
|
||||
#include "misc/sharedstate/datalink.h"
|
||||
#include "misc/swiftmiscexport.h"
|
||||
#include "misc/variantlist.h"
|
||||
#include "misc/identifier.h"
|
||||
#include <QSharedPointer>
|
||||
|
||||
class QDBusConnection;
|
||||
|
||||
@@ -24,7 +25,7 @@ namespace swift::misc
|
||||
{
|
||||
class IHub;
|
||||
class IDuplex;
|
||||
}
|
||||
} // namespace dbus
|
||||
|
||||
/*!
|
||||
* A transport mechanism using signals and slots distributed by DBus.
|
||||
@@ -87,7 +88,7 @@ namespace swift::misc
|
||||
QMap<QString, Channel> m_channels;
|
||||
mutable QRecursiveMutex m_channelsMutex;
|
||||
};
|
||||
}
|
||||
}
|
||||
} // namespace shared_state
|
||||
} // namespace swift::misc
|
||||
|
||||
#endif
|
||||
|
||||
@@ -4,9 +4,10 @@
|
||||
//! \file
|
||||
|
||||
#include "misc/sharedstate/datalinklocal.h"
|
||||
#include "misc/sharedstate/activeobserver.h"
|
||||
#include "misc/sharedstate/activemutator.h"
|
||||
|
||||
#include "misc/promise.h"
|
||||
#include "misc/sharedstate/activemutator.h"
|
||||
#include "misc/sharedstate/activeobserver.h"
|
||||
|
||||
namespace swift::misc::shared_state
|
||||
{
|
||||
@@ -77,4 +78,4 @@ namespace swift::misc::shared_state
|
||||
{
|
||||
return getChannel(getChannelName(object));
|
||||
}
|
||||
}
|
||||
} // namespace swift::misc::shared_state
|
||||
|
||||
@@ -6,12 +6,13 @@
|
||||
#ifndef SWIFT_MISC_SHAREDSTATE_DATALINKLOCAL_H
|
||||
#define SWIFT_MISC_SHAREDSTATE_DATALINKLOCAL_H
|
||||
|
||||
#include "misc/sharedstate/datalink.h"
|
||||
#include "misc/variant.h"
|
||||
#include "misc/swiftmiscexport.h"
|
||||
#include <QObject>
|
||||
#include <QFuture>
|
||||
#include <QMutex>
|
||||
#include <QObject>
|
||||
|
||||
#include "misc/sharedstate/datalink.h"
|
||||
#include "misc/swiftmiscexport.h"
|
||||
#include "misc/variant.h"
|
||||
|
||||
namespace swift::misc::shared_state
|
||||
{
|
||||
@@ -51,6 +52,6 @@ namespace swift::misc::shared_state
|
||||
QMap<QString, Channel> m_channels;
|
||||
mutable QRecursiveMutex m_channelsMutex;
|
||||
};
|
||||
}
|
||||
} // namespace swift::misc::shared_state
|
||||
|
||||
#endif
|
||||
|
||||
@@ -45,4 +45,4 @@ namespace swift::misc::shared_state::dbus
|
||||
{
|
||||
return m_token++;
|
||||
}
|
||||
}
|
||||
} // namespace swift::misc::shared_state::dbus
|
||||
|
||||
@@ -6,13 +6,14 @@
|
||||
#ifndef SWIFT_MISC_SHAREDSTATE_DBUS_DUPLEX_H
|
||||
#define SWIFT_MISC_SHAREDSTATE_DBUS_DUPLEX_H
|
||||
|
||||
#include "misc/genericdbusinterface.h"
|
||||
#include "misc/swiftmiscexport.h"
|
||||
#include "misc/promise.h"
|
||||
#include "misc/variant.h"
|
||||
#include <QObject>
|
||||
#include <QFuture>
|
||||
#include <QMap>
|
||||
#include <QObject>
|
||||
|
||||
#include "misc/genericdbusinterface.h"
|
||||
#include "misc/promise.h"
|
||||
#include "misc/swiftmiscexport.h"
|
||||
#include "misc/variant.h"
|
||||
|
||||
//! DBus interface for sharedstate hub.
|
||||
#define SWIFT_MISC_DUPLEX_INTERFACE "org.swift_project.misc.sharedstate.duplex"
|
||||
@@ -89,7 +90,7 @@ namespace swift::misc
|
||||
QMap<quint32, CPromise<CVariant>> m_submittedRequests;
|
||||
QMap<quint32, CPromise<CVariant>> m_receivedRequests;
|
||||
};
|
||||
}
|
||||
}
|
||||
} // namespace shared_state::dbus
|
||||
} // namespace swift::misc
|
||||
|
||||
#endif
|
||||
|
||||
@@ -4,10 +4,11 @@
|
||||
//! \file
|
||||
|
||||
#include "misc/sharedstate/dbus/dupleximpl.h"
|
||||
#include "misc/sharedstate/dbus/hubimpl.h"
|
||||
#include "misc/variantlist.h"
|
||||
|
||||
#include "misc/dbusserver.h"
|
||||
#include "misc/identifier.h"
|
||||
#include "misc/sharedstate/dbus/hubimpl.h"
|
||||
#include "misc/variantlist.h"
|
||||
#include "misc/verify.h"
|
||||
|
||||
namespace swift::misc::shared_state::dbus
|
||||
@@ -100,4 +101,4 @@ namespace swift::misc::shared_state::dbus
|
||||
{
|
||||
m_handlingChannels.remove(channel);
|
||||
}
|
||||
}
|
||||
} // namespace swift::misc::shared_state::dbus
|
||||
|
||||
@@ -6,9 +6,10 @@
|
||||
#ifndef SWIFT_MISC_SHAREDSTATE_DBUS_DUPLEXIMPL_H
|
||||
#define SWIFT_MISC_SHAREDSTATE_DBUS_DUPLEXIMPL_H
|
||||
|
||||
#include "misc/sharedstate/dbus/duplex.h"
|
||||
#include <functional>
|
||||
|
||||
#include "misc/sharedstate/dbus/duplex.h"
|
||||
|
||||
namespace swift::misc
|
||||
{
|
||||
class CIdentifier;
|
||||
@@ -63,7 +64,7 @@ namespace swift::misc
|
||||
QMap<QString, CVariantList> m_subscriptions;
|
||||
QSet<QString> m_handlingChannels;
|
||||
};
|
||||
}
|
||||
}
|
||||
} // namespace shared_state::dbus
|
||||
} // namespace swift::misc
|
||||
|
||||
#endif
|
||||
|
||||
@@ -4,9 +4,10 @@
|
||||
//! \file
|
||||
|
||||
#include "misc/sharedstate/dbus/duplexproxy.h"
|
||||
|
||||
#include "misc/genericdbusinterface.h"
|
||||
#include "misc/variantlist.h"
|
||||
#include "misc/identifier.h"
|
||||
#include "misc/variantlist.h"
|
||||
|
||||
namespace swift::misc::shared_state::dbus
|
||||
{
|
||||
@@ -51,4 +52,4 @@ namespace swift::misc::shared_state::dbus
|
||||
{
|
||||
m_interface->callDBus(QLatin1String("withdraw"), channel);
|
||||
}
|
||||
}
|
||||
} // namespace swift::misc::shared_state::dbus
|
||||
|
||||
@@ -55,7 +55,7 @@ namespace swift::misc
|
||||
private:
|
||||
CGenericDBusInterface *m_interface = nullptr;
|
||||
};
|
||||
}
|
||||
}
|
||||
} // namespace shared_state::dbus
|
||||
} // namespace swift::misc
|
||||
|
||||
#endif
|
||||
|
||||
@@ -4,9 +4,11 @@
|
||||
//! \file
|
||||
|
||||
#include "misc/sharedstate/dbus/hub.h"
|
||||
|
||||
#include <QDBusConnection>
|
||||
|
||||
#include "misc/sharedstate/dbus/hubimpl.h"
|
||||
#include "misc/sharedstate/dbus/hubproxy.h"
|
||||
#include <QDBusConnection>
|
||||
|
||||
namespace swift::misc::shared_state::dbus
|
||||
{
|
||||
@@ -18,4 +20,4 @@ namespace swift::misc::shared_state::dbus
|
||||
if (proxy) { return new CHubProxy(connection, service, parent); }
|
||||
else { return new CHub(server, parent); }
|
||||
}
|
||||
}
|
||||
} // namespace swift::misc::shared_state::dbus
|
||||
|
||||
@@ -6,11 +6,12 @@
|
||||
#ifndef SWIFT_MISC_SHAREDSTATE_DBUS_HUB_H
|
||||
#define SWIFT_MISC_SHAREDSTATE_DBUS_HUB_H
|
||||
|
||||
#include <QFuture>
|
||||
#include <QObject>
|
||||
#include <QSharedPointer>
|
||||
|
||||
#include "core/corefacadeconfig.h"
|
||||
#include "misc/swiftmiscexport.h"
|
||||
#include <QSharedPointer>
|
||||
#include <QObject>
|
||||
#include <QFuture>
|
||||
|
||||
//! DBus interface for sharedstate hub.
|
||||
#define SWIFT_MISC_HUB_INTERFACE "org.swift_project.misc.sharedstate.hub"
|
||||
@@ -61,7 +62,7 @@ namespace swift::misc
|
||||
//! Constructor.
|
||||
IHub(QObject *parent = nullptr);
|
||||
};
|
||||
}
|
||||
}
|
||||
} // namespace shared_state::dbus
|
||||
} // namespace swift::misc
|
||||
|
||||
#endif
|
||||
|
||||
@@ -4,8 +4,9 @@
|
||||
//! \file
|
||||
|
||||
#include "misc/sharedstate/dbus/hubimpl.h"
|
||||
#include "misc/sharedstate/dbus/dupleximpl.h"
|
||||
|
||||
#include "misc/dbusserver.h"
|
||||
#include "misc/sharedstate/dbus/dupleximpl.h"
|
||||
#include "misc/variantlist.h"
|
||||
|
||||
namespace swift::misc::shared_state::dbus
|
||||
@@ -53,4 +54,4 @@ namespace swift::misc::shared_state::dbus
|
||||
const auto clients = std::move(m_clients);
|
||||
Q_UNUSED(clients)
|
||||
}
|
||||
}
|
||||
} // namespace swift::misc::shared_state::dbus
|
||||
|
||||
@@ -6,10 +6,11 @@
|
||||
#ifndef SWIFT_MISC_SHAREDSTATE_DBUS_HUBIMPL_H
|
||||
#define SWIFT_MISC_SHAREDSTATE_DBUS_HUBIMPL_H
|
||||
|
||||
#include "misc/sharedstate/dbus/hub.h"
|
||||
#include "misc/identifier.h"
|
||||
#include <QSharedPointer>
|
||||
#include <QMap>
|
||||
#include <QSharedPointer>
|
||||
|
||||
#include "misc/identifier.h"
|
||||
#include "misc/sharedstate/dbus/hub.h"
|
||||
|
||||
namespace swift::misc
|
||||
{
|
||||
@@ -64,7 +65,7 @@ namespace swift::misc
|
||||
CDBusServer *m_server = nullptr;
|
||||
QMap<CIdentifier, QSharedPointer<CDuplex>> m_clients;
|
||||
};
|
||||
}
|
||||
}
|
||||
} // namespace shared_state::dbus
|
||||
} // namespace swift::misc
|
||||
|
||||
#endif
|
||||
|
||||
@@ -4,10 +4,11 @@
|
||||
//! \file
|
||||
|
||||
#include "misc/sharedstate/dbus/hubproxy.h"
|
||||
#include "misc/sharedstate/dbus/duplexproxy.h"
|
||||
|
||||
#include "misc/genericdbusinterface.h"
|
||||
#include "misc/variantlist.h"
|
||||
#include "misc/identifier.h"
|
||||
#include "misc/sharedstate/dbus/duplexproxy.h"
|
||||
#include "misc/variantlist.h"
|
||||
|
||||
namespace swift::misc::shared_state::dbus
|
||||
{
|
||||
@@ -48,4 +49,4 @@ namespace swift::misc::shared_state::dbus
|
||||
{
|
||||
closeDuplex(CIdentifier::anonymous());
|
||||
}
|
||||
}
|
||||
} // namespace swift::misc::shared_state::dbus
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
#define SWIFT_MISC_SHAREDSTATE_DBUS_HUBPROXY_H
|
||||
|
||||
#include <QDBusConnection>
|
||||
|
||||
#include "misc/sharedstate/dbus/hub.h"
|
||||
|
||||
namespace swift::misc
|
||||
@@ -57,7 +58,7 @@ namespace swift::misc
|
||||
CGenericDBusInterface *m_interface = nullptr;
|
||||
QString m_service;
|
||||
};
|
||||
}
|
||||
}
|
||||
} // namespace shared_state::dbus
|
||||
} // namespace swift::misc
|
||||
|
||||
#endif
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
//! \file
|
||||
|
||||
#include "misc/sharedstate/listjournal.h"
|
||||
|
||||
#include "misc/sharedstate/datalink.h"
|
||||
|
||||
namespace swift::misc::shared_state
|
||||
@@ -29,4 +30,4 @@ namespace swift::misc::shared_state
|
||||
{
|
||||
m_value.push_back(param);
|
||||
}
|
||||
}
|
||||
} // namespace swift::misc::shared_state
|
||||
|
||||
@@ -6,12 +6,13 @@
|
||||
#ifndef SWIFT_MISC_SHAREDSTATE_LISTJOURNAL_H
|
||||
#define SWIFT_MISC_SHAREDSTATE_LISTJOURNAL_H
|
||||
|
||||
#include <QMutex>
|
||||
#include <QObject>
|
||||
|
||||
#include "misc/sharedstate/activemutator.h"
|
||||
#include "misc/sharedstate/passiveobserver.h"
|
||||
#include "misc/variantlist.h"
|
||||
#include "misc/swiftmiscexport.h"
|
||||
#include <QObject>
|
||||
#include <QMutex>
|
||||
#include "misc/variantlist.h"
|
||||
|
||||
namespace swift::misc::shared_state
|
||||
{
|
||||
@@ -54,6 +55,6 @@ namespace swift::misc::shared_state
|
||||
//! Constructor.
|
||||
CListJournal(QObject *parent) : CGenericListJournal(parent) {}
|
||||
};
|
||||
}
|
||||
} // namespace swift::misc::shared_state
|
||||
|
||||
#endif
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
//! \file
|
||||
|
||||
#include "misc/sharedstate/listmutator.h"
|
||||
|
||||
#include "misc/sharedstate/datalink.h"
|
||||
|
||||
namespace swift::misc::shared_state
|
||||
@@ -17,4 +18,4 @@ namespace swift::misc::shared_state
|
||||
{
|
||||
m_mutator->postEvent(value);
|
||||
}
|
||||
}
|
||||
} // namespace swift::misc::shared_state
|
||||
|
||||
@@ -6,11 +6,12 @@
|
||||
#ifndef SWIFT_MISC_SHAREDSTATE_LISTMUTATOR_H
|
||||
#define SWIFT_MISC_SHAREDSTATE_LISTMUTATOR_H
|
||||
|
||||
#include "misc/sharedstate/passivemutator.h"
|
||||
#include "misc/variantlist.h"
|
||||
#include "misc/swiftmiscexport.h"
|
||||
#include <QObject>
|
||||
#include <QMutex>
|
||||
#include <QObject>
|
||||
|
||||
#include "misc/sharedstate/passivemutator.h"
|
||||
#include "misc/swiftmiscexport.h"
|
||||
#include "misc/variantlist.h"
|
||||
|
||||
namespace swift::misc::shared_state
|
||||
{
|
||||
@@ -55,6 +56,6 @@ namespace swift::misc::shared_state
|
||||
//! Add list element.
|
||||
void addElement(const typename T::value_type &value) { CGenericListMutator::addElement(CVariant::from(value)); }
|
||||
};
|
||||
}
|
||||
} // namespace swift::misc::shared_state
|
||||
|
||||
#endif
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
//! \file
|
||||
|
||||
#include "misc/sharedstate/listobserver.h"
|
||||
|
||||
#include "misc/sharedstate/datalink.h"
|
||||
#include "misc/variantlist.h"
|
||||
|
||||
@@ -53,4 +54,4 @@ namespace swift::misc::shared_state
|
||||
lock.unlock();
|
||||
onGenericElementAdded(param);
|
||||
}
|
||||
}
|
||||
} // namespace swift::misc::shared_state
|
||||
|
||||
@@ -6,12 +6,13 @@
|
||||
#ifndef SWIFT_MISC_SHAREDSTATE_LISTOBSERVER_H
|
||||
#define SWIFT_MISC_SHAREDSTATE_LISTOBSERVER_H
|
||||
|
||||
#include <QMutex>
|
||||
#include <QObject>
|
||||
|
||||
#include "misc/sharedstate/activeobserver.h"
|
||||
#include "misc/sharedstate/datalink.h"
|
||||
#include "misc/variantlist.h"
|
||||
#include "misc/swiftmiscexport.h"
|
||||
#include <QObject>
|
||||
#include <QMutex>
|
||||
#include "misc/variantlist.h"
|
||||
|
||||
namespace swift::misc::shared_state
|
||||
{
|
||||
@@ -88,6 +89,6 @@ namespace swift::misc::shared_state
|
||||
virtual void onGenericElementAdded(const CVariant &value) override final { onElementAdded(value.to<typename T::value_type>()); }
|
||||
virtual void onGenericElementsReplaced(const CVariantList &values) override final { onElementsReplaced(values.to<T>()); }
|
||||
};
|
||||
}
|
||||
} // namespace swift::misc::shared_state
|
||||
|
||||
#endif
|
||||
|
||||
@@ -11,4 +11,4 @@ namespace swift::misc::shared_state
|
||||
{
|
||||
emit eventPosted(param);
|
||||
}
|
||||
}
|
||||
} // namespace swift::misc::shared_state
|
||||
|
||||
@@ -6,11 +6,12 @@
|
||||
#ifndef SWIFT_MISC_SHAREDSTATE_PASSIVEMUTATOR_H
|
||||
#define SWIFT_MISC_SHAREDSTATE_PASSIVEMUTATOR_H
|
||||
|
||||
#include "misc/variant.h"
|
||||
#include "misc/swiftmiscexport.h"
|
||||
#include <QObject>
|
||||
#include <QSharedPointer>
|
||||
|
||||
#include "misc/swiftmiscexport.h"
|
||||
#include "misc/variant.h"
|
||||
|
||||
namespace swift::misc::shared_state
|
||||
{
|
||||
class CActiveMutator;
|
||||
@@ -41,6 +42,6 @@ namespace swift::misc::shared_state
|
||||
//! Emitted by postEvent.
|
||||
void eventPosted(const swift::misc::CVariant ¶m);
|
||||
};
|
||||
}
|
||||
} // namespace swift::misc::shared_state
|
||||
|
||||
#endif
|
||||
|
||||
@@ -27,4 +27,4 @@ namespace swift::misc::shared_state
|
||||
{
|
||||
m_eventHandler(param);
|
||||
}
|
||||
}
|
||||
} // namespace swift::misc::shared_state
|
||||
|
||||
@@ -6,12 +6,13 @@
|
||||
#ifndef SWIFT_MISC_SHAREDSTATE_PASSIVEOBSERVER_H
|
||||
#define SWIFT_MISC_SHAREDSTATE_PASSIVEOBSERVER_H
|
||||
|
||||
#include "misc/variant.h"
|
||||
#include "misc/valueobject.h"
|
||||
#include "misc/swiftmiscexport.h"
|
||||
#include <QMutex>
|
||||
#include <QObject>
|
||||
#include <QSharedPointer>
|
||||
#include <QMutex>
|
||||
|
||||
#include "misc/swiftmiscexport.h"
|
||||
#include "misc/valueobject.h"
|
||||
#include "misc/variant.h"
|
||||
|
||||
SWIFT_DECLARE_VALUEOBJECT_MIXINS(swift::misc::shared_state, CAnyMatch)
|
||||
|
||||
@@ -83,7 +84,7 @@ namespace swift::misc::shared_state
|
||||
|
||||
SWIFT_METACLASS(CAnyMatch, SWIFT_METAMEMBER(dummy));
|
||||
};
|
||||
}
|
||||
} // namespace swift::misc::shared_state
|
||||
|
||||
Q_DECLARE_METATYPE(swift::misc::shared_state::CAnyMatch)
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
//! \file
|
||||
|
||||
#include "misc/sharedstate/scalarjournal.h"
|
||||
|
||||
#include "misc/sharedstate/datalink.h"
|
||||
|
||||
namespace swift::misc::shared_state
|
||||
@@ -26,4 +27,4 @@ namespace swift::misc::shared_state
|
||||
{
|
||||
m_value = param;
|
||||
}
|
||||
}
|
||||
} // namespace swift::misc::shared_state
|
||||
|
||||
@@ -6,12 +6,13 @@
|
||||
#ifndef SWIFT_MISC_SHAREDSTATE_SCALARJOURNAL_H
|
||||
#define SWIFT_MISC_SHAREDSTATE_SCALARJOURNAL_H
|
||||
|
||||
#include <QMutex>
|
||||
#include <QObject>
|
||||
|
||||
#include "misc/sharedstate/activemutator.h"
|
||||
#include "misc/sharedstate/passiveobserver.h"
|
||||
#include "misc/variant.h"
|
||||
#include "misc/swiftmiscexport.h"
|
||||
#include <QObject>
|
||||
#include <QMutex>
|
||||
#include "misc/variant.h"
|
||||
|
||||
namespace swift::misc::shared_state
|
||||
{
|
||||
@@ -54,6 +55,6 @@ namespace swift::misc::shared_state
|
||||
//! Constructor.
|
||||
CScalarJournal(QObject *parent) : CGenericScalarJournal(parent) {}
|
||||
};
|
||||
}
|
||||
} // namespace swift::misc::shared_state
|
||||
|
||||
#endif
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
//! \file
|
||||
|
||||
#include "misc/sharedstate/scalarmutator.h"
|
||||
|
||||
#include "misc/sharedstate/datalink.h"
|
||||
|
||||
namespace swift::misc::shared_state
|
||||
@@ -17,4 +18,4 @@ namespace swift::misc::shared_state
|
||||
{
|
||||
m_mutator->postEvent(value);
|
||||
}
|
||||
}
|
||||
} // namespace swift::misc::shared_state
|
||||
|
||||
@@ -6,11 +6,12 @@
|
||||
#ifndef SWIFT_MISC_SHAREDSTATE_SCALARMUTATOR_H
|
||||
#define SWIFT_MISC_SHAREDSTATE_SCALARMUTATOR_H
|
||||
|
||||
#include "misc/sharedstate/passivemutator.h"
|
||||
#include "misc/variant.h"
|
||||
#include "misc/swiftmiscexport.h"
|
||||
#include <QObject>
|
||||
#include <QMutex>
|
||||
#include <QObject>
|
||||
|
||||
#include "misc/sharedstate/passivemutator.h"
|
||||
#include "misc/swiftmiscexport.h"
|
||||
#include "misc/variant.h"
|
||||
|
||||
namespace swift::misc::shared_state
|
||||
{
|
||||
@@ -55,6 +56,6 @@ namespace swift::misc::shared_state
|
||||
//! Set scalar value.
|
||||
void setValue(const T &value) { CGenericScalarMutator::setValue(CVariant::from(value)); }
|
||||
};
|
||||
}
|
||||
} // namespace swift::misc::shared_state
|
||||
|
||||
#endif
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
//! \file
|
||||
|
||||
#include "misc/sharedstate/scalarobserver.h"
|
||||
|
||||
#include "misc/sharedstate/datalink.h"
|
||||
|
||||
namespace swift::misc::shared_state
|
||||
@@ -35,4 +36,4 @@ namespace swift::misc::shared_state
|
||||
lock.unlock();
|
||||
onGenericValueChanged(param);
|
||||
}
|
||||
}
|
||||
} // namespace swift::misc::shared_state
|
||||
|
||||
@@ -6,11 +6,12 @@
|
||||
#ifndef SWIFT_MISC_SHAREDSTATE_SCALAROBSERVER_H
|
||||
#define SWIFT_MISC_SHAREDSTATE_SCALAROBSERVER_H
|
||||
|
||||
#include "misc/sharedstate/activeobserver.h"
|
||||
#include "misc/variant.h"
|
||||
#include "misc/swiftmiscexport.h"
|
||||
#include <QObject>
|
||||
#include <QMutex>
|
||||
#include <QObject>
|
||||
|
||||
#include "misc/sharedstate/activeobserver.h"
|
||||
#include "misc/swiftmiscexport.h"
|
||||
#include "misc/variant.h"
|
||||
|
||||
namespace swift::misc::shared_state
|
||||
{
|
||||
@@ -67,6 +68,6 @@ namespace swift::misc::shared_state
|
||||
|
||||
virtual void onGenericValueChanged(const CVariant &value) override final { onValueChanged(value.to<T>()); }
|
||||
};
|
||||
}
|
||||
} // namespace swift::misc::shared_state
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user