TreeDataVisitor.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <sstream>
4 #include <stack>
5 
6 #include <QTreeWidget>
7 #include <QLabel>
8 
11 
12 
14 {
15 
18  public TreeDataVisitorBase
19  {
20  public:
21 
23 
24 
25  void visitDictOnEnter(const aron::data::VariantPtr& n) override
26  {
27  const std::string key = n->getPath().getLastElement();
28  _visitEnter(key, "Dict", n->childrenSize());
29  }
31  {
32  _visitExit();
33  }
34 
35  void visitListOnEnter(const aron::data::VariantPtr& n) override
36  {
37  const std::string key = n->getPath().getLastElement();
38  _visitEnter(key, "List", n->childrenSize());
39  }
41  {
42  _visitExit();
43  }
44 
45 
46  void visitBool(const aron::data::VariantPtr& b) override
47  {
48  const auto x = *aron::data::Bool::DynamicCastAndCheck(b);
49  const std::string key = b->getPath().getLastElement();
50  this->addValueRow(key, x, "Bool");
51  }
52  void visitDouble(const aron::data::VariantPtr& d) override
53  {
54  const auto x = *aron::data::Double::DynamicCastAndCheck(d);
55  const std::string key = d->getPath().getLastElement();
56  this->addValueRow(key, x, "Double");
57  }
58  void visitFloat(const aron::data::VariantPtr& f) override
59  {
60  const auto x = *aron::data::Float::DynamicCastAndCheck(f);
61  const std::string key = f->getPath().getLastElement();
62  this->addValueRow(key, x, "Float");
63  }
64  void visitInt(const aron::data::VariantPtr& i) override
65  {
66  const auto x = *aron::data::Int::DynamicCastAndCheck(i);
67  const std::string key = i->getPath().getLastElement();
68  this->addValueRow(key, x, "Int");
69  }
70  void visitLong(const aron::data::VariantPtr& l) override
71  {
72  const auto x = *aron::data::Long::DynamicCastAndCheck(l);
73  const std::string key = l->getPath().getLastElement();
74  this->addValueRow(key, x, "Long");
75  }
76  void visitString(const aron::data::VariantPtr& string) override
77  {
78  const auto x = *aron::data::String::DynamicCastAndCheck(string);
79  const std::string key = string->getPath().getLastElement();
80  this->addValueRow(key, x, "String");
81  }
82 
83  void visitNDArray(const aron::data::VariantPtr& array) override
84  {
85  const auto x = *aron::data::NDArray::DynamicCastAndCheck(array);
86  const std::string key = array->getPath().getLastElement();
87  this->addValueRow(key, x, "ND Array");
88  }
89 
90  };
91 
92 
93 }
armarx::armem::gui::instance::TreeDataVisitorBase
Definition: TreeDataVisitorBase.h:15
armarx::armem::gui::instance::TreeDataVisitor::visitBool
void visitBool(const aron::data::VariantPtr &b) override
Definition: TreeDataVisitor.h:46
armarx::armem::gui::instance::TreeDataVisitor::visitInt
void visitInt(const aron::data::VariantPtr &i) override
Definition: TreeDataVisitor.h:64
armarx::armem::gui::instance::TreeDataVisitor
Definition: TreeDataVisitor.h:16
armarx::aron::data::detail::SpecializedVariantBase< data::dto::AronBool, Bool >::DynamicCastAndCheck
static PointerType DynamicCastAndCheck(const VariantPtr &n)
Definition: SpecializedVariant.h:135
armarx::armem::gui::instance::TreeDataVisitor::visitFloat
void visitFloat(const aron::data::VariantPtr &f) override
Definition: TreeDataVisitor.h:58
armarx::armem::gui::instance::TreeDataVisitor::visitString
void visitString(const aron::data::VariantPtr &string) override
Definition: TreeDataVisitor.h:76
armarx::armem::gui::instance::TreeDataVisitorBase::TreeDataVisitorBase
TreeDataVisitorBase()
Definition: TreeDataVisitorBase.cpp:10
armarx::armem::gui::instance::TreeDataVisitor::visitLong
void visitLong(const aron::data::VariantPtr &l) override
Definition: TreeDataVisitor.h:70
armarx::aron::data::VariantPtr
std::shared_ptr< Variant > VariantPtr
Definition: forward_declarations.h:11
armarx::armem::gui::instance::TreeDataVisitorBase::_visitExit
bool _visitExit()
Definition: TreeDataVisitorBase.cpp:49
armarx::armem::gui::instance::TreeDataVisitor::visitDictOnExit
void visitDictOnExit(const aron::data::VariantPtr &) override
Definition: TreeDataVisitor.h:30
armarx::armem::gui::instance::TreeDataVisitor::visitDictOnEnter
void visitDictOnEnter(const aron::data::VariantPtr &n) override
Definition: TreeDataVisitor.h:25
armarx::armem::gui::instance
Definition: AronDataView.cpp:2
armarx::armem::gui::instance::TreeDataVisitorBase::_visitEnter
bool _visitEnter(const std::string &key, const std::string &type, size_t numChildren)
Definition: TreeDataVisitorBase.cpp:29
All.h
armarx::aron::data::RecursiveConstVariantVisitor
Definition: VariantVisitor.h:120
armarx::armem::gui::instance::TreeDataVisitor::visitDouble
void visitDouble(const aron::data::VariantPtr &d) override
Definition: TreeDataVisitor.h:52
armarx::armem::gui::instance::TreeDataVisitorBase::addValueRow
bool addValueRow(const std::string &key, Navigator &n, const std::string &typeName)
Definition: TreeDataVisitorBase.h:34
TreeDataVisitorBase.h
armarx::armem::gui::instance::TreeDataVisitor::visitListOnExit
void visitListOnExit(const aron::data::VariantPtr &) override
Definition: TreeDataVisitor.h:40
armarx::armem::gui::instance::TreeDataVisitor::visitListOnEnter
void visitListOnEnter(const aron::data::VariantPtr &n) override
Definition: TreeDataVisitor.h:35
armarx::armem::gui::instance::TreeDataVisitor::visitNDArray
void visitNDArray(const aron::data::VariantPtr &array) override
Definition: TreeDataVisitor.h:83