27 lines
481 B
C++
27 lines
481 B
C++
|
#ifndef fk_NATIVEFUNCTION_HPP
|
||
|
#define fk_NATIVEFUNCTION_HPP
|
||
|
|
||
|
#include "commons.hpp"
|
||
|
#include "Constant.hpp"
|
||
|
|
||
|
namespace fk
|
||
|
{
|
||
|
using native_t = std::function
|
||
|
<std::shared_ptr<Constant>(std::vector<std::shared_ptr<Constant>>)>;
|
||
|
|
||
|
class NativeFunction
|
||
|
{
|
||
|
public:
|
||
|
explicit NativeFunction(native_t native);
|
||
|
virtual ~NativeFunction();
|
||
|
|
||
|
std::shared_ptr<Constant>
|
||
|
call(std::vector<std::shared_ptr<Constant>> args);
|
||
|
|
||
|
private:
|
||
|
native_t m_native;
|
||
|
};
|
||
|
}
|
||
|
|
||
|
#endif
|