You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
74 lines
2.3 KiB
74 lines
2.3 KiB
|
|
#ifndef DFTELEMENTSTATE_H
|
|
#define DFTELEMENTSTATE_H
|
|
|
|
#include <cassert>
|
|
|
|
namespace storm {
|
|
namespace storage {
|
|
enum class DFTElementState {Operational = 0, Failed = 2, Failsafe = 1, DontCare = 3};
|
|
|
|
inline std::ostream& operator<<(std::ostream& os, DFTElementState st) {
|
|
switch(st) {
|
|
case DFTElementState::Operational:
|
|
return os << "Operational";
|
|
case DFTElementState::Failed:
|
|
return os << "Failed";
|
|
case DFTElementState::Failsafe:
|
|
return os << "Failsafe";
|
|
case DFTElementState::DontCare:
|
|
return os << "Don't Care";
|
|
}
|
|
assert(false);
|
|
}
|
|
|
|
inline char toChar(DFTElementState st) {
|
|
switch(st) {
|
|
case DFTElementState::Operational:
|
|
return 'O';
|
|
case DFTElementState::Failed:
|
|
return 'F';
|
|
case DFTElementState::Failsafe:
|
|
return 'S';
|
|
case DFTElementState::DontCare:
|
|
return '-';
|
|
}
|
|
assert(false);
|
|
}
|
|
|
|
enum class DFTDependencyState {Passive = 0, Unsuccessful = 1, Successful = 2, DontCare = 3};
|
|
|
|
inline std::ostream& operator<<(std::ostream& os, DFTDependencyState st) {
|
|
switch(st) {
|
|
case DFTDependencyState::Passive:
|
|
return os << "Passive";
|
|
case DFTDependencyState::Successful:
|
|
return os << "Successful";
|
|
case DFTDependencyState::Unsuccessful:
|
|
return os << "Unsuccessful";
|
|
case DFTDependencyState::DontCare:
|
|
return os << "Don't Care";
|
|
}
|
|
assert(false);
|
|
}
|
|
|
|
inline char toChar(DFTDependencyState st) {
|
|
switch(st) {
|
|
case DFTDependencyState::Passive:
|
|
return 'P';
|
|
case DFTDependencyState::Successful:
|
|
return 'S';
|
|
case DFTDependencyState::Unsuccessful:
|
|
return 'U';
|
|
case DFTDependencyState::DontCare:
|
|
return '-';
|
|
}
|
|
assert(false);
|
|
}
|
|
|
|
}
|
|
}
|
|
|
|
|
|
#endif /* DFTELEMENTSTATE_H */
|
|
|