|
A memory storing data in mongodb (needs 'armarx memory start' to start the mongod instance) More...
#include <RobotAPI/libraries/armem/server/ltm/Entity.h>
Public Member Functions | |
Entity (const detail::mixin::Path &, const detail::mixin::MongoDBSettings &, const std::string &, const MemoryID &id, const std::shared_ptr< Processors > &) | |
std::shared_ptr< EntitySnapshot > | findFirstSnapshotAfter (const Time &time) const override |
std::shared_ptr< EntitySnapshot > | findFirstSnapshotAfterOrAt (const Time &time) const override |
std::shared_ptr< EntitySnapshot > | findLatestSnapshot () const override |
std::shared_ptr< EntitySnapshot > | findLatestSnapshotBefore (const Time &time) const override |
std::shared_ptr< EntitySnapshot > | findLatestSnapshotBeforeOrAt (const Time &time) const override |
std::shared_ptr< EntitySnapshot > | findSnapshot (const Time &) const override |
find entity snapshot segment More... | |
bool | forEachSnapshot (std::function< void(EntitySnapshot &)> func) const override |
iterate over all entity snapshots of this ltm More... | |
bool | forEachSnapshotBefore (const Time &time, std::function< void(EntitySnapshot &)> func) const override |
bool | forEachSnapshotBeforeOrAt (const Time &time, std::function< void(EntitySnapshot &)> func) const override |
bool | forEachSnapshotInIndexRange (long first, long last, std::function< void(EntitySnapshot &)> func) const override |
bool | forEachSnapshotInTimeRange (const Time &min, const Time &max, std::function< void(EntitySnapshot &)> func) const override |
bool | hasSnapshot (const Time &) const override |
check if snapshot segment exists More... | |
Public Member Functions inherited from EntityBase< EntitySnapshot > | |
virtual std::shared_ptr< EntitySnapshotT > | findLatestSnapshot () const=0 |
Statistics | getStatistics () const |
void | loadAllReferences (armem::wm::Entity &e) |
return the full sub-ltm as a wm::Entity with only references the ltm may be huge, use with caution More... | |
void | loadLatestNReferences (int n, armem::wm::Entity &e) |
MemoryItem (const std::string &exportName, const MemoryID &) | |
MemoryItem (const std::string &exportName, const MemoryID &, const std::shared_ptr< Processors > &) | |
void | resetStatistics () |
statistics More... | |
void | resolve (armem::wm::Entity &e) |
convert the references of the input into a wm::Memory More... | |
void | store (const armem::wm::Entity &e) |
encode the content of a wm::Memory and store More... | |
Public Member Functions inherited from MemoryItem | |
virtual std::string | getExportName () const |
MemoryID | getMemoryID () const |
MemoryID | id () const |
MemoryItem (const std::string &exportName, const MemoryID &) | |
MemoryItem (const std::string &exportName, const MemoryID &, const std::shared_ptr< Processors > &) | |
std::string | name () const |
void | setExportName (const std::string &n) |
void | setMemoryID (const MemoryID &) |
void | setMemoryName (const std::string &memoryName) |
virtual | ~MemoryItem ()=default |
Public Member Functions inherited from DiskMemoryItemMixin | |
void | createPropertyDefinitions (PropertyDefinitionsPtr &defs, const std::string &prefix) |
DiskMemoryItemMixin ()=default | |
DiskMemoryItemMixin (const Path &memoryParentPath, const std::string &exportName, const armem::MemoryID &id) | |
void | ensureFileExists (const std::string &filename, bool createIfNotExistent=false) const |
void | ensureFullPathExists (bool createIfNotExistent=false) const |
void | ensureMemoryBasePathExists (bool createIfNotExistent=false) const |
bool | fileExists (const std::string &filename) const |
bool | fullPathExists () const |
std::vector< Path > | getAllDirectories () const |
std::vector< Path > | getAllFiles () const |
Path | getFullPath () const |
Path | getMemoryBasePath () const |
bool | memoryBasePathExists () const |
std::vector< unsigned char > | readDataFromFile (const std::string &filename) const |
void | writeDataToFile (const std::string &filename, const std::vector< unsigned char > &data) const |
virtual | ~DiskMemoryItemMixin ()=default |
Public Member Functions inherited from MongoDBStorageMixin | |
std::optional< mongocxx::collection > | collectionExists () const |
std::optional< mongocxx::database > | databaseExists () const |
std::optional< nlohmann::json > | documentExists () const |
std::optional< nlohmann::json > | documentExists (const std::string &id) const |
mongocxx::collection | ensureCollectionExists (bool createIfNotExistent=false) |
mongocxx::database | ensureDatabaseExists (bool createIfNotExistent=false) |
nlohmann::json | ensureDocumentExists (bool createIfNotExistent=false) |
nlohmann::json | ensureDocumentExists (const std::string &id, bool createIfNotExistent=false) |
mongocxx::collection | ensurePreviousCollectionExists (bool createIfNotExistent=false) |
std::vector< nlohmann::json > | getAllDocuments () const |
std::string | getCollectionName () const |
std::string | getDatabaseName () const |
std::string | getDocumentName () const |
std::string | getPreviousCollectionName () const |
MongoDBSettings | getSettings () const |
MongoDBStorageMixin ()=default | |
MongoDBStorageMixin (const MongoDBSettings &settings, const std::string &exportName, const armem::MemoryID &id) | |
std::optional< mongocxx::collection > | previousCollectionExists () const |
nlohmann::json | readDataFromDocument () const |
nlohmann::json | readDataFromDocument (const std::string &id) const |
void | writeDataToDocument (const nlohmann::json &data) |
void | writeDataToDocument (const std::string &id, const nlohmann::json &data) |
void | writeForeignKeyToPreviousDocument () |
void | writeForeignKeyToPreviousDocument (const nlohmann::json &type) |
Protected Member Functions | |
void | _loadAllReferences (armem::wm::Entity &) override |
void | _loadLatestNReferences (int n, armem::wm::Entity &e) override |
void | _resolve (armem::wm::Entity &) override |
void | _store (const armem::wm::Entity &) override |
Protected Member Functions inherited from MemoryItem | |
virtual void | _setExportName (const std::string &) |
virtual void | _setMemoryID (const MemoryID &) |
Protected Member Functions inherited from DiskMemoryItemMixin | |
Path | addDateToMemoryBasePath (const std::filesystem::path &n) const |
void | configureMixin (const nlohmann::json &json) |
void | setMixinExportName (const std::string &n) |
void | setMixinMemoryID (const MemoryID &n) |
Protected Member Functions inherited from MongoDBStorageMixin | |
void | configureMixin (const nlohmann::json &json) |
configuration More... | |
void | connect () const |
bool | connected () const |
void | setHost (const std::string &) |
void | setMixinExportName (const std::string &n) |
void | setMixinMemoryID (const armem::MemoryID &) |
setter More... | |
void | setPassword (const std::string &) |
void | setPort (const unsigned int) |
void | setUser (const std::string &) |
void | start () |
start More... | |
void | stop () |
Additional Inherited Members | |
Public Types inherited from EntityBase< EntitySnapshot > | |
using | EntitySnapshotT = EntitySnapshot |
Static Public Member Functions inherited from EntityBase< EntitySnapshot > | |
static std::string | getLevelName () |
Static Public Attributes inherited from DiskMemoryItemMixin | |
static const int | DEPTH_TO_DATA_FILES |
Protected Attributes inherited from EntityBase< EntitySnapshot > | |
std::recursive_mutex | ltm_mutex |
Statistics | statistics |
Protected Attributes inherited from MemoryItem | |
std::shared_ptr< Processors > | processors |
Static Protected Attributes inherited from DiskMemoryItemMixin | |
static const constexpr char * | DATA_FILENAME = "data.aron" |
static const constexpr char * | MEMORY_EXPORT_SUFFIX = "_" |
static const constexpr char * | METADATA_FILENAME = "metadata.aron" |
static const constexpr char * | TYPE_FILENAME = "type.aron" |
Static Protected Attributes inherited from MongoDBStorageMixin | |
static const constexpr char * | DATA = "_data" |
static const constexpr char * | FOREIGN_KEY = "_foreign_key" |
static const constexpr char * | ID = "_id" |
static const constexpr char * | METADATA = "_metadata" |
static const constexpr char * | TYPE = "_type" |
A memory storing data in mongodb (needs 'armarx memory start' to start the mongod instance)
Entity | ( | const detail::mixin::Path & | p, |
const detail::mixin::MongoDBSettings & | s, | ||
const std::string & | exportName, | ||
const MemoryID & | id, | ||
const std::shared_ptr< Processors > & | filters | ||
) |
Definition at line 24 of file Entity.cpp.
|
overrideprotectedvirtual |
Implements EntityBase< EntitySnapshot >.
Definition at line 347 of file Entity.cpp.
|
overrideprotectedvirtual |
Implements EntityBase< EntitySnapshot >.
Definition at line 367 of file Entity.cpp.
|
overrideprotectedvirtual |
Implements EntityBase< EntitySnapshot >.
Definition at line 405 of file Entity.cpp.
|
overrideprotectedvirtual |
Implements EntityBase< EntitySnapshot >.
Definition at line 426 of file Entity.cpp.
|
overridevirtual |
Implements EntityBase< EntitySnapshot >.
Definition at line 291 of file Entity.cpp.
|
overridevirtual |
Implements EntityBase< EntitySnapshot >.
Definition at line 319 of file Entity.cpp.
|
override |
Definition at line 207 of file Entity.cpp.
|
overridevirtual |
Implements EntityBase< EntitySnapshot >.
Definition at line 235 of file Entity.cpp.
|
overridevirtual |
Implements EntityBase< EntitySnapshot >.
Definition at line 263 of file Entity.cpp.
|
overridevirtual |
find entity snapshot segment
Implements EntityBase< EntitySnapshot >.
Definition at line 195 of file Entity.cpp.
|
overridevirtual |
iterate over all entity snapshots of this ltm
Implements EntityBase< EntitySnapshot >.
Definition at line 38 of file Entity.cpp.
|
overridevirtual |
Implements EntityBase< EntitySnapshot >.
Definition at line 162 of file Entity.cpp.
|
overridevirtual |
Implements EntityBase< EntitySnapshot >.
Definition at line 145 of file Entity.cpp.
|
overridevirtual |
Implements EntityBase< EntitySnapshot >.
Definition at line 95 of file Entity.cpp.
|
overridevirtual |
Implements EntityBase< EntitySnapshot >.
Definition at line 127 of file Entity.cpp.
|
overridevirtual |
check if snapshot segment exists
Implements EntityBase< EntitySnapshot >.
Definition at line 178 of file Entity.cpp.