158 template <
typename Func>
159 void foreach (Func func)
167 for (
const auto& item : local_instance)
211 using namespace std::string_literals;
218 std::string errorMessage =
"cbeam::stable_interprocess_container::serialize: size of serialized container ("s + std::to_string(
buffer.
size())
219 +
" bytes) exceeds shared memory size ("s + std::to_string(
capacity()) +
" bytes)."s;
Manages memory a byte buffer, offering dynamic appending. This class is designed for scenarios where ...
Definition buffer.hpp:50
virtual void * get() const noexcept
return a pointer to the managed memory block
Definition buffer.hpp:141
virtual std::size_t size() const noexcept
returns the size of the buffer in bytes
Definition buffer.hpp:112
virtual size_t size() const
Retrieves the size of the container.
Definition stable_interprocess_container.hpp:135
stable_interprocess_container & operator=(stable_interprocess_container &&)=delete
stable_interprocess_container(const stable_interprocess_container &)=delete
T deserialize() const
Deserializes the shared memory data into a container object.
Definition stable_interprocess_container.hpp:184
stable_interprocess_container(stable_interprocess_container &&)=delete
virtual void clear()
Clears the contents of the container.
Definition stable_interprocess_container.hpp:109
virtual bool empty() const
Checks if the container is empty.
Definition stable_interprocess_container.hpp:122
stable_interprocess_container(const std::string &unique_identifier, std::size_t size)
Constructs a stable_interprocess_container with a specific size and unique identifier.
Definition stable_interprocess_container.hpp:93
void serialize(const T &container)
Serializes a container object and stores it in shared memory.
Definition stable_interprocess_container.hpp:209
stable_interprocess_container & operator=(const stable_interprocess_container &)=delete
A Cbeam-specific runtime error that also acts like std::runtime_error.
Definition runtime_error.hpp:46
Provides a unified, platform-independent interface for managing shared memory segments.
Definition interprocess_shared_memory.hpp:61
lock_guard get_lock_guard() const
Acquires a lock_guard for mutex synchronization.
Definition interprocess_shared_memory.hpp:217
size_t capacity() const noexcept
Returns the size of the shared memory region.
Definition interprocess_shared_memory.hpp:202
void * data() const
Retrieves the starting address of the shared memory region.
Definition interprocess_shared_memory.hpp:189
interprocess_shared_memory(const std::string &unique_identifier, std::size_t size)
Constructor that initializes the shared memory segment.
Definition interprocess_shared_memory.hpp:88
#define CBEAM_LOG(s)
Logs a message using cbeam::logging::log_manager.
Definition log_manager.hpp:124
Offers advanced container types with unique approaches to stability and interprocess sharing....
Definition buffer.hpp:44
void * serialized_object
Represents a serialized value in memory.
Definition traits.hpp:42
static void serialize(const T &val, container::buffer &stream)
Required to serialize an object of type T into a shared_buffer stream.
Definition traits.hpp:63
static void deserialize(serialized_object &it, T &val)
Required to deserialize an object of type T from a serialized memory block, incrementing the iterator...
Definition traits.hpp:77