9 std::cout <<
"=== Minimal Overhead Configuration ===\n";
15 std::cout <<
"Table overhead: " <<
sizeof(
shm_table_small) <<
" bytes\n";
23 std::cout <<
"Created array '" << small_array.
name() <<
"' with "
24 << small_array.
size() <<
" elements\n\n";
28 std::cout <<
"=== Large Simulation Configuration ===\n";
34 std::cout <<
"Table overhead: " <<
sizeof(
shm_table_large) <<
" bytes\n";
40 shm,
"sensor_data_from_camera_01_preprocessed", 1000);
43 shm,
"high_priority_event_queue_for_controller", 500);
45 std::cout <<
"Created structures with long descriptive names:\n";
46 std::cout <<
" - " << sensor_data.
name() <<
"\n";
47 std::cout <<
" - " << event_queue.
name() <<
"\n\n";
51 std::cout <<
"=== Custom Configuration ===\n";
57 my_custom_shm shm(
"custom_shm", 10 * 1024 * 1024);
59 std::cout <<
"Custom table overhead: " <<
sizeof(my_custom_table) <<
" bytes\n";
60 std::cout <<
"Max name length: " << my_custom_table::MAX_NAME_SIZE <<
"\n";
61 std::cout <<
"Max entries: " << my_custom_table::MAX_ENTRIES <<
"\n\n";
64 timestamps[0] = 123456789;
66 std::cout <<
"Custom configuration working with " << timestamps.
size()
76 std::cout <<
"All custom table configurations work successfully!\n";
77 }
catch (
const std::exception& e) {
78 std::cerr <<
"Error: " << e.what() << std::endl;
POSIX shared memory wrapper with RAII and reference counting.
Fixed-size array in shared memory with zero-overhead access.
std::string_view name() const noexcept
Get array name from metadata table.
size_t size() const noexcept
Get number of elements.
Lock-free circular queue for shared memory IPC.
std::string_view name() const noexcept
Metadata table for managing shared memory data structures.
static constexpr size_t MAX_NAME_SIZE
static constexpr size_t MAX_ENTRIES
void example_custom_config()
void example_minimal_overhead()
void example_large_simulation()
Core POSIX shared memory management with automatic reference counting.
Fixed-size shared memory array with STL compatibility.
shm_table_impl< 16, 16 > shm_table_small
shm_table_impl< 64, 256 > shm_table_large