RemoteGuiAronDataVisitor.cpp
Go to the documentation of this file.
2
3#include <SimoxUtility/algorithm/string.h>
4
6
8{
9
11 {
12 groupBox.setLabel(label);
13 groupBox.addChild(layout);
14 }
15
16 bool
18 const std::string& type,
19 size_t size)
20 {
21 std::stringstream label;
22 label << key << " (" << type << " of size " << size << ")";
23 Group& group = groups.emplace(label.str());
24 (void)group;
25 return true;
26 }
27
28 bool
30 {
31 Group group = groups.top();
32 groups.pop();
33 if (groups.size() > 0)
34 {
35 groups.top().groupBox.addChild(group.groupBox);
36 }
37 else
38 {
39 result = group.groupBox;
40 }
41 return true;
42 }
43
44 void
45 RemoteGuiAronDataVisitor::streamValueText(aron::data::String& n, std::stringstream& ss)
46 {
47 ss << "'" << n.getValue() << "'";
48 }
49
50 void
51 RemoteGuiAronDataVisitor::streamValueText(aron::data::NDArray& n, std::stringstream& ss)
52 {
53 ss << "shape (" << simox::alg::join(simox::alg::multi_to_string(n.getShape()), ", ") << ")";
54 }
55
56 void
57 RemoteGuiAronDataVisitor::checkGroupsNotEmpty() const
58 {
59 ARMARX_CHECK_POSITIVE(groups.size()) << "Groups must not be empty.";
60 }
61
62
63} // namespace armarx::armem::server
#define ARMARX_CHECK_POSITIVE(number)
This macro evaluates whether number is positive (> 0) and if it turns out to be false it will throw a...
bool visitEnter(const std::string &key, const std::string &type, size_t size)