mirror of
https://github.com/FairRootGroup/FairMQ.git
synced 2025-10-15 17:41:45 +00:00
Add helpers for AggregatedTopologyState
This commit is contained in:
committed by
Dennis Klein
parent
3eca8e9def
commit
b5545c1575
@@ -105,12 +105,30 @@ inline auto operator==(AggregatedTopologyState lhs, DeviceState rhs) -> bool
|
||||
inline std::ostream& operator<<(std::ostream& os, const AggregatedTopologyState& state)
|
||||
{
|
||||
if (state == AggregatedTopologyState::Mixed) {
|
||||
return os << "Mixed";
|
||||
return os << "MIXED";
|
||||
} else {
|
||||
return os << static_cast<DeviceState>(state);
|
||||
}
|
||||
}
|
||||
|
||||
inline std::string GetAggregatedTopologyStateName(AggregatedTopologyState s)
|
||||
{
|
||||
if (s == AggregatedTopologyState::Mixed) {
|
||||
return "MIXED";
|
||||
} else {
|
||||
return GetStateName(static_cast<State>(s));
|
||||
}
|
||||
}
|
||||
|
||||
inline AggregatedTopologyState GetAggregatedTopologyState(const std::string& state)
|
||||
{
|
||||
if (state == "MIXED") {
|
||||
return AggregatedTopologyState::Mixed;
|
||||
} else {
|
||||
return static_cast<AggregatedTopologyState>(GetState(state));
|
||||
}
|
||||
}
|
||||
|
||||
struct DeviceStatus
|
||||
{
|
||||
bool subscribed_to_state_changes;
|
||||
|
Reference in New Issue
Block a user