/** \file
 *
 *  Contains the MissionAPI class definition.
 *
 *  Copyright (c) 2007,2008,2009 MBARI
 *  MBARI Proprietary Information.  All Rights Reserved
 *
 */

/** \defgroup missionScript Mission Scripts
 *
 * Provides interfaces (MissionAPI and ScriptNode) and classes to
 * allow missions to be specified in a variety of syntaxes -- as long
 * as they implement the MissionAPI and ScriptNode interfaces.
 */

#ifndef MISSIONAPI_H_
#define MISSIONAPI_H_

#include "logger/Logger.h"
#include "missionScript/MissionAPIRegistry.h"
#include "utils/Str.h"

class MissionNode;

/** \ingroup missionScript
 *
 *  Abstract base class for mission scripts.
 *  Intended to allow missions to be scripted in a variety of formats.
 *
 */
class MissionAPI
{
public:

    /// Destructor
    virtual ~MissionAPI() {};

    /// Load the mission with the indicated filename
    /// In case of error, log message with indicated severity and return NULL
    virtual MissionNode* loadMissionFile( const char* filename, Logger& logger,
                                          Syslog::Severity severity ) = 0;

protected:

    /// Protected constructor for abstract base class;
    MissionAPI( const char* name, const char* extension )
    {
        MissionAPIRegistry::Register( name, extension, this );
    };

private:

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

};

#endif /* MISSIONAPI_H_ */
