| 106 | }; |
| 107 | |
| 108 | class CustomFunction |
| 109 | { |
| 110 | public: |
| 111 | inline CustomFunction(std::string const & name, std::vector<CustomFunctionParam> params) |
| 112 | : name_(name), params_(params) |
| 113 | {} |
| 114 | |
| 115 | inline std::string Name() const |
| 116 | { |
| 117 | return name_; |
| 118 | } |
| 119 | |
| 120 | inline std::vector<CustomFunctionParam> const & Params() const |
| 121 | { |
| 122 | return params_; |
| 123 | } |
| 124 | |
| 125 | inline FunctionHandle Handle() const |
| 126 | { |
| 127 | return handle_; |
| 128 | } |
| 129 | |
| 130 | inline FunctionNameAndArity NameAndArity() const |
| 131 | { |
| 132 | return { name_, (unsigned)params_.size() }; |
| 133 | } |
| 134 | |
| 135 | inline void AssignHandle(FunctionHandle handle) |
| 136 | { |
| 137 | handle_ = handle; |
| 138 | } |
| 139 | |
| 140 | bool ValidateArgs(OsiArgumentDesc const & params) const; |
| 141 | void GenerateHeader(std::stringstream & ss) const; |
| 142 | |
| 143 | private: |
| 144 | std::string name_; |
| 145 | std::vector<CustomFunctionParam> params_; |
| 146 | FunctionHandle handle_; |
| 147 | |
| 148 | bool ValidateParam(CustomFunctionParam const & param, OsiArgumentValue const & value) const; |
| 149 | }; |
| 150 | |
| 151 | class CustomCall : public CustomFunction |
| 152 | { |
nothing calls this directly
no outgoing calls
no test coverage detected