Enable guard support
Signed-off-by: Zane Shelley <zshelle@us.ibm.com>
Change-Id: I7bc6c0cdd3aa6d513f1a87d351b99069fc005339
diff --git a/analyzer/callout.hpp b/analyzer/callout.hpp
index b49f97b..8c54793 100644
--- a/analyzer/callout.hpp
+++ b/analyzer/callout.hpp
@@ -181,6 +181,48 @@
inline const ClockType ClockType::OSC_REF_CLOCK_0{"OSC_REF_CLOCK_0"};
inline const ClockType ClockType::OSC_REF_CLOCK_1{"OSC_REF_CLOCK_1"};
+/** @brief Container class for guard service actions. */
+class GuardType
+{
+ public:
+ /** Do not guard. */
+ static const GuardType NONE;
+
+ /** Guard on fatal error (cannot recover resource). */
+ static const GuardType UNRECOVERABLE;
+
+ /** Guard on non-fatal error (can recover resource). */
+ static const GuardType PREDICTIVE;
+
+ private:
+ /**
+ * @brief Constructor from components.
+ * @param i_string The string representation of the procedure used for
+ * callouts.
+ */
+ explicit GuardType(const std::string& i_string) : iv_string(i_string) {}
+
+ private:
+ /** The string representation of the procedure used for callouts. */
+ const std::string iv_string;
+
+ public:
+ bool operator==(const GuardType& r) const
+ {
+ return this->iv_string == r.iv_string;
+ }
+
+ /** iv_string accessor */
+ std::string getString() const
+ {
+ return iv_string;
+ }
+};
+
+inline const GuardType GuardType::NONE{"GARD_NULL"};
+inline const GuardType GuardType::UNRECOVERABLE{"GARD_Unrecoverable"};
+inline const GuardType GuardType::PREDICTIVE{"GARD_Predictive"};
+
} // namespace callout
} // namespace analyzer