X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=Console%2FNode.hh;h=d081ffd6476ce849a441ea64fd565d03879e4308;hb=16d94efc2159cba35fc44e5b26747ae0a2ab237b;hp=c2c8be560738d1029a8865494e15209d0fbd1657;hpb=5e9e6057a4e5c1241ff3f1b75b0f797eb570725d;p=senf.git diff --git a/Console/Node.hh b/Console/Node.hh index c2c8be5..d081ffd 100644 --- a/Console/Node.hh +++ b/Console/Node.hh @@ -34,6 +34,7 @@ #include #include #include "../Utils/Exception.hh" +#include "Parse.hh" //#include "Node.mpp" ///////////////////////////////hh.p//////////////////////////////////////// @@ -54,6 +55,7 @@ namespace console { // Types typedef boost::shared_ptr ptr; + typedef boost::shared_ptr cptr; typedef boost::weak_ptr weak_ptr; /////////////////////////////////////////////////////////////////////////// @@ -66,6 +68,9 @@ namespace console { std::string path() const; + ptr thisptr(); + cptr thisptr() const; + protected: explicit GenericNode(std::string const & name); @@ -92,6 +97,7 @@ namespace console { // Types typedef boost::shared_ptr ptr; + typedef boost::shared_ptr cptr; typedef boost::weak_ptr weak_ptr; typedef boost::iterator_range ChildrenRange; @@ -103,17 +109,23 @@ namespace console { DirectoryNode & operator[](std::string const & name) const; CommandNode & operator()(std::string const & name) const; + GenericNode & get(std::string const & name) const; DirectoryNode & mkdir(std::string const & name); ChildrenRange children() const; + template + GenericNode & traverse(ForwardRange const & range); + + ptr thisptr(); + cptr thisptr() const; + protected: explicit DirectoryNode(std::string const & name); private: void add(GenericNode::ptr node, bool uniquify); - GenericNode & lookup(std::string const & name) const; ChildMap children_; @@ -135,10 +147,17 @@ namespace console { // Types typedef boost::shared_ptr ptr; + typedef boost::shared_ptr cptr; typedef boost::weak_ptr weak_ptr; /////////////////////////////////////////////////////////////////////////// + virtual void operator()(std::ostream & output, + ParseCommandInfo::ArgumentsRange const & arguments) = 0; + + ptr thisptr(); + cptr thisptr() const; + protected: explicit CommandNode(std::string const & name); @@ -152,7 +171,7 @@ namespace console { ///////////////////////////////hh.e//////////////////////////////////////// #include "Node.cci" -//#include "Node.ct" +#include "Node.ct" //#include "Node.cti" #endif