![]() |
VR-Forces Developer's Guide
|
Base class for MIL-STD-2525D JSON registry loaders.
Provides shared helpers for opening and parsing JSON files, reading and validating the "version" field, and checking required fields. Derived classes implement registryName() and their own load() method.

Public Member Functions | |
| DtMilStdJsonRegistryBase () | |
| virtual | ~DtMilStdJsonRegistryBase () |
| bool | isLoaded () const |
| virtual const char * | registryName () const =0 |
| DtMilStdJsonRegistryBase (const DtMilStdJsonRegistryBase &)=delete | |
| DtMilStdJsonRegistryBase (const DtMilStdJsonRegistryBase &&)=delete | |
| DtMilStdJsonRegistryBase & | operator= (const DtMilStdJsonRegistryBase &)=delete |
| DtMilStdJsonRegistryBase & | operator= (const DtMilStdJsonRegistryBase &&)=delete |
Public Member Functions inherited from makVrv::DtVirtualBaseClass | |
| DtVirtualBaseClass () | |
| virtual | ~DtVirtualBaseClass () |
Protected Member Functions | |
| virtual bool | openAndParse (const std::string &filePath, rapidjson::Document &doc) const |
| virtual bool | setAndValidateVersions (const rapidjson::Document &doc, const std::string &filePath) |
| virtual bool | requireField (const rapidjson::Value &obj, const char *fieldName, const std::string &context) const |
| virtual bool | validateStructure (const rapidjson::Document &doc, const std::string &filePath, int version) const |
Protected Attributes | |
| int | myVersion |
| int | myMaxVersion |
| bool | myLoaded |
| makVrv::DtMilStdJsonRegistryBase::DtMilStdJsonRegistryBase | ( | ) |
|
virtual |
|
delete |
Not allowed.
|
delete |
Not allowed.
|
delete |
Not allowed.
|
delete |
Not allowed.
|
inline |
Returns true after a successful load().
true if load() completed successfully; false otherwise.
|
pure virtual |
Return the class name used in warning messages.
Implemented in makVrv::DtMilStdJsonRegistry, makVrv::DtMilStdSvgOverrideRegistry, and makVrv::DtTypeToSidcJsonRegistry.
|
protectedvirtual |
Open filePath and parse it into doc.
Emits DtWarn on file-open failure or JSON parse error.
| filePath | Absolute or relative path to the JSON file to open. |
| doc | Document object to populate with the parsed JSON content. |
true on success; false otherwise.
|
protectedvirtual |
Read and validate the "version" field from doc.
|
protectedvirtual |
Return false and emit DtWarn when obj does not contain fieldName.
| obj | JSON object to inspect. |
| fieldName | Name of the required field. |
| context | Human-readable location string for the error message, e.g. "symbolSets.mappings[2]". |
true if obj contains fieldName; false otherwise.
|
protectedvirtual |
Validate the structural layout of a parsed JSON document.
Called from each registry's load() after the version has been verified. The base implementation returns true unconditionally. Derived classes override this method to check registry-specific required fields and types. Overrides should call the base version first and propagate failure:
| doc | Parsed JSON document to validate. |
| filePath | Path to the source file, used in warning messages. |
| version | Version integer read from the file; passed for use in version-conditional structural checks. |
true when the document structure is acceptable; false otherwise. Reimplemented in makVrv::DtMilStdSvgOverrideRegistry, and makVrv::DtTypeToSidcJsonRegistry.
|
protected |
Version number read from the JSON file. Set by derived-class load() implementations.
|
protected |
Maximum version supported by this registry. Set by derived-class load() implementations.
|
protected |
True after a successful load(). Set by derived-class load() implementations.