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 OverloadedCommand inline non-template implementation */
26 //#include "OverloadedCommand.ih"
30 #define prefix_ inline
31 ///////////////////////////////cci.p///////////////////////////////////////
33 ///////////////////////////////////////////////////////////////////////////
34 // senf::console::CommandOverload
36 prefix_ senf::console::CommandOverload::~CommandOverload()
39 prefix_ void senf::console::CommandOverload::execute(std::ostream & os,
40 ParseCommandInfo const & command)
42 v_execute(os, command);
45 prefix_ void senf::console::CommandOverload::operator()(std::ostream & os,
46 ParseCommandInfo const & command)
51 prefix_ unsigned senf::console::CommandOverload::numArguments()
54 return v_numArguments();
57 prefix_ void senf::console::CommandOverload::argumentDoc(unsigned index, ArgumentDoc & doc)
60 return v_argumentDoc(index,doc);
63 prefix_ std::string senf::console::CommandOverload::doc()
69 prefix_ senf::console::OverloadedCommandNode & senf::console::CommandOverload::node()
76 prefix_ unsigned senf::console::CommandOverload::overloadIndex()
79 return node().overloadIndex(*this);
82 prefix_ senf::console::CommandOverload::CommandOverload()
86 ///////////////////////////////////////////////////////////////////////////
87 // senf::console::OverloadedCommandNode
89 prefix_ senf::console::OverloadedCommandNode::ptr senf::console::OverloadedCommandNode::create()
91 return ptr(new OverloadedCommandNode());
94 prefix_ senf::console::OverloadedCommandNode::ptr senf::console::OverloadedCommandNode::thisptr()
96 return boost::static_pointer_cast<OverloadedCommandNode>(shared_from_this());
99 prefix_ senf::console::OverloadedCommandNode::cptr senf::console::OverloadedCommandNode::thisptr()
102 return boost::static_pointer_cast<OverloadedCommandNode const>(shared_from_this());
105 prefix_ senf::console::OverloadedCommandNode &
106 senf::console::OverloadedCommandNode::doc(std::string const & doc)
113 senf::console::OverloadedCommandNode::overloadIndex(CommandOverload const & overload)
115 return find(overloads_.begin(), overloads_.end(), CommandOverload::cptr(&overload))
116 - overloads_.begin() + 1;
119 prefix_ senf::console::OverloadedCommandNode::OverloadedCommandNode()
122 ///////////////////////////////////////////////////////////////////////////
123 // senf::console::SimpleCommandOverload
125 prefix_ senf::console::SimpleCommandOverload::ptr
126 senf::console::SimpleCommandOverload::create(Function fn)
128 return ptr(new SimpleCommandOverload(fn));
131 prefix_ senf::console::SimpleCommandOverload &
132 senf::console::SimpleCommandOverload::doc(std::string const & doc)
138 prefix_ senf::console::SimpleCommandOverload::SimpleCommandOverload(Function fn)
142 ///////////////////////////////cci.e///////////////////////////////////////
149 // comment-column: 40
150 // c-file-style: "senf"
151 // indent-tabs-mode: nil
152 // ispell-local-dictionary: "american"
153 // compile-command: "scons -u test"