FunctionInfo.hh 1.7 KB
/*
 * FunctionInfo.hh
 *
 *  Created on: Mar 19, 2019
 *      Author: AKKA
 */

#ifndef FUNCTIONINFO_HH_
#define FUNCTIONINFO_HH_

#include <iostream>
#include <map>
#include <boost/shared_ptr.hpp>
#include <vector>
#include <utility>

namespace AMDA {
namespace parser {

/**
 * @class FunctionInfo
 * @brief Information about a function.
 * @details
 */
class FunctionInfo {
public:
	FunctionInfo () :
		_ihmName(""),
		_kernelName(""),
		_nbArgs(1),
		_hasPrompt(false)
	{}

	friend std::ostream& operator<<(std::ostream& out_, const FunctionInfo& info);

	/*
	 * @brief Get function name for IHM
	 */
	const std::string& getIHMName() const {
		return _ihmName;
	}

	/*
	 * @brief Set function name for IHM
	 */
	void setIHMName(const std::string& ihmName) {
		_ihmName = ihmName;
	}

	/*
	 * @brief Get function name for kernel
	 */
	const std::string& getKernelName() const {
		return _kernelName;
	}

	/*
	 * @brief Set function name for kernel
	 */
	void setKernelName(const std::string& kernelName) {
		_kernelName = kernelName;
	}

	/*
	 * @brief Get nb arguments of the function
	 */
	int getNbArgs() const {
		return _nbArgs;
	}

	/*
	 * @brief Set nb arguments of the function
	 */
	void setNbArgs(int nbArgs) {
		_nbArgs = nbArgs;
	}

	/*
	 * @brief Get if function has a prompted argument
	 */
	bool hasPromptedArg() {
		return _hasPrompt;
	}

	/*
	 * @brief Set if function has a prompted argument
	 */
	void setHasPromptedArg(bool hasPrompt) {
		_hasPrompt = hasPrompt;
	}

protected:
	std::string _ihmName;
	std::string _kernelName;
	int         _nbArgs;
	bool        _hasPrompt;
};

typedef std::map<std::string,FunctionInfo> FunctionInfoMap;

} /* namespace parser */
} /* namespace AMDA */


#endif /* FUNCTIONINFO_HH_ */