mirror of
https://github.com/FairRootGroup/FairMQ.git
synced 2025-10-12 16:21:13 +00:00
Apply cppcoreguidelines-avoid-non-const-global-variables
This commit is contained in:
parent
1ee9d2d222
commit
cf9b45cd75
|
@ -115,7 +115,7 @@ class PluginManager
|
|||
|
||||
static const std::string fgkLibPrefix;
|
||||
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::unique_ptr<PluginServices> fPluginServices;
|
||||
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:
|
||||
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
|
||||
{
|
||||
|
||||
array<string, 16> stateNames =
|
||||
const array<string, 16> stateNames =
|
||||
{
|
||||
{
|
||||
"UNDEFINED",
|
||||
|
@ -38,7 +38,7 @@ array<string, 16> stateNames =
|
|||
}
|
||||
};
|
||||
|
||||
unordered_map<string, State> states =
|
||||
const unordered_map<string, State> states =
|
||||
{
|
||||
{ "UNDEFINED", State::Undefined },
|
||||
{ "OK", State::Ok },
|
||||
|
@ -58,7 +58,7 @@ unordered_map<string, State> states =
|
|||
{ "EXITING", State::Exiting }
|
||||
};
|
||||
|
||||
array<string, 12> transitionNames =
|
||||
const array<string, 12> transitionNames =
|
||||
{
|
||||
{
|
||||
"AUTO",
|
||||
|
@ -76,7 +76,7 @@ array<string, 12> transitionNames =
|
|||
}
|
||||
};
|
||||
|
||||
unordered_map<string, Transition> transitions =
|
||||
const unordered_map<string, Transition> transitions =
|
||||
{
|
||||
{ "AUTO", Transition::Auto },
|
||||
{ "INIT DEVICE", Transition::InitDevice },
|
||||
|
|
|
@ -31,21 +31,21 @@ struct TransportError : std::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},
|
||||
{"zeromq", Transport::ZMQ},
|
||||
{"shmem", Transport::SHM},
|
||||
{"ofi", Transport::OFI}
|
||||
};
|
||||
|
||||
static std::unordered_map<Transport, std::string> TransportNames{
|
||||
static const std::unordered_map<Transport, std::string> TransportNames{
|
||||
{Transport::DEFAULT, "default"},
|
||||
{Transport::ZMQ, "zeromq"},
|
||||
{Transport::SHM, "shmem"},
|
||||
{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)
|
||||
try {
|
||||
|
|
|
@ -43,7 +43,7 @@ namespace bipc = ::boost::interprocess;
|
|||
|
||||
namespace
|
||||
{
|
||||
volatile sig_atomic_t gSignalStatus = 0;
|
||||
volatile sig_atomic_t gSignalStatus = 0; // NOLINT(cppcoreguidelines-avoid-non-const-global-variables)
|
||||
}
|
||||
|
||||
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>
|
||||
int InstanceLimiter<Tag, Max>::fCount(0);
|
||||
int InstanceLimiter<Tag, Max>::fCount(0); // NOLINT(cppcoreguidelines-avoid-non-const-global-variables)
|
||||
|
||||
} // namespace fair::mq::tools
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user