#ifndef _COMMAND_H_
#define _COMMAND_H_

#include "../tobject.h"

#include <string>
#include <vector>

using namespace std;

/**
 * \brief Class representing module-specific command definition.
 * 
 * \date 01-29-2006
 *
 * \author Ondrej Svejdar.
 *
 * \todo 
 *
 * \bug 
 *
 */
class Command:public TObject
{
private:
	string name;
	string desc;
	int minArity;
	int maxArity;
public:
	static const char* type;
	const char* getType() const;

	/**
	 * \brief ctor
	 * \param name name of command 
	 * \param desc desctiption
	 * \param minArity minimal arity
	 * \param maxArity maximal arity
	 */
	Command(const string& name,const string& desc,int minArity,int maxArity);

	/**
	 * \brief ctor
	 * \param name name of command 
	 * \param desc desctiption
	 * \param arity exact arity
	 */
	Command(const string& name,const string& desc,int arity=0);

	inline bool operator==(const Command& cmd) const
	{
		return name==cmd.name;
	}

	inline bool isArityValid(int arity)
	{
		return (arity>=minArity&&arity<=maxArity);
	}

	inline const string& getName() const
	{
		return name;
	}
};

#endif/*_COMMAND_H_*/
