Go to the documentation of this file.
14 const std::string& exportName,
16 const std::shared_ptr<Processors>& filters) :
17 ProviderSegmentBase(exportName, id, filters),
18 DiskMemoryItemMixin(p, exportName, id),
19 MongoDBStorageMixin(
s, exportName, id)
40 id().withEntityName(segmentName),
59 id().withEntityName(
name),
61 return c.fullPathExists();
67 std::shared_ptr<Entity>
79 id().withEntityName(entityName),
97 auto aron = conv.convert(filecontent,
"");
105 x.loadAllReferences(
s);
117 auto& conv =
processors->defaultTypeConverter;
121 auto& conv =
processors->defaultTypeConverter;
124 auto aron = conv.convert(filecontent,
"");
132 x.loadLatestNReferences(n,
s);
150 id().withEntityName(e.id().entityName),
162 if (
id().providerSegmentName.empty())
165 <<
"During storage of segment '" << p.
id().
str()
166 <<
"' I noticed that the corresponding LTM has no id set. "
167 <<
"I set the id of the LTM to the same name, however this should not happen!";
180 auto& conv =
processors->defaultTypeConverter;
182 auto [vec, modeSuffix] = conv.convert(p.
aronType());
196 ARMARX_INFO <<
"ProviderSegment does not seem to have an aron type, so aron type information connot be exported";
206 id().withEntityName(e.id().entityName),
std::shared_ptr< Processors > processors
Client-side working memory provider segment.
std::string providerSegmentName
void _loadAllReferences(armem::wm::ProviderSegment &) override
Path getMemoryBasePath() const
void _loadLatestNReferences(int n, armem::wm::ProviderSegment &p) override
#define ARMARX_CHECK_EMPTY(c)
void _resolve(armem::wm::ProviderSegment &) override
std::shared_ptr< Entity > findEntity(const std::string &) const override
find entity segment
std::string str(bool escapeDelimiters=true) const
Get a string representation of this memory ID.
A memory storing data in mongodb (needs 'armarx memory start' to start the mongod instance)
aron::type::ObjectPtr & aronType()
std::recursive_mutex ltm_mutex
std::string unescapeName(const std::string &escapedName)
ProviderSegment(const detail::mixin::Path &, const detail::mixin::MongoDBSettings &, const std::string &, const MemoryID &id, const std::shared_ptr< Processors > &)
std::vector< Path > getAllDirectories() const
bool forEachEntity(std::function< void(Entity &)> func) const override
iterate over all core segments of this ltm
bool fileExists(const std::string &filename) const
std::vector< unsigned char > readDataFromFile(const std::string &filename) const
bool hasEntity(const std::string &) const override
check if entity segment exists
static const constexpr char * TYPE_FILENAME
std::string extractLastDirectoryFromPath(const std::string &path)
MongoDBSettings getSettings() const
void _store(const armem::wm::ProviderSegment &) override
virtual std::string getExportName() const
MemoryID getProviderSegmentID() const
bool forEachEntity(EntityFunctionT &&func)
bool fullPathExists() const
std::filesystem::path Path
Client-side working memory entity.
EntityT & addEntity(const std::string &name)
Add an empty entity with the given name.
double s(double t, double s0, double v0, double a0, double j)
void writeDataToFile(const std::string &filename, const std::vector< unsigned char > &data) const
const std::string TYPE_FILENAME
void ensureFullPathExists(bool createIfNotExistent=false) const