| | |
| | | throw("Error: Not enough memory, can not allocate \"" + name_ + "\""); |
| | | } |
| | | } |
| | | static bool Remove(SharedMemory &shm, const std::string &name) { return shm.destroy<Data>(ObjName(name).c_str()); } |
| | | static Data *Find(SharedMemory &shm, const std::string &name) { return shm.Find<Data>(ObjName(name)); } |
| | | Data *Find(const std::string &name) { return Find(shm_, ObjName(name)); } |
| | | virtual ~ShmObject() {} |
| | |
| | | const Data *data() const { return pdata_; } |
| | | Data *operator->() { return data(); } |
| | | const Data *operator->() const { return data(); } |
| | | bool Remove() { return shm_.destroy<Data>(ObjName(name_).c_str()); } |
| | | bool Remove() { return Remove(shm_, name_); } |
| | | }; |
| | | |
| | | } // namespace bhome_shm |