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

#ifndef WAIT_H_
#define WAIT_H_

#include "component/Behavior.h"
#include "data/Location.h"

/**
 *  Contains the Wait Command
 *
 *  Is not satisfied until the specified wait duration
 *  has passed.
 *
 *  Wait.h should only be included by Wait.cpp
 *  Other classes should include WaitIF.h
 *
 *  \ingroup modules_guidance
 */
class Wait : public Behavior
{
public:

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

    virtual ~Wait();

    /// Initialize function
    void initialize( void );

    /// The actual "payload" of the component
    void run();

    /// Runs and returns false if not in capure radius
    /// Otherwise returns true
    bool runIfUnsatisfied();

    /// Returns true when vehicle has "arrived"
    /// within the captureRadius of the waypoint
    bool isSatisfied();

    /// Uninit function
    void uninitialize( void );

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

protected:

    /// return true if the waiting time is over
    bool calcSatisfied( );

    // Time at which to stop waiting
    Timestamp endTime_;

    float durationSeconds_;

    // Slate input setting variables

    /// duration setting
    SettingReader *durationSettingReader_;

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

};

#endif /*WAIT_H_*/
