fakir/src/NativeFunction.hpp

33 lines
621 B
C++

#ifndef fk_NATIVEFUNCTION_HPP
#define fk_NATIVEFUNCTION_HPP
#include "commons.hpp"
#include "Constant.hpp"
namespace fk
{
class Module;
using native_t = std::function
<std::shared_ptr<Constant>(Loc,
Module&,
std::vector<std::shared_ptr<Constant>>)>;
class NativeFunction
{
public:
explicit NativeFunction(native_t native);
virtual ~NativeFunction();
std::shared_ptr<Constant>
call(Loc const& loc,
Module& mod,
std::vector<std::shared_ptr<Constant>> args);
private:
native_t m_native;
};
}
#endif