4 #include <RobotAPI/interface/armem/server/ActionsInterface.h>
24 dto::RegisterServerResult result;
26 if (not(
input.server.reading or
input.server.writing))
28 result.success =
false;
30 ss <<
"Could not register the memory server '" <<
input.name <<
"'."
31 <<
"\nGiven proxies are null."
32 <<
"\nIf you want to remove a memory server, use `removeServer()`.";
33 result.errorMessage = ss.str();
42 else if (not
input.existOk)
44 result.success =
false;
46 ss <<
"Could not register the memory '" <<
input.name <<
"'."
47 <<
"\nMemory '" <<
input.name <<
"' is already registered. "
48 <<
"\nIf this is ok, set 'existOk' to true when registering the memory.";
49 result.errorMessage = ss.str();
59 result.success =
true;
66 dto::RemoveServerResult result;
70 result.success =
true;
75 else if (!
input.notExistOk)
77 result.success =
false;
79 ss <<
"Could not remove the memory '" <<
input.name <<
"."
80 <<
"\nMemory '" <<
input.name <<
"' is not registered. "
81 <<
"\nIf this is ok, set 'notExistOk' to true when removing the memory.";
82 result.errorMessage = ss.str();
99 catch (
const Ice::Exception&)
107 dto::GetAllRegisteredServersResult
110 dto::GetAllRegisteredServersResult result;
111 result.success =
true;
112 result.errorMessage =
"";
114 for (
const auto& [name, info] :
servers)
118 result.servers[name] = info.server;
128 dto::ResolveServerResult result;
133 result.success =
true;
134 result.server = info.
server;
138 catch (
const std::out_of_range&)
140 result.success =
false;
141 std::stringstream ss;
142 ss <<
"Could not resolve the memory name '" <<
input.name <<
"'."
143 <<
"\nServer '" <<
input.name <<
"' is not registered.";
144 result.errorMessage = ss.str();