+#ifndef SCD_CONT_FSM_H
+#define SCD_CONT_FSM_H
+
+#include <string>
+
+/* forward declaration */
+class scd_cont_state;
+
+
+/**
+ * FSM base class. Holds the current and the history state and allows
+ * state transitions. Transitions are logged in debug loglevel.
+ */
+class scd_cont_fsm
+{
+
+public:
+ /**
+ * Constructor.
+ * \param name the name of the state machine
+ */
+ scd_cont_fsm(const std::string& name): _name(name) {}
+
+ virtual ~scd_cont_fsm() {}
+
+ /**
+ * Sets a new state. This is a state transition.
+ */
+ void set_state(scd_cont_state& state);
+
+ /**
+ * Saves the current state as the history state. This is not a state
+ * transition.
+ */
+ void save_state();
+
+ /**
+ * Saves a specified state as the history state. This is not a state
+ * transition.
+ */
+ void save_state(scd_cont_state& state);
+
+ /**
+ * Restores the saved history state. This is a state transition.
+ */
+ void load_state();
+
+protected:
+ scd_cont_state* _state;
+ scd_cont_state* _hist_state;
+ std::string _name;
+};
+
+#endif