Configurator.h
Go to the documentation of this file.
1#pragma once
2
3#include <string>
4
5#include <RobotAPI/interface/armem/server/ConfiguringMemoryInterface.h>
6
8{
9
10 /**
11 * @brief Configure a memory server
12 *
13 * Set the persistence strategy for the ltm of a memory server:
14 * Currently available: REST and DISK
15 * TODO: MongoDB
16 */
18 {
19
20 public:
21 /**
22 * @brief Construct a memory reader.
23 * @param memory The memory proxy.
24 */
25 Configurator(const Configurator&) = default;
26 Configurator(server::ConfiguringMemoryInterfacePrx configuringMemory = nullptr) :
27 configurationPrx(configuringMemory)
28 {
29
30 }
31
32 /**
33 * @brief Use a rest server as LTM persistence sink
34 * @param identifier LTM identifier that should be unique and is used as <i>origin</i> when any new instances are commited to the wm.
35 * @param exportName Export name of the LTM at the rest server (e.g. http:://host:port/exportName/...)
36 * @param host ip to the rest server (e.g. localhost or a specific ip)
37 * @param port network port on which the server is accessible (e.g. 8080)
38 * @param overwritePrevStrategy if true, the newly defined strategy overwrites the current strategy resulting in a single strategy.
39 * If false, the newly defined strategy is appened to the current stategies (@see RedundantPersistenceStrategy).
40 */
41 void useRestPersistenceStrategy(const std::string& identifier, const std::string& exportName, const std::string& host, int port, bool overwritePrevStrategy);
42
43 /**
44 * @brief Use the disk as LTM persistence sink
45 * @param identifier LTM identifier that should be unique and is used as <i>origin</i> when any new instances are commited to the wm.
46 * @param exportName Export name of the LTM on the disk (e.g. /exportPath/exportName/...)
47 * @param exportPath Base path of the ltm export
48 * @param overwritePrevStrategy if true, the newly defined strategy overwrites the current strategy resulting in a single strategy.
49 * If false, the newly defined strategy is appened to the current stategies (@see RedundantPersistenceStrategy).
50 */
51 void useDiskPersistenceStrategy(const std::string& identifier, const std::string& exportName, const std::string& exportPath, bool overwritePrevStrategy);
52
53 void setConfiguringMemory(server::ConfiguringMemoryInterfacePrx configuringMemory);
54
55
56 inline
57 operator bool() const
58 {
59 return bool(configurationPrx);
60 }
61
62 private:
63
64 public:
65 server::ConfiguringMemoryInterfacePrx configurationPrx;
66 };
67
68} // namespace armarx::armem::client
void useRestPersistenceStrategy(const std::string &identifier, const std::string &exportName, const std::string &host, int port, bool overwritePrevStrategy)
Use a rest server as LTM persistence sink.
Configurator(server::ConfiguringMemoryInterfacePrx configuringMemory=nullptr)
void useDiskPersistenceStrategy(const std::string &identifier, const std::string &exportName, const std::string &exportPath, bool overwritePrevStrategy)
Use the disk as LTM persistence sink.
Configurator(const Configurator &)=default
Construct a memory reader.
void setConfiguringMemory(server::ConfiguringMemoryInterfacePrx configuringMemory)
server::ConfiguringMemoryInterfacePrx configurationPrx
This file is part of ArmarX.