mirror of
https://github.com/FairRootGroup/FairMQ.git
synced 2025-10-13 16:46:47 +00:00
Apply cppcoreguidelines-avoid-non-const-global-variables
This commit is contained in:
parent
d4437dbf74
commit
9db2d200a3
|
@ -115,7 +115,7 @@ class PluginManager
|
||||||
|
|
||||||
static const std::string fgkLibPrefix;
|
static const std::string fgkLibPrefix;
|
||||||
std::vector<boost::filesystem::path> fSearchPaths;
|
std::vector<boost::filesystem::path> fSearchPaths;
|
||||||
static std::vector<boost::dll::shared_library> fgDLLKeepAlive;
|
static std::vector<boost::dll::shared_library> fgDLLKeepAlive; // NOLINT(cppcoreguidelines-avoid-non-const-global-variables)
|
||||||
std::map<std::string, std::function<PluginFactory>> fPluginFactories;
|
std::map<std::string, std::function<PluginFactory>> fPluginFactories;
|
||||||
std::unique_ptr<PluginServices> fPluginServices;
|
std::unique_ptr<PluginServices> fPluginServices;
|
||||||
std::map<std::string, std::unique_ptr<Plugin>> fPlugins;
|
std::map<std::string, std::unique_ptr<Plugin>> fPlugins;
|
||||||
|
|
|
@ -65,9 +65,9 @@ class PropertyHelper
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static std::unordered_map<std::type_index, void(*)(const fair::mq::EventManager&, const std::string&, const Property&)> fEventEmitters;
|
static std::unordered_map<std::type_index, void(*)(const fair::mq::EventManager&, const std::string&, const Property&)> fEventEmitters; // NOLINT(cppcoreguidelines-avoid-non-const-global-variables)
|
||||||
private:
|
private:
|
||||||
static std::unordered_map<std::type_index, std::function<std::pair<std::string, std::string>(const Property&)>> fTypeInfos;
|
static std::unordered_map<std::type_index, std::function<std::pair<std::string, std::string>(const Property&)>> fTypeInfos; // NOLINT(cppcoreguidelines-avoid-non-const-global-variables)
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,7 +16,7 @@ using namespace std;
|
||||||
namespace fair::mq
|
namespace fair::mq
|
||||||
{
|
{
|
||||||
|
|
||||||
array<string, 16> stateNames =
|
const array<string, 16> stateNames =
|
||||||
{
|
{
|
||||||
{
|
{
|
||||||
"UNDEFINED",
|
"UNDEFINED",
|
||||||
|
@ -38,7 +38,7 @@ array<string, 16> stateNames =
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
unordered_map<string, State> states =
|
const unordered_map<string, State> states =
|
||||||
{
|
{
|
||||||
{ "UNDEFINED", State::Undefined },
|
{ "UNDEFINED", State::Undefined },
|
||||||
{ "OK", State::Ok },
|
{ "OK", State::Ok },
|
||||||
|
@ -58,7 +58,7 @@ unordered_map<string, State> states =
|
||||||
{ "EXITING", State::Exiting }
|
{ "EXITING", State::Exiting }
|
||||||
};
|
};
|
||||||
|
|
||||||
array<string, 12> transitionNames =
|
const array<string, 12> transitionNames =
|
||||||
{
|
{
|
||||||
{
|
{
|
||||||
"AUTO",
|
"AUTO",
|
||||||
|
@ -76,7 +76,7 @@ array<string, 12> transitionNames =
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
unordered_map<string, Transition> transitions =
|
const unordered_map<string, Transition> transitions =
|
||||||
{
|
{
|
||||||
{ "AUTO", Transition::Auto },
|
{ "AUTO", Transition::Auto },
|
||||||
{ "INIT DEVICE", Transition::InitDevice },
|
{ "INIT DEVICE", Transition::InitDevice },
|
||||||
|
|
|
@ -31,21 +31,21 @@ struct TransportError : std::runtime_error
|
||||||
using std::runtime_error::runtime_error;
|
using std::runtime_error::runtime_error;
|
||||||
};
|
};
|
||||||
|
|
||||||
static std::unordered_map<std::string, Transport> TransportTypes{
|
static const std::unordered_map<std::string, Transport> TransportTypes{
|
||||||
{"default", Transport::DEFAULT},
|
{"default", Transport::DEFAULT},
|
||||||
{"zeromq", Transport::ZMQ},
|
{"zeromq", Transport::ZMQ},
|
||||||
{"shmem", Transport::SHM},
|
{"shmem", Transport::SHM},
|
||||||
{"ofi", Transport::OFI}
|
{"ofi", Transport::OFI}
|
||||||
};
|
};
|
||||||
|
|
||||||
static std::unordered_map<Transport, std::string> TransportNames{
|
static const std::unordered_map<Transport, std::string> TransportNames{
|
||||||
{Transport::DEFAULT, "default"},
|
{Transport::DEFAULT, "default"},
|
||||||
{Transport::ZMQ, "zeromq"},
|
{Transport::ZMQ, "zeromq"},
|
||||||
{Transport::SHM, "shmem"},
|
{Transport::SHM, "shmem"},
|
||||||
{Transport::OFI, "ofi"}
|
{Transport::OFI, "ofi"}
|
||||||
};
|
};
|
||||||
|
|
||||||
inline std::string TransportName(Transport transport) { return TransportNames[transport]; }
|
inline std::string TransportName(Transport transport) { return TransportNames.at(transport); }
|
||||||
|
|
||||||
inline Transport TransportType(const std::string& transport)
|
inline Transport TransportType(const std::string& transport)
|
||||||
try {
|
try {
|
||||||
|
|
|
@ -43,7 +43,7 @@ namespace bipc = ::boost::interprocess;
|
||||||
|
|
||||||
namespace
|
namespace
|
||||||
{
|
{
|
||||||
volatile sig_atomic_t gSignalStatus = 0;
|
volatile sig_atomic_t gSignalStatus = 0; // NOLINT(cppcoreguidelines-avoid-non-const-global-variables)
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace fair::mq::shmem
|
namespace fair::mq::shmem
|
||||||
|
|
|
@ -43,11 +43,11 @@ struct InstanceLimiter
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static int fCount;
|
static int fCount; // NOLINT(cppcoreguidelines-avoid-non-const-global-variables)
|
||||||
};
|
};
|
||||||
|
|
||||||
template<typename Tag, int Max>
|
template<typename Tag, int Max>
|
||||||
int InstanceLimiter<Tag, Max>::fCount(0);
|
int InstanceLimiter<Tag, Max>::fCount(0); // NOLINT(cppcoreguidelines-avoid-non-const-global-variables)
|
||||||
|
|
||||||
} // namespace fair::mq::tools
|
} // namespace fair::mq::tools
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user