/**
 * @file
 * @ingroup <<<GROUP>>>
 * @brief   <<<BRIEF>>>
 *
 *          This code is Autogenerated from '<<<PYIFGENNAME>>>' with the MIT License.
 *          As such, please only hand-code within 'USER' tags.
 *
 * @author  <<<AUTHOR>>>
 */
#pragma once
#include "I<<<STATEMACHINENAME>>>Controller.h"
#include <boost/thread.hpp>

/// {{{USER_HEADER_INCLUDES}}}
/// {{{USER_HEADER_INCLUDES}}}

/// {{{USER_FORWARD_DECLARATIONS}}}
/// {{{USER_FORWARD_DECLARATIONS}}}

namespace <<<NAMESPACE>>>
{
    /// {{{USER_LOCALS}}}
    /// {{{USER_LOCALS}}}

    CGEN_DECL_CLASS_PTR(I<<<STATEMACHINENAME>>>StateMachine);
    class <<<DLL_EXPORT>>> I<<<STATEMACHINENAME>>>StateMachine
    {
    public:
        static I<<<STATEMACHINENAME>>>StateMachine_ptr Create(const I<<<STATEMACHINENAME>>>Controller_ptr& controller, const bool& run_ctrlr_async = false);
        virtual ~I<<<STATEMACHINENAME>>>StateMachine(){};

        // Flag check
        <<<PER_STATE_BEGIN>>>
        virtual bool Is<<<STATENAME>>>() const = 0;
        <<<PER_STATE_END>>>

        // Event triggering
        <<<PER_EVENT_BEGIN>>>
        virtual void Trigger<<<EVENTNAME>>>(<<<SIGNATURE>>>) = 0;
        <<<PER_EVENT_END>>>

        /// {{{USER_PUBLIC_MEMBERS}}}
        /// {{{USER_PUBLIC_MEMBERS}}}

        // For threaded SM's.
        virtual void Interrupt() = 0;
        virtual bool IsThisThread(const boost::thread::id& thread_id) = 0;

    protected:
        I<<<STATEMACHINENAME>>>StateMachine(){};
        I<<<STATEMACHINENAME>>>Controller_wptr m_controller;

        bool m_is_asynchronous;

        /// {{{USER_PROTECTED_MEMBERS}}}
        /// {{{USER_PROTECTED_MEMBERS}}}
    };
}