9 const AMD_MemoryNameSystemInterface_waitForServerPtr& future,
10 const dto::WaitForServerInput& input)
12 ARMARX_INFO <<
"Waiting for server `" << input.name <<
"`.";
15 std::lock_guard g{futuresMtx};
16 waitForServerFutures[input.name].push_back(future);
25 std::lock_guard g{futuresMtx};
27 for (
auto it = waitForServerFutures.begin(); it != waitForServerFutures.end();)
29 auto& [name, futures] = *it;
34 dto::WaitForServerResult result;
35 result.success =
true;
39 for (
auto& future : futures)
41 future->ice_response(result);
45 it = waitForServerFutures.erase(it);
50 ARMARX_INFO <<
"Server `" << name <<
"` not available yet.";
55 dto::RegisterServerResult
72 grid.
add(
Label(
"Memory Name"), {row, 0})
73 .add(
Label(
"Component Name"), {row, 1})
74 .add(
Label(
"R/W/P/A"), {row, 2})
75 .add(
Label(
"Registration Time"), {row, 3});
78 for (
const auto& [name, info] :
servers)
81 std::string componentName =
"";
82 std::string mode =
"";
83 if (info.server.reading)
85 componentName = info.server.reading->ice_getIdentity().name;
88 if (info.server.writing)
90 componentName = info.server.writing->ice_getIdentity().name;
93 if (info.server.prediction)
95 componentName = info.server.prediction->ice_getIdentity().name;
98 if (info.server.actions)
100 componentName = info.server.actions->ice_getIdentity().name;
108 grid.
add(
Label(componentName), {row, col});
int Label(int n[], int size, int *curLabel, MiscLib::Vector< std::pair< int, size_t > > *labels)
void waitForServer_processOnce()
armarx::RemoteGui::Client::GridLayout RemoteGui_buildInfoGrid()
Builds a RemoteGui grid containing information about registered memories.
dto::RegisterServerResult registerServer(const dto::RegisterServerInput &input) override
Register a new memory server or update an existing entry.
void waitForServer_async(const AMD_MemoryNameSystemInterface_waitForServerPtr &future, const dto::WaitForServerInput &input)
Store the call in a container for later response.
std::map< std::string, ServerInfo > servers
The registered memories.
virtual dto::RegisterServerResult registerServer(const dto::RegisterServerInput &input)
Register a new memory server or update an existing entry.
#define ARMARX_CHECK_EQUAL(lhs, rhs)
This macro evaluates whether lhs is equal (==) rhs and if it turns out to be false it will throw an E...
#define ARMARX_INFO
The normal logging level.
std::string toDateTimeMilliSeconds(const Time &time, int decimals=6)
Returns timeas e.g.
GridLayout & add(Widget const &child, Pos pos, Span span=Span{1, 1})
Information about a memory entry.
mns::dto::MemoryServerInterfaces server