Message pipes rework: renaming to legacy

This commit is contained in:
f4exb 2022-02-28 23:08:01 +01:00
parent c90d04e4b6
commit 74f917682b
26 changed files with 92 additions and 92 deletions

View File

@ -756,7 +756,7 @@ void ADSBDemod::setTarget(const QString& name, float targetAzimuth, float target
m_targetAzElValid = true; m_targetAzElValid = true;
// Send to Rotator Controllers // Send to Rotator Controllers
MessagePipes& messagePipes = MainCore::instance()->getMessagePipes(); MessagePipesLegacy& messagePipes = MainCore::instance()->getMessagePipes();
QList<MessageQueue*> *mapMessageQueues = messagePipes.getMessageQueues(this, "target"); QList<MessageQueue*> *mapMessageQueues = messagePipes.getMessageQueues(this, "target");
if (mapMessageQueues) if (mapMessageQueues)

View File

@ -711,7 +711,7 @@ bool ADSBDemodGUI::updateLocalPosition(Aircraft *aircraft, double latitude, doub
void ADSBDemodGUI::sendToMap(Aircraft *aircraft, QList<SWGSDRangel::SWGMapAnimation *> *animations) void ADSBDemodGUI::sendToMap(Aircraft *aircraft, QList<SWGSDRangel::SWGMapAnimation *> *animations)
{ {
// Send to Map feature // Send to Map feature
MessagePipes& messagePipes = MainCore::instance()->getMessagePipes(); MessagePipesLegacy& messagePipes = MainCore::instance()->getMessagePipes();
QList<MessageQueue*> *mapMessageQueues = messagePipes.getMessageQueues(m_adsbDemod, "mapitems"); QList<MessageQueue*> *mapMessageQueues = messagePipes.getMessageQueues(m_adsbDemod, "mapitems");
if (mapMessageQueues) if (mapMessageQueues)
{ {
@ -4044,7 +4044,7 @@ void ADSBDemodGUI::tick()
// Remove aircraft from hash // Remove aircraft from hash
i = m_aircraft.erase(i); i = m_aircraft.erase(i);
// Remove from map feature // Remove from map feature
MessagePipes& messagePipes = MainCore::instance()->getMessagePipes(); MessagePipesLegacy& messagePipes = MainCore::instance()->getMessagePipes();
QList<MessageQueue*> *mapMessageQueues = messagePipes.getMessageQueues(m_adsbDemod, "mapitems"); QList<MessageQueue*> *mapMessageQueues = messagePipes.getMessageQueues(m_adsbDemod, "mapitems");
if (mapMessageQueues) if (mapMessageQueues)
{ {

View File

@ -148,7 +148,7 @@ bool AISDemod::handleMessage(const Message& cmd)
getMessageQueueToGUI()->push(msg); getMessageQueueToGUI()->push(msg);
} }
MessagePipes& messagePipes = MainCore::instance()->getMessagePipes(); MessagePipesLegacy& messagePipes = MainCore::instance()->getMessagePipes();
// Forward to AIS feature // Forward to AIS feature
QList<MessageQueue*> *aisMessageQueues = messagePipes.getMessageQueues(this, "ais"); QList<MessageQueue*> *aisMessageQueues = messagePipes.getMessageQueues(this, "ais");

View File

@ -702,7 +702,7 @@ void AISDemodGUI::on_logOpen_clicked()
bool cancelled = false; bool cancelled = false;
QStringList cols; QStringList cols;
MessagePipes& messagePipes = MainCore::instance()->getMessagePipes(); MessagePipesLegacy& messagePipes = MainCore::instance()->getMessagePipes();
QList<MessageQueue*> *aisMessageQueues = messagePipes.getMessageQueues(m_aisDemod, "ais"); QList<MessageQueue*> *aisMessageQueues = messagePipes.getMessageQueues(m_aisDemod, "ais");
while (!cancelled && CSV::readRow(in, &cols)) while (!cancelled && CSV::readRow(in, &cols))

View File

@ -867,7 +867,7 @@ void APTDemodGUI::on_deleteImageFromMap_clicked()
void APTDemodGUI::deleteImageFromMap(const QString &name) void APTDemodGUI::deleteImageFromMap(const QString &name)
{ {
MessagePipes& messagePipes = MainCore::instance()->getMessagePipes(); MessagePipesLegacy& messagePipes = MainCore::instance()->getMessagePipes();
QList<MessageQueue*> *mapMessageQueues = messagePipes.getMessageQueues(m_aptDemod, "mapitems"); QList<MessageQueue*> *mapMessageQueues = messagePipes.getMessageQueues(m_aptDemod, "mapitems");
if (mapMessageQueues) if (mapMessageQueues)
{ {

View File

@ -661,7 +661,7 @@ void APTDemodImageWorker::makeTransparent(QImage &image)
void APTDemodImageWorker::sendImageToMap(QImage image) void APTDemodImageWorker::sendImageToMap(QImage image)
{ {
// Send to Map feature // Send to Map feature
MessagePipes& messagePipes = MainCore::instance()->getMessagePipes(); MessagePipesLegacy& messagePipes = MainCore::instance()->getMessagePipes();
QList<MessageQueue*> *mapMessageQueues = messagePipes.getMessageQueues(m_aptDemod, "mapitems"); QList<MessageQueue*> *mapMessageQueues = messagePipes.getMessageQueues(m_aptDemod, "mapitems");
if (mapMessageQueues) if (mapMessageQueues)
{ {

View File

@ -220,7 +220,7 @@ bool ChirpChatDemod::handleMessage(const Message& cmd)
} }
// Forward to APRS and other packet features // Forward to APRS and other packet features
MessagePipes& messagePipes = MainCore::instance()->getMessagePipes(); MessagePipesLegacy& messagePipes = MainCore::instance()->getMessagePipes();
QList<MessageQueue*> *packetMessageQueues = messagePipes.getMessageQueues(this, "packets"); QList<MessageQueue*> *packetMessageQueues = messagePipes.getMessageQueues(this, "packets");
if (packetMessageQueues) if (packetMessageQueues)
{ {

View File

@ -156,7 +156,7 @@ bool PacketDemod::handleMessage(const Message& cmd)
getMessageQueueToGUI()->push(msg); getMessageQueueToGUI()->push(msg);
} }
MessagePipes& messagePipes = MainCore::instance()->getMessagePipes(); MessagePipesLegacy& messagePipes = MainCore::instance()->getMessagePipes();
// Forward to APRS and other packet features // Forward to APRS and other packet features
QList<MessageQueue*> *packetMessageQueues = messagePipes.getMessageQueues(this, "packets"); QList<MessageQueue*> *packetMessageQueues = messagePipes.getMessageQueues(this, "packets");

View File

@ -1908,7 +1908,7 @@ void RadioAstronomyGUI::on_powerTable_cellDoubleClicked(int row, int column)
if ((column >= POWER_COL_RA) && (column >= POWER_COL_EL)) if ((column >= POWER_COL_RA) && (column >= POWER_COL_EL))
{ {
// Display target in Star Tracker // Display target in Star Tracker
MessagePipes& messagePipes = MainCore::instance()->getMessagePipes(); MessagePipesLegacy& messagePipes = MainCore::instance()->getMessagePipes();
QList<MessageQueue*> *messageQueues = messagePipes.getMessageQueues(m_radioAstronomy, "startracker.display"); QList<MessageQueue*> *messageQueues = messagePipes.getMessageQueues(m_radioAstronomy, "startracker.display");
if (messageQueues) if (messageQueues)
{ {
@ -4276,7 +4276,7 @@ void RadioAstronomyGUI::showLoSMarker(int row)
void RadioAstronomyGUI::updateLoSMarker(const QString& name, float l, float b, float d) void RadioAstronomyGUI::updateLoSMarker(const QString& name, float l, float b, float d)
{ {
// Send to Star Tracker // Send to Star Tracker
MessagePipes& messagePipes = MainCore::instance()->getMessagePipes(); MessagePipesLegacy& messagePipes = MainCore::instance()->getMessagePipes();
QList<MessageQueue*> *messageQueues = messagePipes.getMessageQueues(m_radioAstronomy, "startracker.display"); QList<MessageQueue*> *messageQueues = messagePipes.getMessageQueues(m_radioAstronomy, "startracker.display");
if (messageQueues) if (messageQueues)
{ {
@ -4678,7 +4678,7 @@ void RadioAstronomyGUI::on_spectrumIndex_valueChanged(int value)
ui->powerTable->scrollTo(ui->powerTable->model()->index(value, 0)); ui->powerTable->scrollTo(ui->powerTable->model()->index(value, 0));
ui->spectrumDateTime->setDateTime(m_fftMeasurements[value]->m_dateTime); ui->spectrumDateTime->setDateTime(m_fftMeasurements[value]->m_dateTime);
// Display target in Star Tracker // Display target in Star Tracker
MessagePipes& messagePipes = MainCore::instance()->getMessagePipes(); MessagePipesLegacy& messagePipes = MainCore::instance()->getMessagePipes();
QList<MessageQueue*> *messageQueues = messagePipes.getMessageQueues(m_radioAstronomy, "startracker.display"); QList<MessageQueue*> *messageQueues = messagePipes.getMessageQueues(m_radioAstronomy, "startracker.display");
if (messageQueues) if (messageQueues)
{ {

View File

@ -138,11 +138,11 @@ bool AFC::handleMessage(const Message& cmd)
return true; return true;
} }
} }
else if (MessagePipesCommon::MsgReportChannelDeleted::match(cmd)) else if (MessagePipesLegacyCommon::MsgReportChannelDeleted::match(cmd))
{ {
qDebug() << "AFC::handleMessage: MessagePipesCommon::MsgReportChannelDeleted"; qDebug() << "AFC::handleMessage: MessagePipesLegacyCommon::MsgReportChannelDeleted";
MessagePipesCommon::MsgReportChannelDeleted& report = (MessagePipesCommon::MsgReportChannelDeleted&) cmd; MessagePipesLegacyCommon::MsgReportChannelDeleted& report = (MessagePipesLegacyCommon::MsgReportChannelDeleted&) cmd;
const MessagePipesCommon::ChannelRegistrationKey& channelKey = report.getChannelRegistrationKey(); const MessagePipesLegacyCommon::ChannelRegistrationKey& channelKey = report.getChannelRegistrationKey();
MainCore::instance()->getMessagePipes().unregisterChannelToFeature(channelKey.m_key, this, "settings"); MainCore::instance()->getMessagePipes().unregisterChannelToFeature(channelKey.m_key, this, "settings");
return true; return true;

View File

@ -416,7 +416,7 @@ void AISGUI::sendToMap(const QString &name, const QString &label,
float heading float heading
) )
{ {
MessagePipes& messagePipes = MainCore::instance()->getMessagePipes(); MessagePipesLegacy& messagePipes = MainCore::instance()->getMessagePipes();
QList<MessageQueue*> *mapMessageQueues = messagePipes.getMessageQueues(m_ais, "mapitems"); QList<MessageQueue*> *mapMessageQueues = messagePipes.getMessageQueues(m_ais, "mapitems");
if (mapMessageQueues) if (mapMessageQueues)
{ {

View File

@ -337,7 +337,7 @@ bool APRSGUI::handleMessage(const Message& message)
} }
// Forward to map // Forward to map
MessagePipes& messagePipes = MainCore::instance()->getMessagePipes(); MessagePipesLegacy& messagePipes = MainCore::instance()->getMessagePipes();
QList<MessageQueue*> *mapMessageQueues = messagePipes.getMessageQueues(m_aprs, "mapitems"); QList<MessageQueue*> *mapMessageQueues = messagePipes.getMessageQueues(m_aprs, "mapitems");
if (mapMessageQueues) if (mapMessageQueues)
{ {

View File

@ -272,7 +272,7 @@ void DemodAnalyzer::applySettings(const DemodAnalyzerSettings& settings, bool fo
void DemodAnalyzer::updateChannels() void DemodAnalyzer::updateChannels()
{ {
MainCore *mainCore = MainCore::instance(); MainCore *mainCore = MainCore::instance();
// MessagePipes& messagePipes = mainCore->getMessagePipes(); // MessagePipesLegacy& messagePipes = mainCore->getMessagePipes();
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

@ -203,7 +203,7 @@ void JogdialController::applySettings(const JogdialControllerSettings& settings,
void JogdialController::updateChannels() void JogdialController::updateChannels()
{ {
MainCore *mainCore = MainCore::instance(); MainCore *mainCore = MainCore::instance();
// MessagePipes& messagePipes = mainCore->getMessagePipes(); // MessagePipesLegacy& messagePipes = mainCore->getMessagePipes();
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

@ -18,7 +18,7 @@
#include <QGeoRectangle> #include <QGeoRectangle>
#include "channel/channelwebapiutils.h" #include "channel/channelwebapiutils.h"
#include "pipes/messagepipes.h" #include "pipes/messagepipeslegacy.h"
#include "maincore.h" #include "maincore.h"
#include "mapmodel.h" #include "mapmodel.h"
@ -358,7 +358,7 @@ void MapModel::updateTarget()
azEl->calculate(); azEl->calculate();
// Send to Rotator Controllers // Send to Rotator Controllers
MessagePipes& messagePipes = MainCore::instance()->getMessagePipes(); MessagePipesLegacy& messagePipes = MainCore::instance()->getMessagePipes();
QList<MessageQueue*> *mapMessageQueues = messagePipes.getMessageQueues(m_gui->getMap(), "target"); QList<MessageQueue*> *mapMessageQueues = messagePipes.getMessageQueues(m_gui->getMap(), "target");
if (mapMessageQueues) if (mapMessageQueues)
{ {

View File

@ -234,7 +234,7 @@ void SatelliteTrackerWorker::applySettings(const SatelliteTrackerSettings& setti
void SatelliteTrackerWorker::removeFromMap(QString id) void SatelliteTrackerWorker::removeFromMap(QString id)
{ {
MessagePipes& messagePipes = MainCore::instance()->getMessagePipes(); MessagePipesLegacy& messagePipes = MainCore::instance()->getMessagePipes();
QList<MessageQueue*> *mapMessageQueues = messagePipes.getMessageQueues(m_satelliteTracker, "mapitems"); QList<MessageQueue*> *mapMessageQueues = messagePipes.getMessageQueues(m_satelliteTracker, "mapitems");
if (mapMessageQueues) if (mapMessageQueues)
sendToMap(mapMessageQueues, id, "", "", "", 0.0f, 0.0, 0.0, 0.0, 0.0, nullptr, nullptr, nullptr, nullptr); sendToMap(mapMessageQueues, id, "", "", "", 0.0f, 0.0, 0.0, 0.0, 0.0, nullptr, nullptr, nullptr, nullptr);
@ -405,7 +405,7 @@ void SatelliteTrackerWorker::update()
azimuth = std::fmod(azimuth + 180.0, 360.0); azimuth = std::fmod(azimuth + 180.0, 360.0);
elevation = 180.0 - elevation; elevation = 180.0 - elevation;
} }
MessagePipes& messagePipes = MainCore::instance()->getMessagePipes(); MessagePipesLegacy& messagePipes = MainCore::instance()->getMessagePipes();
QList<MessageQueue*> *rotatorMessageQueues = messagePipes.getMessageQueues(m_satelliteTracker, "target"); QList<MessageQueue*> *rotatorMessageQueues = messagePipes.getMessageQueues(m_satelliteTracker, "target");
if (rotatorMessageQueues) if (rotatorMessageQueues)
{ {
@ -425,7 +425,7 @@ void SatelliteTrackerWorker::update()
// Send to Map // Send to Map
if (m_settings.m_drawOnMap) if (m_settings.m_drawOnMap)
{ {
MessagePipes& messagePipes = MainCore::instance()->getMessagePipes(); MessagePipesLegacy& messagePipes = MainCore::instance()->getMessagePipes();
QList<MessageQueue*> *mapMessageQueues = messagePipes.getMessageQueues(m_satelliteTracker, "mapitems"); QList<MessageQueue*> *mapMessageQueues = messagePipes.getMessageQueues(m_satelliteTracker, "mapitems");
if (mapMessageQueues) if (mapMessageQueues)
{ {

View File

@ -407,7 +407,7 @@ void StarTrackerWorker::updateRaDec(RADec rd, QDateTime dt, bool lbTarget)
void StarTrackerWorker::removeFromMap(QString id) void StarTrackerWorker::removeFromMap(QString id)
{ {
MessagePipes& messagePipes = MainCore::instance()->getMessagePipes(); MessagePipesLegacy& messagePipes = MainCore::instance()->getMessagePipes();
QList<MessageQueue*> *mapMessageQueues = messagePipes.getMessageQueues(m_starTracker, "mapitems"); QList<MessageQueue*> *mapMessageQueues = messagePipes.getMessageQueues(m_starTracker, "mapitems");
if (mapMessageQueues) { if (mapMessageQueues) {
sendToMap(mapMessageQueues, id, "", "", 0.0, 0.0); sendToMap(mapMessageQueues, id, "", "", 0.0, 0.0);
@ -580,7 +580,7 @@ void StarTrackerWorker::update()
} }
} }
MessagePipes& messagePipes = MainCore::instance()->getMessagePipes(); MessagePipesLegacy& messagePipes = MainCore::instance()->getMessagePipes();
QList<MessageQueue*>* messageQueues; QList<MessageQueue*>* messageQueues;
// Send Az/El to Rotator Controllers // Send Az/El to Rotator Controllers

View File

@ -170,10 +170,10 @@ set(sdrbase_SOURCES
pipes/datafifostore.cpp pipes/datafifostore.cpp
pipes/datapipes.cpp pipes/datapipes.cpp
pipes/datapipesgcworker.cpp pipes/datapipesgcworker.cpp
pipes/messagepipes.cpp pipes/messagepipeslegacy.cpp
pipes/messagepipes2.cpp pipes/messagepipes2.cpp
pipes/messagepipescommon.cpp pipes/messagepipeslegacycommon.cpp
pipes/messagepipesgcworker.cpp pipes/messagepipeslegacygcworker.cpp
pipes/messagepipes2gcworker.cpp pipes/messagepipes2gcworker.cpp
pipes/messagequeuestore.cpp pipes/messagequeuestore.cpp
pipes/pipeendpoint.cpp pipes/pipeendpoint.cpp
@ -381,10 +381,10 @@ set(sdrbase_HEADERS
pipes/datapipesgcworker.h pipes/datapipesgcworker.h
pipes/elementpipescommon.h pipes/elementpipescommon.h
pipes/elementpipesgc.h pipes/elementpipesgc.h
pipes/messagepipes.h pipes/messagepipeslegacy.h
pipes/messagepipes2.h pipes/messagepipes2.h
pipes/messagepipescommon.h pipes/messagepipeslegacycommon.h
pipes/messagepipesgcworker.h pipes/messagepipeslegacygcworker.h
pipes/messagepipes2gcworker.h pipes/messagepipes2gcworker.h
pipes/messagequeuestore.h pipes/messagequeuestore.h
pipes/pipeendpoint.h pipes/pipeendpoint.h

View File

@ -27,7 +27,7 @@
#include "export.h" #include "export.h"
#include "settings/mainsettings.h" #include "settings/mainsettings.h"
#include "util/message.h" #include "util/message.h"
#include "pipes/messagepipes.h" #include "pipes/messagepipeslegacy.h"
#include "pipes/messagepipes2.h" #include "pipes/messagepipes2.h"
#include "pipes/datapipes.h" #include "pipes/datapipes.h"
#include "channel/channelapi.h" #include "channel/channelapi.h"
@ -731,7 +731,7 @@ public:
void removeFeatureInstance(Feature *feature); void removeFeatureInstance(Feature *feature);
void clearFeatures(FeatureSet *featureSet); void clearFeatures(FeatureSet *featureSet);
// pipes // pipes
MessagePipes& getMessagePipes() { return m_messagePipes; } MessagePipesLegacy& getMessagePipes() { return m_messagePipes; }
MessagePipes2& getMessagePipes2() { return m_messagePipes2; } MessagePipes2& getMessagePipes2() { return m_messagePipes2; }
DataPipes& getDataPipes() { return m_dataPipes; } DataPipes& getDataPipes() { return m_dataPipes; }
@ -752,7 +752,7 @@ private:
QMap<ChannelAPI*, DeviceSet*> m_channelsMap; //!< Channel to device set map QMap<ChannelAPI*, DeviceSet*> m_channelsMap; //!< Channel to device set map
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;
MessagePipes m_messagePipes; MessagePipesLegacy m_messagePipes;
MessagePipes2 m_messagePipes2; MessagePipes2 m_messagePipes2;
DataPipes m_dataPipes; DataPipes m_dataPipes;

View File

@ -19,13 +19,13 @@
#include "util/messagequeue.h" #include "util/messagequeue.h"
#include "messagepipesgcworker.h" #include "messagepipeslegacygcworker.h"
#include "messagepipes.h" #include "messagepipeslegacy.h"
#include "pipeendpoint.h" #include "pipeendpoint.h"
MessagePipes::MessagePipes() MessagePipesLegacy::MessagePipesLegacy()
{ {
m_gcWorker = new MessagePipesGCWorker(); m_gcWorker = new MessagePipesLegacyGCWorker();
m_gcWorker->setC2FRegistrations( m_gcWorker->setC2FRegistrations(
m_registrations.getMutex(), m_registrations.getMutex(),
m_registrations.getElements(), m_registrations.getElements(),
@ -35,43 +35,43 @@ MessagePipes::MessagePipes()
startGC(); startGC();
} }
MessagePipes::~MessagePipes() MessagePipesLegacy::~MessagePipesLegacy()
{ {
if (m_gcWorker->isRunning()) { if (m_gcWorker->isRunning()) {
stopGC(); stopGC();
} }
} }
MessageQueue *MessagePipes::registerChannelToFeature(const PipeEndPoint *source, PipeEndPoint *dest, const QString& type) MessageQueue *MessagePipesLegacy::registerChannelToFeature(const PipeEndPoint *source, PipeEndPoint *dest, const QString& type)
{ {
qDebug("MessagePipes::registerChannelToFeature: %p %p %s", source, dest, qPrintable(type)); qDebug("MessagePipesLegacy::registerChannelToFeature: %p %p %s", source, dest, qPrintable(type));
return m_registrations.registerProducerToConsumer(source, dest, type); return m_registrations.registerProducerToConsumer(source, dest, type);
} }
MessageQueue *MessagePipes::unregisterChannelToFeature(const PipeEndPoint *source, PipeEndPoint *dest, const QString& type) MessageQueue *MessagePipesLegacy::unregisterChannelToFeature(const PipeEndPoint *source, PipeEndPoint *dest, const QString& type)
{ {
qDebug("MessagePipes::unregisterChannelToFeature: %p %p %s", source, dest, qPrintable(type)); qDebug("MessagePipesLegacy::unregisterChannelToFeature: %p %p %s", source, dest, qPrintable(type));
MessageQueue *messageQueue = m_registrations.unregisterProducerToConsumer(source, dest, type); MessageQueue *messageQueue = m_registrations.unregisterProducerToConsumer(source, dest, type);
m_gcWorker->addMessageQueueToDelete(messageQueue); m_gcWorker->addMessageQueueToDelete(messageQueue);
return messageQueue; return messageQueue;
} }
QList<MessageQueue*>* MessagePipes::getMessageQueues(const PipeEndPoint *source, const QString& type) QList<MessageQueue*>* MessagePipesLegacy::getMessageQueues(const PipeEndPoint *source, const QString& type)
{ {
qDebug("MessagePipes::getMessageQueues: %p %s", source, qPrintable(type)); qDebug("MessagePipesLegacy::getMessageQueues: %p %s", source, qPrintable(type));
return m_registrations.getElements(source, type); return m_registrations.getElements(source, type);
} }
void MessagePipes::startGC() void MessagePipesLegacy::startGC()
{ {
qDebug("MessagePipes::startGC"); qDebug("MessagePipesLegacy::startGC");
m_gcWorker->startWork(); m_gcWorker->startWork();
m_gcThread.start(); m_gcThread.start();
} }
void MessagePipes::stopGC() void MessagePipesLegacy::stopGC()
{ {
qDebug("MessagePipes::stopGC"); qDebug("MessagePipesLegacy::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_MESSAGEPIPES_H_ #ifndef SDRBASE_PIPES_MESSAGEPIPESLEGACY_H_
#define SDRBASE_PIPES_MESSAGEPIPES_H_ #define SDRBASE_PIPES_MESSAGEPIPESLEGACY_H_
#include <QObject> #include <QObject>
#include <QHash> #include <QHash>
@ -26,21 +26,21 @@
#include "export.h" #include "export.h"
#include "messagepipescommon.h" #include "messagepipeslegacycommon.h"
#include "elementpipesregistrations.h" #include "elementpipesregistrations.h"
class PipeEndPoint; class PipeEndPoint;
class MessagePipesGCWorker; class MessagePipesLegacyGCWorker;
class MessageQueue; class MessageQueue;
class SDRBASE_API MessagePipes : public QObject class SDRBASE_API MessagePipesLegacy : public QObject
{ {
Q_OBJECT Q_OBJECT
public: public:
MessagePipes(); MessagePipesLegacy();
MessagePipes(const MessagePipes&) = delete; MessagePipesLegacy(const MessagePipesLegacy&) = delete;
MessagePipes& operator=(const MessagePipes&) = delete; MessagePipesLegacy& operator=(const MessagePipesLegacy&) = delete;
~MessagePipes(); ~MessagePipesLegacy();
// FIXME: Names of these functions should probably change, as we now support channel or feature at either end // FIXME: Names of these functions should probably change, as we now support channel or feature at either end
MessageQueue *registerChannelToFeature(const PipeEndPoint *source, PipeEndPoint *dest, const QString& type); MessageQueue *registerChannelToFeature(const PipeEndPoint *source, PipeEndPoint *dest, const QString& type);
@ -50,10 +50,10 @@ public:
private: private:
ElementPipesRegistrations<PipeEndPoint, PipeEndPoint, MessageQueue> m_registrations; ElementPipesRegistrations<PipeEndPoint, PipeEndPoint, MessageQueue> m_registrations;
QThread m_gcThread; //!< Garbage collector thread QThread m_gcThread; //!< Garbage collector thread
MessagePipesGCWorker *m_gcWorker; //!< Garbage collector MessagePipesLegacyGCWorker *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_MESSAGEPIPES_H_ #endif // SDRBASE_PIPES_MESSAGEPIPESLEGACY_H_

View File

@ -15,6 +15,6 @@
// 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 "messagepipescommon.h" #include "messagepipeslegacycommon.h"
MESSAGE_CLASS_DEFINITION(MessagePipesCommon::MsgReportChannelDeleted, Message) MESSAGE_CLASS_DEFINITION(MessagePipesLegacyCommon::MsgReportChannelDeleted, Message)

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_MESSAGEPIPESCOMON_H_ #ifndef SDRBASE_PIPES_MESSAGEPIPESLEGACYCOMON_H_
#define SDRBASE_PIPES_MESSAGEPIPESCOMON_H_ #define SDRBASE_PIPES_MESSAGEPIPESLEGACYCOMON_H_
#include <QHash> #include <QHash>
#include <QMap> #include <QMap>
@ -29,7 +29,7 @@
class PipeEndPoint; class PipeEndPoint;
class MessageQueue; class MessageQueue;
class SDRBASE_API MessagePipesCommon class SDRBASE_API MessagePipesLegacyCommon
{ {
public: public:
typedef ElementPipesCommon::RegistrationKey<PipeEndPoint> ChannelRegistrationKey; typedef ElementPipesCommon::RegistrationKey<PipeEndPoint> ChannelRegistrationKey;
@ -58,4 +58,4 @@ public:
}; };
}; };
#endif // SDRBASE_PIPES_MESSAGEPIPESCOMON_H_ #endif // SDRBASE_PIPES_MESSAGEPIPESLEGACYCOMON_H_

View File

@ -19,50 +19,50 @@
#include "feature/feature.h" #include "feature/feature.h"
#include "util/messagequeue.h" #include "util/messagequeue.h"
#include "maincore.h" #include "maincore.h"
#include "messagepipescommon.h" #include "messagepipeslegacycommon.h"
#include "messagepipesgcworker.h" #include "messagepipeslegacygcworker.h"
bool MessagePipesGCWorker::MessagePipesGC::existsProducer(const PipeEndPoint *pipeEndPoint) bool MessagePipesLegacyGCWorker::MessagePipesGC::existsProducer(const PipeEndPoint *pipeEndPoint)
{ {
return MainCore::instance()->existsChannel((const ChannelAPI *)pipeEndPoint) return MainCore::instance()->existsChannel((const ChannelAPI *)pipeEndPoint)
|| MainCore::instance()->existsFeature((const Feature *)pipeEndPoint); || MainCore::instance()->existsFeature((const Feature *)pipeEndPoint);
} }
bool MessagePipesGCWorker::MessagePipesGC::existsConsumer(const PipeEndPoint *pipeEndPoint) bool MessagePipesLegacyGCWorker::MessagePipesGC::existsConsumer(const PipeEndPoint *pipeEndPoint)
{ {
return MainCore::instance()->existsChannel((const ChannelAPI *)pipeEndPoint) return MainCore::instance()->existsChannel((const ChannelAPI *)pipeEndPoint)
|| MainCore::instance()->existsFeature((const Feature *)pipeEndPoint); || MainCore::instance()->existsFeature((const Feature *)pipeEndPoint);
} }
void MessagePipesGCWorker::MessagePipesGC::sendMessageToConsumer( void MessagePipesLegacyGCWorker::MessagePipesGC::sendMessageToConsumer(
const MessageQueue *, const MessageQueue *,
MessagePipesCommon::ChannelRegistrationKey, MessagePipesLegacyCommon::ChannelRegistrationKey,
PipeEndPoint *) PipeEndPoint *)
{ {
} }
MessagePipesGCWorker::MessagePipesGCWorker() : MessagePipesLegacyGCWorker::MessagePipesLegacyGCWorker() :
m_running(false) m_running(false)
{} {}
MessagePipesGCWorker::~MessagePipesGCWorker() MessagePipesLegacyGCWorker::~MessagePipesLegacyGCWorker()
{} {}
void MessagePipesGCWorker::startWork() void MessagePipesLegacyGCWorker::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 MessagePipesGCWorker::stopWork() void MessagePipesLegacyGCWorker::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 MessagePipesGCWorker::addMessageQueueToDelete(MessageQueue *messageQueue) void MessagePipesLegacyGCWorker::addMessageQueueToDelete(MessageQueue *messageQueue)
{ {
if (messageQueue) if (messageQueue)
{ {
@ -71,8 +71,8 @@ void MessagePipesGCWorker::addMessageQueueToDelete(MessageQueue *messageQueue)
} }
} }
void MessagePipesGCWorker::processGC() void MessagePipesLegacyGCWorker::processGC()
{ {
// qDebug("MessagePipesGCWorker::processGC"); // qDebug("MessagePipesLegacyGCWorker::processGC");
m_messagePipesGC.processGC(); m_messagePipesGC.processGC();
} }

View File

@ -15,30 +15,30 @@
// 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_MESSAGEPIPESGCWORKER_H_ #ifndef SDRBASE_PIPES_MESSAGEPIPESLEGACYGCWORKER_H_
#define SDRBASE_PIPES_MESSAGEPIPESGCWORKER_H_ #define SDRBASE_PIPES_MESSAGEPIPESLEGACYGCWORKER_H_
#include <QObject> #include <QObject>
#include <QTimer> #include <QTimer>
#include "export.h" #include "export.h"
#include "messagepipescommon.h" #include "messagepipeslegacycommon.h"
#include "elementpipesgc.h" #include "elementpipesgc.h"
class QMutex; class QMutex;
class SDRBASE_API MessagePipesGCWorker : public QObject class SDRBASE_API MessagePipesLegacyGCWorker : public QObject
{ {
Q_OBJECT Q_OBJECT
public: public:
MessagePipesGCWorker(); MessagePipesLegacyGCWorker();
~MessagePipesGCWorker(); ~MessagePipesLegacyGCWorker();
void setC2FRegistrations( void setC2FRegistrations(
QMutex *c2fMutex, QMutex *c2fMutex,
QMap<MessagePipesCommon::ChannelRegistrationKey, QList<MessageQueue*>> *c2fQueues, QMap<MessagePipesLegacyCommon::ChannelRegistrationKey, QList<MessageQueue*>> *c2fQueues,
QMap<MessagePipesCommon::ChannelRegistrationKey, QList<PipeEndPoint*>> *c2fPipeEndPoints QMap<MessagePipesLegacyCommon::ChannelRegistrationKey, QList<PipeEndPoint*>> *c2fPipeEndPoints
) )
{ {
m_messagePipesGC.setRegistrations(c2fMutex, c2fQueues, c2fPipeEndPoints); m_messagePipesGC.setRegistrations(c2fMutex, c2fQueues, c2fPipeEndPoints);
@ -55,7 +55,7 @@ private:
private: private:
virtual bool existsProducer(const PipeEndPoint *pipeEndPoint); virtual bool existsProducer(const PipeEndPoint *pipeEndPoint);
virtual bool existsConsumer(const PipeEndPoint *pipeEndPoint); virtual bool existsConsumer(const PipeEndPoint *pipeEndPoint);
virtual void sendMessageToConsumer(const MessageQueue *messageQueue, MessagePipesCommon::ChannelRegistrationKey key, PipeEndPoint *pipeEndPoint); virtual void sendMessageToConsumer(const MessageQueue *messageQueue, MessagePipesLegacyCommon::ChannelRegistrationKey key, PipeEndPoint *pipeEndPoint);
}; };
MessagePipesGC m_messagePipesGC; MessagePipesGC m_messagePipesGC;
@ -66,4 +66,4 @@ private slots:
void processGC(); //!< Collect garbage void processGC(); //!< Collect garbage
}; };
#endif #endif // SDRBASE_PIPES_MESSAGEPIPESLEGACYGCWORKER_H_

View File

@ -34,7 +34,7 @@ MESSAGE_CLASS_DEFINITION(PipeEndPoint::MsgReportPipes, Message)
QList<PipeEndPoint::AvailablePipeSource> PipeEndPoint::updateAvailablePipeSources(QString pipeName, QStringList pipeTypes, QStringList pipeURIs, PipeEndPoint *destination) QList<PipeEndPoint::AvailablePipeSource> PipeEndPoint::updateAvailablePipeSources(QString pipeName, QStringList pipeTypes, QStringList pipeURIs, PipeEndPoint *destination)
{ {
MainCore *mainCore = MainCore::instance(); MainCore *mainCore = MainCore::instance();
MessagePipes& messagePipes = mainCore->getMessagePipes(); MessagePipesLegacy& messagePipes = mainCore->getMessagePipes();
std::vector<DeviceSet*>& deviceSets = mainCore->getDeviceSets(); std::vector<DeviceSet*>& deviceSets = mainCore->getDeviceSets();
QHash<PipeEndPoint *, AvailablePipeSource> availablePipes; QHash<PipeEndPoint *, AvailablePipeSource> availablePipes;