mirror of
https://github.com/FairRootGroup/FairMQ.git
synced 2025-10-13 08:41:16 +00:00
Apply modernize-use-default-member-init
This commit is contained in:
parent
e1b229522c
commit
acf63d3c1b
|
@ -16,15 +16,12 @@ namespace bpo = boost::program_options;
|
||||||
class Sampler : public FairMQDevice
|
class Sampler : public FairMQDevice
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
Sampler()
|
Sampler() {}
|
||||||
: fMaxIterations(0)
|
|
||||||
, fNumIterations(0)
|
|
||||||
{}
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
std::string fText;
|
std::string fText;
|
||||||
uint64_t fMaxIterations;
|
uint64_t fMaxIterations = 0;
|
||||||
uint64_t fNumIterations;
|
uint64_t fNumIterations = 0;
|
||||||
|
|
||||||
void InitTask() override
|
void InitTask() override
|
||||||
{
|
{
|
||||||
|
|
|
@ -17,8 +17,6 @@ class Sink : public FairMQDevice
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
Sink()
|
Sink()
|
||||||
: fMaxIterations(0)
|
|
||||||
, fNumIterations(0)
|
|
||||||
{
|
{
|
||||||
// register a handler for data arriving on "data" channel
|
// register a handler for data arriving on "data" channel
|
||||||
OnData("data", &Sink::HandleData);
|
OnData("data", &Sink::HandleData);
|
||||||
|
@ -46,8 +44,8 @@ class Sink : public FairMQDevice
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
uint64_t fMaxIterations;
|
uint64_t fMaxIterations = 0;
|
||||||
uint64_t fNumIterations;
|
uint64_t fNumIterations = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
void addCustomOptions(bpo::options_description& options)
|
void addCustomOptions(bpo::options_description& options)
|
||||||
|
|
|
@ -18,15 +18,12 @@ namespace bpo = boost::program_options;
|
||||||
class Sampler : public FairMQDevice
|
class Sampler : public FairMQDevice
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
Sampler()
|
Sampler() {}
|
||||||
: fMaxIterations(0)
|
|
||||||
, fNumIterations(0)
|
|
||||||
{}
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
std::string fText;
|
std::string fText;
|
||||||
uint64_t fMaxIterations;
|
uint64_t fMaxIterations = 0;
|
||||||
uint64_t fNumIterations;
|
uint64_t fNumIterations = 0;
|
||||||
|
|
||||||
void InitTask() override
|
void InitTask() override
|
||||||
{
|
{
|
||||||
|
|
|
@ -17,8 +17,6 @@ class Sink : public FairMQDevice
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
Sink()
|
Sink()
|
||||||
: fMaxIterations(0)
|
|
||||||
, fNumIterations(0)
|
|
||||||
{
|
{
|
||||||
// register a handler for data arriving on "data2" channel
|
// register a handler for data arriving on "data2" channel
|
||||||
OnData("data2", &Sink::HandleData);
|
OnData("data2", &Sink::HandleData);
|
||||||
|
@ -45,8 +43,8 @@ class Sink : public FairMQDevice
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
uint64_t fMaxIterations;
|
uint64_t fMaxIterations = 0;
|
||||||
uint64_t fNumIterations;
|
uint64_t fNumIterations = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
void addCustomOptions(bpo::options_description& options)
|
void addCustomOptions(bpo::options_description& options)
|
||||||
|
|
|
@ -18,12 +18,7 @@ namespace bpo = boost::program_options;
|
||||||
class Sampler : public FairMQDevice
|
class Sampler : public FairMQDevice
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
Sampler()
|
Sampler() {}
|
||||||
: fNumDataChannels(0)
|
|
||||||
, fCounter(0)
|
|
||||||
, fMaxIterations(0)
|
|
||||||
, fNumIterations(0)
|
|
||||||
{}
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void InitTask() override
|
void InitTask() override
|
||||||
|
@ -56,10 +51,10 @@ class Sampler : public FairMQDevice
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int fNumDataChannels;
|
int fNumDataChannels = 0;
|
||||||
uint64_t fCounter;
|
uint64_t fCounter = 0;
|
||||||
uint64_t fMaxIterations;
|
uint64_t fMaxIterations = 0;
|
||||||
uint64_t fNumIterations;
|
uint64_t fNumIterations = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
void addCustomOptions(bpo::options_description& options)
|
void addCustomOptions(bpo::options_description& options)
|
||||||
|
|
|
@ -17,8 +17,6 @@ class Sink : public FairMQDevice
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
Sink()
|
Sink()
|
||||||
: fMaxIterations(0)
|
|
||||||
, fNumIterations(0)
|
|
||||||
{
|
{
|
||||||
OnData("data", &Sink::HandleData);
|
OnData("data", &Sink::HandleData);
|
||||||
}
|
}
|
||||||
|
@ -44,8 +42,8 @@ class Sink : public FairMQDevice
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
uint64_t fMaxIterations;
|
uint64_t fMaxIterations = 0;
|
||||||
uint64_t fNumIterations;
|
uint64_t fNumIterations = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
void addCustomOptions(bpo::options_description& options)
|
void addCustomOptions(bpo::options_description& options)
|
||||||
|
|
|
@ -17,8 +17,6 @@ class Sampler : public FairMQDevice
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
Sampler()
|
Sampler()
|
||||||
: fIterations(0)
|
|
||||||
, fCounter(0)
|
|
||||||
{}
|
{}
|
||||||
|
|
||||||
void InitTask() override
|
void InitTask() override
|
||||||
|
@ -53,8 +51,8 @@ class Sampler : public FairMQDevice
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
uint64_t fIterations;
|
uint64_t fIterations = 0;
|
||||||
uint64_t fCounter;
|
uint64_t fCounter = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
void addCustomOptions(bpo::options_description& options)
|
void addCustomOptions(bpo::options_description& options)
|
||||||
|
|
|
@ -17,8 +17,6 @@ class Sink : public FairMQDevice
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
Sink()
|
Sink()
|
||||||
: fIterations(0)
|
|
||||||
, fCounter(0)
|
|
||||||
{
|
{
|
||||||
OnData("data2", &Sink::HandleData);
|
OnData("data2", &Sink::HandleData);
|
||||||
}
|
}
|
||||||
|
@ -45,8 +43,8 @@ class Sink : public FairMQDevice
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
uint64_t fIterations;
|
uint64_t fIterations = 0;
|
||||||
uint64_t fCounter;
|
uint64_t fCounter = 0;
|
||||||
};
|
};
|
||||||
void addCustomOptions(bpo::options_description& options)
|
void addCustomOptions(bpo::options_description& options)
|
||||||
{
|
{
|
||||||
|
|
|
@ -20,10 +20,7 @@ namespace bpo = boost::program_options;
|
||||||
class Sampler : public FairMQDevice
|
class Sampler : public FairMQDevice
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
Sampler()
|
Sampler() {}
|
||||||
: fMaxIterations(5)
|
|
||||||
, fNumIterations(0)
|
|
||||||
{}
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void InitTask() override
|
void InitTask() override
|
||||||
|
@ -81,8 +78,8 @@ class Sampler : public FairMQDevice
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
uint64_t fMaxIterations;
|
uint64_t fMaxIterations = 5;
|
||||||
uint64_t fNumIterations;
|
uint64_t fNumIterations = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
void addCustomOptions(bpo::options_description& options)
|
void addCustomOptions(bpo::options_description& options)
|
||||||
|
|
|
@ -19,10 +19,7 @@ namespace bpo = boost::program_options;
|
||||||
class Sampler : public FairMQDevice
|
class Sampler : public FairMQDevice
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
Sampler()
|
Sampler() {}
|
||||||
: fMaxIterations(0)
|
|
||||||
, fNumIterations(0)
|
|
||||||
{}
|
|
||||||
|
|
||||||
void InitTask() override
|
void InitTask() override
|
||||||
{
|
{
|
||||||
|
@ -64,8 +61,8 @@ class Sampler : public FairMQDevice
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
std::string fText;
|
std::string fText;
|
||||||
uint64_t fMaxIterations;
|
uint64_t fMaxIterations = 0;
|
||||||
uint64_t fNumIterations;
|
uint64_t fNumIterations = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
void addCustomOptions(bpo::options_description& options)
|
void addCustomOptions(bpo::options_description& options)
|
||||||
|
|
|
@ -18,10 +18,6 @@ class Sink : public FairMQDevice
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
Sink()
|
Sink()
|
||||||
: fReceivedData(false)
|
|
||||||
, fReceivedBroadcast(false)
|
|
||||||
, fMaxIterations(0)
|
|
||||||
, fNumIterations(0)
|
|
||||||
{
|
{
|
||||||
OnData("broadcast", &Sink::HandleBroadcast);
|
OnData("broadcast", &Sink::HandleBroadcast);
|
||||||
OnData("data", &Sink::HandleData);
|
OnData("data", &Sink::HandleData);
|
||||||
|
@ -61,10 +57,10 @@ class Sink : public FairMQDevice
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
bool fReceivedData;
|
bool fReceivedData = false;
|
||||||
bool fReceivedBroadcast;
|
bool fReceivedBroadcast = false;
|
||||||
uint64_t fMaxIterations;
|
uint64_t fMaxIterations = 0;
|
||||||
uint64_t fNumIterations;
|
uint64_t fNumIterations = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
void addCustomOptions(bpo::options_description& options)
|
void addCustomOptions(bpo::options_description& options)
|
||||||
|
|
|
@ -16,11 +16,7 @@ namespace bpo = boost::program_options;
|
||||||
class Sampler1 : public FairMQDevice
|
class Sampler1 : public FairMQDevice
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
Sampler1()
|
Sampler1() {}
|
||||||
: fAckListener()
|
|
||||||
, fMaxIterations(0)
|
|
||||||
, fNumIterations(0)
|
|
||||||
{}
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void InitTask() override
|
void InitTask() override
|
||||||
|
@ -73,8 +69,8 @@ class Sampler1 : public FairMQDevice
|
||||||
}
|
}
|
||||||
|
|
||||||
std::thread fAckListener;
|
std::thread fAckListener;
|
||||||
uint64_t fMaxIterations;
|
uint64_t fMaxIterations = 0;
|
||||||
uint64_t fNumIterations;
|
uint64_t fNumIterations = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
void addCustomOptions(bpo::options_description& options)
|
void addCustomOptions(bpo::options_description& options)
|
||||||
|
|
|
@ -16,10 +16,7 @@ namespace bpo = boost::program_options;
|
||||||
class Sampler2 : public FairMQDevice
|
class Sampler2 : public FairMQDevice
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
Sampler2()
|
Sampler2() {}
|
||||||
: fMaxIterations(0)
|
|
||||||
, fNumIterations(0)
|
|
||||||
{}
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void InitTask() override
|
void InitTask() override
|
||||||
|
@ -47,8 +44,8 @@ class Sampler2 : public FairMQDevice
|
||||||
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
uint64_t fMaxIterations;
|
uint64_t fMaxIterations = 0;
|
||||||
uint64_t fNumIterations;
|
uint64_t fNumIterations = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
void addCustomOptions(bpo::options_description& options)
|
void addCustomOptions(bpo::options_description& options)
|
||||||
|
|
|
@ -15,9 +15,6 @@ class Sink : public FairMQDevice
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
Sink()
|
Sink()
|
||||||
: fMaxIterations(0)
|
|
||||||
, fNumIterations1(0)
|
|
||||||
, fNumIterations2(0)
|
|
||||||
{
|
{
|
||||||
// register a handler for data arriving on "data" channel
|
// register a handler for data arriving on "data" channel
|
||||||
OnData("data1", &Sink::HandleData1);
|
OnData("data1", &Sink::HandleData1);
|
||||||
|
@ -65,9 +62,9 @@ class Sink : public FairMQDevice
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
uint64_t fMaxIterations;
|
uint64_t fMaxIterations = 0;
|
||||||
uint64_t fNumIterations1;
|
uint64_t fNumIterations1 = 0;
|
||||||
uint64_t fNumIterations2;
|
uint64_t fNumIterations2 = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
void addCustomOptions(bpo::options_description& options)
|
void addCustomOptions(bpo::options_description& options)
|
||||||
|
|
|
@ -33,12 +33,6 @@ class Receiver : public FairMQDevice
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
Receiver()
|
Receiver()
|
||||||
: fBuffer()
|
|
||||||
, fDiscardedSet()
|
|
||||||
, fNumSenders(0)
|
|
||||||
, fBufferTimeoutInMs(5000)
|
|
||||||
, fMaxTimeframes(0)
|
|
||||||
, fTimeframeCounter(0)
|
|
||||||
{
|
{
|
||||||
OnData("data", &Receiver::HandleData);
|
OnData("data", &Receiver::HandleData);
|
||||||
}
|
}
|
||||||
|
@ -102,10 +96,10 @@ class Receiver : public FairMQDevice
|
||||||
unordered_map<uint16_t, TFBuffer> fBuffer;
|
unordered_map<uint16_t, TFBuffer> fBuffer;
|
||||||
unordered_set<uint16_t> fDiscardedSet;
|
unordered_set<uint16_t> fDiscardedSet;
|
||||||
|
|
||||||
int fNumSenders;
|
int fNumSenders = 0;
|
||||||
int fBufferTimeoutInMs;
|
int fBufferTimeoutInMs = 5000;
|
||||||
int fMaxTimeframes;
|
int fMaxTimeframes = 0;
|
||||||
int fTimeframeCounter;
|
int fTimeframeCounter = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
void addCustomOptions(bpo::options_description& options)
|
void addCustomOptions(bpo::options_description& options)
|
||||||
|
|
|
@ -20,15 +20,8 @@ namespace bpo = boost::program_options;
|
||||||
class Sender : public FairMQDevice
|
class Sender : public FairMQDevice
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
Sender()
|
Sender() {}
|
||||||
: fNumReceivers(0)
|
|
||||||
, fIndex(0)
|
|
||||||
, fSubtimeframeSize(10000)
|
|
||||||
{}
|
|
||||||
|
|
||||||
~Sender() = default;
|
|
||||||
|
|
||||||
protected:
|
|
||||||
void InitTask() override
|
void InitTask() override
|
||||||
{
|
{
|
||||||
fIndex = GetConfig()->GetProperty<int>("sender-index");
|
fIndex = GetConfig()->GetProperty<int>("sender-index");
|
||||||
|
@ -64,9 +57,9 @@ class Sender : public FairMQDevice
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
int fNumReceivers;
|
int fNumReceivers = 0;
|
||||||
unsigned int fIndex;
|
unsigned int fIndex = 0;
|
||||||
int fSubtimeframeSize;
|
int fSubtimeframeSize = 10000;
|
||||||
};
|
};
|
||||||
|
|
||||||
void addCustomOptions(bpo::options_description& options)
|
void addCustomOptions(bpo::options_description& options)
|
||||||
|
|
|
@ -18,12 +18,8 @@ namespace bpo = boost::program_options;
|
||||||
class Synchronizer : public FairMQDevice
|
class Synchronizer : public FairMQDevice
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
Synchronizer()
|
Synchronizer() {}
|
||||||
: fTimeframeId(0)
|
|
||||||
{}
|
|
||||||
~Synchronizer() = default;
|
|
||||||
|
|
||||||
protected:
|
|
||||||
bool ConditionalRun() override
|
bool ConditionalRun() override
|
||||||
{
|
{
|
||||||
FairMQMessagePtr msg(NewSimpleMessage(fTimeframeId));
|
FairMQMessagePtr msg(NewSimpleMessage(fTimeframeId));
|
||||||
|
@ -39,7 +35,7 @@ class Synchronizer : public FairMQDevice
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint16_t fTimeframeId;
|
uint16_t fTimeframeId = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
void addCustomOptions(bpo::options_description& /* options */) {}
|
void addCustomOptions(bpo::options_description& /* options */) {}
|
||||||
|
|
|
@ -18,15 +18,8 @@ namespace bpo = boost::program_options;
|
||||||
class Readout : public FairMQDevice
|
class Readout : public FairMQDevice
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
Readout()
|
Readout() {}
|
||||||
: fMsgSize(10000)
|
|
||||||
, fMaxIterations(0)
|
|
||||||
, fNumIterations(0)
|
|
||||||
, fRegion(nullptr)
|
|
||||||
, fNumUnackedMsgs(0)
|
|
||||||
{}
|
|
||||||
|
|
||||||
protected:
|
|
||||||
void InitTask() override
|
void InitTask() override
|
||||||
{
|
{
|
||||||
fMsgSize = fConfig->GetProperty<int>("msg-size");
|
fMsgSize = fConfig->GetProperty<int>("msg-size");
|
||||||
|
@ -65,6 +58,7 @@ class Readout : public FairMQDevice
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ResetTask() override
|
void ResetTask() override
|
||||||
{
|
{
|
||||||
// if not all messages acknowledged, wait for a bit. But only once, since receiver could be already dead.
|
// if not all messages acknowledged, wait for a bit. But only once, since receiver could be already dead.
|
||||||
|
@ -77,11 +71,11 @@ class Readout : public FairMQDevice
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
int fMsgSize;
|
int fMsgSize = 10000;
|
||||||
uint64_t fMaxIterations;
|
uint64_t fMaxIterations = 0;
|
||||||
uint64_t fNumIterations;
|
uint64_t fNumIterations = 0;
|
||||||
FairMQUnmanagedRegionPtr fRegion;
|
FairMQUnmanagedRegionPtr fRegion = nullptr;
|
||||||
std::atomic<uint64_t> fNumUnackedMsgs;
|
std::atomic<uint64_t> fNumUnackedMsgs = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
void addCustomOptions(bpo::options_description& options)
|
void addCustomOptions(bpo::options_description& options)
|
||||||
|
|
|
@ -14,12 +14,8 @@ namespace bpo = boost::program_options;
|
||||||
class Receiver : public FairMQDevice
|
class Receiver : public FairMQDevice
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
Receiver()
|
Receiver() {}
|
||||||
: fMaxIterations(0)
|
|
||||||
, fNumIterations(0)
|
|
||||||
{}
|
|
||||||
|
|
||||||
protected:
|
|
||||||
void InitTask() override
|
void InitTask() override
|
||||||
{
|
{
|
||||||
// Get the fMaxIterations value from the command line options (via fConfig)
|
// Get the fMaxIterations value from the command line options (via fConfig)
|
||||||
|
@ -43,8 +39,8 @@ class Receiver : public FairMQDevice
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
uint64_t fMaxIterations;
|
uint64_t fMaxIterations = 0;
|
||||||
uint64_t fNumIterations;
|
uint64_t fNumIterations = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
void addCustomOptions(bpo::options_description& options)
|
void addCustomOptions(bpo::options_description& options)
|
||||||
|
|
|
@ -16,9 +16,7 @@ namespace bpo = boost::program_options;
|
||||||
class Sender : public FairMQDevice
|
class Sender : public FairMQDevice
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
Sender()
|
Sender() {}
|
||||||
: fInputChannelName()
|
|
||||||
{}
|
|
||||||
|
|
||||||
void Init() override
|
void Init() override
|
||||||
{
|
{
|
||||||
|
|
|
@ -18,16 +18,8 @@ namespace bpo = boost::program_options;
|
||||||
class Sampler : public FairMQDevice
|
class Sampler : public FairMQDevice
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
Sampler()
|
Sampler() {}
|
||||||
: fMsgSize(10000)
|
|
||||||
, fLinger(100)
|
|
||||||
, fMaxIterations(0)
|
|
||||||
, fNumIterations(0)
|
|
||||||
, fRegion(nullptr)
|
|
||||||
, fNumUnackedMsgs(0)
|
|
||||||
{}
|
|
||||||
|
|
||||||
protected:
|
|
||||||
void InitTask() override
|
void InitTask() override
|
||||||
{
|
{
|
||||||
fMsgSize = fConfig->GetProperty<int>("msg-size");
|
fMsgSize = fConfig->GetProperty<int>("msg-size");
|
||||||
|
@ -102,13 +94,13 @@ class Sampler : public FairMQDevice
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
int fMsgSize;
|
int fMsgSize = 10000;
|
||||||
uint32_t fLinger;
|
uint32_t fLinger = 100;
|
||||||
uint64_t fMaxIterations;
|
uint64_t fMaxIterations = 0;
|
||||||
uint64_t fNumIterations;
|
uint64_t fNumIterations = 0;
|
||||||
FairMQUnmanagedRegionPtr fRegion;
|
FairMQUnmanagedRegionPtr fRegion = nullptr;
|
||||||
std::mutex fMtx;
|
std::mutex fMtx;
|
||||||
uint64_t fNumUnackedMsgs;
|
uint64_t fNumUnackedMsgs = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
void addCustomOptions(bpo::options_description& options)
|
void addCustomOptions(bpo::options_description& options)
|
||||||
|
|
|
@ -14,10 +14,7 @@ namespace bpo = boost::program_options;
|
||||||
class Sink : public FairMQDevice
|
class Sink : public FairMQDevice
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
Sink()
|
Sink() {}
|
||||||
: fMaxIterations(0)
|
|
||||||
, fNumIterations(0)
|
|
||||||
{}
|
|
||||||
|
|
||||||
void InitTask() override
|
void InitTask() override
|
||||||
{
|
{
|
||||||
|
@ -56,8 +53,8 @@ class Sink : public FairMQDevice
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
uint64_t fMaxIterations;
|
uint64_t fMaxIterations = 0;
|
||||||
uint64_t fNumIterations;
|
uint64_t fNumIterations = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -18,10 +18,7 @@ namespace bpo = boost::program_options;
|
||||||
class Client : public FairMQDevice
|
class Client : public FairMQDevice
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
Client()
|
Client() {}
|
||||||
: fMaxIterations(0)
|
|
||||||
, fNumIterations(0)
|
|
||||||
{}
|
|
||||||
|
|
||||||
void InitTask() override
|
void InitTask() override
|
||||||
{
|
{
|
||||||
|
@ -66,8 +63,8 @@ class Client : public FairMQDevice
|
||||||
|
|
||||||
private:
|
private:
|
||||||
std::string fText;
|
std::string fText;
|
||||||
uint64_t fMaxIterations;
|
uint64_t fMaxIterations = 0;
|
||||||
uint64_t fNumIterations;
|
uint64_t fNumIterations = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
void addCustomOptions(bpo::options_description& options)
|
void addCustomOptions(bpo::options_description& options)
|
||||||
|
|
|
@ -17,13 +17,10 @@ class Server : public FairMQDevice
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
Server()
|
Server()
|
||||||
: fMaxIterations(0)
|
|
||||||
, fNumIterations(0)
|
|
||||||
{
|
{
|
||||||
OnData("data", &Server::HandleData);
|
OnData("data", &Server::HandleData);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected:
|
|
||||||
void InitTask() override
|
void InitTask() override
|
||||||
{
|
{
|
||||||
// Get the fMaxIterations value from the command line options (via fConfig)
|
// Get the fMaxIterations value from the command line options (via fConfig)
|
||||||
|
@ -56,8 +53,8 @@ class Server : public FairMQDevice
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
uint64_t fMaxIterations;
|
uint64_t fMaxIterations = 0;
|
||||||
uint64_t fNumIterations;
|
uint64_t fNumIterations = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
void addCustomOptions(bpo::options_description& options)
|
void addCustomOptions(bpo::options_description& options)
|
||||||
|
|
|
@ -27,14 +27,7 @@ enum class FairMQRegionEvent : int
|
||||||
|
|
||||||
struct FairMQRegionInfo
|
struct FairMQRegionInfo
|
||||||
{
|
{
|
||||||
FairMQRegionInfo()
|
FairMQRegionInfo() {}
|
||||||
: managed(true)
|
|
||||||
, id(0)
|
|
||||||
, ptr(nullptr)
|
|
||||||
, size(0)
|
|
||||||
, flags(0)
|
|
||||||
, event(FairMQRegionEvent::created)
|
|
||||||
{}
|
|
||||||
|
|
||||||
FairMQRegionInfo(bool _managed, uint64_t _id, void* _ptr, size_t _size, int64_t _flags, FairMQRegionEvent _event)
|
FairMQRegionInfo(bool _managed, uint64_t _id, void* _ptr, size_t _size, int64_t _flags, FairMQRegionEvent _event)
|
||||||
: managed(_managed)
|
: managed(_managed)
|
||||||
|
@ -45,12 +38,12 @@ struct FairMQRegionInfo
|
||||||
, event(_event)
|
, event(_event)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
bool managed; // managed/unmanaged
|
bool managed = true; // managed/unmanaged
|
||||||
uint64_t id; // id of the region
|
uint64_t id = 0; // id of the region
|
||||||
void* ptr; // pointer to the start of the region
|
void* ptr = nullptr; // pointer to the start of the region
|
||||||
size_t size; // region size
|
size_t size = 0; // region size
|
||||||
int64_t flags; // custom flags set by the creator
|
int64_t flags = 0; // custom flags set by the creator
|
||||||
FairMQRegionEvent event;
|
FairMQRegionEvent event = FairMQRegionEvent::created;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct FairMQRegionBlock {
|
struct FairMQRegionBlock {
|
||||||
|
@ -108,17 +101,16 @@ inline std::ostream& operator<<(std::ostream& os, const FairMQRegionEvent& event
|
||||||
namespace fair::mq
|
namespace fair::mq
|
||||||
{
|
{
|
||||||
|
|
||||||
struct RegionConfig {
|
struct RegionConfig
|
||||||
bool lock;
|
{
|
||||||
bool zero;
|
RegionConfig() {}
|
||||||
|
|
||||||
RegionConfig()
|
|
||||||
: lock(false), zero(false)
|
|
||||||
{}
|
|
||||||
|
|
||||||
RegionConfig(bool l, bool z)
|
RegionConfig(bool l, bool z)
|
||||||
: lock(l), zero(z)
|
: lock(l), zero(z)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
bool lock = false;
|
||||||
|
bool zero = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
using RegionCallback = FairMQRegionCallback;
|
using RegionCallback = FairMQRegionCallback;
|
||||||
|
|
|
@ -29,17 +29,7 @@ namespace fair::mq
|
||||||
class BenchmarkSampler : public Device
|
class BenchmarkSampler : public Device
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
BenchmarkSampler()
|
BenchmarkSampler() {}
|
||||||
: fMultipart(false)
|
|
||||||
, fMemSet(false)
|
|
||||||
, fNumParts(1)
|
|
||||||
, fMsgSize(10000)
|
|
||||||
, fMsgAlignment(0)
|
|
||||||
, fMsgRate(0)
|
|
||||||
, fNumIterations(0)
|
|
||||||
, fMaxIterations(0)
|
|
||||||
, fOutChannelName()
|
|
||||||
{}
|
|
||||||
|
|
||||||
void InitTask() override
|
void InitTask() override
|
||||||
{
|
{
|
||||||
|
@ -109,14 +99,14 @@ class BenchmarkSampler : public Device
|
||||||
}
|
}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
bool fMultipart;
|
bool fMultipart = false;
|
||||||
bool fMemSet;
|
bool fMemSet = false;
|
||||||
size_t fNumParts;
|
size_t fNumParts = 1;
|
||||||
size_t fMsgSize;
|
size_t fMsgSize = 10000;
|
||||||
size_t fMsgAlignment;
|
size_t fMsgAlignment = 0;
|
||||||
float fMsgRate;
|
float fMsgRate = 0;
|
||||||
uint64_t fNumIterations;
|
uint64_t fNumIterations = 0;
|
||||||
uint64_t fMaxIterations;
|
uint64_t fMaxIterations = 0;
|
||||||
std::string fOutChannelName;
|
std::string fOutChannelName;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -23,13 +23,12 @@ class Merger : public Device
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
Merger()
|
Merger()
|
||||||
: fMultipart(true)
|
: fInChannelName("data-in")
|
||||||
, fInChannelName("data-in")
|
|
||||||
, fOutChannelName("data-out")
|
, fOutChannelName("data-out")
|
||||||
{}
|
{}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
bool fMultipart;
|
bool fMultipart = true;
|
||||||
std::string fInChannelName;
|
std::string fInChannelName;
|
||||||
std::string fOutChannelName;
|
std::string fOutChannelName;
|
||||||
|
|
||||||
|
|
|
@ -20,16 +20,11 @@ namespace fair::mq
|
||||||
class Multiplier : public Device
|
class Multiplier : public Device
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
Multiplier()
|
Multiplier() {}
|
||||||
: fMultipart(true)
|
|
||||||
, fNumOutputs(0)
|
|
||||||
, fInChannelName()
|
|
||||||
, fOutChannelNames()
|
|
||||||
{}
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
bool fMultipart;
|
bool fMultipart = true;
|
||||||
int fNumOutputs;
|
int fNumOutputs = 0;
|
||||||
std::string fInChannelName;
|
std::string fInChannelName;
|
||||||
std::vector<std::string> fOutChannelNames;
|
std::vector<std::string> fOutChannelNames;
|
||||||
|
|
||||||
|
|
|
@ -19,14 +19,10 @@ namespace fair::mq
|
||||||
class Proxy : public Device
|
class Proxy : public Device
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
Proxy()
|
Proxy() {}
|
||||||
: fMultipart(true)
|
|
||||||
, fInChannelName()
|
|
||||||
, fOutChannelName()
|
|
||||||
{}
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
bool fMultipart;
|
bool fMultipart = true;
|
||||||
std::string fInChannelName;
|
std::string fInChannelName;
|
||||||
std::string fOutChannelName;
|
std::string fOutChannelName;
|
||||||
|
|
||||||
|
|
|
@ -25,22 +25,14 @@ namespace fair::mq
|
||||||
class Sink : public Device
|
class Sink : public Device
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
Sink()
|
Sink() {}
|
||||||
: fMultipart(false)
|
|
||||||
, fMaxIterations(0)
|
|
||||||
, fNumIterations(0)
|
|
||||||
, fMaxFileSize(0)
|
|
||||||
, fBytesWritten(0)
|
|
||||||
, fInChannelName()
|
|
||||||
, fOutFilename()
|
|
||||||
{}
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
bool fMultipart;
|
bool fMultipart = false;
|
||||||
uint64_t fMaxIterations;
|
uint64_t fMaxIterations = 0;
|
||||||
uint64_t fNumIterations;
|
uint64_t fNumIterations = 0;
|
||||||
uint64_t fMaxFileSize;
|
uint64_t fMaxFileSize = 0;
|
||||||
uint64_t fBytesWritten;
|
uint64_t fBytesWritten = 0;
|
||||||
std::string fInChannelName;
|
std::string fInChannelName;
|
||||||
std::string fOutFilename;
|
std::string fOutFilename;
|
||||||
std::fstream fOutputFile;
|
std::fstream fOutputFile;
|
||||||
|
|
|
@ -19,18 +19,12 @@ namespace fair::mq
|
||||||
class Splitter : public Device
|
class Splitter : public Device
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
Splitter()
|
Splitter() {}
|
||||||
: fMultipart(true)
|
|
||||||
, fNumOutputs(0)
|
|
||||||
, fDirection(0)
|
|
||||||
, fInChannelName()
|
|
||||||
, fOutChannelName()
|
|
||||||
{}
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
bool fMultipart;
|
bool fMultipart = true;
|
||||||
int fNumOutputs;
|
int fNumOutputs = 0;
|
||||||
int fDirection;
|
int fDirection = 0;
|
||||||
std::string fInChannelName;
|
std::string fInChannelName;
|
||||||
std::string fOutChannelName;
|
std::string fOutChannelName;
|
||||||
|
|
||||||
|
|
|
@ -187,11 +187,7 @@ using Uint16MsgDebugMapHashMap = boost::unordered_map<uint16_t, SizetMsgDebugMap
|
||||||
|
|
||||||
struct RegionBlock
|
struct RegionBlock
|
||||||
{
|
{
|
||||||
RegionBlock()
|
RegionBlock() {}
|
||||||
: fHandle()
|
|
||||||
, fSize(0)
|
|
||||||
, fHint(0)
|
|
||||||
{}
|
|
||||||
|
|
||||||
RegionBlock(boost::interprocess::managed_shared_memory::handle_t handle, size_t size, size_t hint)
|
RegionBlock(boost::interprocess::managed_shared_memory::handle_t handle, size_t size, size_t hint)
|
||||||
: fHandle(handle)
|
: fHandle(handle)
|
||||||
|
@ -199,9 +195,9 @@ struct RegionBlock
|
||||||
, fHint(hint)
|
, fHint(hint)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
boost::interprocess::managed_shared_memory::handle_t fHandle;
|
boost::interprocess::managed_shared_memory::handle_t fHandle{};
|
||||||
size_t fSize;
|
size_t fSize = 0;
|
||||||
size_t fHint;
|
size_t fHint = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
// find id for unique shmem name:
|
// find id for unique shmem name:
|
||||||
|
|
|
@ -35,7 +35,6 @@ class Message final : public fair::mq::Message
|
||||||
public:
|
public:
|
||||||
Message(FairMQTransportFactory* factory = nullptr)
|
Message(FairMQTransportFactory* factory = nullptr)
|
||||||
: fair::mq::Message(factory)
|
: fair::mq::Message(factory)
|
||||||
, fAlignment(0)
|
|
||||||
, fMsg(std::make_unique<zmq_msg_t>())
|
, fMsg(std::make_unique<zmq_msg_t>())
|
||||||
{
|
{
|
||||||
if (zmq_msg_init(fMsg.get()) != 0) {
|
if (zmq_msg_init(fMsg.get()) != 0) {
|
||||||
|
@ -55,7 +54,6 @@ class Message final : public fair::mq::Message
|
||||||
|
|
||||||
Message(const size_t size, FairMQTransportFactory* factory = nullptr)
|
Message(const size_t size, FairMQTransportFactory* factory = nullptr)
|
||||||
: fair::mq::Message(factory)
|
: fair::mq::Message(factory)
|
||||||
, fAlignment(0)
|
|
||||||
, fMsg(std::make_unique<zmq_msg_t>())
|
, fMsg(std::make_unique<zmq_msg_t>())
|
||||||
{
|
{
|
||||||
if (zmq_msg_init_size(fMsg.get(), size) != 0) {
|
if (zmq_msg_init_size(fMsg.get(), size) != 0) {
|
||||||
|
@ -96,7 +94,6 @@ class Message final : public fair::mq::Message
|
||||||
|
|
||||||
Message(void* data, const size_t size, fairmq_free_fn* ffn, void* hint = nullptr, FairMQTransportFactory* factory = nullptr)
|
Message(void* data, const size_t size, fairmq_free_fn* ffn, void* hint = nullptr, FairMQTransportFactory* factory = nullptr)
|
||||||
: fair::mq::Message(factory)
|
: fair::mq::Message(factory)
|
||||||
, fAlignment(0)
|
|
||||||
, fMsg(std::make_unique<zmq_msg_t>())
|
, fMsg(std::make_unique<zmq_msg_t>())
|
||||||
{
|
{
|
||||||
if (zmq_msg_init_data(fMsg.get(), data, size, ffn, hint) != 0) {
|
if (zmq_msg_init_data(fMsg.get(), data, size, ffn, hint) != 0) {
|
||||||
|
@ -106,7 +103,6 @@ class Message final : public fair::mq::Message
|
||||||
|
|
||||||
Message(UnmanagedRegionPtr& region, void* data, const size_t size, void* hint = 0, FairMQTransportFactory* factory = nullptr)
|
Message(UnmanagedRegionPtr& region, void* data, const size_t size, void* hint = 0, FairMQTransportFactory* factory = nullptr)
|
||||||
: fair::mq::Message(factory)
|
: fair::mq::Message(factory)
|
||||||
, fAlignment(0)
|
|
||||||
, fMsg(std::make_unique<zmq_msg_t>())
|
, fMsg(std::make_unique<zmq_msg_t>())
|
||||||
{
|
{
|
||||||
if (region->GetType() != GetType()) {
|
if (region->GetType() != GetType()) {
|
||||||
|
@ -264,7 +260,7 @@ class Message final : public fair::mq::Message
|
||||||
~Message() override { CloseMessage(); }
|
~Message() override { CloseMessage(); }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
size_t fAlignment;
|
size_t fAlignment = 0;
|
||||||
std::unique_ptr<zmq_msg_t> fMsg;
|
std::unique_ptr<zmq_msg_t> fMsg;
|
||||||
|
|
||||||
zmq_msg_t* GetMessage() const { return fMsg.get(); }
|
zmq_msg_t* GetMessage() const { return fMsg.get(); }
|
||||||
|
|
Loading…
Reference in New Issue
Block a user