Generating transport code for development in C++
The CMake
commands add_nk_idl(), add_nk_cdl() and add_nk_edl() are used to generate transport proxy objects and stubs using the nkppmeta
compiler when building a solution.
add_nk_idl()
This command is declared in the file /opt/KasperskyOS-Community-Edition-<version>/toolchain/share/cmake/Modules/platform/nk2.cmake
.
This command creates a CMake
target for generating a *.idl.cpp.h
header file for a defined IDL file using the nkppmeta
compiler. The command also creates a library containing the transport code for the defined interface. To link to this library, use the bind_nk_targets()
command.
The generated header files contain a C++ representation for the interface and data types described in the IDL file, and the methods required for use of proxy objects and stubs.
Parameters:
NAME
— name of theCMake
target. Required parameter.IDL_FILE
— path to the IDL file. Required parameter.NK_MODULE
– parameter in which you need to specify the package name, excluding the name of the IDL file. For example, if the package name in the IDL description is defined askl.core.NameServer
, thekl.core
value must be passed in theNK_MODULE
parameter.LANG
– parameter in which you need to specify theCXX
value.
Example call:
add_nk_cdl()
This command is declared in the file /opt/KasperskyOS-Community-Edition-<version>/toolchain/share/cmake/Modules/platform/nk2.cmake
.
This command creates a CMake
target for generating a *.cdl.cpp.h
file for a defined CDL file using the nkppmeta
compiler. The command also creates a library containing the transport code for the defined component. To link to this library, use the bind_nk_targets()
command.
The *.cdl.cpp.h
file contains the tree of embedded components and endpoints provided by the component described in the CDL file.
Parameters:
NAME
— name of theCMake
target. Required parameter.CDL_FILE
— path to the CDL file. Required parameter.NK_MODULE
– parameter in which you need to specify the component name, excluding the name of the CDL file. For example, if the component name in the CDL description is defined askl.core.NameServer
, thekl.core
value must be passed in theNK_MODULE
parameter.LANG
– parameter in which you need to specify theCXX
value.
Example call:
add_nk_edl()
This command is declared in the file /opt/KasperskyOS-Community-Edition-<version>/toolchain/share/cmake/Modules/platform/nk2.cmake
.
This command creates a CMake
target for generating a *.edl.cpp.h
file for a defined EDL file using the nkppmeta
compiler. The command also creates a library containing the transport code for the server or client program. To link to this library, use the bind_nk_targets()
command.
The *.edl.cpp.h
file contains the tree of embedded components and endpoints provided by the process class described in the EDL file.
Parameters:
NAME
— name of theCMake
target. Required parameter.EDL_FILE
— path to the EDL file. Required parameter.NK_MODULE
– parameter in which you need to specify the name of the process class, excluding the name of the EDL file. For example, if the process class name in the EDL description is defined askl.core.NameServer
, thekl.core
value must be passed in theNK_MODULE
parameter.LANG
– parameter in which you need to specify theCXX
value.
Example call: