μHAL (v2.7.9)
Part of the IPbus software repository
DummyDerivedNode.cpp
Go to the documentation of this file.
2 
3 namespace uhal {
4  namespace tests {
5  UHAL_REGISTER_DERIVED_NODE(DummyParentNode)
6  UHAL_REGISTER_DERIVED_NODE(DummyChildNode)
7 
9  uhal::Node(aNode) {
10  }
11 
13  }
14 
15  void
17 
18  std::stringstream ss;
19 #ifdef __GNUG__
20  // this is fugly but necessary due to the way that typeid::name() returns the object type name under g++.
21  int lStatus(0);
22  static std::size_t lSize(1024);
23  static char* lDemangled = new char[lSize];
24  ss << (abi::__cxa_demangle(typeid ( *this).name(), lDemangled, &lSize, &lStatus));
25 #else
26  ss << (typeid ( T).name());
27 #endif
28 
29  std::cout << "This is " << ss.str() << std::endl;
30  const boost::unordered_map<std::string, std::string>& lParameters = getParameters();
31  boost::unordered_map<std::string, std::string>::const_iterator it;
32  uint32_t k = 0;
33  for (it = lParameters.begin(); it != lParameters.end(); ++it, ++k)
34  std::cout << ss.str() << " par[" << k << "]: key=" << it->first << ", val=" << it->second << std::endl;
35 
36  // print the list of childs as well?
37  }
38 
40  uhal::tests::DummyParentNode(aNode) {
41  }
42 
44  }
45 
46  }
47 }
48 
uhal::tests::DummyChildNode::DummyChildNode
DummyChildNode(const Node &aNode)
Definition: DummyDerivedNode.cpp:39
uhal::Node::getParameters
const boost::unordered_map< std::string, std::string > & getParameters() const
Return parameters of the current node.
Definition: Node.cpp:308
uhal::tests::DummyChildNode::~DummyChildNode
virtual ~DummyChildNode()
Definition: DummyDerivedNode.cpp:43
UHAL_REGISTER_DERIVED_NODE
#define UHAL_REGISTER_DERIVED_NODE(classname)
Macro which adds a Derived Node Class to the factory It takes a classname and then creates a registra...
Definition: DerivedNode.hpp:53
setupTemplate.name
name
Definition: setupTemplate.py:32
uhal
Definition: HttpResponseGrammar.hpp:49
DummyDerivedNode.hpp
uhal::tests::DummyParentNode::~DummyParentNode
virtual ~DummyParentNode()
Definition: DummyDerivedNode.cpp:12
uhal::Node
A heirarchical node for navigating heirarchical firmwares.
Definition: Node.hpp:86
uhal::tests::DummyParentNode::printParameters
void printParameters() const
Definition: DummyDerivedNode.cpp:16
uhal::tests::DummyParentNode
Definition: DummyDerivedNode.hpp:12