Update FairMQStateMachine & introduce FairMQChannels

Organize sockets as a map of vectors of FairMQChannels.

Update FairMQStateMachine by removing SETTINGINPUT, SETTINGOUTPUT,
BIND and CONNECT states and by adding INITIALIZING_TASK, RESETTING_TASK
and RESETTING_DEVICE states. Run states functions in their own thread.
This commit is contained in:
Alexey Rybalchenko
2015-04-29 13:25:42 +02:00
parent a2ebbbe450
commit 7fda980710
54 changed files with 1674 additions and 1573 deletions

52
fairmq/FairMQChannel.h Normal file
View File

@@ -0,0 +1,52 @@
/********************************************************************************
* Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH *
* *
* This software is distributed under the terms of the *
* GNU Lesser General Public Licence version 3 (LGPL) version 3, *
* copied verbatim in the file "LICENSE" *
********************************************************************************/
/**
* FairMQChannel.h
*
* @since 2015-06-02
* @author A. Rybalchenko
*/
#ifndef FAIRMQCHANNEL_H_
#define FAIRMQCHANNEL_H_
#include <string>
#include "FairMQSocket.h"
class FairMQChannel
{
friend class FairMQDevice;
public:
FairMQChannel();
FairMQChannel(const std::string& type, const std::string& method, const std::string& address);
virtual ~FairMQChannel();
bool ValidateChannel();
// Wrappers for the socket methods to simplify the usage of channels
int Send(FairMQMessage* msg, const std::string& flag = "");
int Send(FairMQMessage* msg, const int flags);
int Receive(FairMQMessage* msg, const std::string& flag = "");
int Receive(FairMQMessage* msg, const int flags);
std::string fType;
std::string fMethod;
std::string fAddress;
int fSndBufSize;
int fRcvBufSize;
int fRateLogging;
FairMQSocket* fSocket;
private:
std::string fChannelName;
};
#endif /* FAIRMQCHANNEL_H_ */