//-------------------------------------------------------------------------------------------------
// <copyright file="LWOpenLuaInternalCmd.h" company="LiquidRobotics">
//  Copyright (c) Liquid Robotics Corporation, confidential and proprietary.  All rights reserved. 
// </copyright>
//
// <summary>
//	Declarations for  LWOpenLuaInternalCmd, a delegate class that carries a command
//	create a new lua instance and is queued up on the lua instance specific thread.
//	When it runs, it calls back to the controller to complete instance creation.
// </summary>
//
// <owner>Mike Cookson</owner>
//-------------------------------------------------------------------------------------------------

#ifndef __LWOpenLuaInternalCmd_h__
#define __LWOpenLuaInternalCmd_h__

#include "LWConcreteCmd.h"

namespace LiquidRobotics {

namespace SMACFramework {
	class CmdLineParser;
	class Logger;
}

namespace LuaWrapper {

class SHARED_LIB_PUBLIC LWOpenLuaInternalCmd : public LWConcreteCmd
{
public:

	typedef LWConcreteCmd::CmdBasePtr CmdPtr;
	typedef LiquidRobotics::SMACFramework::Logger Logger;
	typedef LWControllerBase0::ParsingContext ParsingContext;

	LWOpenLuaInternalCmd(TCon& _ctrl, const string& _cmd, const string& _instanceName, const string& _fileName, int _traceOpt = 0);
	virtual ~LWOpenLuaInternalCmd();

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

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

private:

	LWControllerBase0& ctrl;
	string cmd;
	string instanceName;
	string fileName;
	string cmdResponse;
	const int traceOpt;
};

}
}

#endif
