From 113aff6e57efa0582218d699800611425637ff97 Mon Sep 17 00:00:00 2001 From: f4exb Date: Mon, 21 Feb 2022 03:06:16 +0100 Subject: [PATCH] Data pipes redesign: renaming. Part of #1154 --- sdrbase/CMakeLists.txt | 14 ++---- sdrbase/maincore.h | 6 +-- sdrbase/pipes/datapipes.cpp | 31 ++++++------- sdrbase/pipes/datapipes.h | 30 ++++++------ sdrbase/pipes/datapipes2.cpp | 68 ---------------------------- sdrbase/pipes/datapipes2.h | 55 ---------------------- sdrbase/pipes/datapipes2gcworker.cpp | 46 ------------------- sdrbase/pipes/datapipes2gcworker.h | 49 -------------------- sdrbase/pipes/datapipescommon.cpp | 20 -------- sdrbase/pipes/datapipescommon.h | 63 -------------------------- sdrbase/pipes/datapipesgcworker.cpp | 39 ++-------------- sdrbase/pipes/datapipesgcworker.h | 35 +++----------- 12 files changed, 45 insertions(+), 411 deletions(-) delete mode 100644 sdrbase/pipes/datapipes2.cpp delete mode 100644 sdrbase/pipes/datapipes2.h delete mode 100644 sdrbase/pipes/datapipes2gcworker.cpp delete mode 100644 sdrbase/pipes/datapipes2gcworker.h delete mode 100644 sdrbase/pipes/datapipescommon.cpp delete mode 100644 sdrbase/pipes/datapipescommon.h diff --git a/sdrbase/CMakeLists.txt b/sdrbase/CMakeLists.txt index a74b7da38..d9cc7cf6d 100644 --- a/sdrbase/CMakeLists.txt +++ b/sdrbase/CMakeLists.txt @@ -167,12 +167,9 @@ set(sdrbase_SOURCES limerfe/limerfeusbcalib.cpp - pipes/datapipes.cpp - pipes/datapipescommon.cpp - pipes/datapipesgcworker.cpp pipes/datafifostore.cpp - pipes/datapipes2.cpp - pipes/datapipes2gcworker.cpp + pipes/datapipes.cpp + pipes/datapipesgcworker.cpp pipes/messagepipes.cpp pipes/messagepipescommon.cpp pipes/messagepipesgcworker.cpp @@ -376,12 +373,9 @@ set(sdrbase_HEADERS limerfe/limerfeusbcalib.h - pipes/datapipes.h - pipes/datapipescommon.h - pipes/datapipesgcworker.h pipes/datafifostore.h - pipes/datapipes2.h - pipes/datapipes2gcworker.h + pipes/datapipes.h + pipes/datapipesgcworker.h pipes/elementpipescommon.h pipes/elementpipesgc.h pipes/messagepipes.h diff --git a/sdrbase/maincore.h b/sdrbase/maincore.h index 80470bb3c..6cbc0d0d0 100644 --- a/sdrbase/maincore.h +++ b/sdrbase/maincore.h @@ -28,7 +28,7 @@ #include "settings/mainsettings.h" #include "util/message.h" #include "pipes/messagepipes.h" -#include "pipes/datapipes2.h" +#include "pipes/datapipes.h" #include "channel/channelapi.h" class DeviceSet; @@ -731,7 +731,7 @@ public: void clearFeatures(FeatureSet *featureSet); // pipes MessagePipes& getMessagePipes() { return m_messagePipes; } - DataPipes2& getDataPipes() { return m_dataPipes; } + DataPipes& getDataPipes() { return m_dataPipes; } friend class MainServer; friend class MainWindow; @@ -751,7 +751,7 @@ private: QMap m_featuresMap; //!< Feature to feature set map PluginManager* m_pluginManager; MessagePipes m_messagePipes; - DataPipes2 m_dataPipes; + DataPipes m_dataPipes; void debugMaps(); }; diff --git a/sdrbase/pipes/datapipes.cpp b/sdrbase/pipes/datapipes.cpp index 0cd02c407..f99e87a6d 100644 --- a/sdrbase/pipes/datapipes.cpp +++ b/sdrbase/pipes/datapipes.cpp @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////////////// -// Copyright (C) 2020 Edouard Griffiths, F4EXB // +// Copyright (C) 2022 Edouard Griffiths, F4EXB // // // // This program is free software; you can redistribute it and/or modify // // it under the terms of the GNU General Public License as published by // @@ -16,18 +16,13 @@ /////////////////////////////////////////////////////////////////////////////////// #include "dsp/datafifo.h" - -#include "datapipesgcworker.h" #include "datapipes.h" +#include "datapipesgcworker.h" -DataPipes::DataPipes() +DataPipes::DataPipes() : + m_registrations(&m_dataFifoStore) { - m_gcWorker = new DataPipesGCWorker(); - m_gcWorker->setC2FRegistrations( - m_registrations.getMutex(), - m_registrations.getElements(), - m_registrations.getConsumers() - ); + m_gcWorker = new DataPipesGCWorker(m_registrations); m_gcWorker->moveToThread(&m_gcThread); startGC(); } @@ -37,23 +32,23 @@ DataPipes::~DataPipes() if (m_gcWorker->isRunning()) { stopGC(); } + + m_gcWorker->deleteLater(); } -DataFifo *DataPipes::registerChannelToFeature(const ChannelAPI *source, Feature *feature, const QString& type) +ObjectPipe *DataPipes::registerProducerToConsumer(const QObject *producer, const QObject *consumer, const QString& type) { - return m_registrations.registerProducerToConsumer(source, feature, type); + return m_registrations.registerProducerToConsumer(producer, consumer, type); } -DataFifo *DataPipes::unregisterChannelToFeature(const ChannelAPI *source, Feature *feature, const QString& type) +ObjectPipe *DataPipes::unregisterProducerToConsumer(const QObject *producer, const QObject *consumer, const QString& type) { - DataFifo *dataFifo = m_registrations.unregisterProducerToConsumer(source, feature, type); - m_gcWorker->addDataFifoToDelete(dataFifo); - return dataFifo; + return m_registrations.unregisterProducerToConsumer(producer, consumer, type); } -QList* DataPipes::getFifos(const ChannelAPI *source, const QString& type) +void DataPipes::getDataPipes(const QObject *producer, const QString& type, QList& pipes) { - return m_registrations.getElements(source, type); + return m_registrations.getPipes(producer, type, pipes); } void DataPipes::startGC() diff --git a/sdrbase/pipes/datapipes.h b/sdrbase/pipes/datapipes.h index 9f3fd76b4..079bbf8e8 100644 --- a/sdrbase/pipes/datapipes.h +++ b/sdrbase/pipes/datapipes.h @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////////////// -// Copyright (C) 2020 Edouard Griffiths, F4EXB // +// Copyright (C) 2022 Edouard Griffiths, F4EXB // // // // This program is free software; you can redistribute it and/or modify // // it under the terms of the GNU General Public License as published by // @@ -15,24 +15,18 @@ // along with this program. If not, see . // /////////////////////////////////////////////////////////////////////////////////// -#ifndef SDRBASE_PIPES_DATAPIPES_H_ -#define SDRBASE_PIPES_DATAPIPES_H_ +#ifndef SDRBASE_PIPES_DATAPIPES2_H_ +#define SDRBASE_PIPES_DATAPIPES2_H_ #include -#include -#include -#include #include #include "export.h" +#include "objectpipesregistrations.h" +#include "datafifostore.h" -#include "datapipescommon.h" -#include "elementpipesregistrations.h" - -class ChannelAPI; -class Feature; -class DataPipesGCWorker; class DataFifo; +class DataPipesGCWorker; class SDRBASE_API DataPipes : public QObject { @@ -43,12 +37,13 @@ public: DataPipes& operator=(const DataPipes&) = delete; ~DataPipes(); - DataFifo *registerChannelToFeature(const ChannelAPI *source, Feature *feature, const QString& type); - DataFifo *unregisterChannelToFeature(const ChannelAPI *source, Feature *feature, const QString& type); - QList* getFifos(const ChannelAPI *source, 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); + void getDataPipes(const QObject *producer, const QString& type, QList& pipes); private: - ElementPipesRegistrations m_registrations; + DataFifoStore m_dataFifoStore; + ObjectPipesRegistrations m_registrations; QThread m_gcThread; //!< Garbage collector thread DataPipesGCWorker *m_gcWorker; //!< Garbage collector @@ -56,4 +51,5 @@ private: void stopGC(); //!< Stop garbage collector }; -#endif // SDRBASE_PIPES_DATAPIPES_H_ + +#endif // SDRBASE_PIPES_DATAPIPES2_H_ diff --git a/sdrbase/pipes/datapipes2.cpp b/sdrbase/pipes/datapipes2.cpp deleted file mode 100644 index e48a1489b..000000000 --- a/sdrbase/pipes/datapipes2.cpp +++ /dev/null @@ -1,68 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -// Copyright (C) 2022 Edouard Griffiths, F4EXB // -// // -// This program is free software; you can redistribute it and/or modify // -// it under the terms of the GNU General Public License as published by // -// the Free Software Foundation as version 3 of the License, or // -// (at your option) any later version. // -// // -// This program is distributed in the hope that it will be useful, // -// but WITHOUT ANY WARRANTY; without even the implied warranty of // -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // -// GNU General Public License V3 for more details. // -// // -// You should have received a copy of the GNU General Public License // -// along with this program. If not, see . // -/////////////////////////////////////////////////////////////////////////////////// - -#include "dsp/datafifo.h" -#include "datapipes2.h" -#include "datapipes2gcworker.h" - -DataPipes2::DataPipes2() : - m_registrations(&m_dataFifoStore) -{ - m_gcWorker = new DataPipes2GCWorker(m_registrations); - m_gcWorker->moveToThread(&m_gcThread); - startGC(); -} - -DataPipes2::~DataPipes2() -{ - if (m_gcWorker->isRunning()) { - stopGC(); - } - - m_gcWorker->deleteLater(); -} - -ObjectPipe *DataPipes2::registerProducerToConsumer(const QObject *producer, const QObject *consumer, const QString& type) -{ - return m_registrations.registerProducerToConsumer(producer, consumer, type); -} - -ObjectPipe *DataPipes2::unregisterProducerToConsumer(const QObject *producer, const QObject *consumer, const QString& type) -{ - return m_registrations.unregisterProducerToConsumer(producer, consumer, type); -} - -void DataPipes2::getDataPipes(const QObject *producer, const QString& type, QList& pipes) -{ - return m_registrations.getPipes(producer, type, pipes); -} - -void DataPipes2::startGC() -{ - qDebug("DataPipes2::startGC"); - - m_gcWorker->startWork(); - m_gcThread.start(); -} - -void DataPipes2::stopGC() -{ - qDebug("DataPipes2::stopGC"); - m_gcWorker->stopWork(); - m_gcThread.quit(); - m_gcThread.wait(); -} diff --git a/sdrbase/pipes/datapipes2.h b/sdrbase/pipes/datapipes2.h deleted file mode 100644 index 5438f0013..000000000 --- a/sdrbase/pipes/datapipes2.h +++ /dev/null @@ -1,55 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -// Copyright (C) 2022 Edouard Griffiths, F4EXB // -// // -// This program is free software; you can redistribute it and/or modify // -// it under the terms of the GNU General Public License as published by // -// the Free Software Foundation as version 3 of the License, or // -// (at your option) any later version. // -// // -// This program is distributed in the hope that it will be useful, // -// but WITHOUT ANY WARRANTY; without even the implied warranty of // -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // -// GNU General Public License V3 for more details. // -// // -// You should have received a copy of the GNU General Public License // -// along with this program. If not, see . // -/////////////////////////////////////////////////////////////////////////////////// - -#ifndef SDRBASE_PIPES_DATAPIPES2_H_ -#define SDRBASE_PIPES_DATAPIPES2_H_ - -#include -#include - -#include "export.h" -#include "objectpipesregistrations.h" -#include "datafifostore.h" - -class DataFifo; -class DataPipes2GCWorker; - -class SDRBASE_API DataPipes2 : public QObject -{ - Q_OBJECT -public: - DataPipes2(); - DataPipes2(const DataPipes2&) = delete; - DataPipes2& operator=(const DataPipes2&) = delete; - ~DataPipes2(); - - ObjectPipe *registerProducerToConsumer(const QObject *producer, const QObject *consumer, const QString& type); - ObjectPipe *unregisterProducerToConsumer(const QObject *producer, const QObject *consumer, const QString& type); - void getDataPipes(const QObject *producer, const QString& type, QList& pipes); - -private: - DataFifoStore m_dataFifoStore; - ObjectPipesRegistrations m_registrations; - QThread m_gcThread; //!< Garbage collector thread - DataPipes2GCWorker *m_gcWorker; //!< Garbage collector - - void startGC(); //!< Start garbage collector - void stopGC(); //!< Stop garbage collector -}; - - -#endif // SDRBASE_PIPES_DATAPIPES2_H_ diff --git a/sdrbase/pipes/datapipes2gcworker.cpp b/sdrbase/pipes/datapipes2gcworker.cpp deleted file mode 100644 index 08f20c173..000000000 --- a/sdrbase/pipes/datapipes2gcworker.cpp +++ /dev/null @@ -1,46 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -// Copyright (C) 2022 Edouard Griffiths, F4EXB // -// // -// This program is free software; you can redistribute it and/or modify // -// it under the terms of the GNU General Public License as published by // -// the Free Software Foundation as version 3 of the License, or // -// (at your option) any later version. // -// // -// This program is distributed in the hope that it will be useful, // -// but WITHOUT ANY WARRANTY; without even the implied warranty of // -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // -// GNU General Public License V3 for more details. // -// // -// You should have received a copy of the GNU General Public License // -// along with this program. If not, see . // -/////////////////////////////////////////////////////////////////////////////////// - -#include "dsp/datafifo.h" -#include "datapipes2gcworker.h" - -DataPipes2GCWorker::DataPipes2GCWorker(ObjectPipesRegistrations& objectPipesRegistrations) : - m_running(false), - m_objectPipesRegistrations(objectPipesRegistrations) -{} - -DataPipes2GCWorker::~DataPipes2GCWorker() -{} - -void DataPipes2GCWorker::startWork() -{ - connect(&m_gcTimer, SIGNAL(timeout()), this, SLOT(processGC())); - m_gcTimer.start(10000); // collect garbage every 10s - m_running = true; -} - -void DataPipes2GCWorker::stopWork() -{ - m_running = false; - m_gcTimer.stop(); - disconnect(&m_gcTimer, SIGNAL(timeout()), this, SLOT(processGC())); -} - -void DataPipes2GCWorker::processGC() -{ - m_objectPipesRegistrations.processGC(); -} diff --git a/sdrbase/pipes/datapipes2gcworker.h b/sdrbase/pipes/datapipes2gcworker.h deleted file mode 100644 index 03a9dcd06..000000000 --- a/sdrbase/pipes/datapipes2gcworker.h +++ /dev/null @@ -1,49 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -// Copyright (C) 2022 Edouard Griffiths, F4EXB // -// // -// This program is free software; you can redistribute it and/or modify // -// it under the terms of the GNU General Public License as published by // -// the Free Software Foundation as version 3 of the License, or // -// (at your option) any later version. // -// // -// This program is distributed in the hope that it will be useful, // -// but WITHOUT ANY WARRANTY; without even the implied warranty of // -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // -// GNU General Public License V3 for more details. // -// // -// You should have received a copy of the GNU General Public License // -// along with this program. If not, see . // -/////////////////////////////////////////////////////////////////////////////////// - -#ifndef SDRBASE_PIPES_DATAPIPES2GCWORKER_H_ -#define SDRBASE_PIPES_DATAPIPES2GCWORKER_H_ - -#include -#include - -#include "export.h" -#include "objectpipesregistrations.h" - -class DataFifo; - -class SDRBASE_API DataPipes2GCWorker : public QObject -{ - Q_OBJECT -public: - DataPipes2GCWorker(ObjectPipesRegistrations& objectPipesRegistrations); - ~DataPipes2GCWorker(); - - void startWork(); - void stopWork(); - bool isRunning() const { return m_running; } - -private: - bool m_running; - QTimer m_gcTimer; - ObjectPipesRegistrations& m_objectPipesRegistrations; - -private slots: - void processGC(); //!< Collect garbage -}; - -#endif // SDRBASE_PIPES_DATAPIPES2GCWORKER_H_ diff --git a/sdrbase/pipes/datapipescommon.cpp b/sdrbase/pipes/datapipescommon.cpp deleted file mode 100644 index 28f8fd0a6..000000000 --- a/sdrbase/pipes/datapipescommon.cpp +++ /dev/null @@ -1,20 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -// Copyright (C) 2020 Edouard Griffiths, F4EXB // -// // -// This program is free software; you can redistribute it and/or modify // -// it under the terms of the GNU General Public License as published by // -// the Free Software Foundation as version 3 of the License, or // -// (at your option) any later version. // -// // -// This program is distributed in the hope that it will be useful, // -// but WITHOUT ANY WARRANTY; without even the implied warranty of // -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // -// GNU General Public License V3 for more details. // -// // -// You should have received a copy of the GNU General Public License // -// along with this program. If not, see . // -/////////////////////////////////////////////////////////////////////////////////// - -#include "datapipescommon.h" - -MESSAGE_CLASS_DEFINITION(DataPipesCommon::MsgReportChannelDeleted, Message) diff --git a/sdrbase/pipes/datapipescommon.h b/sdrbase/pipes/datapipescommon.h deleted file mode 100644 index e6682067a..000000000 --- a/sdrbase/pipes/datapipescommon.h +++ /dev/null @@ -1,63 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -// Copyright (C) 2020 Edouard Griffiths, F4EXB // -// // -// This program is free software; you can redistribute it and/or modify // -// it under the terms of the GNU General Public License as published by // -// the Free Software Foundation as version 3 of the License, or // -// (at your option) any later version. // -// // -// This program is distributed in the hope that it will be useful, // -// but WITHOUT ANY WARRANTY; without even the implied warranty of // -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // -// GNU General Public License V3 for more details. // -// // -// You should have received a copy of the GNU General Public License // -// along with this program. If not, see . // -/////////////////////////////////////////////////////////////////////////////////// - -#ifndef SDRBASE_PIPES_DATAPIPESCOMON_H_ -#define SDRBASE_PIPES_DATAPIPESCOMON_H_ - -#include -#include -#include - -#include "export.h" -#include "util/message.h" - -#include "elementpipescommon.h" - -class ChannelAPI; -class Feature; -class DataFifo; - -class SDRBASE_API DataPipesCommon -{ -public: - typedef ElementPipesCommon::RegistrationKey ChannelRegistrationKey; - - /** Send this message to stakeholders when the garbage collector finds that a channel was deleted */ - class SDRBASE_API MsgReportChannelDeleted : public Message { - MESSAGE_CLASS_DECLARATION - - public: - const DataFifo *getFifo() const { return m_fifo; } - const ChannelRegistrationKey& getChannelRegistrationKey() const { return m_channelRegistrationKey; } - - static MsgReportChannelDeleted* create(const DataFifo *fifo, const ChannelRegistrationKey& channelRegistrationKey) { - return new MsgReportChannelDeleted(fifo, channelRegistrationKey); - } - - private: - const DataFifo *m_fifo; - ChannelRegistrationKey m_channelRegistrationKey; - - MsgReportChannelDeleted(const DataFifo *fifo, const ChannelRegistrationKey& channelRegistrationKey) : - Message(), - m_fifo(fifo), - m_channelRegistrationKey(channelRegistrationKey) - { } - }; -}; - -#endif // SDRBASE_PIPES_DATAPIPESCOMON_H_ diff --git a/sdrbase/pipes/datapipesgcworker.cpp b/sdrbase/pipes/datapipesgcworker.cpp index 83b843b34..5907727d5 100644 --- a/sdrbase/pipes/datapipesgcworker.cpp +++ b/sdrbase/pipes/datapipesgcworker.cpp @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////////////// -// Copyright (C) 2020 Edouard Griffiths, F4EXB // +// Copyright (C) 2022 Edouard Griffiths, F4EXB // // // // This program is free software; you can redistribute it and/or modify // // it under the terms of the GNU General Public License as published by // @@ -15,31 +15,12 @@ // along with this program. If not, see . // /////////////////////////////////////////////////////////////////////////////////// -#include "feature/feature.h" #include "dsp/datafifo.h" -#include "maincore.h" -#include "datapipescommon.h" #include "datapipesgcworker.h" -bool DataPipesGCWorker::DataPipesGC::existsProducer(const ChannelAPI *channel) -{ - return MainCore::instance()->existsChannel(channel); -} - -bool DataPipesGCWorker::DataPipesGC::existsConsumer(const Feature *feature) -{ - return MainCore::instance()->existsFeature(feature); -} - -void DataPipesGCWorker::DataPipesGC::sendMessageToConsumer(const DataFifo *fifo, DataPipesCommon::ChannelRegistrationKey channelKey, Feature *feature) -{ - DataPipesCommon::MsgReportChannelDeleted *msg = DataPipesCommon::MsgReportChannelDeleted::create( - fifo, channelKey); - feature->getInputMessageQueue()->push(msg); -} - -DataPipesGCWorker::DataPipesGCWorker() : - m_running(false) +DataPipesGCWorker::DataPipesGCWorker(ObjectPipesRegistrations& objectPipesRegistrations) : + m_running(false), + m_objectPipesRegistrations(objectPipesRegistrations) {} DataPipesGCWorker::~DataPipesGCWorker() @@ -59,17 +40,7 @@ void DataPipesGCWorker::stopWork() disconnect(&m_gcTimer, SIGNAL(timeout()), this, SLOT(processGC())); } -void DataPipesGCWorker::addDataFifoToDelete(DataFifo *dataFifo) -{ - if (dataFifo) - { - m_gcTimer.start(10000); // restart GC to make sure deletion is postponed - m_dataPipesGC.addElementToDelete(dataFifo); - } -} - void DataPipesGCWorker::processGC() { - // qDebug("MessagePipesGCWorker::processGC"); - m_dataPipesGC.processGC(); + m_objectPipesRegistrations.processGC(); } diff --git a/sdrbase/pipes/datapipesgcworker.h b/sdrbase/pipes/datapipesgcworker.h index 6fc5bc3bb..618b506f7 100644 --- a/sdrbase/pipes/datapipesgcworker.h +++ b/sdrbase/pipes/datapipesgcworker.h @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////////////// -// Copyright (C) 2020 Edouard Griffiths, F4EXB // +// Copyright (C) 2022 Edouard Griffiths, F4EXB // // // // This program is free software; you can redistribute it and/or modify // // it under the terms of the GNU General Public License as published by // @@ -15,56 +15,35 @@ // along with this program. If not, see . // /////////////////////////////////////////////////////////////////////////////////// -#ifndef SDRBASE_PIPES_DATAPIPESGCWORKER_H_ -#define SDRBASE_PIPES_DATAPIPESGCWORKER_H_ +#ifndef SDRBASE_PIPES_DATAPIPES2GCWORKER_H_ +#define SDRBASE_PIPES_DATAPIPES2GCWORKER_H_ #include #include #include "export.h" +#include "objectpipesregistrations.h" -#include "elementpipesgc.h" -#include "datapipescommon.h" - -class QMutex; class DataFifo; class SDRBASE_API DataPipesGCWorker : public QObject { Q_OBJECT public: - DataPipesGCWorker(); + DataPipesGCWorker(ObjectPipesRegistrations& objectPipesRegistrations); ~DataPipesGCWorker(); - void setC2FRegistrations( - QMutex *c2fMutex, - QMap> *c2fFifos, - QMap> *c2fFeatures - ) - { - m_dataPipesGC.setRegistrations(c2fMutex, c2fFifos, c2fFeatures); - } - void startWork(); void stopWork(); - void addDataFifoToDelete(DataFifo *dataFifo); bool isRunning() const { return m_running; } private: - class DataPipesGC : public ElementPipesGC - { - private: - virtual bool existsProducer(const ChannelAPI *channelAPI); - virtual bool existsConsumer(const Feature *feature); - virtual void sendMessageToConsumer(const DataFifo *fifo, DataPipesCommon::ChannelRegistrationKey key, Feature *feature); - }; - - DataPipesGC m_dataPipesGC; bool m_running; QTimer m_gcTimer; + ObjectPipesRegistrations& m_objectPipesRegistrations; private slots: void processGC(); //!< Collect garbage }; -#endif // SDRBASE_PIPES_DATAPIPESGCWORKER_H_ +#endif // SDRBASE_PIPES_DATAPIPES2GCWORKER_H_