Go to the documentation of this file.
24 virtual std::string
getKey();
34 std::vector<unsigned char>
data;
74 const std::string& exportName,
106 std::vector<unsigned char>&
data) = 0;
112 std::vector<unsigned char>&
data)
123 std::string key) = 0;
137 std::vector<unsigned char>
186 const std::string& prefix) = 0;
Abstract memory persistence strategy (resp.
static const constexpr char * TYPE_FILENAME
For usage if you might want to create the key using some logic defined with your strategy rather than...
virtual ItemResult retrieveItemWithOrigin(const armarx::armem::MemoryID &id, std::string &key)
Retrieves the actual data but also appends the origin which is in this case the strategy identifier.
bool enabled_
If false, the strategy is not writing or reading anything.
void storeItem(const armarx::armem::MemoryID &memoryId, ItemIdentifier itemIdentifer, std::vector< unsigned char > &data)
virtual std::vector< std::string > getItemKeys(const armarx::armem::MemoryID &id)=0
Keys of the actual items containing data stored for the memory id.
virtual ~MemoryPersistenceStrategy()=default
virtual bool containsItem(const armarx::armem::MemoryID &id, std::string key)=0
virtual bool containsContainer(const armarx::armem::MemoryID &id, std::string key)=0
virtual void storeItem(const armarx::armem::MemoryID &id, std::string key, std::vector< unsigned char > &data)=0
Stores an item containing actual data for the current memory id.
virtual std::vector< unsigned char > retrieveItem(const armarx::armem::MemoryID &id, std::string key)=0
Retrieve the actual data of an item stored for the memory id.
static const constexpr char * METADATA_FILENAME
virtual std::vector< std::string > getContainerKeys(const armarx::armem::MemoryID &id)=0
Returns keys that allow use to move a step further in the hierarchy (e.g.
static const int DEPTH_TO_DATA_FILES
void setIdentifier(const std::string &identifier)
std::string getIdentifier()
std::string getExportName()
static const constexpr char * DATA_FILENAME
Retrieved items' data with an origin (resp.
MemoryPersistenceStrategy()
std::string identifier_
Name of the strategy.
MemoryPersistenceStrategy(const std::string &identifier, const std::string &exportName, bool enabled=true)
virtual std::string getKey()
virtual ~ItemIdentifier()
std::vector< unsigned char > data
virtual void setExportName(const std::string &exportName)
std::string exportName_
Name of the specific memory export where our items should be stored.
std::vector< unsigned char > retrieveItem(const armarx::armem::MemoryID &memoryId, ItemIdentifier itemIdentifier)
static const constexpr char * MEMORY_EXPORT_SUFFIX
virtual void createPropertyDefinitions(PropertyDefinitionsPtr &defs, const std::string &prefix)=0