mirror of
				https://github.com/f4exb/sdrangel.git
				synced 2025-10-31 04:50:29 -04:00 
			
		
		
		
	Message pipes rework: renaming pipes2 to pipes
This commit is contained in:
		
							parent
							
								
									74f917682b
								
							
						
					
					
						commit
						7ab11615f6
					
				| @ -157,7 +157,7 @@ bool VORDemodSC::handleMessage(const Message& cmd) | ||||
|             m_guiMessageQueue->push(msg); | ||||
|         } | ||||
| 
 | ||||
|         MessagePipes2& messagePipes = MainCore::instance()->getMessagePipes2(); | ||||
|         MessagePipes& messagePipes = MainCore::instance()->getMessagePipes2(); | ||||
|         QList<ObjectPipe*> pipes; | ||||
|         messagePipes.getMessagePipes(this, "report", pipes); | ||||
| 
 | ||||
| @ -178,7 +178,7 @@ bool VORDemodSC::handleMessage(const Message& cmd) | ||||
|             m_guiMessageQueue->push(msg); | ||||
|         } | ||||
| 
 | ||||
|         MessagePipes2& messagePipes = MainCore::instance()->getMessagePipes2(); | ||||
|         MessagePipes& messagePipes = MainCore::instance()->getMessagePipes2(); | ||||
|         QList<ObjectPipe*> pipes; | ||||
|         messagePipes.getMessagePipes(this, "report", pipes); | ||||
| 
 | ||||
|  | ||||
| @ -336,7 +336,7 @@ void VORLocalizer::applySettings(const VORLocalizerSettings& settings, bool forc | ||||
| void VORLocalizer::updateChannels() | ||||
| { | ||||
|     MainCore *mainCore = MainCore::instance(); | ||||
|     MessagePipes2& messagePipes = mainCore->getMessagePipes2(); | ||||
|     MessagePipes& messagePipes = mainCore->getMessagePipes2(); | ||||
|     std::vector<DeviceSet*>& deviceSets = mainCore->getDeviceSets(); | ||||
|     std::vector<DeviceSet*>::const_iterator it = deviceSets.begin(); | ||||
|     m_availableChannels.clear(); | ||||
|  | ||||
| @ -171,10 +171,10 @@ set(sdrbase_SOURCES | ||||
|     pipes/datapipes.cpp | ||||
|     pipes/datapipesgcworker.cpp | ||||
|     pipes/messagepipeslegacy.cpp | ||||
|     pipes/messagepipes2.cpp | ||||
|     pipes/messagepipes.cpp | ||||
|     pipes/messagepipeslegacycommon.cpp | ||||
|     pipes/messagepipeslegacygcworker.cpp | ||||
|     pipes/messagepipes2gcworker.cpp | ||||
|     pipes/messagepipesgcworker.cpp | ||||
|     pipes/messagequeuestore.cpp | ||||
|     pipes/pipeendpoint.cpp | ||||
|     pipes/objectpipe.cpp | ||||
| @ -382,10 +382,10 @@ set(sdrbase_HEADERS | ||||
|     pipes/elementpipescommon.h | ||||
|     pipes/elementpipesgc.h | ||||
|     pipes/messagepipeslegacy.h | ||||
|     pipes/messagepipes2.h | ||||
|     pipes/messagepipes.h | ||||
|     pipes/messagepipeslegacycommon.h | ||||
|     pipes/messagepipeslegacygcworker.h | ||||
|     pipes/messagepipes2gcworker.h | ||||
|     pipes/messagepipesgcworker.h | ||||
|     pipes/messagequeuestore.h | ||||
|     pipes/pipeendpoint.h | ||||
|     pipes/objectpipe.h | ||||
|  | ||||
| @ -28,7 +28,7 @@ | ||||
| #include "settings/mainsettings.h" | ||||
| #include "util/message.h" | ||||
| #include "pipes/messagepipeslegacy.h" | ||||
| #include "pipes/messagepipes2.h" | ||||
| #include "pipes/messagepipes.h" | ||||
| #include "pipes/datapipes.h" | ||||
| #include "channel/channelapi.h" | ||||
| 
 | ||||
| @ -732,7 +732,7 @@ public: | ||||
|     void clearFeatures(FeatureSet *featureSet); | ||||
|     // pipes
 | ||||
|     MessagePipesLegacy& getMessagePipes() { return m_messagePipes; } | ||||
|     MessagePipes2& getMessagePipes2() { return m_messagePipes2; } | ||||
|     MessagePipes& getMessagePipes2() { return m_messagePipes2; } | ||||
|     DataPipes& getDataPipes() { return m_dataPipes; } | ||||
| 
 | ||||
|     friend class MainServer; | ||||
| @ -753,7 +753,7 @@ private: | ||||
|     QMap<Feature*, FeatureSet*> m_featuresMap;   //!< Feature to feature set map
 | ||||
|     PluginManager* m_pluginManager; | ||||
|     MessagePipesLegacy m_messagePipes; | ||||
|     MessagePipes2 m_messagePipes2; | ||||
|     MessagePipes m_messagePipes2; | ||||
|     DataPipes m_dataPipes; | ||||
| 
 | ||||
|     void debugMaps(); | ||||
|  | ||||
| @ -15,18 +15,18 @@ | ||||
| // along with this program. If not, see <http://www.gnu.org/licenses/>.          //
 | ||||
| ///////////////////////////////////////////////////////////////////////////////////
 | ||||
| 
 | ||||
| #include "messagepipes2.h" | ||||
| #include "messagepipes2gcworker.h" | ||||
| #include "messagepipes.h" | ||||
| #include "messagepipesgcworker.h" | ||||
| 
 | ||||
| MessagePipes2::MessagePipes2() : | ||||
| MessagePipes::MessagePipes() : | ||||
|     m_registrations(&m_messageQueueStore) | ||||
| { | ||||
|   	m_gcWorker = new MessagePipes2GCWorker(m_registrations); | ||||
|   	m_gcWorker = new MessagePipesGCWorker(m_registrations); | ||||
| 	m_gcWorker->moveToThread(&m_gcThread); | ||||
| 	startGC(); | ||||
| } | ||||
| 
 | ||||
| MessagePipes2::~MessagePipes2() | ||||
| MessagePipes::~MessagePipes() | ||||
| { | ||||
| 	if (m_gcWorker->isRunning()) { | ||||
| 		stopGC(); | ||||
| @ -35,32 +35,32 @@ MessagePipes2::~MessagePipes2() | ||||
|     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); | ||||
| } | ||||
| 
 | ||||
| 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); | ||||
| } | ||||
| 
 | ||||
| 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); | ||||
| } | ||||
| 
 | ||||
| void MessagePipes2::startGC() | ||||
| void MessagePipes::startGC() | ||||
| { | ||||
| 	qDebug("MessagePipes2::startGC"); | ||||
| 	qDebug("MessagePipes::startGC"); | ||||
| 
 | ||||
|     m_gcWorker->startWork(); | ||||
|     m_gcThread.start(); | ||||
| } | ||||
| 
 | ||||
| void MessagePipes2::stopGC() | ||||
| void MessagePipes::stopGC() | ||||
| { | ||||
|     qDebug("MessagePipes2::stopGC"); | ||||
|     qDebug("MessagePipes::stopGC"); | ||||
| 	m_gcWorker->stopWork(); | ||||
| 	m_gcThread.quit(); | ||||
| 	m_gcThread.wait(); | ||||
| @ -15,8 +15,8 @@ | ||||
| // along with this program. If not, see <http://www.gnu.org/licenses/>.          //
 | ||||
| ///////////////////////////////////////////////////////////////////////////////////
 | ||||
| 
 | ||||
| #ifndef SDRBASE_PIPES_MESSAGEPIPES2_H_ | ||||
| #define SDRBASE_PIPES_MESSAGEPIPES2_H_ | ||||
| #ifndef SDRBASE_PIPES_MESSAGEPIPES_H_ | ||||
| #define SDRBASE_PIPES_MESSAGEPIPES_H_ | ||||
| 
 | ||||
| #include <QObject> | ||||
| #include <QThread> | ||||
| @ -25,16 +25,16 @@ | ||||
| #include "objectpipesregistrations.h" | ||||
| #include "messagequeuestore.h" | ||||
| 
 | ||||
| class MessagePipes2GCWorker; | ||||
| class MessagePipesGCWorker; | ||||
| 
 | ||||
| class SDRBASE_API MessagePipes2 : public QObject | ||||
| class SDRBASE_API MessagePipes : public QObject | ||||
| { | ||||
|     Q_OBJECT | ||||
| public: | ||||
|     MessagePipes2(); | ||||
|     MessagePipes2(const MessagePipes2&) = delete; | ||||
|     MessagePipes2& operator=(const MessagePipes2&) = delete; | ||||
|     ~MessagePipes2(); | ||||
|     MessagePipes(); | ||||
|     MessagePipes(const MessagePipes&) = delete; | ||||
|     MessagePipes& operator=(const MessagePipes&) = delete; | ||||
|     ~MessagePipes(); | ||||
| 
 | ||||
|     ObjectPipe *registerProducerToConsumer(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; | ||||
|     ObjectPipesRegistrations m_registrations; | ||||
|     QThread m_gcThread; //!< Garbage collector thread
 | ||||
|     MessagePipes2GCWorker *m_gcWorker; //!< Garbage collector
 | ||||
|     MessagePipesGCWorker *m_gcWorker; //!< Garbage collector
 | ||||
| 
 | ||||
| 	void startGC(); //!< Start garbage collector
 | ||||
| 	void stopGC();  //!< Stop garbage collector
 | ||||
| }; | ||||
| 
 | ||||
| 
 | ||||
| #endif // SDRBASE_PIPES_MESSAGEPIPES2_H_
 | ||||
| #endif // SDRBASE_PIPES_MESSAGEPIPES_H_
 | ||||
| @ -15,31 +15,31 @@ | ||||
| // 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_objectPipesRegistrations(objectPipesRegistrations) | ||||
| {} | ||||
| 
 | ||||
| MessagePipes2GCWorker::~MessagePipes2GCWorker() | ||||
| MessagePipesGCWorker::~MessagePipesGCWorker() | ||||
| {} | ||||
| 
 | ||||
| void MessagePipes2GCWorker::startWork() | ||||
| void MessagePipesGCWorker::startWork() | ||||
| { | ||||
|     connect(&m_gcTimer, SIGNAL(timeout()), this, SLOT(processGC())); | ||||
|     m_gcTimer.start(10000); // collect garbage every 10s
 | ||||
|     m_running = true; | ||||
| } | ||||
| 
 | ||||
| void MessagePipes2GCWorker::stopWork() | ||||
| void MessagePipesGCWorker::stopWork() | ||||
| { | ||||
|     m_running = false; | ||||
|     m_gcTimer.stop(); | ||||
|     disconnect(&m_gcTimer, SIGNAL(timeout()), this, SLOT(processGC())); | ||||
| } | ||||
| 
 | ||||
| void MessagePipes2GCWorker::processGC() | ||||
| void MessagePipesGCWorker::processGC() | ||||
| { | ||||
|     m_objectPipesRegistrations.processGC(); | ||||
| } | ||||
| @ -15,8 +15,8 @@ | ||||
| // along with this program. If not, see <http://www.gnu.org/licenses/>.          //
 | ||||
| ///////////////////////////////////////////////////////////////////////////////////
 | ||||
| 
 | ||||
| #ifndef SDRBASE_PIPES_MESSAGEPIPES2GCWORKER_H_ | ||||
| #define SDRBASE_PIPES_MESSAGEPIPES2GCWORKER_H_ | ||||
| #ifndef SDRBASE_PIPES_MESSAGEPIPESGCWORKER_H_ | ||||
| #define SDRBASE_PIPES_MESSAGEPIPESGCWORKER_H_ | ||||
| 
 | ||||
| #include <QObject> | ||||
| #include <QTimer> | ||||
| @ -24,12 +24,12 @@ | ||||
| #include "export.h" | ||||
| #include "objectpipesregistrations.h" | ||||
| 
 | ||||
| class SDRBASE_API MessagePipes2GCWorker : public QObject | ||||
| class SDRBASE_API MessagePipesGCWorker : public QObject | ||||
| { | ||||
|     Q_OBJECT | ||||
| public: | ||||
|     MessagePipes2GCWorker(ObjectPipesRegistrations& objectPipesRegistrations); | ||||
|     ~MessagePipes2GCWorker(); | ||||
|     MessagePipesGCWorker(ObjectPipesRegistrations& objectPipesRegistrations); | ||||
|     ~MessagePipesGCWorker(); | ||||
| 
 | ||||
|     void startWork(); | ||||
|     void stopWork(); | ||||
| @ -44,4 +44,4 @@ private slots: | ||||
|     void processGC(); //!< Collect garbage
 | ||||
| }; | ||||
| 
 | ||||
| #endif // SDRBASE_PIPES_MESSAGEPIPES2GCWORKER_H_
 | ||||
| #endif // SDRBASE_PIPES_MESSAGEPIPESGCWORKER_H_
 | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user