|
1 | | -# C++ Project .gitignore |
| 1 | +# Shared Memory Boost IPC |
2 | 2 |
|
| 3 | +[Korean README](README.ko.md) |
3 | 4 |
|
4 | | -[Korean](README.ko.md) |
| 5 | +This project demonstrates inter-process communication (IPC) using shared memory with [Boost.Interprocess](https://www.boost.org/doc/libs/release/doc/html/interprocess.html). It provides simple reader and writer examples to show how multiple processes can exchange data efficiently via shared memory. |
5 | 6 |
|
6 | | ---- |
| 7 | +## Features |
| 8 | +- Shared memory communication using Boost.Interprocess |
| 9 | +- Example writer and reader applications |
| 10 | +- CMake-based build system |
| 11 | +- Header-only interface for easy integration |
7 | 12 |
|
8 | | -This `.gitignore` file is a **comprehensive ignore list** for C++ projects, covering a wide range of IDEs, editors, and build systems. |
9 | | - |
10 | | -## Included Environments |
11 | | - |
12 | | -- **IDEs / Editors**: |
13 | | - - Visual Studio 2019/2022 |
14 | | - - Visual Studio Code (VSCode) |
15 | | - - CLion / JetBrains IDEs |
16 | | - - Qt Creator |
17 | | - - Eclipse CDT |
18 | | - - Xcode |
19 | | - - Neovim / Vim |
20 | | - - Emacs |
21 | | - - Sublime Text |
22 | | - - Atom |
23 | | - - Code::Blocks |
24 | | - - CodeLite |
25 | | - - KDevelop |
26 | | - - NetBeans (C/C++) |
27 | | - - Geany |
28 | | - - Dev-C++ |
29 | | - - JetBrains Fleet |
30 | | - - Kate |
31 | | - |
32 | | -- **Build systems**: |
33 | | - - CMake |
34 | | - - Ninja |
35 | | - - Meson |
36 | | - - SCons |
37 | | - |
38 | | -- **Package managers**: |
39 | | - - Conan |
40 | | - - vcpkg |
41 | | - - Hunter |
42 | | - - CPM.cmake |
43 | | - |
44 | | -- **Language servers**: |
45 | | - - clangd |
46 | | - - ccls |
47 | | - - gtags / ctags |
48 | | - |
49 | | -## Purpose |
50 | | - |
51 | | -This `.gitignore` aims to: |
52 | | -- Keep repositories clean from temporary build outputs. |
53 | | -- Avoid committing local IDE/editor configuration files. |
54 | | -- Exclude cache and log files that are machine/user-specific. |
55 | | - |
56 | | -## Usage |
57 | | - |
58 | | -Place the `.gitignore` file in the root of your C++ project: |
59 | | - |
60 | | -```bash |
61 | | -curl -o .gitignore https://example.com/path/to/.gitignore |
| 13 | +## Project Structure |
| 14 | +``` |
| 15 | +shared_memory_boost_ipc/ |
| 16 | +├── include/ |
| 17 | +│ └── shared_ipc.hpp # Shared memory IPC interface |
| 18 | +├── reader/ |
| 19 | +│ ├── reader.cpp # Reader example |
| 20 | +│ └── CMakeLists.txt # Reader build config |
| 21 | +├── writer/ |
| 22 | +│ ├── writer.cpp # Writer example |
| 23 | +│ └── CMakeLists.txt # Writer build config |
| 24 | +├── CMakeLists.txt # Top-level build config |
| 25 | +├── LICENSE # License information |
| 26 | +├── README.md # Project documentation |
62 | 27 | ``` |
63 | 28 |
|
64 | | -Git will automatically ignore files and directories matching the patterns. |
65 | | - |
66 | | -## Notes |
67 | | - |
68 | | -- If you need to track some files listed in `.gitignore`, use `git add -f <file>` to force-add them. |
69 | | -- If you are manually managing `Makefile`, remove the `Makefile` entry in this `.gitignore`. |
| 29 | +## Prerequisites |
| 30 | +- C++17 or later |
| 31 | +- [Boost](https://www.boost.org/) library (Interprocess module) |
| 32 | +- CMake 3.10+ |
| 33 | + |
| 34 | +## Build Instructions |
| 35 | +1. Install Boost (ensure `boost_system` and `boost_interprocess` are available). |
| 36 | +2. Clone this repository: |
| 37 | + ```sh |
| 38 | + git clone https://github.com/JayTwoLab/shared_memory_boost_ipc.git |
| 39 | + cd shared_memory_boost_ipc |
| 40 | + ``` |
| 41 | +3. Create a build directory and run CMake: |
| 42 | + ```sh |
| 43 | + mkdir build |
| 44 | + cd build |
| 45 | + cmake .. |
| 46 | + cmake --build . |
| 47 | + ``` |
| 48 | + - For fast search boost |
| 49 | + ```sh |
| 50 | + cmake -S . -B build -DBOOST_ROOT=/usr -DBOOST_INCLUDEDIR=/usr/include -DBOOST_LIBRARYDIR=/usr/lib64 -DBoost_NO_SYSTEM_PATHS=ON -DBoost_DEBUG=ON |
| 51 | + ``` |
| 52 | +4. The executables for the reader and writer will be built in their respective folders. |
70 | 53 |
|
| 54 | +## Usage |
| 55 | +1. Start the writer process to create and write data to shared memory: |
| 56 | + ```sh |
| 57 | + ./writer/writer |
| 58 | + ``` |
| 59 | +2. Start the reader process to read data from shared memory: |
| 60 | + ```sh |
| 61 | + ./reader/reader |
| 62 | + ``` |
| 63 | + |
| 64 | +## License |
| 65 | +This project is licensed under the terms of the LICENSE file in this repository. |
| 66 | + |
| 67 | +## References |
| 68 | +- [Boost.Interprocess Documentation](https://www.boost.org/doc/libs/release/doc/html/interprocess.html) |
0 commit comments