34 #ifndef GRAPH_TREE_TREE_H
35 #define GRAPH_TREE_TREE_H
43 #ifndef GRAPH_TREE_BASE_H
63 Tree(
bool allowChildren=
true,
const std::string & str=
"" );
73 std::set<std::string>& missing)
const;
76 bool recurse=
true )
const;
78 std::set< Tree * > getElementsWith(
const std::string&,
const T&,
79 bool recurse=
true )
const;
81 virtual size_t size() const
82 #ifndef AIMS_GRAPH_SIZE_NO_DEPREC_WARNING
91 void recurseElementsWith(
const std::string&,
bool,
const Tree *,
92 std::set< Tree * >& )
const;
95 void recurseElementsWith(
const std::string&,
const T&,
bool,
const Tree *,
96 std::set< Tree * >& )
const;
102 inline Tree::Tree(
bool allowChildren,
const std::string & str )
111 Tree::recurseElementsWith(
const std::string& s,
const T& t,
bool recurse,
112 const Tree *p, std::set< Tree * >& trees )
const
118 if ( ( ao =
dynamic_cast< Tree *
>( *e ) ) != 0 )
120 if ( ao->hasProperty( s ) )
124 if ( ao->getProperty( s, tmp ) && tmp == t )
129 recurseElementsWith( s, t, recurse, ao, trees );
140 std::set< Tree * > trees;
142 recurseElementsWith( s, t, recurse,
this, trees );
void insert(BaseTree *child, int index=-1)
Adds child to the receiver at index (default: end)
const_iterator end() const
std::list< BaseTree * >::const_iterator const_iterator
const_iterator begin() const
Abstract base class for visiting constant Trees.
Abstract base class for visiting Trees.
virtual bool check(const carto::SyntaxSet &syntax, std::set< std::string > &missing) const
virtual size_t childrenSize() const
Returns the number of children BaseTree the receiver contains.
virtual size_t size() const __attribute__((__deprecated__))
deprecated
virtual void const_accept(ConstTreeVisitor &visitor) const
std::set< Tree * > getElementsWith(const std::string &, bool recurse=true) const
Tree(bool allowChildren=true, const std::string &str="")
virtual void accept(TreeVisitor &visitor)
SyntaxedObject< PropertySet > AttributedObject
std::map< std::string, Syntax > SyntaxSet
#define DECLARE_GENERIC_OBJECT_TYPE(T)