5 #ifndef StlUtilities_HH
6 #define StlUtilities_HH
18 #include "StiCompositeTreeNode.h"
48 if (data) {cout <<
" "<<(*data)<<endl;}
74 return (mname == rhs->
getName());
83 IndexNode(
unsigned int i) : counter(i) {};
90 newKey.index= counter++;
131 cout <<
" Daughters"<<endl;
141 inline bool operator() (
const TNode* lhs,
TNode* rhs) {
150 typedef vector<StiCompositeTreeNode<T>*> tvector_t;
156 (*this) = for_each(node->
begin(), node->
end(), *
this);
159 vec.push_back(node );
163 void operator=(
const LeafFinder& rhs) {copyToThis(rhs);}
168 void copyToThis(
const LeafFinder& rhs) {vec = rhs.vec;}
174 inline T gFindClosestOrderKey(T begin, T end,
const StiOrderKey& findThis)
178 for (T it=begin; it!=end; ++it) {
179 double val = fabs(findThis.key-(*it)->getOrderKey().key);
194 return (thedata == rhs->
getData());
202 void operator()(
const T* val) {
const string & getName() const
Return the name of the node.
T * getData() const
Return a (non-const!) pointer to the data hung on this node.
unsigned int getChildCount() const
Return the number of children that belong to this node.
const StiOrderKey & getOrderKey() const
Return a reference to the the orderkey of this node.
vec_type::iterator begin()
Provide random access iterator to the beginning of the vector of children.
vec_type::iterator end()
Provide random access iterator to the end of the vector of children.
void setOrderKey(const StiOrderKey &)
Set the order-key for the node.