/** \file
 *
 *  Contains the Execute class declaration.
 *
 *  Execute.h should only be included by Execute.cpp
 *  Other classes should include ExecuteIF.h
 *
 *  Copyright (c) 2007,2008,2009 MBARI
 *  MBARI Proprietary Information.  All Rights Reserved
 */

#ifndef EXECUTE_H_
#define EXECUTE_H_

#include "component/Behavior.h"

/**
 *  Contains the Execute Command. Causes the indicated
 *  command to be executed as if it were on the
 *  tethys command line.
 *
 *  \todo add timing options, etc. to meet requirements:
 *  \ref req_timing_dataAsync and \ref req_timing_dataLoop
 *
 *  Execute.h should only be included by Execute.cpp
 *  Other classes should include ExecuteIF.h
 *
 *  \ingroup modules_guidance
 */
class Execute : public Behavior
{
public:

    Execute( const Str& prefix, const Module* module );

    virtual ~Execute();

    /// Initialize function
    void initialize( void );

    /// Just do the run: ignore the results of the satisfied
    void run();

    /// Just do the satisfied: return true if envelope "satisfied"
    bool isSatisfied();

    /// Do the run, and return true if envelope "satisfied"
    bool runIfUnsatisfied();

    /// Called when the mission component becomes preempted.
    void preempted();

    /// Uninit function
    void uninitialize( void );

    /// Mission Component factory interface
    static Behavior* CreateBehavior( const Str& prefix, const Module* module );

protected:

    // Slate input setting variables
    SettingReader *commandSettingReader_;

    Str commandSetting_;

    // Ensures it is only run once per initialization
    bool satisfied_;

private:
    // Note that the copy constructor below is private and not given a body.
    // Any attempt to call it will return a compiler error.
    Execute( const Execute& old ); // disallow copy constructor

};

#endif /*EXECUTE_H_*/
