|
AntHocNet 2.0.0
Paper-faithful ant-colony ad hoc routing: the shared core and its adapters
|
Functions | |
| std::string | registeredNames () |
| Every registered name, comma-separated — for diagnostics and for the adapters' "valid values" help text (child #144). | |
| const ILinkMetric * | find (const std::string &name) |
Look up name; returns nullptr when it is not registered. | |
| const ILinkMetric & | get (const std::string &name) |
Look up name, or throw std::invalid_argument naming the offending value and the registered alternatives. | |
Variables | |
| constexpr char | kClassic [] = "classic" |
| Registry name of the canonical AntHocNet metric (Eq.2, ClassicMetric). | |
| std::string anthocnet::core::metrics::registeredNames | ( | ) |
Every registered name, comma-separated — for diagnostics and for the adapters' "valid values" help text (child #144).
| const ILinkMetric * anthocnet::core::metrics::find | ( | const std::string & | name | ) |
Look up name; returns nullptr when it is not registered.
The non-throwing probe, for callers that prefer to raise the failure with their own simulator's fatal-error mechanism. It never substitutes ClassicMetric for an unknown name. Note that forwarding a nullptr on to AntRouterLogic would silently mean "classic", so the null case must be handled here, not passed along.
| const ILinkMetric & anthocnet::core::metrics::get | ( | const std::string & | name | ) |
Look up name, or throw std::invalid_argument naming the offending value and the registered alternatives.
Use this on configuration paths that must not proceed on a typo.
The rest of the core is exception-free by convention (the codec reports malformed input with a bool because it runs per packet on untrusted bytes). This is one-shot configuration, not a hot path, and it must be impossible to ignore — hence the throw.
|
constexpr |
Registry name of the canonical AntHocNet metric (Eq.2, ClassicMetric).
This is the protocol default; the name is part of the adapter-facing configuration surface, so it is stable.
Definition at line 51 of file link_metric_registry.h.