Mads
Multi-Agent Distributed System
Loading...
Searching...
No Matches
director_config.hpp File Reference
#include <chrono>
#include <cstdint>
#include <filesystem>
#include <optional>
#include <string>
#include <vector>

Go to the source code of this file.

Classes

struct  Mads::ReadySpec
 A parsed, validated ready = "..." value. More...
 
struct  Mads::ProcessConfig
 One process instance, after scale expansion and template substitution. This is what mads up actually starts: one ProcessConfig per launched OS process. More...
 
struct  Mads::DirectorConfig
 A fully parsed, validated, expanded director.toml. processes is already in a valid topological start order (every entry's after names appear earlier in the vector), so mads up can just iterate it in order. More...
 
struct  Mads::DirectorLoadOptions
 Caller-supplied overrides applied while the file is expanded. More...
 

Namespaces

namespace  Mads
 

Enumerations

enum class  Mads::ReadyKind { Mads::Broker , Mads::Port , Mads::Log , Mads::Delay }
 Discriminates the four ready = "..." probe kinds. More...
 

Functions

std::optional< std::chrono::milliseconds > Mads::parse_duration (const std::string &text)
 Parses a duration string like "500ms", "2s", "1.5s", "3m" into a std::chrono::milliseconds value. A bare number (no unit) is interpreted as seconds. Returns std::nullopt on malformed input (empty string, non-numeric magnitude, unknown unit, or a negative value).
 
std::optional< ReadySpecMads::parse_ready_spec (const std::string &value, std::string *out_error)
 Parses a raw ready string into a ReadySpec. Exposed standalone (rather than only reachable through load_director_config()) so it has its own focused unit tests.
 
std::optional< DirectorConfigMads::load_director_config (const std::string &path, std::string *out_error, std::vector< std::string > *out_warnings=nullptr, const DirectorLoadOptions &options={})
 Loads, validates, expands and orders a director.toml file.
 

Variables

constexpr const char * Mads::kDefaultBrokerProbeUri = "tcp://localhost:9092"
 Default broker settings URI probed by a bare ready = "broker".