LINE Solver (C++)
Templated C++ port of the LINE queueing solver
Loading...
Searching...
No Matches
api_dispatch.h File Reference

Direct invocation of a single API function from named JSON arguments. More...

#include <string>
#include <vector>
#include "line/reg/api_json.h"
#include "line/reg/registry.h"
Include dependency graph for api_dispatch.h:

Go to the source code of this file.

Classes

struct  line::reg::ArithSpec
 The arithmetic a call runs at: Real also carries the precision tier. More...

Namespaces

namespace  line
namespace  line::reg

Functions

ArithSpec line::reg::parse_arith (const std::string &text)
 Parse –arith.
std::vector< std::string > line::reg::api_exposed_functions ()
 Names exposed over this boundary, sorted; a subset of the registry.
bool line::reg::api_is_exposed (const std::string &name)
 True when the named function has a dispatch entry.
Json line::reg::api_invoke (const std::string &name, const std::string &arith, const Json &args)
 Invoke one API function.
std::string line::reg::api_render_readable (const Json &result)
 Human-readable rendering of the object api_invoke returns, for -o readable.

Detailed Description

Direct invocation of a single API function from named JSON arguments.

This is the entry point behind the CLI's –api flag and the one a pybind11 or MEX gateway should call, so that all hosts share one dispatch table and one conversion policy (include/line/reg/api_json.h).

Three refusals, all explicit and all by name, because the port is incremental and a caller must never be able to mistake "not wired" for a result:

  • a name absent from the registry is not ported to C++ at all;
  • a name in the registry but not in the dispatch table is ported and tested but not yet exposed over this boundary;
  • an arithmetic the registry does not list for that function is refused naming the modes it does list. No path returns an empty result, a zero, or a value from a different arithmetic than the caller asked for.

Definition in file api_dispatch.h.