![]() |
VR-Forces Developer's Guide
|
Builds JSON parameter spec arrays for non-scripted VRF tasks and sets by walking a DtReaderWriterRegistry. Each DtReaderWriter entry is mapped to a parameter descriptor using the parameter types defined in ObjectCommandMessages.md.
RW types that have no clean JSON wire representation (TaitBryan, AggregateState, ForceType, Resource, KeyValueList, and any unknown type) are emitted with "Supported":false so the client can surface an appropriate warning without crashing.
Usage: DtRwCommandSpecBuilder builder; Json::Value params = builder.buildParamsForTaskType("move-to"); if (!params.isNull()) { ... }
Public Member Functions | |
| DtRwCommandSpecBuilder () | |
| ~DtRwCommandSpecBuilder ()=default | |
| Json::Value | buildParamsForTaskType (const std::string &taskType) const |
| Json::Value | buildParamsForSetType (const std::string &setType) const |
| Json::Value | buildParamsFromRegistry (const DtReaderWriterRegistry ®) const |
| std::vector< std::string > | allRegisteredTaskTypes () const |
| std::vector< std::string > | allRegisteredSetTypes () const |
Static Public Member Functions | |
| static std::string | displayNameFromTypeString (const std::string &typeString) |
Private Types | |
| using | RwParamBuilder = std::function< bool(const DtReaderWriter *, Json::Value &)> |
Private Member Functions | |
| Json::Value | buildParamFromRw (const DtReaderWriter *rw) const |
| void | registerParamBuilders () |
Static Private Member Functions | |
| static bool | buildFloatParam (const DtReaderWriter *rw, Json::Value ¶m, const std::string &unit, const std::string &unitCategory) |
| static bool | buildIntegerParam (const DtReaderWriter *rw, Json::Value ¶m, const std::string &unit, const std::string &unitCategory) |
| static bool | buildSimpleParam (const DtReaderWriter *rw, Json::Value ¶m, const std::string &typeName) |
| static bool | buildUnsupportedParam (const DtReaderWriter *rw, Json::Value ¶m) |
Private Attributes | |
| std::unordered_map < std::string, RwParamBuilder > | myParamBuilders |
| RwParamBuilder | myDefaultBuilder |
| std::unordered_set< std::string > | myIgnoredParamNames |
|
private |
| DtRwCommandSpecBuilder::DtRwCommandSpecBuilder | ( | ) |
|
default |
| Json::Value DtRwCommandSpecBuilder::buildParamsForTaskType | ( | const std::string & | taskType | ) | const |
Normalises taskType (same variants as DtJsonTaskSetBuilder::findValidTaskType), instantiates the task temporarily, and returns a JSON array of parameter descriptors from its registry. Returns a null Json::Value if the task type is unknown.
| Json::Value DtRwCommandSpecBuilder::buildParamsForSetType | ( | const std::string & | setType | ) | const |
Same as buildParamsForTaskType but for DtSetDataRequest types. Returns a null Json::Value if the set type is unknown.
| Json::Value DtRwCommandSpecBuilder::buildParamsFromRegistry | ( | const DtReaderWriterRegistry & | reg | ) | const |
Low-level: iterates all entries in reg and returns a JSON array of parameter descriptors. Never returns null (may return an empty array).
| std::vector<std::string> DtRwCommandSpecBuilder::allRegisteredTaskTypes | ( | ) | const |
Returns the canonical type strings for all non-scripted tasks registered in DtSimTask::factory() at the time of the call.
| std::vector<std::string> DtRwCommandSpecBuilder::allRegisteredSetTypes | ( | ) | const |
Returns the canonical type strings for all non-scripted set-data requests registered in DtSetDataRequest::factory() at the time of the call.
|
static |
Converts a raw factory type string (e.g. "move-to-task") into a human-readable display name (e.g. "Move To") by stripping the trailing "-task" or "-set" suffix and applying title-case word splitting.
|
private |
|
private |
|
staticprivate |
|
staticprivate |
|
staticprivate |
|
staticprivate |
|
private |
|
private |
|
private |
Parameter names that should never appear in a built command spec.