#include <RobotAPI/libraries/armem/server/ltm/detail/mixins/BufferedMemoryMixin.h>
template<class _CoreSegmentT>
class armarx::armem::server::ltm::detail::mixin::BufferedMemoryMixin< _CoreSegmentT >
Definition at line 127 of file BufferedMemoryMixin.h.
◆ StorageItem
template<class _CoreSegmentT>
◆ BufferedMemoryMixin()
template<class _CoreSegmentT>
◆ ~BufferedMemoryMixin()
template<class _CoreSegmentT>
◆ _directlyStore()
template<class _CoreSegmentT>
| virtual void _directlyStore |
( |
const armem::wm::Memory & | memory, |
|
|
bool | simulatedVersion = false ) |
|
protectedpure virtual |
◆ _preFilterMemory()
template<class _CoreSegmentT>
Pre-filter a memory object before enqueuing for async storage.
This method applies snapshot filters BEFORE the memory enters the async queue, reducing queue pressure and avoiding work on the async worker threads.
- Parameters
-
| memory | The memory to filter |
| filteredCount | Output: number of snapshots that were filtered out |
| passedCount | Output: number of snapshots that passed the filter |
- Returns
- A new memory containing only the snapshots that passed the filters, or nullptr if all snapshots were filtered out
Implemented in Memory.
◆ addToBuffer()
template<class _CoreSegmentT>
◆ asyncStorageWorker()
template<class _CoreSegmentT>
| void asyncStorageWorker |
( |
size_t | threadId | ) |
|
|
inlineprotected |
Worker thread that processes the async storage queue.
- Parameters
-
| threadId | ID of this worker thread (for logging) |
Definition at line 641 of file BufferedMemoryMixin.h.
◆ bufferFinished()
template<class _CoreSegmentT>
◆ configureMixin()
template<class _CoreSegmentT>
| void configureMixin |
( |
const nlohmann::json & | json | ) |
|
|
inlineprotected |
◆ countSnapshotsInItem()
template<class _CoreSegmentT>
| size_t countSnapshotsInItem |
( |
const StorageItem & | item | ) |
const |
|
inlineprotected |
◆ createPropertyDefinitions()
template<class _CoreSegmentT>
◆ directlyStore() [1/2]
template<class _CoreSegmentT>
◆ directlyStore() [2/2]
template<class _CoreSegmentT>
| void directlyStore |
( |
const armem::wm::Memory & | memory, |
|
|
bool | simulatedVersion = false ) |
|
inline |
◆ enqueueForAsyncStorage()
template<class _CoreSegmentT>
◆ enqueueForAsyncStoragePublic()
template<class _CoreSegmentT>
| void enqueueForAsyncStoragePublic |
( |
std::shared_ptr< const armem::wm::Memory > | memory | ) |
|
|
inlineprotected |
◆ enqueuePendingConversion()
template<class _CoreSegmentT>
Enqueue snapshots for deferred conversion and async storage This defers the expensive toMemory() conversion to the async thread.
Definition at line 444 of file BufferedMemoryMixin.h.
◆ enqueueStorageItem()
template<class _CoreSegmentT>
Internal method to enqueue any storage item (Memory or PendingConversion) PERFORMANCE: Uses lock-free queue to avoid mutex contention at 50Hz commit rate NON-BLOCKING: If the queue is full, the item is DROPPED immediately to prevent upstream queue (e.g., RobotWriterQueue) from backing up.
Definition at line 559 of file BufferedMemoryMixin.h.
◆ flushAsyncStorage()
template<class _CoreSegmentT>
| bool flushAsyncStorage |
( |
int | timeoutMs = 0 | ) |
|
|
inline |
Flush the async storage queue and wait for all pending items to be stored.
This blocks until the queue is empty and all storage operations are complete.
- Parameters
-
| timeoutMs | Maximum time to wait in milliseconds (0 = wait indefinitely) |
- Returns
- true if queue was flushed successfully, false if timeout occurred
Definition at line 192 of file BufferedMemoryMixin.h.
◆ getAsyncStorageStatistics()
template<class _CoreSegmentT>
◆ getBuffer()
template<class _CoreSegmentT>
◆ getNumThreadsProcessing()
template<class _CoreSegmentT>
| size_t getNumThreadsProcessing |
( |
| ) |
const |
|
inline |
◆ getQueueSize()
template<class _CoreSegmentT>
| size_t getQueueSize |
( |
| ) |
const |
|
inline |
◆ resetAsyncStorageStatistics()
template<class _CoreSegmentT>
| void resetAsyncStorageStatistics |
( |
| ) |
|
|
inline |
◆ setMixinMemoryID()
template<class _CoreSegmentT>
| void setMixinMemoryID |
( |
const MemoryID & | id | ) |
|
|
inlineprotected |
◆ start()
template<class _CoreSegmentT>
◆ stop()
template<class _CoreSegmentT>
◆ storeBuffer()
template<class _CoreSegmentT>
◆ buffer
template<class _CoreSegmentT>
Internal memory for data consolidated from wm to ltm (double-buffer) The to-put-to-ltm buffer (contains data in plain text) This buffer may still be filtered (e.g.
snapshot filters). This means that it is not guaranteed that all data in the buffer will be stored in the ltm
Definition at line 868 of file BufferedMemoryMixin.h.
◆ maxAsyncQueueSize
template<class _CoreSegmentT>
| size_t maxAsyncQueueSize = 1000 |
|
protected |
◆ numAsyncStorageThreads
template<class _CoreSegmentT>
| size_t numAsyncStorageThreads = 4 |
|
protected |
◆ storeFlag
template<class _CoreSegmentT>
| std::atomic_flag storeFlag = ATOMIC_FLAG_INIT |
|
protected |
◆ storeFrequency
template<class _CoreSegmentT>
| float storeFrequency = 10 |
|
protected |
◆ to_store
template<class _CoreSegmentT>
◆ workerShutdownTimeoutSeconds
template<class _CoreSegmentT>
| int workerShutdownTimeoutSeconds = 30 |
|
protected |
Timeout in seconds for worker thread shutdown (default 30 seconds)
Definition at line 882 of file BufferedMemoryMixin.h.
The documentation for this class was generated from the following file: