EntityInstanceBase.h
Go to the documentation of this file.
1#pragma once
2
3#include <functional>
4
5// BaseClass
9
10#include "MemoryItem.h"
11
13{
14 /// @brief Interface functions for the longterm memory classes
16 {
17 public:
19 {
20 long recordedData = 0;
22 };
23
24 public:
26
27 /// return the full sub-ltm as a wm::EntitySnapshot with only references
28 /// the ltm may be huge, use with caution
29 void
34
35 /// convert the references of the input into a wm::Memory
36 void
41
42 /// encode the content of a wm::Memory and store
43 nlohmann::json
45 {
46 return _implStore(e);
47 }
48
49 /// statistics
50 void
52 {
53 statistics.recordedData = 0;
54 statistics.recordedMetaData = 0;
55 }
56
57 Statistics
59 {
60 return statistics;
61 }
62
63 static std::string getLevelName();
64
65 protected:
66 // Implementation methods - subclasses override these
67 // Thread safety is handled by DiskPersistence's per-directory mutexes
69 virtual void _implResolve(armem::wm::EntityInstance&) const = 0;
70 virtual nlohmann::json _implStore(const armem::wm::EntityInstance&) = 0;
71
72 protected:
74 };
75} // namespace armarx::armem::server::ltm::detail
Interface functions for the longterm memory classes.
virtual void _implLoadAllReferences(armem::wm::EntitySnapshot &) const =0
void resolve(armem::wm::EntityInstance &e) const
convert the references of the input into a wm::Memory
void loadAllReferences(armem::wm::EntitySnapshot &e) const
return the full sub-ltm as a wm::EntitySnapshot with only references the ltm may be huge,...
nlohmann::json store(const armem::wm::EntityInstance &e)
encode the content of a wm::Memory and store
virtual void _implResolve(armem::wm::EntityInstance &) const =0
virtual nlohmann::json _implStore(const armem::wm::EntityInstance &)=0
MemoryItem(const std::string &exportName, const MemoryID &)
MemoryItem(const std::string &exportName, const MemoryID &)
Client-side working entity instance.
Client-side working memory entity snapshot.