MNX Document Model
Loading...
Searching...
No Matches
MNX Document Model

Welcome to the MNX Document Model.

Use the navigation buttons at the top of this page to browse through the framework documentation.

The MNX Document Model is a C++ class framework around the MNX music interchange format, which uses JSON files. It requires the C++17 standard or higher. (It is currently tested with C++23.)

Features include:

  • Implemented with an underlying nlohmann JSON document. No class-level serializing to/from JSON is required.
  • Lightweight class definitions contain only the shared JSON document and a json_pointer to the object. (See mnx::Base.)
  • Validation routines for both the MNX JSON schema and semantic validation.

Member functions for each MNX entity are defined using macros that create the boilerplate for the definitions. For example, MNX_REQUIRED_PROPERTY creates a getter (equal to the property name) and a setter (set_ followed by the property name). The boilerplate macros are defined in BaseTypes.h and have extensive documentation in the comments.

A key feature of this DOM is that MNX-required children and properties must be supplied when an object is constructed from scratch. They can be subsequently changed if need be. Many classes have Initializer types to facilitate passing all the required data for a child object.

Warning
Avoid using references for instances returned by the methods in this library. Because classes are so lightweight, all methods return temporary copies. Using a reference on a temporary is undefined behavior.
Author
Robert Patterson