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

Internal to the –api dispatcher: what a per-domain translation unit needs to add entries to the table that api_invoke consults. More...

#include <cstdint>
#include <functional>
#include <map>
#include <string>
#include <type_traits>
#include <vector>
#include "line/api/qsys/qsys_res.h"
#include "line/reg/api_dispatch.h"
#include "line/reg/api_json.h"
Include dependency graph for api_dispatch_detail.h:

Go to the source code of this file.

Classes

struct  line::reg::NeedsTranscendental< Op >
 Wrap an Op whose registry entry lists Double and Real but NOT Exact. More...
struct  line::reg::DoubleOnly< Op >
 Wrap an Op whose registry entry lists Double ONLY. More...

Namespaces

namespace  line
 Conservation laws of a layered queueing network, enumerated from its structure.
namespace  line::reg

Macros

#define LINE_API_GROUP(g)

Typedefs

using line::reg::Invoker = std::function<Json(const ArithSpec&, Args&)>
using line::reg::DispatchTable = std::map<std::string, Invoker>
using line::reg::LibraryOnlyTable = std::map<std::string, std::string>
 name -> why the function has no named-JSON-argument form.

Functions

template<class Op>
Json line::reg::run_at (const ArithSpec &s, Args &a)
 Run an operation at the selected arithmetic.
std::uint64_t line::reg::required_seed (Args &a, const std::string &fn, const char *spelled="seed")
 The seed of a function whose port draws from a caller-owned generator.
template<class T>
Json line::reg::encode_qsys_res (const qsys::QsysResT< T > &r)
 MATLAB's res struct of the exact queueing-system functions: one key per measure, in the reference's field order, scalars as scalars and row vectors as lists, plus analyzer.
qsys::QsysResOptions line::reg::read_qsys_res_options (Args &a, bool with_nmax=true)
 The 'tPoints', 'percentiles' and 'nmax' options those functions share.
template<class Op>
Invoker line::reg::make ()
const std::vector< void(*)(DispatchTable &)> & line::reg::api_dispatch_registrars ()
const std::vector< void(*)(LibraryOnlyTable &)> & line::reg::api_library_only_registrars ()

Detailed Description

Internal to the –api dispatcher: what a per-domain translation unit needs to add entries to the table that api_invoke consults.

The table is split across translation units (api_dispatch.cpp plus one api_dispatch_<group>.cpp per family of domains) because every entry instantiates its algorithm at five arithmetics, and one file carrying all of them is both the slowest object in the build and a file no two changes can touch at once.

REGISTRATION IS EXPLICIT, NOT BY STATIC INITIALIZER. line_mp_api is a static archive, and a translation unit whose only reference is a self-registering global is exactly what the linker drops from one: the table would come up short with nothing to say so. Each group therefore exports two named functions, listed in api_dispatch_registrars() and api_library_only_registrars() below, and the link fails loudly if one is missing.

Definition in file api_dispatch_detail.h.

Macro Definition Documentation

◆ LINE_API_GROUP

#define LINE_API_GROUP ( g)
Value:
void register_api_##g(DispatchTable& t); \
void register_library_only_##g(LibraryOnlyTable& t);

Definition at line 164 of file api_dispatch_detail.h.