Overview

The CfgMgr is used to manage configuration parameters in the system and save the parameters in YAML format. The CfgMgr works with the interfaces for setting, obtaining, listening, snapshotting, and reloading parameters to improve parameter management efficiency.

  • Saving Parameters in a YAML File

    If a large number of stable parameters are involved in the system, YAML files are used to save the parameters for unified maintenance. When the configuration management system is started for the first time, all YAML files are loaded. If a YAML file is changed, the CfgMgr::Reload interface must be invoked to reload the new YAML file.

  • Managing Parameters Through Interfaces
    • To obtain parameter values in the YAML file, invoke the CfgMgr::Get interface.
    • To modify parameter values in the YAML file, invoke the CfgMgr::Set interface.
    • To monitor whether a specified parameter value changes, invoke the CfgMgr::Monitor interface. To cancel the monitoring, invoke the CfgMgr::CancelMonitor interface.
    • To create a parameter snapshot, invoke the CfgMgr::CreateSnapshot interface. To restore a snapshot, invoke the CfgMgr::RevertSnapshot interface. To delete a snapshot, invoke the CfgMgr::DeleteSnapshot interface.