C++ SDK for Windows
To utilize the AAPM CPP SDK, it is essential to employ the libraries (DLL/libs) and headers (include) located within the installation directories under "libs/cpp." For seamless integration and utilization of the Windows CPP SDK, leveraging a build manager such as CMAKE (version 3.10 and above) is highly recommended. Notably, the Kron AAPM SDK does not include gRPC protocol libraries. However, developers can install gRPC packages onto their computers as outlined in the documentation available at https://grpc.io/docs/languages/cpp/, utilizing package managers like CMAKE and vcpkg.
Upon completion of the installation process, you will observe that the package list indicates the successful installation of the grpc and protobuf packages.
When packages are installed, developers can create a new application, such as the SampleCMakeApplication, as an example. To achieve this, they should create a new project folder organize the DLLs and libraries from "libs\cpp" into one directory, and include it in a folder with the same name.
This structure should be set up as follows:
In the directory 'aapm-test/cpp', you can create a 'CMakeLists.txt' file with the following command:
The developer can create SampleApplication.cpp and its corresponding header file in this folder as follows:
The project is now ready for compilation using the CMake command. Below, the GUI interface is utilized to select the appropriate folder and compiler. Additionally, it is essential to click on the "Specify Toolchain..." button, especially for packages installed with vcpkg, as the toolchain needs to be added accordingly.
Upon navigating to the directory selected as "Where to build the binaries" in the CMake GUI, it becomes apparent that the Visual Studio project is ready for use. The .sln file can be opened with Visual Studio.
The project incorporating the AAPM C++ SDK is now ready for deployment. The only remaining task is to build the project. Under the Debug folder of our sample project, the file SampleCMakeApplication.exe has been generated. Upon double-clicking this executable, certain DLL errors may arise because dynamic libraries such as protobuf and openssl are not available under the Debug folder. (These DLLs are included in the installation package under libs\cpp.) To create a folder containing the executable and other necessary DLLs, follow the steps below. When the executable is launched from this folder by double-clicking, the output will be as follows.
In the AAPM C++ SDK, as with other SDKs, if communication with the AAPM Agent fails, it will attempt to establish a direct connection to the Kron PAM address provided as a parameter in the httpAddress method. This approach enables direct access in cases where communication with the Agent encounters issues.