mirror of
https://github.com/FairRootGroup/FairMQ.git
synced 2025-10-13 16:46:47 +00:00
Remove useless code
This commit is contained in:
parent
383992a534
commit
fdae39c956
|
@ -13,16 +13,8 @@
|
|||
|
||||
namespace bpo = boost::program_options;
|
||||
|
||||
class Sampler : public FairMQDevice
|
||||
struct Sampler : fair::mq::Device
|
||||
{
|
||||
public:
|
||||
Sampler() = default;
|
||||
|
||||
protected:
|
||||
std::string fText;
|
||||
uint64_t fMaxIterations = 0;
|
||||
uint64_t fNumIterations = 0;
|
||||
|
||||
void InitTask() override
|
||||
{
|
||||
// Get the fText and fMaxIterations values from the command line options (via fConfig)
|
||||
|
@ -57,6 +49,11 @@ class Sampler : public FairMQDevice
|
|||
|
||||
return true;
|
||||
}
|
||||
|
||||
private:
|
||||
std::string fText;
|
||||
uint64_t fMaxIterations = 0;
|
||||
uint64_t fNumIterations = 0;
|
||||
};
|
||||
|
||||
void addCustomOptions(bpo::options_description& options)
|
||||
|
|
|
@ -13,16 +13,14 @@
|
|||
|
||||
namespace bpo = boost::program_options;
|
||||
|
||||
class Sink : public FairMQDevice
|
||||
struct Sink : fair::mq::Device
|
||||
{
|
||||
public:
|
||||
Sink()
|
||||
{
|
||||
// register a handler for data arriving on "data" channel
|
||||
OnData("data", &Sink::HandleData);
|
||||
}
|
||||
|
||||
protected:
|
||||
void InitTask() override
|
||||
{
|
||||
// Get the fMaxIterations value from the command line options (via fConfig)
|
||||
|
|
|
@ -13,15 +13,13 @@
|
|||
|
||||
namespace bpo = boost::program_options;
|
||||
|
||||
class Processor : public FairMQDevice
|
||||
struct Processor : fair::mq::Device
|
||||
{
|
||||
public:
|
||||
Processor()
|
||||
{
|
||||
OnData("data1", &Processor::HandleData);
|
||||
}
|
||||
|
||||
protected:
|
||||
bool HandleData(FairMQMessagePtr& msg, int)
|
||||
{
|
||||
LOG(info) << "Received data, processing...";
|
||||
|
|
|
@ -15,16 +15,8 @@
|
|||
|
||||
namespace bpo = boost::program_options;
|
||||
|
||||
class Sampler : public FairMQDevice
|
||||
struct Sampler : fair::mq::Device
|
||||
{
|
||||
public:
|
||||
Sampler() = default;
|
||||
|
||||
protected:
|
||||
std::string fText;
|
||||
uint64_t fMaxIterations = 0;
|
||||
uint64_t fNumIterations = 0;
|
||||
|
||||
void InitTask() override
|
||||
{
|
||||
// Get the fText and fMaxIterations values from the command line options (via fConfig)
|
||||
|
@ -53,6 +45,11 @@ class Sampler : public FairMQDevice
|
|||
|
||||
return true;
|
||||
}
|
||||
|
||||
private:
|
||||
std::string fText;
|
||||
uint64_t fMaxIterations = 0;
|
||||
uint64_t fNumIterations = 0;
|
||||
};
|
||||
|
||||
void addCustomOptions(bpo::options_description& options)
|
||||
|
|
|
@ -13,17 +13,15 @@
|
|||
|
||||
namespace bpo = boost::program_options;
|
||||
|
||||
class Sink : public FairMQDevice
|
||||
struct Sink : fair::mq::Device
|
||||
{
|
||||
public:
|
||||
Sink()
|
||||
{
|
||||
// register a handler for data arriving on "data2" channel
|
||||
OnData("data2", &Sink::HandleData);
|
||||
}
|
||||
|
||||
protected:
|
||||
virtual void InitTask() override
|
||||
void InitTask() override
|
||||
{
|
||||
// Get the fMaxIterations value from the command line options (via fConfig)
|
||||
fMaxIterations = fConfig->GetProperty<uint64_t>("max-iterations");
|
||||
|
|
|
@ -15,12 +15,8 @@
|
|||
|
||||
namespace bpo = boost::program_options;
|
||||
|
||||
class Sampler : public FairMQDevice
|
||||
struct Sampler : fair::mq::Device
|
||||
{
|
||||
public:
|
||||
Sampler() = default;
|
||||
|
||||
protected:
|
||||
void InitTask() override
|
||||
{
|
||||
fNumDataChannels = fChannels.at("data").size();
|
||||
|
@ -50,7 +46,7 @@ class Sampler : public FairMQDevice
|
|||
return true;
|
||||
}
|
||||
|
||||
|
||||
private:
|
||||
int fNumDataChannels = 0;
|
||||
uint64_t fCounter = 0;
|
||||
uint64_t fMaxIterations = 0;
|
||||
|
|
|
@ -13,9 +13,8 @@
|
|||
|
||||
namespace bpo = boost::program_options;
|
||||
|
||||
class Sink : public FairMQDevice
|
||||
struct Sink : fair::mq::Device
|
||||
{
|
||||
public:
|
||||
Sink()
|
||||
{
|
||||
OnData("data", &Sink::HandleData);
|
||||
|
|
|
@ -13,15 +13,13 @@
|
|||
|
||||
namespace bpo = boost::program_options;
|
||||
|
||||
class Processor : public FairMQDevice
|
||||
struct Processor : fair::mq::Device
|
||||
{
|
||||
public:
|
||||
Processor()
|
||||
{
|
||||
OnData("data1", &Processor::HandleData);
|
||||
}
|
||||
|
||||
protected:
|
||||
bool HandleData(FairMQMessagePtr& msg, int)
|
||||
{
|
||||
LOG(info) << "Received data, processing...";
|
||||
|
|
|
@ -13,17 +13,13 @@
|
|||
|
||||
namespace bpo = boost::program_options;
|
||||
|
||||
class Sampler : public FairMQDevice
|
||||
struct Sampler : fair::mq::Device
|
||||
{
|
||||
public:
|
||||
Sampler() = default;
|
||||
|
||||
void InitTask() override
|
||||
{
|
||||
fIterations = fConfig->GetValue<uint64_t>("iterations");
|
||||
}
|
||||
|
||||
protected:
|
||||
bool ConditionalRun() override
|
||||
{
|
||||
// NewSimpleMessage creates a copy of the data and takes care of its destruction (after the transfer takes place).
|
||||
|
|
|
@ -13,9 +13,8 @@
|
|||
|
||||
namespace bpo = boost::program_options;
|
||||
|
||||
class Sink : public FairMQDevice
|
||||
struct Sink : fair::mq::Device
|
||||
{
|
||||
public:
|
||||
Sink()
|
||||
{
|
||||
OnData("data2", &Sink::HandleData);
|
||||
|
@ -26,7 +25,6 @@ class Sink : public FairMQDevice
|
|||
fIterations = fConfig->GetValue<uint64_t>("iterations");
|
||||
}
|
||||
|
||||
protected:
|
||||
bool HandleData(FairMQMessagePtr& msg, int)
|
||||
{
|
||||
LOG(info) << "Received: \"" << std::string(static_cast<char*>(msg->GetData()), msg->GetSize()) << "\"";
|
||||
|
|
|
@ -17,12 +17,8 @@
|
|||
|
||||
namespace bpo = boost::program_options;
|
||||
|
||||
class Sampler : public FairMQDevice
|
||||
struct Sampler : fair::mq::Device
|
||||
{
|
||||
public:
|
||||
Sampler() = default;
|
||||
|
||||
protected:
|
||||
void InitTask() override
|
||||
{
|
||||
fMaxIterations = fConfig->GetProperty<uint64_t>("max-iterations");
|
||||
|
|
|
@ -13,15 +13,13 @@
|
|||
|
||||
namespace bpo = boost::program_options;
|
||||
|
||||
class Sink : public FairMQDevice
|
||||
struct Sink : fair::mq::Device
|
||||
{
|
||||
public:
|
||||
Sink()
|
||||
{
|
||||
OnData("data", &Sink::HandleData);
|
||||
}
|
||||
|
||||
protected:
|
||||
bool HandleData(FairMQParts& parts, int)
|
||||
{
|
||||
LOG(info) << "Received message with " << parts.Size() << " parts";
|
||||
|
|
|
@ -14,12 +14,8 @@
|
|||
|
||||
namespace bpo = boost::program_options;
|
||||
|
||||
class Broadcaster : public FairMQDevice
|
||||
struct Broadcaster : fair::mq::Device
|
||||
{
|
||||
public:
|
||||
Broadcaster() = default;
|
||||
|
||||
protected:
|
||||
bool ConditionalRun() override
|
||||
{
|
||||
std::this_thread::sleep_for(std::chrono::seconds(1));
|
||||
|
|
|
@ -16,11 +16,8 @@
|
|||
|
||||
namespace bpo = boost::program_options;
|
||||
|
||||
class Sampler : public FairMQDevice
|
||||
struct Sampler : fair::mq::Device
|
||||
{
|
||||
public:
|
||||
Sampler() = default;
|
||||
|
||||
void InitTask() override
|
||||
{
|
||||
fText = fConfig->GetProperty<std::string>("text");
|
||||
|
@ -59,7 +56,7 @@ class Sampler : public FairMQDevice
|
|||
}
|
||||
}
|
||||
|
||||
protected:
|
||||
private:
|
||||
std::string fText;
|
||||
uint64_t fMaxIterations = 0;
|
||||
uint64_t fNumIterations = 0;
|
||||
|
|
|
@ -14,9 +14,8 @@
|
|||
|
||||
namespace bpo = boost::program_options;
|
||||
|
||||
class Sink : public FairMQDevice
|
||||
struct Sink : fair::mq::Device
|
||||
{
|
||||
public:
|
||||
Sink()
|
||||
{
|
||||
OnData("broadcast", &Sink::HandleBroadcast);
|
||||
|
|
|
@ -13,12 +13,8 @@
|
|||
|
||||
namespace bpo = boost::program_options;
|
||||
|
||||
class Sampler1 : public FairMQDevice
|
||||
struct Sampler1 : fair::mq::Device
|
||||
{
|
||||
public:
|
||||
Sampler1() = default;
|
||||
|
||||
protected:
|
||||
void InitTask() override
|
||||
{
|
||||
fMaxIterations = fConfig->GetProperty<uint64_t>("max-iterations");
|
||||
|
@ -68,6 +64,7 @@ class Sampler1 : public FairMQDevice
|
|||
LOG(info) << "Acknowledged " << numAcks << " messages";
|
||||
}
|
||||
|
||||
private:
|
||||
std::thread fAckListener;
|
||||
uint64_t fMaxIterations = 0;
|
||||
uint64_t fNumIterations = 0;
|
||||
|
|
|
@ -13,12 +13,8 @@
|
|||
|
||||
namespace bpo = boost::program_options;
|
||||
|
||||
class Sampler2 : public FairMQDevice
|
||||
struct Sampler2 : fair::mq::Device
|
||||
{
|
||||
public:
|
||||
Sampler2() = default;
|
||||
|
||||
protected:
|
||||
void InitTask() override
|
||||
{
|
||||
fMaxIterations = fConfig->GetProperty<uint64_t>("max-iterations");
|
||||
|
@ -42,7 +38,6 @@ class Sampler2 : public FairMQDevice
|
|||
return true;
|
||||
}
|
||||
|
||||
|
||||
private:
|
||||
uint64_t fMaxIterations = 0;
|
||||
uint64_t fNumIterations = 0;
|
||||
|
|
|
@ -11,9 +11,8 @@
|
|||
|
||||
namespace bpo = boost::program_options;
|
||||
|
||||
class Sink : public FairMQDevice
|
||||
struct Sink : fair::mq::Device
|
||||
{
|
||||
public:
|
||||
Sink()
|
||||
{
|
||||
// register a handler for data arriving on "data" channel
|
||||
|
@ -21,7 +20,6 @@ class Sink : public FairMQDevice
|
|||
OnData("data2", &Sink::HandleData2);
|
||||
}
|
||||
|
||||
protected:
|
||||
void InitTask() override
|
||||
{
|
||||
fMaxIterations = fConfig->GetProperty<uint64_t>("max-iterations");
|
||||
|
|
|
@ -29,16 +29,13 @@ struct TFBuffer
|
|||
chrono::steady_clock::time_point end;
|
||||
};
|
||||
|
||||
class Receiver : public FairMQDevice
|
||||
struct Receiver : fair::mq::Device
|
||||
{
|
||||
public:
|
||||
Receiver()
|
||||
{
|
||||
OnData("data", &Receiver::HandleData);
|
||||
}
|
||||
|
||||
~Receiver() = default;
|
||||
|
||||
void InitTask() override
|
||||
{
|
||||
fNumSenders = GetConfig()->GetValue<int>("num-senders");
|
||||
|
@ -46,7 +43,6 @@ class Receiver : public FairMQDevice
|
|||
fMaxTimeframes = GetConfig()->GetValue<int>("max-timeframes");
|
||||
}
|
||||
|
||||
protected:
|
||||
bool HandleData(FairMQParts& parts, int /* index */)
|
||||
{
|
||||
Header& h = *(static_cast<Header*>(parts.At(0)->GetData()));
|
||||
|
@ -93,6 +89,7 @@ class Receiver : public FairMQDevice
|
|||
}
|
||||
}
|
||||
|
||||
private:
|
||||
unordered_map<uint16_t, TFBuffer> fBuffer;
|
||||
unordered_set<uint16_t> fDiscardedSet;
|
||||
|
||||
|
|
|
@ -17,11 +17,8 @@ using namespace std;
|
|||
using namespace example_n_m;
|
||||
namespace bpo = boost::program_options;
|
||||
|
||||
class Sender : public FairMQDevice
|
||||
struct Sender : fair::mq::Device
|
||||
{
|
||||
public:
|
||||
Sender() = default;
|
||||
|
||||
void InitTask() override
|
||||
{
|
||||
fIndex = GetConfig()->GetProperty<int>("sender-index");
|
||||
|
|
|
@ -15,11 +15,8 @@
|
|||
using namespace std;
|
||||
namespace bpo = boost::program_options;
|
||||
|
||||
class Synchronizer : public FairMQDevice
|
||||
struct Synchronizer : fair::mq::Device
|
||||
{
|
||||
public:
|
||||
Synchronizer() = default;
|
||||
|
||||
bool ConditionalRun() override
|
||||
{
|
||||
FairMQMessagePtr msg(NewSimpleMessage(fTimeframeId));
|
||||
|
@ -35,6 +32,7 @@ class Synchronizer : public FairMQDevice
|
|||
return true;
|
||||
}
|
||||
|
||||
private:
|
||||
uint16_t fTimeframeId = 0;
|
||||
};
|
||||
|
||||
|
|
|
@ -9,9 +9,8 @@
|
|||
#include <fairmq/Device.h>
|
||||
#include <fairmq/runDevice.h>
|
||||
|
||||
class QCDispatcher : public FairMQDevice
|
||||
struct QCDispatcher : fair::mq::Device
|
||||
{
|
||||
public:
|
||||
QCDispatcher()
|
||||
: fDoQC(false)
|
||||
{
|
||||
|
@ -31,7 +30,6 @@ class QCDispatcher : public FairMQDevice
|
|||
});
|
||||
}
|
||||
|
||||
protected:
|
||||
bool HandleData(FairMQMessagePtr& msg, int)
|
||||
{
|
||||
if (fDoQC.load() == true) {
|
||||
|
|
|
@ -12,13 +12,9 @@
|
|||
#include <thread> // this_thread::sleep_for
|
||||
#include <chrono>
|
||||
|
||||
class Sampler : public FairMQDevice
|
||||
struct Sampler : fair::mq::Device
|
||||
{
|
||||
public:
|
||||
Sampler() = default;
|
||||
|
||||
protected:
|
||||
virtual bool ConditionalRun()
|
||||
bool ConditionalRun() override
|
||||
{
|
||||
FairMQMessagePtr msg(NewMessage(1000));
|
||||
|
||||
|
|
|
@ -11,12 +11,9 @@
|
|||
|
||||
#include <string>
|
||||
|
||||
class Sink : public FairMQDevice
|
||||
struct Sink : fair::mq::Device
|
||||
{
|
||||
public:
|
||||
Sink() { OnData("data2", &Sink::HandleData); }
|
||||
|
||||
protected:
|
||||
bool HandleData(FairMQMessagePtr& /*msg*/, int /*index*/) { return true; }
|
||||
};
|
||||
|
||||
|
|
|
@ -11,15 +11,13 @@
|
|||
|
||||
namespace bpo = boost::program_options;
|
||||
|
||||
class Processor : public FairMQDevice
|
||||
struct Processor : fair::mq::Device
|
||||
{
|
||||
public:
|
||||
Processor()
|
||||
{
|
||||
OnData("bp", &Processor::HandleData);
|
||||
}
|
||||
|
||||
protected:
|
||||
bool HandleData(FairMQMessagePtr& msg, int /*index*/)
|
||||
{
|
||||
FairMQMessagePtr msg2(NewMessageFor("ps", 0, msg->GetSize()));
|
||||
|
|
|
@ -15,11 +15,8 @@
|
|||
|
||||
namespace bpo = boost::program_options;
|
||||
|
||||
class Readout : public FairMQDevice
|
||||
struct Readout : fair::mq::Device
|
||||
{
|
||||
public:
|
||||
Readout() = default;
|
||||
|
||||
void InitTask() override
|
||||
{
|
||||
fMsgSize = fConfig->GetProperty<int>("msg-size");
|
||||
|
|
|
@ -11,11 +11,8 @@
|
|||
|
||||
namespace bpo = boost::program_options;
|
||||
|
||||
class Receiver : public FairMQDevice
|
||||
struct Receiver : fair::mq::Device
|
||||
{
|
||||
public:
|
||||
Receiver() = default;
|
||||
|
||||
void InitTask() override
|
||||
{
|
||||
// Get the fMaxIterations value from the command line options (via fConfig)
|
||||
|
|
|
@ -13,11 +13,8 @@
|
|||
|
||||
namespace bpo = boost::program_options;
|
||||
|
||||
class Sender : public FairMQDevice
|
||||
struct Sender : fair::mq::Device
|
||||
{
|
||||
public:
|
||||
Sender() = default;
|
||||
|
||||
void Init() override
|
||||
{
|
||||
fInputChannelName = fConfig->GetProperty<std::string>("input-name");
|
||||
|
|
|
@ -15,11 +15,8 @@
|
|||
|
||||
namespace bpo = boost::program_options;
|
||||
|
||||
class Sampler : public FairMQDevice
|
||||
struct Sampler : fair::mq::Device
|
||||
{
|
||||
public:
|
||||
Sampler() = default;
|
||||
|
||||
void InitTask() override
|
||||
{
|
||||
fMsgSize = fConfig->GetProperty<int>("msg-size");
|
||||
|
|
|
@ -11,11 +11,8 @@
|
|||
|
||||
namespace bpo = boost::program_options;
|
||||
|
||||
class Sink : public FairMQDevice
|
||||
struct Sink : fair::mq::Device
|
||||
{
|
||||
public:
|
||||
Sink() = default;
|
||||
|
||||
void InitTask() override
|
||||
{
|
||||
// Get the fMaxIterations value from the command line options (via fConfig)
|
||||
|
|
|
@ -15,11 +15,8 @@
|
|||
|
||||
namespace bpo = boost::program_options;
|
||||
|
||||
class Client : public FairMQDevice
|
||||
struct Client : fair::mq::Device
|
||||
{
|
||||
public:
|
||||
Client() = default;
|
||||
|
||||
void InitTask() override
|
||||
{
|
||||
fText = fConfig->GetProperty<std::string>("text");
|
||||
|
|
|
@ -13,9 +13,8 @@
|
|||
|
||||
namespace bpo = boost::program_options;
|
||||
|
||||
class Server : public FairMQDevice
|
||||
struct Server : fair::mq::Device
|
||||
{
|
||||
public:
|
||||
Server()
|
||||
{
|
||||
OnData("data", &Server::HandleData);
|
||||
|
|
|
@ -29,8 +29,6 @@ namespace fair::mq
|
|||
class BenchmarkSampler : public Device
|
||||
{
|
||||
public:
|
||||
BenchmarkSampler() = default;
|
||||
|
||||
void InitTask() override
|
||||
{
|
||||
fMultipart = fConfig->GetProperty<bool>("multipart");
|
||||
|
|
|
@ -21,16 +21,10 @@ namespace fair::mq
|
|||
|
||||
class Merger : public Device
|
||||
{
|
||||
public:
|
||||
Merger()
|
||||
: fInChannelName("data-in")
|
||||
, fOutChannelName("data-out")
|
||||
{}
|
||||
|
||||
protected:
|
||||
bool fMultipart = true;
|
||||
std::string fInChannelName;
|
||||
std::string fOutChannelName;
|
||||
std::string fInChannelName{"data-in"};
|
||||
std::string fOutChannelName{"data-out"};
|
||||
|
||||
void InitTask() override
|
||||
{
|
||||
|
|
|
@ -19,9 +19,6 @@ namespace fair::mq
|
|||
|
||||
class Multiplier : public Device
|
||||
{
|
||||
public:
|
||||
Multiplier() = default;
|
||||
|
||||
protected:
|
||||
bool fMultipart = true;
|
||||
int fNumOutputs = 0;
|
||||
|
|
|
@ -18,9 +18,6 @@ namespace fair::mq
|
|||
|
||||
class Proxy : public Device
|
||||
{
|
||||
public:
|
||||
Proxy() = default;
|
||||
|
||||
protected:
|
||||
bool fMultipart = true;
|
||||
std::string fInChannelName;
|
||||
|
|
|
@ -24,9 +24,6 @@ namespace fair::mq
|
|||
|
||||
class Sink : public Device
|
||||
{
|
||||
public:
|
||||
Sink() = default;
|
||||
|
||||
protected:
|
||||
bool fMultipart = false;
|
||||
uint64_t fMaxIterations = 0;
|
||||
|
|
|
@ -18,9 +18,6 @@ namespace fair::mq
|
|||
|
||||
class Splitter : public Device
|
||||
{
|
||||
public:
|
||||
Splitter() = default;
|
||||
|
||||
protected:
|
||||
bool fMultipart = true;
|
||||
int fNumOutputs = 0;
|
||||
|
|
Loading…
Reference in New Issue
Block a user