|
Basically the option to use multiple ltm sinks as source or target. More...
#include <RobotAPI/libraries/armem/server/ltm/persistence/RedundantPersistenceStrategy.h>
Public Member Functions | |
void | addStrategy (std::shared_ptr< MemoryPersistenceStrategy > strategy) |
Add another strategy to the end. More... | |
void | clearStrategies () |
Removes all strategies. More... | |
bool | containsContainer (const armarx::armem::MemoryID &id, std::string key) override |
Checks if any strategy contains the container. More... | |
bool | containsItem (const armarx::armem::MemoryID &id, std::string key) override |
Checks if any strategy contains the item. More... | |
void | createPropertyDefinitions (PropertyDefinitionsPtr &defs, const std::string &prefix) override |
void | disable () override |
void | enable () override |
std::vector< std::string > | getContainerKeys (const armarx::armem::MemoryID &id) override |
Returns all containers over all strategies. More... | |
std::vector< std::string > | getItemKeys (const armarx::armem::MemoryID &id) override |
Returns all items over all strategies. More... | |
bool | isEnabled () override |
RedundantPersistenceStrategy ()=default | |
RedundantPersistenceStrategy (std::vector< std::shared_ptr< MemoryPersistenceStrategy >> &strategies) | |
std::vector< unsigned char > | retrieveItem (const armarx::armem::MemoryID &id, std::string key) override |
Retrieves the data of the item following the FIFO principle (if the item exists at any strategy). More... | |
ItemResult | retrieveItemWithOrigin (const armarx::armem::MemoryID &id, std::string &key) override |
Retrieves the actual data but also appends the origin which is in this case the strategy identifier. More... | |
void | setExportName (const std::string &exportName) override |
Sets the export name for all strategies. More... | |
void | storeItem (const armarx::armem::MemoryID &id, const std::string key, std::vector< unsigned char > &data) override |
Stores the item to every strategy. More... | |
![]() | |
std::string | getExportName () |
std::string | getIdentifier () |
MemoryPersistenceStrategy () | |
MemoryPersistenceStrategy (const std::string &identifier, const std::string &exportName, bool enabled=true) | |
std::vector< unsigned char > | retrieveItem (const armarx::armem::MemoryID &memoryId, ItemIdentifier itemIdentifier) |
void | setIdentifier (const std::string &identifier) |
void | storeItem (const armarx::armem::MemoryID &memoryId, ItemIdentifier itemIdentifer, std::vector< unsigned char > &data) |
virtual | ~MemoryPersistenceStrategy ()=default |
Additional Inherited Members | |
![]() | |
static const constexpr char * | DATA_FILENAME = "data.aron" |
static const int | DEPTH_TO_DATA_FILES = 7 |
static const constexpr char * | MEMORY_EXPORT_SUFFIX = "_" |
static const constexpr char * | METADATA_FILENAME = "metadata.aron" |
static const constexpr char * | TYPE_FILENAME = "type.aron" |
![]() | |
bool | enabled_ = true |
If false, the strategy is not writing or reading anything. More... | |
std::string | exportName_ |
Name of the specific memory export where our items should be stored. More... | |
std::string | identifier_ |
Name of the strategy. More... | |
Basically the option to use multiple ltm sinks as source or target.
Holds a list to different persistence strategies potentially also another redundant strategy resulting in tree structure.
Why the name 'redundant'? -> Comes from the possibility to search in multiple ltm sinks for an item or store item to different sinks that are potentially at different location/different implementations. But you won't find any more redundancies features.
What if an item key occurs multiple times? -> FIFO: Strategy that was added first is choosen. In case we have a tree, you go from "left to right through the graph".
Definition at line 22 of file RedundantPersistenceStrategy.h.
|
default |
|
inline |
Definition at line 27 of file RedundantPersistenceStrategy.h.
|
inline |
Add another strategy to the end.
Will be last in the item/container FIFO.
Definition at line 156 of file RedundantPersistenceStrategy.h.
|
inline |
Removes all strategies.
Definition at line 164 of file RedundantPersistenceStrategy.h.
|
inlineoverridevirtual |
Checks if any strategy contains the container.
Implements MemoryPersistenceStrategy.
Definition at line 69 of file RedundantPersistenceStrategy.h.
|
inlineoverridevirtual |
Checks if any strategy contains the item.
Implements MemoryPersistenceStrategy.
Definition at line 85 of file RedundantPersistenceStrategy.h.
|
inlineoverridevirtual |
Implements MemoryPersistenceStrategy.
Definition at line 169 of file RedundantPersistenceStrategy.h.
|
inlineoverridevirtual |
Reimplemented from MemoryPersistenceStrategy.
Definition at line 189 of file RedundantPersistenceStrategy.h.
|
inlineoverridevirtual |
Reimplemented from MemoryPersistenceStrategy.
Definition at line 197 of file RedundantPersistenceStrategy.h.
|
inlineoverridevirtual |
Returns all containers over all strategies.
Duplicates are not treated.
Implements MemoryPersistenceStrategy.
Definition at line 36 of file RedundantPersistenceStrategy.h.
|
inlineoverridevirtual |
Returns all items over all strategies.
Duplicates are not treated.
Implements MemoryPersistenceStrategy.
Definition at line 53 of file RedundantPersistenceStrategy.h.
|
inlineoverridevirtual |
Reimplemented from MemoryPersistenceStrategy.
Definition at line 177 of file RedundantPersistenceStrategy.h.
|
inlineoverridevirtual |
Retrieves the data of the item following the FIFO principle (if the item exists at any strategy).
Implements MemoryPersistenceStrategy.
Definition at line 112 of file RedundantPersistenceStrategy.h.
|
inlineoverridevirtual |
Retrieves the actual data but also appends the origin which is in this case the strategy identifier.
Reimplemented from MemoryPersistenceStrategy.
Definition at line 125 of file RedundantPersistenceStrategy.h.
|
inlineoverridevirtual |
Sets the export name for all strategies.
Reimplemented from MemoryPersistenceStrategy.
Definition at line 142 of file RedundantPersistenceStrategy.h.
|
inlineoverridevirtual |
Stores the item to every strategy.
Implements MemoryPersistenceStrategy.
Definition at line 101 of file RedundantPersistenceStrategy.h.