VoltMod
C++23 framework for CS2 server plugins
Loading...
Searching...
No Matches
VoltMod::Args Namespace Reference

The argument types a command handler's parameter list is written in. More...

Classes

struct  Duration
 
struct  Int
 
struct  Opt
 
struct  PlayerOrSteamId
 
struct  Rest
 
struct  SteamId
 
struct  Target
 
struct  Targets
 
struct  U64
 
struct  Word
 

Typedefs

using All = std::tuple< Target, Targets, Duration, SteamId, PlayerOrSteamId, Int, U64, Word, Rest >
 

Detailed Description

The argument types a command handler's parameter list is written in.

A handler's signature is its argument spec: Run([](Caller c, Args::Target t, Args::Duration d) { ... }) declares two arguments, in that order, and the framework parses, validates and binds them before the handler runs.

The one nested namespace of types in the framework, because Target, Int, Word and Rest are far too generic to carry at VoltMod:: scope, and they appear nowhere but in a handler's parameter list.

Each type names its own ArgKind, which is all the framework needs to know about it: there is no separate trait table to keep in step.

Typedef Documentation

◆ All

Every argument type, in ArgKind order. The one list: BoundArg takes its alternatives from it, and the static_assert below checks it against the enum.

Definition at line 155 of file Args.hpp.