4 // Fraunhofer Institute for Open Communication Systems (FOKUS)
5 // Competence Center NETwork research (NET), St. Augustin, GERMANY
6 // Stefan Bund <g0dil@berlios.de>
8 // This program is free software; you can redistribute it and/or modify
9 // it under the terms of the GNU General Public License as published by
10 // the Free Software Foundation; either version 2 of the License, or
11 // (at your option) any later version.
13 // This program is distributed in the hope that it will be useful,
14 // but WITHOUT ANY WARRANTY; without even the implied warranty of
15 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 // GNU General Public License for more details.
18 // You should have received a copy of the GNU General Public License
19 // along with this program; if not, write to the
20 // Free Software Foundation, Inc.,
21 // 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
24 \brief Node inline non-template implementation */
29 #include "../Utils/senfassert.hh"
31 #define prefix_ inline
32 ///////////////////////////////cci.p///////////////////////////////////////
34 ///////////////////////////////////////////////////////////////////////////
35 // senf::console::GenericNode
37 prefix_ senf::console::GenericNode::~GenericNode()
40 prefix_ std::string const & senf::console::GenericNode::name()
46 prefix_ senf::console::GenericNode::GenericNode(std::string const & name)
47 : name_ (name), parent_ (0)
50 prefix_ void senf::console::GenericNode::name(std::string const & name)
55 prefix_ void senf::console::GenericNode::name(GenericNode & node, std::string const & name)
60 prefix_ boost::shared_ptr<senf::console::DirectoryNode> senf::console::GenericNode::parent()
63 return boost::static_pointer_cast<DirectoryNode>(
64 parent_ ? parent_->shared_from_this() : ptr() );
67 ///////////////////////////////////////////////////////////////////////////
68 // senf::console::DirectoryNode
70 prefix_ senf::console::GenericNode &
71 senf::console::DirectoryNode::add(std::auto_ptr<GenericNode> node, bool uniquify)
73 GenericNode::ptr p (node.release());
78 prefix_ senf::console::DirectoryNode &
79 senf::console::DirectoryNode::operator[](std::string const & name)
82 return dynamic_cast<DirectoryNode&>(lookup(name));
85 prefix_ senf::console::CommandNode &
86 senf::console::DirectoryNode::operator()(std::string const & name)
89 return dynamic_cast<CommandNode&>(lookup(name));
92 prefix_ senf::console::DirectoryNode &
93 senf::console::DirectoryNode::mkdir(std::string const & name)
95 return static_cast<DirectoryNode &>(
96 add(std::auto_ptr<GenericNode>(new DirectoryNode(name))));
99 prefix_ senf::console::DirectoryNode::ChildrenRange senf::console::DirectoryNode::children()
102 return boost::make_iterator_range(children_.begin(), children_.end());
105 prefix_ senf::console::DirectoryNode::DirectoryNode(std::string const & name)
109 ///////////////////////////////////////////////////////////////////////////
110 // senf::console::CommandNode
112 prefix_ senf::console::CommandNode::CommandNode(std::string const & name)
116 ///////////////////////////////cci.e///////////////////////////////////////
123 // comment-column: 40
124 // c-file-style: "senf"
125 // indent-tabs-mode: nil
126 // ispell-local-dictionary: "american"
127 // compile-command: "scons -u test"