mirror of
https://github.com/FairRootGroup/FairMQ.git
synced 2025-10-13 00:31:14 +00:00
Fix copy constructor & assignment operator warning in FairMQChannel
Fix Weffc++ warnings - Add missing copy constructors and assignment operators . - Hide the warning from FairMQStateMachine.h where it is produced by boost and/or is intended. - Some code cleanup.
This commit is contained in:
parent
9a0a8c7516
commit
e4fed2fa1b
|
@ -63,6 +63,47 @@ FairMQChannel::FairMQChannel(const string& type, const string& method, const str
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
FairMQChannel::FairMQChannel(const FairMQChannel& chan)
|
||||||
|
: fType(chan.fType)
|
||||||
|
, fMethod(chan.fMethod)
|
||||||
|
, fAddress(chan.fAddress)
|
||||||
|
, fSndBufSize(chan.fSndBufSize)
|
||||||
|
, fRcvBufSize(chan.fRcvBufSize)
|
||||||
|
, fRateLogging(chan.fRateLogging)
|
||||||
|
, fSocket(nullptr)
|
||||||
|
, fChannelName(chan.fChannelName)
|
||||||
|
, fIsValid(false)
|
||||||
|
, fPoller(nullptr)
|
||||||
|
, fCmdSocket(nullptr)
|
||||||
|
, fTransportFactory(nullptr)
|
||||||
|
, fNoBlockFlag(chan.fNoBlockFlag)
|
||||||
|
, fSndMoreFlag(chan.fSndMoreFlag)
|
||||||
|
, fSndTimeoutInMs(chan.fSndTimeoutInMs)
|
||||||
|
, fRcvTimeoutInMs(chan.fRcvTimeoutInMs)
|
||||||
|
{}
|
||||||
|
|
||||||
|
FairMQChannel& FairMQChannel::operator=(const FairMQChannel& chan)
|
||||||
|
{
|
||||||
|
fType = chan.fType;
|
||||||
|
fMethod = chan.fMethod;
|
||||||
|
fAddress = chan.fAddress;
|
||||||
|
fSndBufSize = chan.fSndBufSize;
|
||||||
|
fRcvBufSize = chan.fRcvBufSize;
|
||||||
|
fRateLogging = chan.fRateLogging;
|
||||||
|
fSocket = nullptr;
|
||||||
|
fChannelName = chan.fChannelName;
|
||||||
|
fIsValid = false;
|
||||||
|
fPoller = nullptr;
|
||||||
|
fCmdSocket = nullptr;
|
||||||
|
fTransportFactory = nullptr;
|
||||||
|
fNoBlockFlag = chan.fNoBlockFlag;
|
||||||
|
fSndMoreFlag = chan.fSndMoreFlag;
|
||||||
|
fSndTimeoutInMs = chan.fSndTimeoutInMs;
|
||||||
|
fRcvTimeoutInMs = chan.fRcvTimeoutInMs;
|
||||||
|
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
string FairMQChannel::GetType() const
|
string FairMQChannel::GetType() const
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
|
|
|
@ -41,6 +41,12 @@ class FairMQChannel
|
||||||
/// @param address Network address to bind/connect to (e.g. "tcp://127.0.0.1:5555" or "ipc://abc")
|
/// @param address Network address to bind/connect to (e.g. "tcp://127.0.0.1:5555" or "ipc://abc")
|
||||||
FairMQChannel(const std::string& type, const std::string& method, const std::string& address);
|
FairMQChannel(const std::string& type, const std::string& method, const std::string& address);
|
||||||
|
|
||||||
|
/// Copy Constructor
|
||||||
|
FairMQChannel(const FairMQChannel&);
|
||||||
|
|
||||||
|
/// Assignment operator
|
||||||
|
FairMQChannel& operator=(const FairMQChannel&);
|
||||||
|
|
||||||
/// Default destructor
|
/// Default destructor
|
||||||
virtual ~FairMQChannel();
|
virtual ~FairMQChannel();
|
||||||
|
|
||||||
|
|
|
@ -45,6 +45,10 @@ class FairMQDevice : public FairMQStateMachine, public FairMQConfigurable
|
||||||
|
|
||||||
/// Default constructor
|
/// Default constructor
|
||||||
FairMQDevice();
|
FairMQDevice();
|
||||||
|
/// Copy constructor (disabled)
|
||||||
|
FairMQDevice(const FairMQDevice&) = delete;
|
||||||
|
/// Assignment operator (disabled)
|
||||||
|
FairMQDevice operator=(const FairMQDevice&) = delete;
|
||||||
/// Default destructor
|
/// Default destructor
|
||||||
virtual ~FairMQDevice();
|
virtual ~FairMQDevice();
|
||||||
|
|
||||||
|
@ -173,10 +177,6 @@ class FairMQDevice : public FairMQStateMachine, public FairMQConfigurable
|
||||||
/// Signal handler
|
/// Signal handler
|
||||||
void SignalHandler(int signal);
|
void SignalHandler(int signal);
|
||||||
bool fCatchingSignals;
|
bool fCatchingSignals;
|
||||||
|
|
||||||
/// Copy Constructor
|
|
||||||
FairMQDevice(const FairMQDevice&);
|
|
||||||
FairMQDevice operator=(const FairMQDevice&);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /* FAIRMQDEVICE_H_ */
|
#endif /* FAIRMQDEVICE_H_ */
|
||||||
|
|
|
@ -57,6 +57,15 @@ struct internal_IDLE { std::string name() const { return "internal_IDLE"
|
||||||
struct END { std::string name() const { return "END"; } };
|
struct END { std::string name() const { return "END"; } };
|
||||||
struct ERROR_FOUND { std::string name() const { return "ERROR_FOUND"; } };
|
struct ERROR_FOUND { std::string name() const { return "ERROR_FOUND"; } };
|
||||||
|
|
||||||
|
// deactivate the warning for non-virtual destructor thrown in the boost library
|
||||||
|
#if defined(__clang__)
|
||||||
|
_Pragma("clang diagnostic push")
|
||||||
|
_Pragma("clang diagnostic ignored \"-Wnon-virtual-dtor\"")
|
||||||
|
#elif defined(__GNUC__) || defined(__GNUG__)
|
||||||
|
_Pragma("GCC diagnostic push")
|
||||||
|
_Pragma("GCC diagnostic ignored \"-Wnon-virtual-dtor\"")
|
||||||
|
#endif
|
||||||
|
|
||||||
// defining the boost MSM state machine
|
// defining the boost MSM state machine
|
||||||
struct FairMQFSM_ : public msm::front::state_machine_def<FairMQFSM_>
|
struct FairMQFSM_ : public msm::front::state_machine_def<FairMQFSM_>
|
||||||
{
|
{
|
||||||
|
@ -459,6 +468,13 @@ struct FairMQFSM_ : public msm::front::state_machine_def<FairMQFSM_>
|
||||||
std::atomic<State> fState;
|
std::atomic<State> fState;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// reactivate the warning for non-virtual destructor
|
||||||
|
#if defined(__clang__)
|
||||||
|
_Pragma("clang diagnostic pop")
|
||||||
|
#elif defined(__GNUC__) || defined(__GNUG__)
|
||||||
|
_Pragma("GCC diagnostic pop")
|
||||||
|
#endif
|
||||||
|
|
||||||
typedef msm::back::state_machine<FairMQFSM_> FairMQFSM;
|
typedef msm::back::state_machine<FairMQFSM_> FairMQFSM;
|
||||||
} // namespace FairMQFSM
|
} // namespace FairMQFSM
|
||||||
|
|
||||||
|
|
|
@ -8,24 +8,19 @@
|
||||||
#ifndef BASEDESERIALIZATIONPOLICY_H
|
#ifndef BASEDESERIALIZATIONPOLICY_H
|
||||||
#define BASEDESERIALIZATIONPOLICY_H
|
#define BASEDESERIALIZATIONPOLICY_H
|
||||||
|
|
||||||
|
|
||||||
#include "FairMQMessage.h"
|
#include "FairMQMessage.h"
|
||||||
|
|
||||||
// c++11 code
|
// c++11 code
|
||||||
#include <type_traits>
|
#include <type_traits>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// CRTP base class
|
// CRTP base class
|
||||||
template <typename TDerived >
|
template <typename TDerived >
|
||||||
class BaseDeserializationPolicy
|
class BaseDeserializationPolicy
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
BaseDeserializationPolicy()
|
BaseDeserializationPolicy() {}
|
||||||
{}
|
|
||||||
|
|
||||||
virtual ~BaseDeserializationPolicy()
|
virtual ~BaseDeserializationPolicy() {}
|
||||||
{}
|
|
||||||
|
|
||||||
template<typename C = TDerived>
|
template<typename C = TDerived>
|
||||||
auto DeserializeMsg(FairMQMessage* msg)-> decltype(static_cast<C*>(this)->DeserializeMsg(msg))
|
auto DeserializeMsg(FairMQMessage* msg)-> decltype(static_cast<C*>(this)->DeserializeMsg(msg))
|
||||||
|
@ -33,7 +28,6 @@ public:
|
||||||
static_assert(std::is_same<C, TDerived>{}, "BaseDeserializationPolicy::DeserializeMsg hack broken");
|
static_assert(std::is_same<C, TDerived>{}, "BaseDeserializationPolicy::DeserializeMsg hack broken");
|
||||||
return static_cast<TDerived*>(this)->DeserializeMsg(msg);
|
return static_cast<TDerived*>(this)->DeserializeMsg(msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -58,4 +52,3 @@ public:
|
||||||
};*/
|
};*/
|
||||||
|
|
||||||
#endif /* BASEDESERIALIZATIONPOLICY_H */
|
#endif /* BASEDESERIALIZATIONPOLICY_H */
|
||||||
|
|
||||||
|
|
|
@ -15,11 +15,9 @@ template <typename TDerived >
|
||||||
class BaseProcessorTaskPolicy
|
class BaseProcessorTaskPolicy
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
BaseProcessorTaskPolicy()
|
BaseProcessorTaskPolicy() {}
|
||||||
{}
|
|
||||||
|
|
||||||
virtual ~BaseProcessorTaskPolicy()
|
virtual ~BaseProcessorTaskPolicy() {}
|
||||||
{}
|
|
||||||
|
|
||||||
template<typename C = TDerived>
|
template<typename C = TDerived>
|
||||||
auto GetOutputData() -> decltype(static_cast<C*>(this)->GetOutputData())
|
auto GetOutputData() -> decltype(static_cast<C*>(this)->GetOutputData())
|
||||||
|
@ -34,8 +32,6 @@ public:
|
||||||
static_assert(std::is_same<C, TDerived>{}, "BaseProcessorTaskPolicy::ExecuteTask hack broken");
|
static_assert(std::is_same<C, TDerived>{}, "BaseProcessorTaskPolicy::ExecuteTask hack broken");
|
||||||
return static_cast<TDerived*>(this)->ExecuteTask(container);
|
return static_cast<TDerived*>(this)->ExecuteTask(container);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -65,5 +61,5 @@ public:
|
||||||
|
|
||||||
};
|
};
|
||||||
*/
|
*/
|
||||||
#endif /* BASEPROCESSORTASKPOLICY_H */
|
|
||||||
|
|
||||||
|
#endif /* BASEPROCESSORTASKPOLICY_H */
|
||||||
|
|
|
@ -16,11 +16,9 @@ template <typename TDerived >
|
||||||
class BaseSerializationPolicy
|
class BaseSerializationPolicy
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
BaseSerializationPolicy()
|
BaseSerializationPolicy() {}
|
||||||
{}
|
|
||||||
|
|
||||||
virtual ~BaseSerializationPolicy()
|
virtual ~BaseSerializationPolicy() {}
|
||||||
{}
|
|
||||||
|
|
||||||
template<typename CONTAINER_TYPE, typename C = TDerived>
|
template<typename CONTAINER_TYPE, typename C = TDerived>
|
||||||
auto SerializeMsg(CONTAINER_TYPE container) -> decltype(static_cast<C*>(this)->SerializeMsg(container) )
|
auto SerializeMsg(CONTAINER_TYPE container) -> decltype(static_cast<C*>(this)->SerializeMsg(container) )
|
||||||
|
@ -35,7 +33,6 @@ public:
|
||||||
static_assert(std::is_same<C, TDerived>{}, "BaseSerializationPolicy::SetMessage hack broken");
|
static_assert(std::is_same<C, TDerived>{}, "BaseSerializationPolicy::SetMessage hack broken");
|
||||||
return static_cast<TDerived*>(this)->SetMessage(msg);
|
return static_cast<TDerived*>(this)->SetMessage(msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -64,5 +61,5 @@ public:
|
||||||
|
|
||||||
};
|
};
|
||||||
*/
|
*/
|
||||||
#endif /* BASESERIALIZATIONPOLICY_H */
|
|
||||||
|
|
||||||
|
#endif /* BASESERIALIZATIONPOLICY_H */
|
||||||
|
|
|
@ -8,18 +8,16 @@
|
||||||
#ifndef BASESINKPOLICY_H
|
#ifndef BASESINKPOLICY_H
|
||||||
#define BASESINKPOLICY_H
|
#define BASESINKPOLICY_H
|
||||||
|
|
||||||
|
|
||||||
#include <type_traits>
|
#include <type_traits>
|
||||||
|
|
||||||
// CRTP base class
|
// CRTP base class
|
||||||
template <typename TDerived >
|
template <typename TDerived >
|
||||||
class BaseSinkPolicy
|
class BaseSinkPolicy
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
BaseSinkPolicy()
|
BaseSinkPolicy() {}
|
||||||
{}
|
|
||||||
|
|
||||||
virtual ~BaseSinkPolicy()
|
virtual ~BaseSinkPolicy() {}
|
||||||
{}
|
|
||||||
|
|
||||||
template<typename CONTAINER_TYPE, typename C = TDerived>
|
template<typename CONTAINER_TYPE, typename C = TDerived>
|
||||||
auto AddToFile(CONTAINER_TYPE container) -> decltype(static_cast<C*>(this)->AddToFile(container) )
|
auto AddToFile(CONTAINER_TYPE container) -> decltype(static_cast<C*>(this)->AddToFile(container) )
|
||||||
|
@ -34,8 +32,6 @@ public:
|
||||||
static_assert(std::is_same<C, TDerived>{}, "BaseSinkPolicy::InitOutputFile hack broken");
|
static_assert(std::is_same<C, TDerived>{}, "BaseSinkPolicy::InitOutputFile hack broken");
|
||||||
return static_cast<TDerived*>(this)->InitOutputFile();
|
return static_cast<TDerived*>(this)->InitOutputFile();
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /* BASESINKPOLICY_H */
|
#endif /* BASESINKPOLICY_H */
|
||||||
|
|
||||||
|
|
|
@ -9,17 +9,16 @@
|
||||||
#define BASESOURCEPOLICY_H
|
#define BASESOURCEPOLICY_H
|
||||||
|
|
||||||
#include <type_traits>
|
#include <type_traits>
|
||||||
|
|
||||||
// c++11 code
|
// c++11 code
|
||||||
// CRTP base class
|
// CRTP base class
|
||||||
template <typename TDerived >
|
template <typename TDerived >
|
||||||
class BaseSourcePolicy
|
class BaseSourcePolicy
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
BaseSourcePolicy()
|
BaseSourcePolicy() {}
|
||||||
{}
|
|
||||||
|
|
||||||
virtual ~BaseSourcePolicy()
|
virtual ~BaseSourcePolicy() {}
|
||||||
{}
|
|
||||||
|
|
||||||
template<typename C = TDerived>
|
template<typename C = TDerived>
|
||||||
auto InitSource()-> decltype(static_cast<C*>(this)->InitSource() )
|
auto InitSource()-> decltype(static_cast<C*>(this)->InitSource() )
|
||||||
|
@ -49,7 +48,6 @@ public:
|
||||||
static_assert(std::is_same<C, TDerived>{}, "BaseSourcePolicy::GetOutData hack broken");
|
static_assert(std::is_same<C, TDerived>{}, "BaseSourcePolicy::GetOutData hack broken");
|
||||||
return static_cast<TDerived*>(this)->GetOutData();
|
return static_cast<TDerived*>(this)->GetOutData();
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -87,5 +85,5 @@ public:
|
||||||
|
|
||||||
};
|
};
|
||||||
*/
|
*/
|
||||||
#endif /* BASESOURCEPOLICY_H */
|
|
||||||
|
|
||||||
|
#endif /* BASESOURCEPOLICY_H */
|
||||||
|
|
|
@ -72,4 +72,3 @@ class GenericMerger : public FairMQDevice, public MergerPolicy, public InputPoli
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /* GENERICMERGER_H */
|
#endif /* GENERICMERGER_H */
|
||||||
|
|
||||||
|
|
|
@ -13,6 +13,7 @@ base_GenericSampler<T,U,K,L>::base_GenericSampler()
|
||||||
, fEventRate(1)
|
, fEventRate(1)
|
||||||
, fEventCounter(0)
|
, fEventCounter(0)
|
||||||
, fContinuous(false)
|
, fContinuous(false)
|
||||||
|
, fTaskList()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -25,6 +25,8 @@ class FairMQMessageNN : public FairMQMessage
|
||||||
FairMQMessageNN();
|
FairMQMessageNN();
|
||||||
FairMQMessageNN(size_t size);
|
FairMQMessageNN(size_t size);
|
||||||
FairMQMessageNN(void* data, size_t size, fairmq_free_fn *ffn = NULL, void* hint = NULL);
|
FairMQMessageNN(void* data, size_t size, fairmq_free_fn *ffn = NULL, void* hint = NULL);
|
||||||
|
FairMQMessageNN(const FairMQMessageNN&) = delete;
|
||||||
|
FairMQMessageNN operator=(const FairMQMessageNN&) = delete;
|
||||||
|
|
||||||
virtual void Rebuild();
|
virtual void Rebuild();
|
||||||
virtual void Rebuild(size_t size);
|
virtual void Rebuild(size_t size);
|
||||||
|
@ -50,10 +52,6 @@ class FairMQMessageNN : public FairMQMessage
|
||||||
bool fReceiving;
|
bool fReceiving;
|
||||||
|
|
||||||
void Clear();
|
void Clear();
|
||||||
|
|
||||||
/// Copy Constructor
|
|
||||||
FairMQMessageNN(const FairMQMessageNN&);
|
|
||||||
FairMQMessageNN operator=(const FairMQMessageNN&);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /* FAIRMQMESSAGENN_H_ */
|
#endif /* FAIRMQMESSAGENN_H_ */
|
||||||
|
|
|
@ -33,6 +33,8 @@ class FairMQPollerNN : public FairMQPoller
|
||||||
public:
|
public:
|
||||||
FairMQPollerNN(const std::vector<FairMQChannel>& channels);
|
FairMQPollerNN(const std::vector<FairMQChannel>& channels);
|
||||||
FairMQPollerNN(std::unordered_map<std::string, std::vector<FairMQChannel>>& channelsMap, std::initializer_list<std::string> channelList);
|
FairMQPollerNN(std::unordered_map<std::string, std::vector<FairMQChannel>>& channelsMap, std::initializer_list<std::string> channelList);
|
||||||
|
FairMQPollerNN(const FairMQPollerNN&) = delete;
|
||||||
|
FairMQPollerNN operator=(const FairMQPollerNN&) = delete;
|
||||||
|
|
||||||
virtual void Poll(const int timeout);
|
virtual void Poll(const int timeout);
|
||||||
virtual bool CheckInput(const int index);
|
virtual bool CheckInput(const int index);
|
||||||
|
@ -49,10 +51,6 @@ class FairMQPollerNN : public FairMQPoller
|
||||||
int fNumItems;
|
int fNumItems;
|
||||||
|
|
||||||
std::unordered_map<std::string, int> fOffsetMap;
|
std::unordered_map<std::string, int> fOffsetMap;
|
||||||
|
|
||||||
/// Copy Constructor
|
|
||||||
FairMQPollerNN(const FairMQPollerNN&);
|
|
||||||
FairMQPollerNN operator=(const FairMQPollerNN&);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /* FAIRMQPOLLERNN_H_ */
|
#endif /* FAIRMQPOLLERNN_H_ */
|
|
@ -27,6 +27,8 @@ class FairMQSocketNN : public FairMQSocket
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
FairMQSocketNN(const std::string& type, const std::string& name, int numIoThreads); // numIoThreads is not used in nanomsg.
|
FairMQSocketNN(const std::string& type, const std::string& name, int numIoThreads); // numIoThreads is not used in nanomsg.
|
||||||
|
FairMQSocketNN(const FairMQSocketNN&) = delete;
|
||||||
|
FairMQSocketNN operator=(const FairMQSocketNN&) = delete;
|
||||||
|
|
||||||
virtual std::string GetId();
|
virtual std::string GetId();
|
||||||
|
|
||||||
|
@ -67,10 +69,6 @@ class FairMQSocketNN : public FairMQSocket
|
||||||
unsigned long fBytesRx;
|
unsigned long fBytesRx;
|
||||||
unsigned long fMessagesTx;
|
unsigned long fMessagesTx;
|
||||||
unsigned long fMessagesRx;
|
unsigned long fMessagesRx;
|
||||||
|
|
||||||
/// Copy Constructor
|
|
||||||
FairMQSocketNN(const FairMQSocketNN&);
|
|
||||||
FairMQSocketNN operator=(const FairMQSocketNN&);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /* FAIRMQSOCKETNN_H_ */
|
#endif /* FAIRMQSOCKETNN_H_ */
|
||||||
|
|
|
@ -22,11 +22,15 @@ FairProgOptions::FairProgOptions() :
|
||||||
fGenericDesc("Generic options description"),
|
fGenericDesc("Generic options description"),
|
||||||
fConfigDesc("Configuration options description"),
|
fConfigDesc("Configuration options description"),
|
||||||
fHiddenDesc("Hidden options description"),
|
fHiddenDesc("Hidden options description"),
|
||||||
fEnvironmentDesc("Environment Variables"),
|
fEnvironmentDesc("Environment variables"),
|
||||||
fCmdLineOptions("Command line options"),
|
fCmdLineOptions("Command line options"),
|
||||||
fConfigFileOptions("Configuration file options"),
|
fConfigFileOptions("Configuration file options"),
|
||||||
fVisibleOptions("Visible options"),
|
fVisibleOptions("Visible options"),
|
||||||
fVerboseLvl("INFO"), fUseConfigFile(false), fConfigFile()
|
fVerboseLvl("INFO"),
|
||||||
|
fUseConfigFile(false),
|
||||||
|
fConfigFile(),
|
||||||
|
fVarMap(),
|
||||||
|
fSeverityMap()
|
||||||
{
|
{
|
||||||
// define generic options
|
// define generic options
|
||||||
fGenericDesc.add_options()
|
fGenericDesc.add_options()
|
||||||
|
|
|
@ -25,8 +25,6 @@
|
||||||
#include <iterator>
|
#include <iterator>
|
||||||
#include <tuple>
|
#include <tuple>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
template<class T>
|
template<class T>
|
||||||
std::ostream& operator<<(std::ostream& os, const std::vector<T>& v)
|
std::ostream& operator<<(std::ostream& os, const std::vector<T>& v)
|
||||||
{
|
{
|
||||||
|
@ -36,7 +34,6 @@ std::ostream& operator<<(std::ostream& os, const std::vector<T>& v)
|
||||||
|
|
||||||
namespace fairmq
|
namespace fairmq
|
||||||
{
|
{
|
||||||
|
|
||||||
namespace po = boost::program_options;
|
namespace po = boost::program_options;
|
||||||
|
|
||||||
//_____________________________________________________________________________________________________________________________
|
//_____________________________________________________________________________________________________________________________
|
||||||
|
@ -108,6 +105,7 @@ namespace fairmq
|
||||||
return std::string("empty value");
|
return std::string("empty value");
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
//_____________________________________________________________________________________________________________________________
|
//_____________________________________________________________________________________________________________________________
|
||||||
|
|
||||||
// policy to convert variable value content into a tuple with value, type, defaulted, empty information
|
// policy to convert variable value content into a tuple with value, type, defaulted, empty information
|
||||||
|
|
|
@ -28,8 +28,6 @@
|
||||||
#include "FairMQParser.h"
|
#include "FairMQParser.h"
|
||||||
#include "FairMQProgOptions.h"
|
#include "FairMQProgOptions.h"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// template function that take any device,
|
// template function that take any device,
|
||||||
// and run a simple MQ state machine configured from a JSON file
|
// and run a simple MQ state machine configured from a JSON file
|
||||||
template<typename TMQDevice>
|
template<typename TMQDevice>
|
||||||
|
@ -114,6 +112,4 @@ inline int runNonInteractiveStateMachine(TMQDevice& device, FairMQProgOptions& c
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#endif /* RUNSIMPLEMQSTATEMACHINE_H */
|
#endif /* RUNSIMPLEMQSTATEMACHINE_H */
|
||||||
|
|
||||||
|
|
|
@ -20,6 +20,8 @@ class FairMQContextZMQ
|
||||||
public:
|
public:
|
||||||
/// Constructor
|
/// Constructor
|
||||||
FairMQContextZMQ(int numIoThreads);
|
FairMQContextZMQ(int numIoThreads);
|
||||||
|
FairMQContextZMQ(const FairMQContextZMQ&) = delete;
|
||||||
|
FairMQContextZMQ operator=(const FairMQContextZMQ&) = delete;
|
||||||
|
|
||||||
virtual ~FairMQContextZMQ();
|
virtual ~FairMQContextZMQ();
|
||||||
void* GetContext();
|
void* GetContext();
|
||||||
|
@ -27,10 +29,6 @@ class FairMQContextZMQ
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void* fContext;
|
void* fContext;
|
||||||
|
|
||||||
/// Copy Constructor
|
|
||||||
FairMQContextZMQ(const FairMQContextZMQ&);
|
|
||||||
FairMQContextZMQ operator=(const FairMQContextZMQ&);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /* FAIRMQCONTEXTZMQ_H_ */
|
#endif /* FAIRMQCONTEXTZMQ_H_ */
|
||||||
|
|
|
@ -33,6 +33,8 @@ class FairMQPollerZMQ : public FairMQPoller
|
||||||
public:
|
public:
|
||||||
FairMQPollerZMQ(const std::vector<FairMQChannel>& channels);
|
FairMQPollerZMQ(const std::vector<FairMQChannel>& channels);
|
||||||
FairMQPollerZMQ(std::unordered_map<std::string, std::vector<FairMQChannel>>& channelsMap, std::initializer_list<std::string> channelList);
|
FairMQPollerZMQ(std::unordered_map<std::string, std::vector<FairMQChannel>>& channelsMap, std::initializer_list<std::string> channelList);
|
||||||
|
FairMQPollerZMQ(const FairMQPollerZMQ&) = delete;
|
||||||
|
FairMQPollerZMQ operator=(const FairMQPollerZMQ&) = delete;
|
||||||
|
|
||||||
virtual void Poll(const int timeout);
|
virtual void Poll(const int timeout);
|
||||||
virtual bool CheckInput(const int index);
|
virtual bool CheckInput(const int index);
|
||||||
|
@ -49,10 +51,6 @@ class FairMQPollerZMQ : public FairMQPoller
|
||||||
int fNumItems;
|
int fNumItems;
|
||||||
|
|
||||||
std::unordered_map<std::string,int> fOffsetMap;
|
std::unordered_map<std::string,int> fOffsetMap;
|
||||||
|
|
||||||
/// Copy Constructor
|
|
||||||
FairMQPollerZMQ(const FairMQPollerZMQ&);
|
|
||||||
FairMQPollerZMQ operator=(const FairMQPollerZMQ&);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /* FAIRMQPOLLERZMQ_H_ */
|
#endif /* FAIRMQPOLLERZMQ_H_ */
|
|
@ -24,6 +24,8 @@ class FairMQSocketZMQ : public FairMQSocket
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
FairMQSocketZMQ(const std::string& type, const std::string& name, int numIoThreads);
|
FairMQSocketZMQ(const std::string& type, const std::string& name, int numIoThreads);
|
||||||
|
FairMQSocketZMQ(const FairMQSocketZMQ&) = delete;
|
||||||
|
FairMQSocketZMQ operator=(const FairMQSocketZMQ&) = delete;
|
||||||
|
|
||||||
virtual std::string GetId();
|
virtual std::string GetId();
|
||||||
|
|
||||||
|
@ -66,10 +68,6 @@ class FairMQSocketZMQ : public FairMQSocket
|
||||||
unsigned long fMessagesRx;
|
unsigned long fMessagesRx;
|
||||||
|
|
||||||
static boost::shared_ptr<FairMQContextZMQ> fContext;
|
static boost::shared_ptr<FairMQContextZMQ> fContext;
|
||||||
|
|
||||||
/// Copy Constructor
|
|
||||||
FairMQSocketZMQ(const FairMQSocketZMQ&);
|
|
||||||
FairMQSocketZMQ operator=(const FairMQSocketZMQ&);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /* FAIRMQSOCKETZMQ_H_ */
|
#endif /* FAIRMQSOCKETZMQ_H_ */
|
||||||
|
|
Loading…
Reference in New Issue
Block a user