C++ API to access, manage and store electronic device topologies.
A topology is a set of electronic components that are connected together, the API expects to receive any topology as JSON file as one of the examples here.
ℹ️ Note: every device in the topology must have a unique id relative to the devices of its type, the same is for the topologies, so please check for any repeated id's.
this is not applied on the nodes, as many devices can be attached to the same node.
-
Read and write topologies to and from disk.
-
Stores multiple topologies in memory.
-
Execute operations on topologies.
-
readJSON: read a topology from a given JSON file and store it in the memory.
-
writeJSON: write a given topology from the memory to a JSON file.
-
queryTopologies: query about which topologies are currently in the memory.
-
deleteTopology: delete a given topology from memory.
-
queryDevices: query about which devices are in a given topology.
-
queryDevicesWithNetlistNode: query about which devices are connected to a given netlist node in a given topology.
you can use the API as shared library in your code and including only API.h file.
This project uses Make building tool and use CMake to control the software compilation and testing processes and generating Make build files.
after cloning the repo
git clone https://github.com/MustafaAmer-1/Topology-API.git
create clean building directory
mkdir build
cd build
cmake ..
# compile
make
the testing project with it's source code has been added to the root CMakeList.txt file as subdirectory, so building the library will build it's test codes as well.
this project uses catch2 a unit testing framework for C++.
the testing source code is placed in TestAPI directory alongside with catch2 single-include header file.
⚠️ All of the tests use the json files located in json_examples directory, to run the tests correctly you need to replace the macro defined in every test file named JSON_EXAMPLES_PATH with the absolute or relative path of the json file relative to the tests executable files.
This project has been analysed with cppcheck static code analysis tool and has reported NO ERROR nor warning.