Go to the documentation of this file.
13 const std::string& exportName,
15 const std::shared_ptr<Processors>& filters) :
16 CoreSegmentBase(exportName, id, filters),
17 DiskMemoryItemMixin(p, exportName, id),
18 MongoDBStorageMixin(
s, exportName, id)
37 id().withProviderSegmentName(segmentName),
55 id().withProviderSegmentName(
name),
58 return c.fullPathExists();
64 std::shared_ptr<ProviderSegment>
77 id().withProviderSegmentName(providerSegmentName),
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);
144 c.forEachProviderSegment(
150 id().withProviderSegmentName(e.id().providerSegmentName),
162 if (
id().coreSegmentName.empty())
165 <<
"During storage of segment '" <<
c.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(
c.aronType());
196 ARMARX_INFO <<
"CoreSegment does not have aron type, so aron type information "
197 "cannot be exported";
201 c.forEachProviderSegment(
202 [&](
const auto& prov)
207 id().withProviderSegmentName(prov.id().providerSegmentName),
std::shared_ptr< Processors > processors
Client-side working memory provider segment.
Path getMemoryBasePath() const
std::recursive_mutex ltm_mutex
void _store(const armem::wm::CoreSegment &) override
#define ARMARX_CHECK_EMPTY(c)
aron::type::ObjectPtr & aronType()
std::string coreSegmentName
std::string unescapeName(const std::string &escapedName)
std::vector< Path > getAllDirectories() const
bool hasProviderSegment(const std::string &name) const override
check if provider segment exists
bool fileExists(const std::string &filename) const
Client-side working memory core segment.
std::vector< unsigned char > readDataFromFile(const std::string &filename) const
static const constexpr char * TYPE_FILENAME
void _resolve(armem::wm::CoreSegment &) override
ProviderSegmentT & addProviderSegment(const std::string &name, aron::type::ObjectPtr providerSegmentType=nullptr, const std::vector< PredictionEngine > &predictionEngines={})
Add an empty provider segment with the given name, optional provider segment type and prediction engi...
std::string extractLastDirectoryFromPath(const std::string &path)
MongoDBSettings getSettings() const
virtual std::string getExportName() const
void _loadLatestNReferences(int n, armem::wm::CoreSegment &c) override
bool forEachProviderSegment(std::function< void(ProviderSegment &)> func) const override
iterate over all provider segments of this ltm
MemoryID getCoreSegmentID() const
bool fullPathExists() const
CoreSegment(const detail::mixin::Path &, const detail::mixin::MongoDBSettings &, const std::string &, const MemoryID &, const std::shared_ptr< Processors > &)
void _loadAllReferences(armem::wm::CoreSegment &) override
std::filesystem::path Path
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
std::shared_ptr< ProviderSegment > findProviderSegment(const std::string &) const override
find provider segment
void ensureFullPathExists(bool createIfNotExistent=false) const