Loader.h
Go to the documentation of this file.
1#pragma once
2
3#include <RobotAPI/interface/armem/server/LoadingMemoryInterface.h>
4
6{
7
8 /**
9 * @brief Load LTMs into WM
10 */
11 class Loader
12 {
13
14 public:
15 /**
16 * @brief Construct a memory reader.
17 * @param memory The memory proxy.
18 */
19 Loader(const Loader&) = default;
20
21 Loader(server::LoadingMemoryInterfacePrx loadingMemory = nullptr) :
22 loadingPrx(loadingMemory)
23 {
24 }
25
26 /**
27 * Loads all entries of potential multiple ltms into the wm (i.e. if a RedundantPersistenceStrategy is used with multiple strategies inside)
28 */
29 void loadLTMintoWM(bool complete = true);
30
31 /**
32 * @brief loads data from a specified LTM export into the currently running WM (needs to already have the CoreSegments)
33 *
34 * This function loads an LTM specified by export_path and memoryName into the current WM.
35 * It handles if the path is not a correct LTM export.
36 * If you do this multiple times the LTM is always appended to the WM ,meaning you can load several LTM exports into the same WM.
37 * This does not exclude the maxHistory size from working! If you load to much snapshots they will still be discarded.
38 *
39 * @param export_path path to the export folder (needs to be a string with '/' as delimiter)
40 * @param memoryName name of the memory server (e.g. 'Object', 'Skill')
41 * @param coreSegmentName (not yet supported)
42 * @param addNonExistingCoreSegments (not yet supported)
43 * @param amountOfSnapshotsPerSegmentToLoad (not yet supported)
44 *
45 * @return bool true if everything worked fine, false if some error arose permitting the LTM to be loaded
46 */
47 bool loadExportIntoWM(std::string export_path,
48 std::string memoryName,
49 std::vector<std::string> coreSegmentNames,
50 bool addNonExistingCoreSegments,
51 int amountOfSnapshotsPerSegmentToLoad);
52
53 void setLoadingMemory(server::LoadingMemoryInterfacePrx configuringMemory);
54
55 inline operator bool() const
56 {
57 return bool(loadingPrx);
58 }
59
60 private:
61 public:
62 server::LoadingMemoryInterfacePrx loadingPrx;
63 };
64
65} // namespace armarx::armem::client
bool loadExportIntoWM(std::string export_path, std::string memoryName, std::vector< std::string > coreSegmentNames, bool addNonExistingCoreSegments, int amountOfSnapshotsPerSegmentToLoad)
loads data from a specified LTM export into the currently running WM (needs to already have the CoreS...
Definition Loader.cpp:18
server::LoadingMemoryInterfacePrx loadingPrx
Definition Loader.h:62
Loader(server::LoadingMemoryInterfacePrx loadingMemory=nullptr)
Definition Loader.h:21
void setLoadingMemory(server::LoadingMemoryInterfacePrx configuringMemory)
void loadLTMintoWM(bool complete=true)
Loads all entries of potential multiple ltms into the wm (i.e.
Definition Loader.cpp:10
Loader(const Loader &)=default
Construct a memory reader.
This file is part of ArmarX.