TnxConsole namespace

Typedefs

using CommandFn = void(*)(void*context, std::span<const std::string_view> args)
args: the words after the command's name. Text in double quotes is one word.

Functions

void Register(std::string_view name, std::string_view args, std::string_view help, CommandFn run, void* context = nullptr)
void RegisterVariable(std::string_view name, std::atomic<uint32_t>& value, std::string_view help)
Add a variable. The atomic must outlive its registration.
void RegisterVariable(std::string_view name, std::atomic<int32_t>& value, std::string_view help)
void RegisterVariable(std::string_view name, std::atomic<float>& value, std::string_view help)
void RegisterVariable(std::string_view name, std::atomic<bool>& value, std::string_view help)
void Unregister(std::string_view name)
auto IsRegistered(std::string_view name) -> bool
void Submit(std::string_view line)
Queue line to be run by the next Pump. Any thread.
auto Pump() -> uint32_t
Run what was queued. Sentinel, once per main loop iteration. Returns how many lines ran.
auto Execute(std::string_view line) -> bool
Run line now, on this thread. False if it names nothing that is registered (which is logged).
void ForEach(std::string_view prefix, VisitFn visit, void* context)