How sysrepo/sysrepo-cpp works
Main Components
• The core library components: these are represented by the header and source files for the key classes such as Connection, Session, Subscription, and support utilities (Enum, exception, utils). They represent the fundamental building blocks of the C++ binding.
• The underlying dependencies: note that this library wraps around the original sysrepo library and depends on libyang-cpp for YANG model processing.
• The build and integration sectors: you have the CMake configuration (cmake/ folder, CMakeLists.txt) and test components (tests/ folder) which show how the project is compiled and validated.
• Example usage: provided in the examples/ folder to illustrate how clients might use the binding to interact with sysrepo.
File Structure and Its Implications
• The top-level project structure (“include”, “src”, “tests”, “examples”) suggests a fairly standard layout for a C++ library.
• The include/sysrepo-cpp directory (with its headers) and the corresponding source files in src/ indicate how the binding’s functionality is split across multiple modules. For example, the file Connection.hpp and Connection.cpp work together to encapsulate connection management.
• The presence of cmake configuration files along with Doxygen and clang-format, etc., highlights an emphasis on proper build configuration and documentation – though these are more toolchain features than core architecture.
Relationships and Design Principles
• That the sysrepo-cpp library abstracts direct interaction with sysrepo and that it uses RAII for automatic memory management.
• That multiple instances of a Session can share underlying state, as explained in the README (i.e., multiple sessions possibly coming from a single Connection).