Now communication using signal and slots

between threads is working rightly
parent 4f7387ef
......@@ -42,12 +42,12 @@ void SkyliveAuth::startPlugin()
}
void SkyliveAuth::receiveMessage(std::string &msg)
void SkyliveAuth::receiveMessage(std::string msg)
{
std::cout << "SkyliveAuth receive" << msg << std::endl;
}
void SkyliveAuth::sendMessage(std::string &msg)
void SkyliveAuth::sendMessage(std::string msg)
{
emit putMessage(msg);
}
......
......@@ -44,11 +44,11 @@ class SkyliveAuth : public QObject, SkylivexPluginInterface
public:
void startPlugin();
void sendMessage(std::string &msg);
void sendMessage(std::string msg);
public slots:
void receiveMessage(std::string &msg);
void receiveMessage(std::string msg);
signals:
void putMessage(std::string &msg);
void putMessage(std::string msg);
};
......@@ -43,12 +43,12 @@ void SkyliveProtocol::startPlugin()
sendMessage(prova);
}
void SkyliveProtocol::receiveMessage(std::string &msg)
void SkyliveProtocol::receiveMessage(std::string msg)
{
std::cout << "SkyliveProtocol receive" << msg << std::endl;
}
void SkyliveProtocol::sendMessage(std::string &msg)
void SkyliveProtocol::sendMessage(std::string msg)
{
emit putMessage(msg);
}
......
......@@ -44,10 +44,10 @@ class SkyliveProtocol : public QObject, SkylivexPluginInterface
public:
void startPlugin();
void sendMessage(std::string &msg);
void sendMessage(std::string msg);
public slots:
void receiveMessage(std::string &msg);
void receiveMessage(std::string msg);
signals:
void putMessage(std::string &msg);
void putMessage(std::string msg);
};
......@@ -67,5 +67,5 @@ MainWin::~MainWin()
void MainWin::msgFromCore(std::string &msg)
{
//std::cout << "Message from core: " << msg << std::endl;
std::cout << "Message from core: " << msg << std::endl;
}
......@@ -43,12 +43,14 @@
#include "pluginsinterfaces.h"
#include <iostream>
Q_DECLARE_METATYPE(std::string)
// Load and initialize plugins and shared memory communication
void SkyliveX::initialize()
{
std::cout << "antani" << std::endl;
qRegisterMetaType<std::string>("std::string");
loadPlugins();
}
......@@ -125,7 +127,7 @@ void SkyliveX::receiveFromMainWin(std::string &msg)
emit msgForPlugins(msg);
}
void SkyliveX::receiveFromPlugins(std::string &msg)
void SkyliveX::receiveFromPlugins(std::string msg)
{
sendMessage(msg);
}
......@@ -67,12 +67,12 @@ class SkyliveX : public QObject
void initialize();
void process();
void receiveFromMainWin(std::string &msg);
void receiveFromPlugins(std::string &msg);
void receiveFromPlugins(std::string msg);
signals:
void finished();
void msgForMainWin(std::string &msg);
void msgForPlugins(std::string &msg);
void msgForPlugins(std::string msg);
};
#endif
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment