VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Member Functions | Protected Member Functions | Protected Attributes
makVrv::DtMilStdJsonRegistryBase Class Referenceabstract

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.

Inheritance diagram for makVrv::DtMilStdJsonRegistryBase:
Inheritance graph
[legend]

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
 

Constructor & Destructor Documentation

makVrv::DtMilStdJsonRegistryBase::DtMilStdJsonRegistryBase ( )
virtual makVrv::DtMilStdJsonRegistryBase::~DtMilStdJsonRegistryBase ( )
virtual
makVrv::DtMilStdJsonRegistryBase::DtMilStdJsonRegistryBase ( const DtMilStdJsonRegistryBase &  )
delete

Not allowed.

makVrv::DtMilStdJsonRegistryBase::DtMilStdJsonRegistryBase ( const DtMilStdJsonRegistryBase &&  )
delete

Not allowed.

Member Function Documentation

DtMilStdJsonRegistryBase& makVrv::DtMilStdJsonRegistryBase::operator= ( const DtMilStdJsonRegistryBase &  )
delete

Not allowed.

DtMilStdJsonRegistryBase& makVrv::DtMilStdJsonRegistryBase::operator= ( const DtMilStdJsonRegistryBase &&  )
delete

Not allowed.

bool makVrv::DtMilStdJsonRegistryBase::isLoaded ( ) const
inline

Returns true after a successful load().

Returns
true if load() completed successfully; false otherwise.
virtual const char* makVrv::DtMilStdJsonRegistryBase::registryName ( ) const
pure virtual

Return the class name used in warning messages.

Returns
A stable, null-terminated literal string identifying the registry.
Note
Derived classes must return a stable string literal (e.g. a class-name string constant). The returned pointer is used directly in warning messages and must remain valid for the lifetime of the object.

Implemented in makVrv::DtMilStdJsonRegistry, makVrv::DtMilStdSvgOverrideRegistry, and makVrv::DtTypeToSidcJsonRegistry.

virtual bool makVrv::DtMilStdJsonRegistryBase::openAndParse ( const std::string &  filePath,
rapidjson::Document &  doc 
) const
protectedvirtual

Open filePath and parse it into doc.

Emits DtWarn on file-open failure or JSON parse error.

Parameters
filePathAbsolute or relative path to the JSON file to open.
docDocument object to populate with the parsed JSON content.
Returns
true on success; false otherwise.
virtual bool makVrv::DtMilStdJsonRegistryBase::setAndValidateVersions ( const rapidjson::Document &  doc,
const std::string &  filePath 
)
protectedvirtual

Read and validate the "version" field from doc.

virtual bool makVrv::DtMilStdJsonRegistryBase::requireField ( const rapidjson::Value &  obj,
const char *  fieldName,
const std::string &  context 
) const
protectedvirtual

Return false and emit DtWarn when obj does not contain fieldName.

Parameters
objJSON object to inspect.
fieldNameName of the required field.
contextHuman-readable location string for the error message, e.g. "symbolSets.mappings[2]".
Returns
true if obj contains fieldName; false otherwise.
virtual bool makVrv::DtMilStdJsonRegistryBase::validateStructure ( const rapidjson::Document &  doc,
const std::string &  filePath,
int  version 
) const
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:

return false;
Parameters
docParsed JSON document to validate.
filePathPath to the source file, used in warning messages.
versionVersion integer read from the file; passed for use in version-conditional structural checks.
Returns
true when the document structure is acceptable; false otherwise.

Reimplemented in makVrv::DtMilStdSvgOverrideRegistry, and makVrv::DtTypeToSidcJsonRegistry.

Member Data Documentation

int makVrv::DtMilStdJsonRegistryBase::myVersion
protected

Version number read from the JSON file. Set by derived-class load() implementations.

int makVrv::DtMilStdJsonRegistryBase::myMaxVersion
protected

Maximum version supported by this registry. Set by derived-class load() implementations.

bool makVrv::DtMilStdJsonRegistryBase::myLoaded
protected

True after a successful load(). Set by derived-class load() implementations.


The documentation for this class was generated from the following file:

Document ID: Generated on Thu Oct 15 21:27:02 EDT 2026 from SVN revision 296421
Copyright © 2005-2026 MAK Technologies. All Rights Reserved (www.mak.com)