1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-09-20 11:56:36 -04:00

Message pipes rework: renaming pipes2 to pipes

This commit is contained in:
f4exb 2022-02-28 23:32:23 +01:00
parent 74f917682b
commit 7ab11615f6
8 changed files with 44 additions and 44 deletions

View File

@ -157,7 +157,7 @@ bool VORDemodSC::handleMessage(const Message& cmd)
m_guiMessageQueue->push(msg); m_guiMessageQueue->push(msg);
} }
MessagePipes2& messagePipes = MainCore::instance()->getMessagePipes2(); MessagePipes& messagePipes = MainCore::instance()->getMessagePipes2();
QList<ObjectPipe*> pipes; QList<ObjectPipe*> pipes;
messagePipes.getMessagePipes(this, "report", pipes); messagePipes.getMessagePipes(this, "report", pipes);
@ -178,7 +178,7 @@ bool VORDemodSC::handleMessage(const Message& cmd)
m_guiMessageQueue->push(msg); m_guiMessageQueue->push(msg);
} }
MessagePipes2& messagePipes = MainCore::instance()->getMessagePipes2(); MessagePipes& messagePipes = MainCore::instance()->getMessagePipes2();
QList<ObjectPipe*> pipes; QList<ObjectPipe*> pipes;
messagePipes.getMessagePipes(this, "report", pipes); messagePipes.getMessagePipes(this, "report", pipes);

View File

@ -336,7 +336,7 @@ void VORLocalizer::applySettings(const VORLocalizerSettings& settings, bool forc
void VORLocalizer::updateChannels() void VORLocalizer::updateChannels()
{ {
MainCore *mainCore = MainCore::instance(); MainCore *mainCore = MainCore::instance();
MessagePipes2& messagePipes = mainCore->getMessagePipes2(); MessagePipes& messagePipes = mainCore->getMessagePipes2();
std::vector<DeviceSet*>& deviceSets = mainCore->getDeviceSets(); std::vector<DeviceSet*>& deviceSets = mainCore->getDeviceSets();
std::vector<DeviceSet*>::const_iterator it = deviceSets.begin(); std::vector<DeviceSet*>::const_iterator it = deviceSets.begin();
m_availableChannels.clear(); m_availableChannels.clear();

View File

@ -171,10 +171,10 @@ set(sdrbase_SOURCES
pipes/datapipes.cpp pipes/datapipes.cpp
pipes/datapipesgcworker.cpp pipes/datapipesgcworker.cpp
pipes/messagepipeslegacy.cpp pipes/messagepipeslegacy.cpp
pipes/messagepipes2.cpp pipes/messagepipes.cpp
pipes/messagepipeslegacycommon.cpp pipes/messagepipeslegacycommon.cpp
pipes/messagepipeslegacygcworker.cpp pipes/messagepipeslegacygcworker.cpp
pipes/messagepipes2gcworker.cpp pipes/messagepipesgcworker.cpp
pipes/messagequeuestore.cpp pipes/messagequeuestore.cpp
pipes/pipeendpoint.cpp pipes/pipeendpoint.cpp
pipes/objectpipe.cpp pipes/objectpipe.cpp
@ -382,10 +382,10 @@ set(sdrbase_HEADERS
pipes/elementpipescommon.h pipes/elementpipescommon.h
pipes/elementpipesgc.h pipes/elementpipesgc.h
pipes/messagepipeslegacy.h pipes/messagepipeslegacy.h
pipes/messagepipes2.h pipes/messagepipes.h
pipes/messagepipeslegacycommon.h pipes/messagepipeslegacycommon.h
pipes/messagepipeslegacygcworker.h pipes/messagepipeslegacygcworker.h
pipes/messagepipes2gcworker.h pipes/messagepipesgcworker.h
pipes/messagequeuestore.h pipes/messagequeuestore.h
pipes/pipeendpoint.h pipes/pipeendpoint.h
pipes/objectpipe.h pipes/objectpipe.h

View File

@ -28,7 +28,7 @@
#include "settings/mainsettings.h" #include "settings/mainsettings.h"
#include "util/message.h" #include "util/message.h"
#include "pipes/messagepipeslegacy.h" #include "pipes/messagepipeslegacy.h"
#include "pipes/messagepipes2.h" #include "pipes/messagepipes.h"
#include "pipes/datapipes.h" #include "pipes/datapipes.h"
#include "channel/channelapi.h" #include "channel/channelapi.h"
@ -732,7 +732,7 @@ public:
void clearFeatures(FeatureSet *featureSet); void clearFeatures(FeatureSet *featureSet);
// pipes // pipes
MessagePipesLegacy& getMessagePipes() { return m_messagePipes; } MessagePipesLegacy& getMessagePipes() { return m_messagePipes; }
MessagePipes2& getMessagePipes2() { return m_messagePipes2; } MessagePipes& getMessagePipes2() { return m_messagePipes2; }
DataPipes& getDataPipes() { return m_dataPipes; } DataPipes& getDataPipes() { return m_dataPipes; }
friend class MainServer; friend class MainServer;
@ -753,7 +753,7 @@ private:
QMap<Feature*, FeatureSet*> m_featuresMap; //!< Feature to feature set map QMap<Feature*, FeatureSet*> m_featuresMap; //!< Feature to feature set map
PluginManager* m_pluginManager; PluginManager* m_pluginManager;
MessagePipesLegacy m_messagePipes; MessagePipesLegacy m_messagePipes;
MessagePipes2 m_messagePipes2; MessagePipes m_messagePipes2;
DataPipes m_dataPipes; DataPipes m_dataPipes;
void debugMaps(); void debugMaps();

View File

@ -15,18 +15,18 @@
// along with this program. If not, see <http://www.gnu.org/licenses/>. // // along with this program. If not, see <http://www.gnu.org/licenses/>. //
/////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////
#include "messagepipes2.h" #include "messagepipes.h"
#include "messagepipes2gcworker.h" #include "messagepipesgcworker.h"
MessagePipes2::MessagePipes2() : MessagePipes::MessagePipes() :
m_registrations(&m_messageQueueStore) m_registrations(&m_messageQueueStore)
{ {
m_gcWorker = new MessagePipes2GCWorker(m_registrations); m_gcWorker = new MessagePipesGCWorker(m_registrations);
m_gcWorker->moveToThread(&m_gcThread); m_gcWorker->moveToThread(&m_gcThread);
startGC(); startGC();
} }
MessagePipes2::~MessagePipes2() MessagePipes::~MessagePipes()
{ {
if (m_gcWorker->isRunning()) { if (m_gcWorker->isRunning()) {
stopGC(); stopGC();
@ -35,32 +35,32 @@ MessagePipes2::~MessagePipes2()
m_gcWorker->deleteLater(); m_gcWorker->deleteLater();
} }
ObjectPipe *MessagePipes2::registerProducerToConsumer(const QObject *producer, const QObject *consumer, const QString& type) ObjectPipe *MessagePipes::registerProducerToConsumer(const QObject *producer, const QObject *consumer, const QString& type)
{ {
return m_registrations.registerProducerToConsumer(producer, consumer, type); return m_registrations.registerProducerToConsumer(producer, consumer, type);
} }
ObjectPipe *MessagePipes2::unregisterProducerToConsumer(const QObject *producer, const QObject *consumer, const QString& type) ObjectPipe *MessagePipes::unregisterProducerToConsumer(const QObject *producer, const QObject *consumer, const QString& type)
{ {
return m_registrations.unregisterProducerToConsumer(producer, consumer, type); return m_registrations.unregisterProducerToConsumer(producer, consumer, type);
} }
void MessagePipes2::getMessagePipes(const QObject *producer, const QString& type, QList<ObjectPipe*>& pipes) void MessagePipes::getMessagePipes(const QObject *producer, const QString& type, QList<ObjectPipe*>& pipes)
{ {
return m_registrations.getPipes(producer, type, pipes); return m_registrations.getPipes(producer, type, pipes);
} }
void MessagePipes2::startGC() void MessagePipes::startGC()
{ {
qDebug("MessagePipes2::startGC"); qDebug("MessagePipes::startGC");
m_gcWorker->startWork(); m_gcWorker->startWork();
m_gcThread.start(); m_gcThread.start();
} }
void MessagePipes2::stopGC() void MessagePipes::stopGC()
{ {
qDebug("MessagePipes2::stopGC"); qDebug("MessagePipes::stopGC");
m_gcWorker->stopWork(); m_gcWorker->stopWork();
m_gcThread.quit(); m_gcThread.quit();
m_gcThread.wait(); m_gcThread.wait();

View File

@ -15,8 +15,8 @@
// along with this program. If not, see <http://www.gnu.org/licenses/>. // // along with this program. If not, see <http://www.gnu.org/licenses/>. //
/////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////
#ifndef SDRBASE_PIPES_MESSAGEPIPES2_H_ #ifndef SDRBASE_PIPES_MESSAGEPIPES_H_
#define SDRBASE_PIPES_MESSAGEPIPES2_H_ #define SDRBASE_PIPES_MESSAGEPIPES_H_
#include <QObject> #include <QObject>
#include <QThread> #include <QThread>
@ -25,16 +25,16 @@
#include "objectpipesregistrations.h" #include "objectpipesregistrations.h"
#include "messagequeuestore.h" #include "messagequeuestore.h"
class MessagePipes2GCWorker; class MessagePipesGCWorker;
class SDRBASE_API MessagePipes2 : public QObject class SDRBASE_API MessagePipes : public QObject
{ {
Q_OBJECT Q_OBJECT
public: public:
MessagePipes2(); MessagePipes();
MessagePipes2(const MessagePipes2&) = delete; MessagePipes(const MessagePipes&) = delete;
MessagePipes2& operator=(const MessagePipes2&) = delete; MessagePipes& operator=(const MessagePipes&) = delete;
~MessagePipes2(); ~MessagePipes();
ObjectPipe *registerProducerToConsumer(const QObject *producer, const QObject *consumer, const QString& type); ObjectPipe *registerProducerToConsumer(const QObject *producer, const QObject *consumer, const QString& type);
ObjectPipe *unregisterProducerToConsumer(const QObject *producer, const QObject *consumer, const QString& type); ObjectPipe *unregisterProducerToConsumer(const QObject *producer, const QObject *consumer, const QString& type);
@ -44,11 +44,11 @@ private:
MessageQueueStore m_messageQueueStore; MessageQueueStore m_messageQueueStore;
ObjectPipesRegistrations m_registrations; ObjectPipesRegistrations m_registrations;
QThread m_gcThread; //!< Garbage collector thread QThread m_gcThread; //!< Garbage collector thread
MessagePipes2GCWorker *m_gcWorker; //!< Garbage collector MessagePipesGCWorker *m_gcWorker; //!< Garbage collector
void startGC(); //!< Start garbage collector void startGC(); //!< Start garbage collector
void stopGC(); //!< Stop garbage collector void stopGC(); //!< Stop garbage collector
}; };
#endif // SDRBASE_PIPES_MESSAGEPIPES2_H_ #endif // SDRBASE_PIPES_MESSAGEPIPES_H_

View File

@ -15,31 +15,31 @@
// along with this program. If not, see <http://www.gnu.org/licenses/>. // // along with this program. If not, see <http://www.gnu.org/licenses/>. //
/////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////
#include "messagepipes2gcworker.h" #include "messagepipesgcworker.h"
MessagePipes2GCWorker::MessagePipes2GCWorker(ObjectPipesRegistrations& objectPipesRegistrations) : MessagePipesGCWorker::MessagePipesGCWorker(ObjectPipesRegistrations& objectPipesRegistrations) :
m_running(false), m_running(false),
m_objectPipesRegistrations(objectPipesRegistrations) m_objectPipesRegistrations(objectPipesRegistrations)
{} {}
MessagePipes2GCWorker::~MessagePipes2GCWorker() MessagePipesGCWorker::~MessagePipesGCWorker()
{} {}
void MessagePipes2GCWorker::startWork() void MessagePipesGCWorker::startWork()
{ {
connect(&m_gcTimer, SIGNAL(timeout()), this, SLOT(processGC())); connect(&m_gcTimer, SIGNAL(timeout()), this, SLOT(processGC()));
m_gcTimer.start(10000); // collect garbage every 10s m_gcTimer.start(10000); // collect garbage every 10s
m_running = true; m_running = true;
} }
void MessagePipes2GCWorker::stopWork() void MessagePipesGCWorker::stopWork()
{ {
m_running = false; m_running = false;
m_gcTimer.stop(); m_gcTimer.stop();
disconnect(&m_gcTimer, SIGNAL(timeout()), this, SLOT(processGC())); disconnect(&m_gcTimer, SIGNAL(timeout()), this, SLOT(processGC()));
} }
void MessagePipes2GCWorker::processGC() void MessagePipesGCWorker::processGC()
{ {
m_objectPipesRegistrations.processGC(); m_objectPipesRegistrations.processGC();
} }

View File

@ -15,8 +15,8 @@
// along with this program. If not, see <http://www.gnu.org/licenses/>. // // along with this program. If not, see <http://www.gnu.org/licenses/>. //
/////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////
#ifndef SDRBASE_PIPES_MESSAGEPIPES2GCWORKER_H_ #ifndef SDRBASE_PIPES_MESSAGEPIPESGCWORKER_H_
#define SDRBASE_PIPES_MESSAGEPIPES2GCWORKER_H_ #define SDRBASE_PIPES_MESSAGEPIPESGCWORKER_H_
#include <QObject> #include <QObject>
#include <QTimer> #include <QTimer>
@ -24,12 +24,12 @@
#include "export.h" #include "export.h"
#include "objectpipesregistrations.h" #include "objectpipesregistrations.h"
class SDRBASE_API MessagePipes2GCWorker : public QObject class SDRBASE_API MessagePipesGCWorker : public QObject
{ {
Q_OBJECT Q_OBJECT
public: public:
MessagePipes2GCWorker(ObjectPipesRegistrations& objectPipesRegistrations); MessagePipesGCWorker(ObjectPipesRegistrations& objectPipesRegistrations);
~MessagePipes2GCWorker(); ~MessagePipesGCWorker();
void startWork(); void startWork();
void stopWork(); void stopWork();
@ -44,4 +44,4 @@ private slots:
void processGC(); //!< Collect garbage void processGC(); //!< Collect garbage
}; };
#endif // SDRBASE_PIPES_MESSAGEPIPES2GCWORKER_H_ #endif // SDRBASE_PIPES_MESSAGEPIPESGCWORKER_H_