|
SHM
Shared-memory based Handy-communication Manager
|
Basic class definitions for accessing shared memory, ring buffers, etc. The notation is complianted ROS Cpp style guide. http://wiki.ros.org/ja/CppStyleGuide. More...
#include <iostream>#include <limits>#include <string>#include <regex>#include <stdexcept>#include <mutex>#include <atomic>#include <sys/mman.h>#include <sys/stat.h>#include <fcntl.h>#include <sys/time.h>#include <pthread.h>#include <unistd.h>#include <sys/types.h>#include <sys/ipc.h>#include <sys/shm.h>Go to the source code of this file.
Classes | |
| class | irlab::shm::SharedMemory |
| Class that abstracts the method of accessing shared memory. More... | |
| class | irlab::shm::SharedMemoryPosix |
| Class that is described the method of accessing POSIX shared memory. More... | |
| class | irlab::shm::RingBuffer |
| Class that is described ring-buffer used for shared memory. More... | |
Enumerations | |
| enum | irlab::shm::PERM : mode_t { irlab::shm::PERM_USER_READ = S_IRUSR , irlab::shm::PERM_USER_WRITE = S_IWUSR , irlab::shm::PERM_GROUP_READ = S_IRGRP , irlab::shm::PERM_GROUP_WRITE = S_IWGRP , irlab::shm::PERM_OTHER_READ = S_IROTH , irlab::shm::PERM_OTHER_WRITE = S_IWOTH } |
Functions | |
| int | irlab::shm::disconnectMemory (std::string name) |
| 共有メモリを破棄する(POSIX版) More... | |
| int | irlab::shm::disconnectMemory (int id) |
Variables | |
| const PERM | irlab::shm::DEFAULT_PERM = static_cast<PERM>(PERM_USER_READ | PERM_USER_WRITE | PERM_GROUP_READ | PERM_GROUP_WRITE | PERM_OTHER_READ | PERM_OTHER_WRITE) |
Basic class definitions for accessing shared memory, ring buffers, etc. The notation is complianted ROS Cpp style guide. http://wiki.ros.org/ja/CppStyleGuide.
Definition in file shm_base.hpp.
| enum irlab::shm::PERM : mode_t |
Permissions for shared memory
Definition at line 41 of file shm_base.hpp.
| int irlab::shm::disconnectMemory | ( | std::string | name | ) |
共有メモリを破棄する(POSIX版)
| [in] | name | 共有メモリ名 |
この関数では、引数で与えられた共有メモリ名の共有メモリを破棄する. 破棄すると言ってもファイルの削除と同様に、すでにプログラムで展開されている場合は、 破棄された共有メモリにアクセスし続けることができる. 破棄後に同名の共有メモリを作成した場合、新しいアドレスが生成されるため、 再度サブスクライバを生成しないと新しい共有メモリにアクセスできない. ファイルディスクリプタを保持し、inodeのカウントを監視することで、 共有メモリの破棄を検知することができるが、むやみに共有メモリを破棄することがないことを前提として、 余計な処理を加えないためにあえて共有メモリの監視はしていない。
Definition at line 21 of file shared_memory.cpp.