Registry.h
Go to the documentation of this file.
1#pragma once
2
3#include <map>
4#include <string>
5
7
8#include <RobotAPI/interface/armem/mns/MemoryNameSystemInterface.h>
9#include <RobotAPI/interface/armem/server/ActionsInterface.h>
10#include <RobotAPI/interface/armem/server/PredictingMemoryInterface.h>
11#include <RobotAPI/interface/armem/server/ReadingMemoryInterface.h>
12#include <RobotAPI/interface/armem/server/WritingMemoryInterface.h>
14
15namespace armarx::armem::mns
16{
17
18 /**
19 * @brief A registry for memory servers.
20 */
22 {
23 public:
24 Registry(const std::string& logTag = "MemoryNameSystem Registry");
25
26
27 /// Indicates whether a server entry for that name exists.
28 bool hasServer(const std::string& memoryName) const;
29
30
31 /**
32 * @brief Register a new memory server or update an existing entry.
33 *
34 * Causes threads waiting in `waitForMemory()` to resume if the respective
35 * memory server was added.
36 */
37 virtual dto::RegisterServerResult registerServer(const dto::RegisterServerInput& input);
38 /**
39 * @brief Remove a server entry.
40 */
41 dto::RemoveServerResult removeServer(const dto::RemoveServerInput& input);
42
43
44 /**
45 * @brief Gets a server entry, if it is available.
46 */
47 dto::ResolveServerResult resolveServer(const dto::ResolveServerInput& input);
48
49 dto::GetAllRegisteredServersResult getAllRegisteredServers();
50
51
52 public:
53 /// Information about a memory entry.
55 {
56 std::string name;
57 mns::dto::MemoryServerInterfaces server;
59 };
60
61 /// The registered memories.
62 std::map<std::string, ServerInfo> servers;
63 };
64
65} // namespace armarx::armem::mns
Base Class for all Logging classes.
Definition Logging.h:240
dto::GetAllRegisteredServersResult getAllRegisteredServers()
Definition Registry.cpp:107
std::map< std::string, ServerInfo > servers
The registered memories.
Definition Registry.h:62
bool hasServer(const std::string &memoryName) const
Indicates whether a server entry for that name exists.
Definition Registry.cpp:16
virtual dto::RegisterServerResult registerServer(const dto::RegisterServerInput &input)
Register a new memory server or update an existing entry.
Definition Registry.cpp:22
dto::RemoveServerResult removeServer(const dto::RemoveServerInput &input)
Remove a server entry.
Definition Registry.cpp:64
dto::ResolveServerResult resolveServer(const dto::ResolveServerInput &input)
Gets a server entry, if it is available.
Definition Registry.cpp:125
Registry(const std::string &logTag="MemoryNameSystem Registry")
Definition Registry.cpp:10
armarx::core::time::DateTime Time
Information about a memory entry.
Definition Registry.h:55
mns::dto::MemoryServerInterfaces server
Definition Registry.h:57