You need
- CMake version at least 3.10.x in linux
- C++17 compiler
- spdlog
- boost
There are two ways to build this project.
For .e.g in unix os
mkdir build
cd build
cmake ..
make #The output executable files are in the fold named bin
make install
# First, pull a laster image. docker pull simplepan/dawn_dev
# Second, you have to attach to the container
cd {your directory stored repository}
mkdir build && cd build
cmake ..
make
make install
We provide a sudo
permission account DAWN
. Password is 123456
.
cd Docker
docker build --network=host --no-cache --target build_base -t dawn_base:latest
docker build --network=host --no-cache --target build_dependence -t image_name
-
In your CMakeLists.txt, find this package and depend on it.
find_package(dawn REQUIRED) target_link_libraries(your_target dawn::dawn)
-
In your C++ source file, include the header file and use API.
//Process 1 #include <dawn/transport/shmTransport.h> int main() { dawn::shmTransport tp("dawn"); tp.write(data, data_len); } //Process 2 #include <dawn/transport/shmTransport.h> int main() { dawn::shmTransport tp("dawn"); int data_len; //Variable data_len will be passed as a reference. tp.read(data, data_len, dawn::BLOCK_TYPE::BLOCK); //Receive data from process 1. }
- Dawn support multiple publishers and multiple subscribers.
- Dawn shmTransport bases on share memory.