//-------------------------------------------------------------------------------------------------
// <copyright file="LWForwardLocationInternalCmd.h" company="LiquidRobotics">
//  Copyright (c) Liquid Robotics Corporation, confidential and proprietary.  All rights reserved. 
// </copyright>
//
// <summary>
//	Declarations for LWForwardLocationInternalCmd, a delegate class that carries
//	GPS data that was just received and is queued up on the lua instance specific
//	thread.  When it runs, it forwards the data to the script on the SMCReportLocation
//	method.
// </summary>
//
// <owner>Mike Cookson</owner>
//-------------------------------------------------------------------------------------------------

#ifndef __LWForwardLocationInternalCmd_h__
#define __LWForwardLocationInternalCmd_h__

#include "LWConcreteCmd.h"

namespace LiquidRobotics {

namespace SMACFramework {
	class ByteArray;
	class LuaInstance;
}

namespace LuaWrapper {

class SHARED_LIB_PUBLIC LWForwardLocationInternalCmd : public LWConcreteCmd
{
public:

	typedef LiquidRobotics::SMACFramework::ByteArray ByteArray;
	typedef LWConcreteCmd::CmdBasePtr CmdPtr;
	typedef LiquidRobotics::SMACFramework::LuaInstance LuaInstance;

	LWForwardLocationInternalCmd(TCon& _ctrl, const string& _cmd, const string& _instanceName, double _lat, double _lon);
	virtual ~LWForwardLocationInternalCmd();

	// this method is called by the background thread to execute the command
	virtual void Execute();

	// get the output of the command
	virtual string GetResult();

	// determines if the instance wants fowarded GPS info
	static bool InstanceWantsGPSForwarding(LuaInstance& L);

private:

	LWControllerBase0& ctrl;
	const string cmd;
	const string instanceName;
	const double lat;
	const double lon;
};

}
}

#endif
