| 185 | }; |
| 186 | |
| 187 | class CustomFunctionManager |
| 188 | { |
| 189 | public: |
| 190 | // Arbitrary ID for custom extension functions |
| 191 | static constexpr uint32_t CallClassId = 1337; |
| 192 | static constexpr uint32_t QueryClassId = 1338; |
| 193 | static constexpr uint32_t EventClassId = 1339; |
| 194 | |
| 195 | FunctionHandle Register(std::unique_ptr<CustomCall> call); |
| 196 | FunctionHandle Register(std::unique_ptr<CustomQuery> qry); |
| 197 | FunctionHandle Register(std::unique_ptr<CustomEvent> event); |
| 198 | CustomFunction * Find(FunctionNameAndArity const & signature); |
| 199 | |
| 200 | bool Call(FunctionHandle handle, OsiArgumentDesc const & params); |
| 201 | bool Query(FunctionHandle handle, OsiArgumentDesc & params); |
| 202 | |
| 203 | std::string GenerateHeaders() const; |
| 204 | |
| 205 | private: |
| 206 | std::unordered_map<FunctionNameAndArity, CustomFunction *> signatures_; |
| 207 | std::vector<std::unique_ptr<CustomCall>> calls_; |
| 208 | std::vector<std::unique_ptr<CustomQuery>> queries_; |
| 209 | std::vector<std::unique_ptr<CustomEvent>> events_; |
| 210 | |
| 211 | void RegisterSignature(CustomFunction * func); |
| 212 | }; |
| 213 | |
| 214 | struct OsiSymbolInfo |
| 215 | { |
nothing calls this directly
no outgoing calls
no test coverage detected