Refactor the transport interface

- give transport Initialize() method with access to device config.
 - avoid using global context in the transport.
 - simplify shutdown procedure (no need for extra thread).
This commit is contained in:
Alexey Rybalchenko
2017-04-04 17:14:37 +02:00
committed by Mohammad Al-Turany
parent d7eb692951
commit 5aaf27bf02
25 changed files with 278 additions and 358 deletions

View File

@@ -14,13 +14,12 @@
#include "FairMQSocket.h"
#include "FairMQMessage.h"
#include "FairMQContextSHM.h"
#include "FairMQShmManager.h"
class FairMQSocketSHM : public FairMQSocket
{
public:
FairMQSocketSHM(const std::string& type, const std::string& name, const int numIoThreads, const std::string& id = "");
FairMQSocketSHM(const std::string& type, const std::string& name, const std::string& id = "", void* context = nullptr);
FairMQSocketSHM(const FairMQSocketSHM&) = delete;
FairMQSocketSHM operator=(const FairMQSocketSHM&) = delete;
@@ -38,7 +37,6 @@ class FairMQSocketSHM : public FairMQSocket
virtual void* GetSocket() const;
virtual int GetSocket(int nothing) const;
virtual void Close();
virtual void Terminate();
virtual void Interrupt();
virtual void Resume();
@@ -68,8 +66,6 @@ class FairMQSocketSHM : public FairMQSocket
std::atomic<unsigned long> fMessagesTx;
std::atomic<unsigned long> fMessagesRx;
static std::unique_ptr<FairMQContextSHM> fContext;
static bool fContextInitialized;
static std::atomic<bool> fInterrupted;
};