![]() |
VR-Forces Developer's Guide
|
DtWebServerSettings — process-wide singleton for runtime web server settings.
Settings are loaded from the JSON config file once by calling initialize() from main() before any other threads start. After that, all parts of the application can read settings via getInstance() without any synchronization overhead.
Usage: // Startup (main.cxx): DtWebServerSettings::getInstance().initialize(configFilePath);
// Anywhere else: int port = DtWebServerSettings::getInstance().port;
Public Member Functions | |
| void | initialize (const std::string &configFilePath) |
Static Public Member Functions | |
| static DtWebServerSettings & | getInstance () |
Public Attributes | |
| std::string | address |
| int | port |
| int | threads |
| bool | accessControlEnabled |
| std::string | usersFilePath |
| std::string | roleDefsDir |
| std::string | roleAssignmentsDir |
| std::string | scenarioClassificationLevel |
| bool | autoSubscribeResources |
| bool | autoEnableSpotReports |
| int | numNetworkThreads |
Private Member Functions | |
| DtWebServerSettings () | |
|
private |
|
static |
Returns the process-wide singleton instance.
Referenced by DtAuthHelpers::requirePermission(), and DtAuthHelpers::requireValidSession().
| void DtWebServerSettings::initialize | ( | const std::string & | configFilePath | ) |
Load settings from the given JSON config file path. Falls back to compiled-in defaults if the file cannot be opened or parsed. Must be called exactly once from main() before any background threads start.
| std::string DtWebServerSettings::address |
| int DtWebServerSettings::port |
| int DtWebServerSettings::threads |
| bool DtWebServerSettings::accessControlEnabled |
When true (default), all /api/* requests require a valid Bearer session key. Set to false to disable authentication entirely (useful for development).
| std::string DtWebServerSettings::usersFilePath |
Path to the JSON file containing the list of users and their permissions. Defaults to DtServerConfig::SETTINGS_DIR / DtServerConfig::DEFAULT_USERS_FILENAME.
| std::string DtWebServerSettings::roleDefsDir |
Directory containing role definition JSON files (one file per named definition). Defaults to DtServerConfig::DEFAULT_ROLE_DEFS_DIR.
| std::string DtWebServerSettings::roleAssignmentsDir |
Directory containing saved role assignment JSON files (one file per named set). Defaults to DtServerConfig::DEFAULT_ROLE_ASSIGNMENTS_DIR.
| std::string DtWebServerSettings::scenarioClassificationLevel |
Classification level string included in every ScenarioStatus message. Defaults to DtServerConfig::DEFAULT_SCENARIO_CLASSIFICATION_LEVEL.
| bool DtWebServerSettings::autoSubscribeResources |
When true, the server automatically calls startMonitoring for every entity and aggregate discovered in the simulation, so that VRF sends periodic resource updates. Defaults to false (resources are not sent unless the client or another subsystem explicitly subscribes).
| bool DtWebServerSettings::autoEnableSpotReports |
When true, the server automatically sends DtSetSpotReportingRequestEnableToGuiIfOff to entities whose force or UUID appears in a role's contactsFromForce or contactsFromUUID perspective fields. This enables spot reporting to the front-end for entities that do not already have it enabled, without disturbing entities that are already reporting. Defaults to false.
| int DtWebServerSettings::numNetworkThreads |