Eliminate warnings in FairLink and FairMQ Plugins.

This commit is contained in:
Alexey Rybalchenko 2017-09-11 14:50:48 +02:00 committed by Mohammad Al-Turany
parent f6365d013e
commit 2db114bc5c
16 changed files with 117 additions and 96 deletions

View File

@ -284,19 +284,19 @@ class FairMQChannel
}; };
template<typename... Args> template<typename... Args>
inline FairMQMessagePtr NewMessage(Args&&... args) const FairMQMessagePtr NewMessage(Args&&... args) const
{ {
return Transport()->CreateMessage(std::forward<Args>(args)...); return Transport()->CreateMessage(std::forward<Args>(args)...);
} }
template<typename T> template<typename T>
inline FairMQMessagePtr NewSimpleMessage(const T& data) const FairMQMessagePtr NewSimpleMessage(const T& data) const
{ {
return Transport()->NewSimpleMessage(data); return Transport()->NewSimpleMessage(data);
} }
template<typename T> template<typename T>
inline FairMQMessagePtr NewStaticMessage(const T& data) const FairMQMessagePtr NewStaticMessage(const T& data) const
{ {
return Transport()->NewStaticMessage(data); return Transport()->NewStaticMessage(data);
} }

View File

@ -93,12 +93,12 @@ class FairMQDevice : public FairMQStateMachine, public FairMQConfigurable
Deserializer().Deserialize(msg, std::forward<DataType>(data), std::forward<Args>(args)...); Deserializer().Deserialize(msg, std::forward<DataType>(data), std::forward<Args>(args)...);
} }
inline int Send(FairMQMessagePtr& msg, const std::string& chan, const int i = 0) const int Send(FairMQMessagePtr& msg, const std::string& chan, const int i = 0) const
{ {
return fChannels.at(chan).at(i).Send(msg); return fChannels.at(chan).at(i).Send(msg);
} }
inline int Receive(FairMQMessagePtr& msg, const std::string& chan, const int i = 0) const int Receive(FairMQMessagePtr& msg, const std::string& chan, const int i = 0) const
{ {
return fChannels.at(chan).at(i).Receive(msg); return fChannels.at(chan).at(i).Receive(msg);
} }
@ -109,7 +109,7 @@ class FairMQDevice : public FairMQStateMachine, public FairMQConfigurable
/// @param i channel index /// @param i channel index
/// @return Number of bytes that have been queued. -2 If queueing was not possible or timed out. /// @return Number of bytes that have been queued. -2 If queueing was not possible or timed out.
/// In case of errors, returns -1. /// In case of errors, returns -1.
inline int Send(FairMQMessagePtr& msg, const std::string& chan, const int i, int sndTimeoutInMs) const int Send(FairMQMessagePtr& msg, const std::string& chan, const int i, int sndTimeoutInMs) const
{ {
return fChannels.at(chan).at(i).Send(msg, sndTimeoutInMs); return fChannels.at(chan).at(i).Send(msg, sndTimeoutInMs);
} }
@ -120,7 +120,7 @@ class FairMQDevice : public FairMQStateMachine, public FairMQConfigurable
/// @param i channel index /// @param i channel index
/// @return Number of bytes that have been received. -2 If reading from the queue was not possible or timed out. /// @return Number of bytes that have been received. -2 If reading from the queue was not possible or timed out.
/// In case of errors, returns -1. /// In case of errors, returns -1.
inline int Receive(FairMQMessagePtr& msg, const std::string& chan, const int i, int rcvTimeoutInMs) const int Receive(FairMQMessagePtr& msg, const std::string& chan, const int i, int rcvTimeoutInMs) const
{ {
return fChannels.at(chan).at(i).Receive(msg, rcvTimeoutInMs); return fChannels.at(chan).at(i).Receive(msg, rcvTimeoutInMs);
} }
@ -131,7 +131,7 @@ class FairMQDevice : public FairMQStateMachine, public FairMQConfigurable
/// @param i channel index /// @param i channel index
/// @return Number of bytes that have been queued. -2 If queueing was not possible or timed out. /// @return Number of bytes that have been queued. -2 If queueing was not possible or timed out.
/// In case of errors, returns -1. /// In case of errors, returns -1.
inline int SendAsync(FairMQMessagePtr& msg, const std::string& chan, const int i = 0) const int SendAsync(FairMQMessagePtr& msg, const std::string& chan, const int i = 0) const
{ {
return fChannels.at(chan).at(i).SendAsync(msg); return fChannels.at(chan).at(i).SendAsync(msg);
} }
@ -142,17 +142,17 @@ class FairMQDevice : public FairMQStateMachine, public FairMQConfigurable
/// @param i channel index /// @param i channel index
/// @return Number of bytes that have been received. -2 If reading from the queue was not possible or timed out. /// @return Number of bytes that have been received. -2 If reading from the queue was not possible or timed out.
/// In case of errors, returns -1. /// In case of errors, returns -1.
inline int ReceiveAsync(FairMQMessagePtr& msg, const std::string& chan, const int i = 0) const int ReceiveAsync(FairMQMessagePtr& msg, const std::string& chan, const int i = 0) const
{ {
return fChannels.at(chan).at(i).ReceiveAsync(msg); return fChannels.at(chan).at(i).ReceiveAsync(msg);
} }
inline int64_t Send(FairMQParts& parts, const std::string& chan, const int i = 0) const int64_t Send(FairMQParts& parts, const std::string& chan, const int i = 0) const
{ {
return fChannels.at(chan).at(i).Send(parts.fParts); return fChannels.at(chan).at(i).Send(parts.fParts);
} }
inline int64_t Receive(FairMQParts& parts, const std::string& chan, const int i = 0) const int64_t Receive(FairMQParts& parts, const std::string& chan, const int i = 0) const
{ {
return fChannels.at(chan).at(i).Receive(parts.fParts); return fChannels.at(chan).at(i).Receive(parts.fParts);
} }
@ -163,7 +163,7 @@ class FairMQDevice : public FairMQStateMachine, public FairMQConfigurable
/// @param i channel index /// @param i channel index
/// @return Number of bytes that have been queued. -2 If queueing was not possible or timed out. /// @return Number of bytes that have been queued. -2 If queueing was not possible or timed out.
/// In case of errors, returns -1. /// In case of errors, returns -1.
inline int64_t Send(FairMQParts& parts, const std::string& chan, const int i, int sndTimeoutInMs) const int64_t Send(FairMQParts& parts, const std::string& chan, const int i, int sndTimeoutInMs) const
{ {
return fChannels.at(chan).at(i).Send(parts.fParts, sndTimeoutInMs); return fChannels.at(chan).at(i).Send(parts.fParts, sndTimeoutInMs);
} }
@ -174,7 +174,7 @@ class FairMQDevice : public FairMQStateMachine, public FairMQConfigurable
/// @param i channel index /// @param i channel index
/// @return Number of bytes that have been received. -2 If reading from the queue was not possible or timed out. /// @return Number of bytes that have been received. -2 If reading from the queue was not possible or timed out.
/// In case of errors, returns -1. /// In case of errors, returns -1.
inline int64_t Receive(FairMQParts& parts, const std::string& chan, const int i, int rcvTimeoutInMs) const int64_t Receive(FairMQParts& parts, const std::string& chan, const int i, int rcvTimeoutInMs) const
{ {
return fChannels.at(chan).at(i).Receive(parts.fParts, rcvTimeoutInMs); return fChannels.at(chan).at(i).Receive(parts.fParts, rcvTimeoutInMs);
} }
@ -185,7 +185,7 @@ class FairMQDevice : public FairMQStateMachine, public FairMQConfigurable
/// @param i channel index /// @param i channel index
/// @return Number of bytes that have been queued. -2 If queueing was not possible or timed out. /// @return Number of bytes that have been queued. -2 If queueing was not possible or timed out.
/// In case of errors, returns -1. /// In case of errors, returns -1.
inline int64_t SendAsync(FairMQParts& parts, const std::string& chan, const int i = 0) const int64_t SendAsync(FairMQParts& parts, const std::string& chan, const int i = 0) const
{ {
return fChannels.at(chan).at(i).SendAsync(parts.fParts); return fChannels.at(chan).at(i).SendAsync(parts.fParts);
} }
@ -196,7 +196,7 @@ class FairMQDevice : public FairMQStateMachine, public FairMQConfigurable
/// @param i channel index /// @param i channel index
/// @return Number of bytes that have been received. -2 If reading from the queue was not possible or timed out. /// @return Number of bytes that have been received. -2 If reading from the queue was not possible or timed out.
/// In case of errors, returns -1. /// In case of errors, returns -1.
inline int64_t ReceiveAsync(FairMQParts& parts, const std::string& chan, const int i = 0) const int64_t ReceiveAsync(FairMQParts& parts, const std::string& chan, const int i = 0) const
{ {
return fChannels.at(chan).at(i).ReceiveAsync(parts.fParts); return fChannels.at(chan).at(i).ReceiveAsync(parts.fParts);
} }
@ -208,37 +208,37 @@ class FairMQDevice : public FairMQStateMachine, public FairMQConfigurable
} }
template<typename... Args> template<typename... Args>
inline FairMQMessagePtr NewMessage(Args&&... args) const FairMQMessagePtr NewMessage(Args&&... args) const
{ {
return Transport()->CreateMessage(std::forward<Args>(args)...); return Transport()->CreateMessage(std::forward<Args>(args)...);
} }
template<typename... Args> template<typename... Args>
inline FairMQMessagePtr NewMessageFor(const std::string& channel, int index, Args&&... args) const FairMQMessagePtr NewMessageFor(const std::string& channel, int index, Args&&... args) const
{ {
return fChannels.at(channel).at(index).Transport()->CreateMessage(std::forward<Args>(args)...); return fChannels.at(channel).at(index).Transport()->CreateMessage(std::forward<Args>(args)...);
} }
template<typename T> template<typename T>
inline FairMQMessagePtr NewStaticMessage(const T& data) const FairMQMessagePtr NewStaticMessage(const T& data) const
{ {
return Transport()->NewStaticMessage(data); return Transport()->NewStaticMessage(data);
} }
template<typename T> template<typename T>
inline FairMQMessagePtr NewStaticMessageFor(const std::string& channel, int index, const T& data) const FairMQMessagePtr NewStaticMessageFor(const std::string& channel, int index, const T& data) const
{ {
return fChannels.at(channel).at(index).NewStaticMessage(data); return fChannels.at(channel).at(index).NewStaticMessage(data);
} }
template<typename T> template<typename T>
inline FairMQMessagePtr NewSimpleMessage(const T& data) const FairMQMessagePtr NewSimpleMessage(const T& data) const
{ {
return Transport()->NewSimpleMessage(data); return Transport()->NewSimpleMessage(data);
} }
template<typename T> template<typename T>
inline FairMQMessagePtr NewSimpleMessageFor(const std::string& channel, int index, const T& data) const FairMQMessagePtr NewSimpleMessageFor(const std::string& channel, int index, const T& data) const
{ {
return fChannels.at(channel).at(index).NewSimpleMessage(data); return fChannels.at(channel).at(index).NewSimpleMessage(data);
} }
@ -263,7 +263,7 @@ class FairMQDevice : public FairMQStateMachine, public FairMQConfigurable
{ {
FairMQ::Transport type = fChannels.at(chans.at(0)).at(0).Transport()->GetType(); FairMQ::Transport type = fChannels.at(chans.at(0)).at(0).Transport()->GetType();
for (int i = 1; i < chans.size(); ++i) for (unsigned int i = 1; i < chans.size(); ++i)
{ {
if (type != fChannels.at(chans.at(i)).at(0).Transport()->GetType()) if (type != fChannels.at(chans.at(i)).at(0).Transport()->GetType())
{ {
@ -303,7 +303,7 @@ class FairMQDevice : public FairMQStateMachine, public FairMQConfigurable
/// Works only when running in a terminal. Running in background would exit, because no interactive input (std::cin) is possible. /// Works only when running in a terminal. Running in background would exit, because no interactive input (std::cin) is possible.
void InteractiveStateLoop(); void InteractiveStateLoop();
/// Prints the available commands of the InteractiveStateLoop() /// Prints the available commands of the InteractiveStateLoop()
inline void PrintInteractiveStateLoopHelp() void PrintInteractiveStateLoopHelp()
{ {
LOG(INFO) << "Use keys to control the state machine:"; LOG(INFO) << "Use keys to control the state machine:";
LOG(INFO) << "[h] help, [p] pause, [r] run, [s] stop, [t] reset task, [d] reset device, [q] end, [j] init task, [i] init device"; LOG(INFO) << "[h] help, [p] pause, [r] run, [s] stop, [t] reset task, [d] reset device, [q] end, [j] init task, [i] init device";

View File

@ -79,7 +79,8 @@ struct FairMQFSM : public msmf::state_machine_def<FairMQFSM>
{ {
public: public:
FairMQFSM() FairMQFSM()
: fWorkerThread() : fState()
, fChangeStateMutex()
, fWork() , fWork()
, fWorkAvailableCondition() , fWorkAvailableCondition()
, fWorkDoneCondition() , fWorkDoneCondition()
@ -87,10 +88,9 @@ struct FairMQFSM : public msmf::state_machine_def<FairMQFSM>
, fWorkerTerminated(false) , fWorkerTerminated(false)
, fWorkActive(false) , fWorkActive(false)
, fWorkAvailable(false) , fWorkAvailable(false)
, fState()
, fChangeStateMutex()
, fStateChangeSignal() , fStateChangeSignal()
, fStateChangeSignalsMap() , fStateChangeSignalsMap()
, fWorkerThread()
{} {}
virtual ~FairMQFSM() virtual ~FairMQFSM()

View File

@ -85,7 +85,7 @@ class FairMQTransportFactory
} }
template<typename T> template<typename T>
inline FairMQMessagePtr NewSimpleMessage(const T& data) const FairMQMessagePtr NewSimpleMessage(const T& data) const
{ {
// todo: is_trivially_copyable not available on gcc < 5, workaround? // todo: is_trivially_copyable not available on gcc < 5, workaround?
// static_assert(std::is_trivially_copyable<T>::value, "The argument type for NewSimpleMessage has to be trivially copyable!"); // static_assert(std::is_trivially_copyable<T>::value, "The argument type for NewSimpleMessage has to be trivially copyable!");
@ -94,13 +94,13 @@ class FairMQTransportFactory
} }
template<std::size_t N> template<std::size_t N>
inline FairMQMessagePtr NewSimpleMessage(const char(&data)[N]) const FairMQMessagePtr NewSimpleMessage(const char(&data)[N]) const
{ {
std::string* msgStr = new std::string(data); std::string* msgStr = new std::string(data);
return CreateMessage(const_cast<char*>(msgStr->c_str()), msgStr->length(), FairMQSimpleMsgCleanup<std::string>, msgStr); return CreateMessage(const_cast<char*>(msgStr->c_str()), msgStr->length(), FairMQSimpleMsgCleanup<std::string>, msgStr);
} }
inline FairMQMessagePtr NewSimpleMessage(const std::string& str) const FairMQMessagePtr NewSimpleMessage(const std::string& str) const
{ {
std::string* msgStr = new std::string(str); std::string* msgStr = new std::string(str);
@ -108,12 +108,12 @@ class FairMQTransportFactory
} }
template<typename T> template<typename T>
inline FairMQMessagePtr NewStaticMessage(const T& data) const FairMQMessagePtr NewStaticMessage(const T& data) const
{ {
return CreateMessage(data, sizeof(T), FairMQNoCleanup, nullptr); return CreateMessage(data, sizeof(T), FairMQNoCleanup, nullptr);
} }
inline FairMQMessagePtr NewStaticMessage(const std::string& str) const FairMQMessagePtr NewStaticMessage(const std::string& str) const
{ {
return CreateMessage(const_cast<char*>(str.c_str()), str.length(), FairMQNoCleanup, nullptr); return CreateMessage(const_cast<char*>(str.c_str()), str.length(), FairMQNoCleanup, nullptr);
} }

View File

@ -41,6 +41,10 @@ class Plugin
Plugin() = delete; Plugin() = delete;
Plugin(const std::string name, const Version version, const std::string maintainer, const std::string homepage, PluginServices* pluginServices); Plugin(const std::string name, const Version version, const std::string maintainer, const std::string homepage, PluginServices* pluginServices);
Plugin(const Plugin&) = delete;
Plugin operator=(const Plugin&) = delete;
virtual ~Plugin(); virtual ~Plugin();
auto GetName() const -> const std::string& { return fkName; } auto GetName() const -> const std::string& { return fkName; }
@ -90,7 +94,6 @@ class Plugin
const std::string fkMaintainer; const std::string fkMaintainer;
const std::string fkHomepage; const std::string fkHomepage;
PluginServices* fPluginServices; PluginServices* fPluginServices;
}; /* class Plugin */ }; /* class Plugin */
} /* namespace mq */ } /* namespace mq */

View File

@ -28,7 +28,12 @@ using boost::optional;
const std::string fair::mq::PluginManager::fgkLibPrefix = "FairMQPlugin_"; const std::string fair::mq::PluginManager::fgkLibPrefix = "FairMQPlugin_";
fair::mq::PluginManager::PluginManager() fair::mq::PluginManager::PluginManager()
: fSearchPaths{{"."}} : fSearchPaths{{"."}}
, fPluginFactories()
, fPlugins()
, fPluginOrder()
, fPluginProgOptions()
, fPluginServices()
{ {
} }
@ -61,16 +66,17 @@ auto fair::mq::PluginManager::ProgramOptions() -> po::options_description
{ {
auto plugin_options = po::options_description{"Plugin Manager"}; auto plugin_options = po::options_description{"Plugin Manager"};
plugin_options.add_options() plugin_options.add_options()
("plugin-search-path,S", po::value<vector<string>>()->multitoken(), ("plugin-search-path,S", po::value<vector<string>>()->multitoken(), "List of plugin search paths.\n\n"
"List of plugin search paths.\n\n" "* Override default search path, e.g.\n"
"* Override default search path, e.g.\n" " -S /home/user/lib /lib\n"
" -S /home/user/lib /lib\n" "* Append(>) or prepend(<) to default search path, e.g.\n"
"* Append(>) or prepend(<) to default search path, e.g.\n" " -S >/lib </home/user/lib\n"
" -S >/lib </home/user/lib\n" "* If you mix the overriding and appending/prepending syntaxes, the overriding paths act as default search path, e.g.\n"
"* If you mix the overriding and appending/prepending syntaxes, the overriding paths act as default search path, e.g.\n" " -S /usr/lib >/lib </home/user/lib /usr/local/lib results in /home/user/lib,/usr/local/lib,/usr/lib/,/lib")
" -S /usr/lib >/lib </home/user/lib /usr/local/lib results in /home/user/lib,/usr/local/lib,/usr/lib/,/lib") ("plugin,P", po::value<vector<string>>(), "List of plugin names to load in order,"
("plugin,P", po::value<vector<string>>(), "e.g. if the file is called 'libFairMQPlugin_example.so', just list 'example' or 'd:example' here."
"List of plugin names to load in order, e.g. if the file is called 'libFairMQPlugin_example.so', just list 'example' or 'd:example' here. To load a prelinked plugin, list 'p:example' here."); "To load a prelinked plugin, list 'p:example' here.");
return plugin_options; return plugin_options;
} }

View File

@ -37,11 +37,14 @@ class PluginServices
public: public:
PluginServices() = delete; PluginServices() = delete;
PluginServices(FairMQProgOptions* config, std::shared_ptr<FairMQDevice> device) PluginServices(FairMQProgOptions* config, std::shared_ptr<FairMQDevice> device)
: fDevice{device} : fConfig{config}
, fConfig{config} , fDevice{device}
{ {
} }
PluginServices(const PluginServices&) = delete;
PluginServices operator=(const PluginServices&) = delete;
/// See https://github.com/FairRootGroup/FairRoot/blob/dev/fairmq/docs/Device.md#13-state-machine /// See https://github.com/FairRootGroup/FairRoot/blob/dev/fairmq/docs/Device.md#13-state-machine
enum class DeviceState : int enum class DeviceState : int
{ {

View File

@ -84,7 +84,7 @@ FairMQMessageNN::FairMQMessageNN(void* data, const size_t size, fairmq_free_fn*
} }
} }
FairMQMessageNN::FairMQMessageNN(FairMQRegionPtr& region, void* data, const size_t size) FairMQMessageNN::FairMQMessageNN(FairMQRegionPtr& /*region*/, void* data, const size_t size)
: fMessage(data) : fMessage(data)
, fSize(size) , fSize(size)
, fReceiving(false) , fReceiving(false)
@ -187,7 +187,7 @@ void FairMQMessageNN::Copy(const unique_ptr<FairMQMessage>& msg)
} }
} }
inline void FairMQMessageNN::Clear() void FairMQMessageNN::Clear()
{ {
if (nn_freemsg(fMessage) < 0) if (nn_freemsg(fMessage) < 0)
{ {

View File

@ -24,47 +24,56 @@ constexpr const char* SUBOPT::channelOptionKeys[];
FairMQMap SUBOPT::UserParser(const po::variables_map& omap, const std::string& deviceId, const std::string& rootNode) FairMQMap SUBOPT::UserParser(const po::variables_map& omap, const std::string& deviceId, const std::string& rootNode)
{ {
std::string nodeKey = rootNode + ".device"; std::string nodeKey = rootNode + ".device";
ptree pt; ptree pt;
pt.put(nodeKey + ".id", deviceId.c_str()); pt.put(nodeKey + ".id", deviceId.c_str());
nodeKey += ".channels"; nodeKey += ".channels";
// parsing of channel properties is the only implemented method right now // parsing of channel properties is the only implemented method right now
if (omap.count(OptionKeyChannelConfig) > 0) { if (omap.count(OptionKeyChannelConfig) > 0)
std::map<std::string, ptree> channelProperties; {
auto tokens = omap[OptionKeyChannelConfig].as<std::vector<std::string>>(); std::map<std::string, ptree> channelProperties;
for (auto token : tokens) { auto tokens = omap[OptionKeyChannelConfig].as<std::vector<std::string>>();
std::map<std::string, ptree>::iterator channelProperty = channelProperties.end(); for (auto token : tokens)
ptree socketProperty; {
std::string channelName; // std::map<std::string, ptree>::iterator channelProperty = channelProperties.end();
std::string argString(token); ptree socketProperty;
char* subopts = &argString[0]; std::string channelName;
char* value = nullptr; std::string argString(token);
while (subopts && *subopts != 0 && *subopts != ' ') { char* subopts = &argString[0];
char* saved = subopts; char* value = nullptr;
int subopt=getsubopt(&subopts, (char**)channelOptionKeys, &value); while (subopts && *subopts != 0 && *subopts != ' ')
if (subopt == NAME) { {
channelName = value; // char* saved = subopts;
channelProperties[channelName].put("name", channelName); int subopt=getsubopt(&subopts, (char**)channelOptionKeys, &value);
} else if (subopt == NAME)
if (subopt>=0 && value != nullptr) { {
socketProperty.put(channelOptionKeys[subopt], value); channelName = value;
channelProperties[channelName].put("name", channelName);
}
else if (subopt>=0 && value != nullptr)
{
socketProperty.put(channelOptionKeys[subopt], value);
}
}
if (channelName != "")
{
channelProperties[channelName].add_child("sockets.socket", socketProperty);
}
else
{
// TODO: what is the error policy here, should we abort?
LOG(ERROR) << "missing channel name in argument of option --channel-config";
}
}
for (auto channelProperty : channelProperties)
{
pt.add_child(nodeKey + ".channel", channelProperty.second);
} }
}
if (channelName != "") {
channelProperties[channelName].add_child("sockets.socket", socketProperty);
} else {
// TODO: what is the error policy here, should we abort?
LOG(ERROR) << "missing channel name in argument of option --channel-config";
}
} }
for (auto channelProperty : channelProperties) {
pt.add_child(nodeKey + ".channel", channelProperty.second);
}
}
return ptreeToMQMap(pt, deviceId, rootNode); return ptreeToMQMap(pt, deviceId, rootNode);
} }
} // namespace FairMQMap } // namespace FairMQParser

View File

@ -345,7 +345,7 @@ void Monitor::Cleanup(const string& segmentName)
{ {
cout << "Region counter found: " << rc->fCount << endl; cout << "Region counter found: " << rc->fCount << endl;
unsigned int regionCount = rc->fCount; unsigned int regionCount = rc->fCount;
for (int i = 1; i <= regionCount; ++i) for (unsigned int i = 1; i <= regionCount; ++i)
{ {
RemoveObject("fairmq_shmem_region_" + to_string(regionCount)); RemoveObject("fairmq_shmem_region_" + to_string(regionCount));
} }
@ -403,7 +403,7 @@ void Monitor::PrintQueues()
{ {
cout << "found " << queues->size() << " queue(s):" << endl; cout << "found " << queues->size() << " queue(s):" << endl;
for (int i = 0; i < queues->size(); ++i) for (unsigned int i = 0; i < queues->size(); ++i)
{ {
string name(queues->at(i).c_str()); string name(queues->at(i).c_str());
cout << '\t' << name << " : "; cout << '\t' << name << " : ";

View File

@ -149,5 +149,3 @@ add_custom_target(FairMQTests
DEPENDS DEPENDS
${ALL_TEST_TARGETS} ${ALL_TEST_TARGETS}
) )

View File

@ -41,6 +41,8 @@ class DummyPlugin : public fair::mq::Plugin
case DeviceState::Exiting: case DeviceState::Exiting:
UnsubscribeFromDeviceStateChange(); UnsubscribeFromDeviceStateChange();
break; break;
default:
break;
} }
} }
); );

View File

@ -41,9 +41,9 @@ TEST(Plugin, Operators)
FairMQProgOptions config{}; FairMQProgOptions config{};
auto device = make_shared<FairMQDevice>(); auto device = make_shared<FairMQDevice>();
PluginServices services{&config, device}; PluginServices services{&config, device};
auto p1 = Plugin{"dds", {1, 0, 0}, "Foo Bar <foo.bar@test.net>", "https://git.test.net/dds.git", &services}; Plugin p1{"dds", {1, 0, 0}, "Foo Bar <foo.bar@test.net>", "https://git.test.net/dds.git", &services};
auto p2 = Plugin{"dds", {1, 0, 0}, "Foo Bar <foo.bar@test.net>", "https://git.test.net/dds.git", &services}; Plugin p2{"dds", {1, 0, 0}, "Foo Bar <foo.bar@test.net>", "https://git.test.net/dds.git", &services};
auto p3 = Plugin{"file", {1, 0, 0}, "Foo Bar <foo.bar@test.net>", "https://git.test.net/file.git", &services}; Plugin p3{"file", {1, 0, 0}, "Foo Bar <foo.bar@test.net>", "https://git.test.net/file.git", &services};
EXPECT_EQ(p1, p2); EXPECT_EQ(p1, p2);
EXPECT_NE(p1, p3); EXPECT_NE(p1, p3);
control(device); control(device);
@ -54,7 +54,7 @@ TEST(Plugin, OstreamOperators)
FairMQProgOptions config{}; FairMQProgOptions config{};
auto device = make_shared<FairMQDevice>(); auto device = make_shared<FairMQDevice>();
PluginServices services{&config, device}; PluginServices services{&config, device};
auto p1 = Plugin{"dds", {1, 0, 0}, "Foo Bar <foo.bar@test.net>", "https://git.test.net/dds.git", &services}; Plugin p1{"dds", {1, 0, 0}, "Foo Bar <foo.bar@test.net>", "https://git.test.net/dds.git", &services};
stringstream ss; stringstream ss;
ss << p1; ss << p1;
EXPECT_EQ(ss.str(), string{"'dds', version '1.0.0', maintainer 'Foo Bar <foo.bar@test.net>', homepage 'https://git.test.net/dds.git'"}); EXPECT_EQ(ss.str(), string{"'dds', version '1.0.0', maintainer 'Foo Bar <foo.bar@test.net>', homepage 'https://git.test.net/dds.git'"});

View File

@ -59,7 +59,7 @@ TEST(PluginManager, LoadPluginDynamic)
// program options // program options
auto count = 0; auto count = 0;
mgr.ForEachPluginProgOptions([&count](const options_description& d){ ++count; }); mgr.ForEachPluginProgOptions([&count](const options_description& /*d*/){ ++count; });
ASSERT_EQ(count, 1); ASSERT_EQ(count, 1);
control(device); control(device);

View File

@ -22,7 +22,7 @@
// template function that takes any device // template function that takes any device
// and runs a simple MQ state machine configured from a JSON file and/or a plugin. // and runs a simple MQ state machine configured from a JSON file and/or a plugin.
template<typename TMQDevice> template<typename TMQDevice>
inline int runStateMachine(TMQDevice& device, FairMQProgOptions& cfg) int runStateMachine(TMQDevice& device, FairMQProgOptions& cfg)
{ {
std::string config = cfg.GetValue<std::string>("config"); std::string config = cfg.GetValue<std::string>("config");
std::string control = cfg.GetValue<std::string>("control"); std::string control = cfg.GetValue<std::string>("control");

View File

@ -50,7 +50,7 @@ FairMQMessageZMQ::FairMQMessageZMQ(void* data, const size_t size, fairmq_free_fn
} }
} }
FairMQMessageZMQ::FairMQMessageZMQ(FairMQRegionPtr& region, void* data, const size_t size) FairMQMessageZMQ::FairMQMessageZMQ(FairMQRegionPtr& /*region*/, void* data, const size_t size)
: fMessage() : fMessage()
{ {
// FIXME: make this zero-copy: // FIXME: make this zero-copy: