From: g0dil Date: Tue, 8 Apr 2008 00:07:58 +0000 (+0000) Subject: Utils: Add some type traits in type_traits.hh X-Git-Url: http://g0dil.de/git?p=senf.git;a=commitdiff_plain;h=bf1d8ba5ce6fc6a169a938183f8d01c8bdbccf32 Utils: Add some type traits in type_traits.hh Console: First implementation of command argument parsing doclib: Better doxygen header/footer dependency handling add missing Console includes git-svn-id: https://svn.berlios.de/svnroot/repos/senf/trunk@789 270642c3-0616-0410-b53a-bc976706d245 --- diff --git a/Console/Node.cci b/Console/Node.cci index ed1e30e..11d212e 100644 --- a/Console/Node.cci +++ b/Console/Node.cci @@ -92,6 +92,13 @@ prefix_ senf::console::DirectoryNode::ptr senf::console::DirectoryNode::create() return ptr(new DirectoryNode()); } +prefix_ bool senf::console::DirectoryNode::hasChild(std::string const & name) + const +{ + ChildMap::const_iterator i (children_.find(name)); + return i != children_.end(); +} + prefix_ senf::console::DirectoryNode & senf::console::DirectoryNode::getDirectory(std::string const & name) const diff --git a/Console/Node.hh b/Console/Node.hh index 86c3e17..29c5511 100644 --- a/Console/Node.hh +++ b/Console/Node.hh @@ -210,8 +210,6 @@ //#include "Node.mpp" ///////////////////////////////hh.p//////////////////////////////////////// -#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP() - namespace senf { namespace console { @@ -411,6 +409,9 @@ namespace console { be saved and/or re-attached at some other place in the tree. */ + bool hasChild(std::string const & name) const; + ///< \c true, if there is a child with name \a name + GenericNode & get(std::string const & name) const; ///< Get child node /**< \throws UnknownNodeNameException if a child \a name @@ -489,8 +490,6 @@ namespace console { friend DirectoryNode & root(); }; - BOOST_TYPEOF_REGISTER_TYPE(DirectoryNode); - /// Exception: Unknown node name struct UnknownNodeNameException : public senf::Exception { UnknownNodeNameException() : senf::Exception("Unknown node name") {}}; @@ -617,12 +616,16 @@ namespace console { Function const & fn, ...); #endif - BOOST_TYPEOF_REGISTER_TYPE(SimpleCommandNode); - DirectoryNode & root(); }} +#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP() + +BOOST_TYPEOF_REGISTER_TYPE(senf::console::DirectoryNode) +BOOST_TYPEOF_REGISTER_TYPE(senf::console::SimpleCommandNode) + + ///////////////////////////////hh.e//////////////////////////////////////// #include "Node.cci" #include "Node.ct" diff --git a/Console/ParseParameter.cti b/Console/ParseParameter.cti new file mode 100644 index 0000000..a36a08c --- /dev/null +++ b/Console/ParseParameter.cti @@ -0,0 +1,110 @@ +// $Id$ +// +// Copyright (C) 2008 +// Fraunhofer Institute for Open Communication Systems (FOKUS) +// Competence Center NETwork research (NET), St. Augustin, GERMANY +// Stefan Bund +// +// This program is free software; you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation; either version 2 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the +// Free Software Foundation, Inc., +// 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +/** \file + \brief ParseParameter inline template implementation */ + +//#include "ParseParameter.ih" + +// Custom includes +#include "../Utils/TypeInfo.hh" + +#define prefix_ inline +///////////////////////////////cti.p/////////////////////////////////////// + +/////////////////////////////////////////////////////////////////////////// +// senf::console::detail::ParameterInfoBase + +prefix_ senf::console::detail::ParameterInfoBase::ParameterInfoBase(std::string const & type_) + : type (type_), name (), hasDefault (false) +{} + +/////////////////////////////////////////////////////////////////////////// +// senf::console::detail::ParameterInfo + +template +prefix_ typename senf::console::detail::ParameterInfo::ptr +senf::console::detail::ParameterInfo::create() +{ + return ptr(new ParameterInfo()); +} + +template +prefix_ senf::console::detail::ParameterInfo::ParameterInfo() + : ParameterInfoBase ( ParameterTraits::typeDescription() ), + defaultValue () +{} + +/////////////////////////////////////////////////////////////////////////// +// senf::console::detail::ReturnValueTraits + +template +template +prefix_ void senf::console::detail::ReturnValueTraits::callAndWrite(Fn const & fn, + std::ostream & os) +{ + os << fn() << "\n"; +} + +template +prefix_ void senf::console::detail::ReturnValueTraits::callAndWrite(Fn const & fn, + std::ostream & os) +{ + fn(); +} + +/////////////////////////////////////////////////////////////////////////// +// senf::console::detail::ParameterTraits + +template +prefix_ void senf::console::detail::ParameterTraits:: +parse(ParseCommandInfo::TokensRange const & tokens, Type & out) +{ + if (tokens.size() != 1) + throw SyntaxErrorException("parameter syntax error"); + try { + out = boost::lexical_cast(tokens.begin()[0].value()); + } + catch (std::bad_cast & ex) { + throw SyntaxErrorException("parameter syntax error"); + } +} + +template +prefix_ std::string senf::console::detail::ParameterTraits::typeDescription() +{ + return prettyName(typeid(Type)); +} + +///////////////////////////////cti.e/////////////////////////////////////// +#undef prefix_ + + +// Local Variables: +// mode: c++ +// fill-column: 100 +// comment-column: 40 +// c-file-style: "senf" +// indent-tabs-mode: nil +// ispell-local-dictionary: "american" +// compile-command: "scons -u test" +// End: diff --git a/Console/ParseParameter.hh b/Console/ParseParameter.hh new file mode 100644 index 0000000..31ac63e --- /dev/null +++ b/Console/ParseParameter.hh @@ -0,0 +1,110 @@ +// $Id$ +// +// Copyright (C) 2008 +// Fraunhofer Institute for Open Communication Systems (FOKUS) +// Competence Center NETwork research (NET), St. Augustin, GERMANY +// Stefan Bund +// +// This program is free software; you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation; either version 2 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the +// Free Software Foundation, Inc., +// 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +/** \file + \brief ParseParameter public header */ + +#ifndef HH_ParseParameter_ +#define HH_ParseParameter_ 1 + +// Custom includes +#include +#include +#include "../Utils/intrusive_refcount.hh" +#include "Parse.hh" +#include "Node.hh" + +//#include "ParseParameter.mpp" +///////////////////////////////hh.p//////////////////////////////////////// + +namespace senf { +namespace console { +namespace detail { + + struct ParameterInfoBase + : public intrusive_refcount + { + typedef boost::intrusive_ptr ptr; + + std::string type; + std::string name; + bool hasDefault; + + ParameterInfoBase(std::string const & type); + }; + + template + struct ParameterInfo + : public ParameterInfoBase + { + typedef boost::intrusive_ptr ptr; + + static ptr create(); + ParameterInfo(); + + ParameterType defaultValue; + }; + + template + struct ReturnValueTraits + { + typedef Type type; + + template + static void callAndWrite(Fn const & fn, std::ostream & os); + }; + + template <> + struct ReturnValueTraits + { + typedef void type; + + template + static void callAndWrite(Fn const & fn, std::ostream & os); + }; + + template + struct ParameterTraits + { + typedef Type type; + static void parse(ParseCommandInfo::TokensRange const & tokens, Type & out); + static std::string typeDescription(); + }; + +}}} + +///////////////////////////////hh.e//////////////////////////////////////// +//#include "ParseParameter.cci" +//#include "ParseParameter.ct" +#include "ParseParameter.cti" +#endif + + +// Local Variables: +// mode: c++ +// fill-column: 100 +// comment-column: 40 +// c-file-style: "senf" +// indent-tabs-mode: nil +// ispell-local-dictionary: "american" +// compile-command: "scons -u test" +// End: diff --git a/Console/ParseParameter.test.cc b/Console/ParseParameter.test.cc new file mode 100644 index 0000000..79b1d9f --- /dev/null +++ b/Console/ParseParameter.test.cc @@ -0,0 +1,53 @@ +// $Id$ +// +// Copyright (C) 2008 +// Fraunhofer Institute for Open Communication Systems (FOKUS) +// Competence Center NETwork research (NET), St. Augustin, GERMANY +// Stefan Bund +// +// This program is free software; you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation; either version 2 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the +// Free Software Foundation, Inc., +// 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +/** \file + \brief ParseParameter.test unit tests */ + +//#include "ParseParameter.test.hh" +//#include "ParseParameter.test.ih" + +// Custom includes +#include "ParseParameter.hh" + +#include +#include + +#define prefix_ +///////////////////////////////cc.p//////////////////////////////////////// + +BOOST_AUTO_UNIT_TEST(parseParameter) +{} + +///////////////////////////////cc.e//////////////////////////////////////// +#undef prefix_ + + +// Local Variables: +// mode: c++ +// fill-column: 100 +// comment-column: 40 +// c-file-style: "senf" +// indent-tabs-mode: nil +// ispell-local-dictionary: "american" +// compile-command: "scons -u test" +// End: diff --git a/Console/ParsedCommand.cc b/Console/ParsedCommand.cc new file mode 100644 index 0000000..3a62096 --- /dev/null +++ b/Console/ParsedCommand.cc @@ -0,0 +1,55 @@ +// $Id$ +// +// Copyright (C) 2008 +// Fraunhofer Institute for Open Communication Systems (FOKUS) +// Competence Center NETwork research (NET), St. Augustin, GERMANY +// Stefan Bund +// +// This program is free software; you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation; either version 2 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the +// Free Software Foundation, Inc., +// 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +/** \file + \brief ParsedCommand non-inline non-template implementation */ + +#include "ParsedCommand.hh" +#include "ParsedCommand.ih" + +// Custom includes + +#include "ParsedCommand.mpp" +#define prefix_ +///////////////////////////////cc.p//////////////////////////////////////// + +/////////////////////////////////////////////////////////////////////////// +// senf::console::ParsedCommandOverloadBase + +prefix_ void senf::console::ParsedCommandOverloadBase::v_help(std::ostream & os) + const +{} + +///////////////////////////////cc.e//////////////////////////////////////// +#undef prefix_ +#include "ParsedCommand.mpp" + + +// Local Variables: +// mode: c++ +// fill-column: 100 +// comment-column: 40 +// c-file-style: "senf" +// indent-tabs-mode: nil +// ispell-local-dictionary: "american" +// compile-command: "scons -u test" +// End: diff --git a/Console/ParsedCommand.cci b/Console/ParsedCommand.cci new file mode 100644 index 0000000..4d4fc29 --- /dev/null +++ b/Console/ParsedCommand.cci @@ -0,0 +1,59 @@ +// $Id$ +// +// Copyright (C) 2008 +// Fraunhofer Institute for Open Communication Systems (FOKUS) +// Competence Center NETwork research (NET), St. Augustin, GERMANY +// Stefan Bund +// +// This program is free software; you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation; either version 2 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the +// Free Software Foundation, Inc., +// 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +/** \file + \brief ParsedCommand inline non-template implementation */ + +#include "ParsedCommand.ih" + +// Custom includes + +#define prefix_ inline +///////////////////////////////cci.p/////////////////////////////////////// + +/////////////////////////////////////////////////////////////////////////// +// senf::console::ParsedCommandOverloadBase + +prefix_ senf::console::ParsedCommandOverloadBase::ParsedCommandOverloadBase() +{} + +prefix_ senf::console::detail::ParameterInfoBase & +senf::console::ParsedCommandOverloadBase::arg(unsigned n) + const +{ + BOOST_ASSERT(n < parameters_.size()); + return * parameters_[n]; +} + +///////////////////////////////cci.e/////////////////////////////////////// +#undef prefix_ + + +// Local Variables: +// mode: c++ +// fill-column: 100 +// comment-column: 40 +// c-file-style: "senf" +// indent-tabs-mode: nil +// ispell-local-dictionary: "american" +// compile-command: "scons -u test" +// End: diff --git a/Console/ParsedCommand.ct b/Console/ParsedCommand.ct new file mode 100644 index 0000000..f0469de --- /dev/null +++ b/Console/ParsedCommand.ct @@ -0,0 +1,53 @@ +// $Id$ +// +// Copyright (C) 2008 +// Fraunhofer Institute for Open Communication Systems (FOKUS) +// Competence Center NETwork research (NET), St. Augustin, GERMANY +// Stefan Bund +// +// This program is free software; you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation; either version 2 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the +// Free Software Foundation, Inc., +// 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +/** \file + \brief ParsedCommand non-inline template implementation */ + +#include "ParsedCommand.ih" + +// Custom includes + +#define prefix_ +///////////////////////////////ct.p//////////////////////////////////////// + +/////////////////////////////////////////////////////////////////////////// +// senf::console::ParsedCommandOverload + +#define BOOST_PP_ITERATION_PARAMS_1 (4, (0, SENF_CONSOLE_MAX_COMMAND_ARITY, \ + SENF_ABSOLUTE_INCLUDE_PATH(Console/ParsedCommand.mpp), \ + 3)) +#include BOOST_PP_ITERATE() + +///////////////////////////////ct.e//////////////////////////////////////// +#undef prefix_ + + +// Local Variables: +// mode: c++ +// fill-column: 100 +// comment-column: 40 +// c-file-style: "senf" +// indent-tabs-mode: nil +// ispell-local-dictionary: "american" +// compile-command: "scons -u test" +// End: diff --git a/Console/ParsedCommand.cti b/Console/ParsedCommand.cti new file mode 100644 index 0000000..86a78fc --- /dev/null +++ b/Console/ParsedCommand.cti @@ -0,0 +1,127 @@ +// $Id$ +// +// Copyright (C) 2008 +// Fraunhofer Institute for Open Communication Systems (FOKUS) +// Competence Center NETwork research (NET), St. Augustin, GERMANY +// Stefan Bund +// +// This program is free software; you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation; either version 2 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the +// Free Software Foundation, Inc., +// 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +/** \file + \brief ParsedCommand inline template implementation */ + +#include "ParsedCommand.ih" + +// Custom includes + +#define prefix_ inline +///////////////////////////////cti.p/////////////////////////////////////// + +/////////////////////////////////////////////////////////////////////////// +// senf::console::ParsedCommandOverloadBase + +template +prefix_ senf::console::detail::ParameterInfo & +senf::console::ParsedCommandOverloadBase::arg(unsigned n) + const +{ + return static_cast &>(arg(n)); +} + +template +prefix_ void senf::console::ParsedCommandOverloadBase::addParameter() +{ + parameters_.push_back(detail::ParameterInfo::create()); +} + +/////////////////////////////////////////////////////////////////////////// +// senf::console::ParsedCommandOverload + +#define BOOST_PP_ITERATION_PARAMS_1 (4, (0, SENF_CONSOLE_MAX_COMMAND_ARITY, \ + SENF_ABSOLUTE_INCLUDE_PATH(Console/ParsedCommand.mpp), \ + 2)) +#include BOOST_PP_ITERATE() + +/////////////////////////////////////////////////////////////////////////// +// namespace members + +namespace { + + // What is THIS about ?? + + // Ok, here's the dope: parsed commands may optionally have an std::ostream & first argument. If + // this argument is given, then the function will be called with the console output stream as + // it's first argument. + // + // This is implemented in the following way: ParsedCommandOverload (the class responsible for + // calling the callback) will ALWAYS pass the stream as first argument. If the user callback + // expects os as it's first argument, 'ignoreOneArg' will be false and the user supplied + // function will be directly passed to ParsedCommandOverload. + // + // If however, it does NOT take an std::ostream first argument, 'ignoreOneArg' will be true and + // the create member will use boost::bind to DROP the first argument. + + template + struct CreateParsedCommandOverload + {}; + + template + struct CreateParsedCommandOverload + { + typedef Traits traits; + + template + static typename senf::console::ParsedCommandOverload::ptr create(Function fn) + { return senf::console::ParsedCommandOverload::create(fn); }; + }; + +# define BOOST_PP_ITERATION_PARAMS_1 (4, (0, SENF_CONSOLE_MAX_COMMAND_ARITY, \ + SENF_ABSOLUTE_INCLUDE_PATH(Console/ParsedCommand.mpp), \ + 4)) +# include BOOST_PP_ITERATE() + +} + +template +prefix_ senf::console::ParsedCommandOverload< + typename senf::console::detail::ParsedCommandTraits::traits> & +senf::console::senf_console_add_node(DirectoryNode & node, std::string const & name, + Function fn, int) +{ + OverloadedCommandNode & cmdNode ( + node.hasChild(name) + ? dynamic_cast(node(name)) + : node.add(name, OverloadedCommandNode::create()) ); + + typedef senf::console::detail::ParsedCommandTraits CmdTraits; + + return cmdNode.add( CreateParsedCommandOverload< + typename CmdTraits::traits, ! CmdTraits::has_ostream_arg>::create(fn) ); +} + +///////////////////////////////cti.e/////////////////////////////////////// +#undef prefix_ + + +// Local Variables: +// mode: c++ +// fill-column: 100 +// comment-column: 40 +// c-file-style: "senf" +// indent-tabs-mode: nil +// ispell-local-dictionary: "american" +// compile-command: "scons -u test" +// End: diff --git a/Console/ParsedCommand.hh b/Console/ParsedCommand.hh new file mode 100644 index 0000000..cd126c3 --- /dev/null +++ b/Console/ParsedCommand.hh @@ -0,0 +1,103 @@ +// $Id$ +// +// Copyright (C) 2008 +// Fraunhofer Institute for Open Communication Systems (FOKUS) +// Competence Center NETwork research (NET), St. Augustin, GERMANY +// Stefan Bund +// +// This program is free software; you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation; either version 2 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the +// Free Software Foundation, Inc., +// 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +/** \file + \brief ParsedCommand public header */ + +#ifndef HH_ParsedCommand_ +#define HH_ParsedCommand_ 1 + +// Custom includes +#include +#include +#include +#include +#include +#include "../config.hh" +#include "OverloadedCommand.hh" +#include "ParseParameter.hh" +#include "../Utils/type_traits.hh" + +#include "ParsedCommand.ih" +#include "ParsedCommand.mpp" +///////////////////////////////hh.p//////////////////////////////////////// + +namespace senf { +namespace console { + + class ParsedCommandOverloadBase + : public CommandOverload + { + public: + typedef boost::intrusive_ptr ptr; + + protected: + ParsedCommandOverloadBase(); + + detail::ParameterInfoBase & arg(unsigned n) const; + template detail::ParameterInfo & arg(unsigned n) const; + + template + void addParameter(); + + private: + virtual void v_help(std::ostream & os) const; + + typedef std::vector Parameters; + Parameters parameters_; + }; + + template + class ParsedCommandOverload {}; + +# define BOOST_PP_ITERATION_PARAMS_1 (4, (0, SENF_CONSOLE_MAX_COMMAND_ARITY, \ + SENF_ABSOLUTE_INCLUDE_PATH(Console/ParsedCommand.mpp), \ + 1)) +# include BOOST_PP_ITERATE() + + template + ParsedCommandOverload::traits> & + senf_console_add_node(DirectoryNode & node, std::string const & name, Function fn, int); + +}} + +#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP() + +BOOST_TYPEOF_REGISTER_TEMPLATE(senf::console::ParsedCommandOverload, (class,unsigned)) +BOOST_TYPEOF_REGISTER_TEMPLATE(boost::function_traits, 1) + +///////////////////////////////hh.e//////////////////////////////////////// +#include "ParsedCommand.cci" +#include "ParsedCommand.ct" +#include "ParsedCommand.cti" +#endif + + +// Local Variables: +// mode: c++ +// fill-column: 100 +// comment-column: 40 +// c-file-style: "senf" +// indent-tabs-mode: nil +// ispell-local-dictionary: "american" +// compile-command: "scons -u test" +// End: diff --git a/Console/ParsedCommand.ih b/Console/ParsedCommand.ih new file mode 100644 index 0000000..445d055 --- /dev/null +++ b/Console/ParsedCommand.ih @@ -0,0 +1,90 @@ +// $Id$ +// +// Copyright (C) 2008 +// Fraunhofer Institute for Open Communication Systems (FOKUS) +// Competence Center NETwork research (NET), St. Augustin, GERMANY +// Stefan Bund +// +// This program is free software; you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation; either version 2 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the +// Free Software Foundation, Inc., +// 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +/** \file + \brief ParsedCommand internal header */ + +#ifndef IH_ParsedCommand_ +#define IH_ParsedCommand_ 1 + +// Custom includes + +///////////////////////////////ih.p//////////////////////////////////////// + +namespace senf { +namespace console { +namespace detail { + + template ::value> + struct ParsedCommandTraits + {}; + + template 0)> + struct FirstArgType + { + typedef void type; + }; + + template + struct FirstArgType + { + typedef typename Traits::arg1_type type; + }; + + template + struct ParsedCommandTraits + { + typedef Function base_type; + typedef typename senf::remove_member_pointer< + typename boost::remove_pointer::type>::type function_type; + typedef boost::function_traits base_traits; + + typedef typename FirstArgType::type first_arg_type; + + static const bool has_ostream_arg = boost::is_same::value; + + typedef typename boost::mpl::if_c< + has_ostream_arg, + typename function_traits_remove_arg::type, + base_traits> + ::type traits; + + static const bool is_member = boost::is_member_pointer::value; + + typedef typename senf::member_class::type class_type; + }; + +}}} + +///////////////////////////////ih.e//////////////////////////////////////// +#endif + + +// Local Variables: +// mode: c++ +// fill-column: 100 +// comment-column: 40 +// c-file-style: "senf" +// indent-tabs-mode: nil +// ispell-local-dictionary: "american" +// compile-command: "scons -u test" +// End: diff --git a/Console/ParsedCommand.mpp b/Console/ParsedCommand.mpp new file mode 100644 index 0000000..3052290 --- /dev/null +++ b/Console/ParsedCommand.mpp @@ -0,0 +1,210 @@ +// $Id$ +// +// Copyright (C) 2008 +// Fraunhofer Institute for Open Communication Systems (FOKUS) +// Competence Center NETwork research (NET), St. Augustin, GERMANY +// Stefan Bund +// +// This program is free software; you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation; either version 2 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the +// Free Software Foundation, Inc., +// 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +/** \file + \brief ParsedCommand Boost.Preprocesser external iteration include */ + +#if !BOOST_PP_IS_ITERATING && !defined(MPP_ParsedCommand_) +#define MPP_ParsedCommand_ 1 + +// Custom includes +#include +#include +#include +#include +#include +#include +#include + +// ///////////////////////////mpp.p//////////////////////////////////////// +#elif BOOST_PP_IS_ITERATING // //////////////////////////////////////////// +// //////////////////////////////////////////////////////////////////////// +// Local Macros + +#define mpp_ArgTypeN(n) BOOST_PP_CAT(BOOST_PP_CAT(arg, BOOST_PP_INC(n)), _type) +#define mpp_ArgN(n) BOOST_PP_CAT(arg, BOOST_PP_INC(n)) + +#define mpp_ArgTypes_(z,n,d) typename traits::mpp_ArgTypeN(n) +#define mpp_TrailingArgTypes() BOOST_PP_ENUM_TRAILING( BOOST_PP_ITERATION(), mpp_ArgTypes_, _ ) + +#define mpp_Args_(z,n,d) boost::cref(mpp_ArgN(n)) +#define mpp_TrailingArgs() BOOST_PP_ENUM_TRAILING( BOOST_PP_ITERATION(), mpp_Args_, _ ) + +#define mpp_BindArgs_(z,n,d) BOOST_PP_CAT( _, BOOST_PP_INC(BOOST_PP_INC(n))) +#define mpp_TrailingBindArgs() BOOST_PP_ENUM_TRAILING( BOOST_PP_ITERATION(), mpp_BindArgs_, _ ) + +// //////////////////////////////////////////////////////////////////////// +#if BOOST_PP_ITERATION_FLAGS()==1 // ////////////////////////////////////// +// //////////////////////////////////////////////////////////////////////// + +// Header file (.hh) + +template +class ParsedCommandOverload + : public ParsedCommandOverloadBase +{ +public: + typedef boost::intrusive_ptr ptr; + typedef FunctionTraits traits; + typedef boost::function Function; + +# define mpp_l(z,n,d) \ + typedef typename boost::remove_reference::type \ + mpp_ArgTypeN(n); + BOOST_PP_REPEAT( BOOST_PP_ITERATION(), mpp_l, _ ) +# undef mpp_l + + static ptr create(Function fn); + +protected: + +private: + ParsedCommandOverload(Function fn); + + virtual void v_execute(std::ostream & os, ParseCommandInfo const & command) const; + + Function function_; +}; + +// //////////////////////////////////////////////////////////////////////// +#elif BOOST_PP_ITERATION_FLAGS()==2 // //////////////////////////////////// +// //////////////////////////////////////////////////////////////////////// + +// inline template implementation (.cti) + +template +prefix_ typename senf::console::ParsedCommandOverload::ptr +senf::console::ParsedCommandOverload::create(Function fn) +{ + return ptr(new ParsedCommandOverload(fn)); +} + +template +prefix_ +senf::console::ParsedCommandOverload:: +ParsedCommandOverload(Function fn) + : function_ (fn) +{ +# define mpp_l(z,n,d) addParameter< mpp_ArgTypeN(n) >(); + BOOST_PP_REPEAT( BOOST_PP_ITERATION(), mpp_l, _ ) +# undef mpp_l +} + +// //////////////////////////////////////////////////////////////////////// +#elif BOOST_PP_ITERATION_FLAGS()==3 // //////////////////////////////////// +// //////////////////////////////////////////////////////////////////////// + +// non-inline template implementation (.ct) + +template +prefix_ void senf::console::ParsedCommandOverload:: +v_execute(std::ostream & os, ParseCommandInfo const & command) + const +{ + if ( command.arguments().size() > BOOST_PP_ITERATION() + || (command.arguments().size() < BOOST_PP_ITERATION() + && ! arg( BOOST_PP_ITERATION()-1 ).hasDefault) ) + throw SyntaxErrorException("invalid number of arguments"); + + // First define local variables argN for the parameters. The variables are initialized to their + // default values +# define mpp_l(z,n,d) mpp_ArgTypeN(n) mpp_ArgN(n) (arg< mpp_ArgTypeN(n) >( n ).defaultValue); + BOOST_PP_REPEAT( BOOST_PP_ITERATION(), mpp_l, _ ) +# undef mpp_l + + ParseCommandInfo::argument_iterator i (command.arguments().begin()); + ParseCommandInfo::argument_iterator const i_end (command.arguments().end()); + + // Now parse the arguments which are provided leaving the trailing arguments at their default + // value. We have already checked above, whether those default values are valid. Be aware, that + // the following cases do NOT have 'break' statements ! + + switch (BOOST_PP_ITERATION() - command.arguments().size()) { + +# define mpp_l(z,n,d) \ + case n : \ + detail::ParameterTraits< mpp_ArgTypeN(n) >::parse( *(i++), mpp_ArgN(n) ); + BOOST_PP_REPEAT( BOOST_PP_ITERATION(), mpp_l, _ ) +# undef mpp_l + + default : // This happens, if ALL arguments are defaulted + ; + } + + // Now call the function binding the arguments to the values parsed above. callAndWrite is + // specialized to ignore a 'void' return value but automatically write all other values to the + // output stream. + detail::ReturnValueTraits::callAndWrite( + boost::bind(function_, boost::ref(os) + mpp_TrailingArgs()), + os ); +} + +// //////////////////////////////////////////////////////////////////////// +#elif BOOST_PP_ITERATION_FLAGS()==4 // //////////////////////////////////// +// //////////////////////////////////////////////////////////////////////// + +// CreateParsedCommandOverload + +template +struct CreateParsedCommandOverload +{ + typedef Traits traits; + + template + static typename senf::console::ParsedCommandOverload::ptr create(Function fn) + { + return senf::console::ParsedCommandOverload::create( + boost::bind(fn mpp_TrailingBindArgs()) ); + } + +}; + +// //////////////////////////////////////////////////////////////////////// +#endif // ///////////////////////////////////////////////////////////////// +// //////////////////////////////////////////////////////////////////////// +// Undefine local Macros + +#undef mpp_TrailingArgs +#undef mpp_Args_ + +#undef mpp_TrailingArgTypes +#undef mpp_ArgTypes_ + +#undef mpp_ArgN +#undef mpp_ArgTypeN + +// //////////////////////////////////////////////////////////////////////// +#endif // ///////////////////////////////////////////////////////////////// +// ///////////////////////////mpp.e//////////////////////////////////////// + + +// Local Variables: +// mode: c++ +// fill-column: 100 +// comment-column: 40 +// c-file-style: "senf" +// indent-tabs-mode: nil +// ispell-local-dictionary: "american" +// compile-command: "scons -u test" +// End: diff --git a/Console/ParsedCommand.test.cc b/Console/ParsedCommand.test.cc new file mode 100644 index 0000000..6365608 --- /dev/null +++ b/Console/ParsedCommand.test.cc @@ -0,0 +1,130 @@ +// $Id$ +// +// Copyright (C) 2008 +// Fraunhofer Institute for Open Communication Systems (FOKUS) +// Competence Center NETwork research (NET), St. Augustin, GERMANY +// Stefan Bund +// +// This program is free software; you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation; either version 2 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the +// Free Software Foundation, Inc., +// 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +/** \file + \brief ParsedCommand.test unit tests */ + +//#include "ParsedCommand.test.hh" +//#include "ParsedCommand.test.ih" + +// Custom includes +#include +#include "ParsedCommand.hh" +#include "Executor.hh" +#include "Parse.hh" +#include "ScopedDirectory.hh" + +#include +#include + +#define prefix_ +///////////////////////////////cc.p//////////////////////////////////////// + +namespace { + + int cb1(int a, double b) { return int(a+b); } + double cb2() { return 1.2; } + void cb3(int) {} + std::string cb4(std::ostream & os) { os << "text\n"; return "value"; } + void cb5(std::ostream & os, int v) { os << "Value: " << v << "\n"; } +} + +BOOST_AUTO_UNIT_TEST(parsedCommand) +{ + senf::console::Executor executor; + senf::console::CommandParser parser; + senf::console::ScopedDirectory<> dir; + senf::console::root().add("test", dir); + + { + std::stringstream ss; + dir.add("cb1", &cb1); + parser.parse("test/cb1 2 3.2", + boost::bind( boost::ref(executor), boost::ref(ss), _1 )); + BOOST_CHECK_EQUAL( ss.str(), "5\n" ); + } + + { + std::stringstream ss; + dir.add("cb2", &cb2); + parser.parse("test/cb2", + boost::bind( boost::ref(executor), boost::ref(ss), _1 )); + BOOST_CHECK_EQUAL( ss.str(), "1.2\n" ); + } + + { + std::stringstream ss; + dir.add("cb3", &cb3); + parser.parse("test/cb3 234", + boost::bind( boost::ref(executor), boost::ref(ss), _1 )); + BOOST_CHECK_EQUAL( ss.str(), "" ); + } + + { + std::stringstream ss; + dir.add("cb4", &cb4); + parser.parse("test/cb4", + boost::bind( boost::ref(executor), boost::ref(ss), _1 )); + BOOST_CHECK_EQUAL( ss.str(), "text\n" "value\n" ); + } + + { + std::stringstream ss; + dir.add("cb5", &cb5); + parser.parse("test/cb5 1234", + boost::bind( boost::ref(executor), boost::ref(ss), _1 )); + BOOST_CHECK_EQUAL( ss.str(), "Value: 1234\n" ); + } + + { + std::stringstream ss; + + BOOST_CHECK_THROW( + parser.parse("test/cb1 2 3.2 foo", + boost::bind( boost::ref(executor), boost::ref(ss), _1 )), + senf::console::SyntaxErrorException ); + + BOOST_CHECK_THROW( + parser.parse("test/cb1 2", + boost::bind( boost::ref(executor), boost::ref(ss), _1 )), + senf::console::SyntaxErrorException ); + + BOOST_CHECK_THROW( + parser.parse("test/cb1 2 foo", + boost::bind( boost::ref(executor), boost::ref(ss), _1 )), + senf::console::SyntaxErrorException ); + } +} + +///////////////////////////////cc.e//////////////////////////////////////// +#undef prefix_ + + +// Local Variables: +// mode: c++ +// fill-column: 100 +// comment-column: 40 +// c-file-style: "senf" +// indent-tabs-mode: nil +// ispell-local-dictionary: "american" +// compile-command: "scons -u test" +// End: diff --git a/Console/ScopedDirectory.cci b/Console/ScopedDirectory.cci index 518a3af..6f19b12 100644 --- a/Console/ScopedDirectory.cci +++ b/Console/ScopedDirectory.cci @@ -45,6 +45,12 @@ senf::console::ScopedDirectoryBase::remove(std::string const & name) return node().remove(name); } +prefix_ bool senf::console::ScopedDirectoryBase::hasChild(std::string const & name) + const +{ + return node().hasChild(name); +} + prefix_ senf::console::DirectoryNode & senf::console::ScopedDirectoryBase::getDirectory(std::string const & name) const diff --git a/Console/ScopedDirectory.hh b/Console/ScopedDirectory.hh index 6c27f40..d28e157 100644 --- a/Console/ScopedDirectory.hh +++ b/Console/ScopedDirectory.hh @@ -72,6 +72,7 @@ namespace console { ///\{ GenericNode::ptr remove(std::string const & name); + bool hasChild(std::string const & name) const; DirectoryNode & getDirectory(std::string const & name) const; DirectoryNode & operator[](std::string const & name) const; CommandNode & getCommand(std::string const & name) const; diff --git a/Utils/type_traits.hh b/Utils/type_traits.hh new file mode 100644 index 0000000..bbf56a5 --- /dev/null +++ b/Utils/type_traits.hh @@ -0,0 +1,99 @@ +// $Id$ +// +// Copyright (C) 2008 +// Fraunhofer Institute for Open Communication Systems (FOKUS) +// Competence Center NETwork research (NET), St. Augustin, GERMANY +// Stefan Bund +// +// This program is free software; you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation; either version 2 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the +// Free Software Foundation, Inc., +// 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +/** \file + \brief type_traits public header */ + +#ifndef HH_type_traits_ +#define HH_type_traits_ 1 + +// Custom includes +#include +#include +#include +#include + +#include "type_traits.mpp" +///////////////////////////////hh.p//////////////////////////////////////// + +namespace senf { + + template + struct function_traits_remove_arg {}; + + template + struct remove_member_pointer + { + typedef MemberPointer type; + }; + + template + struct remove_member_pointer + { + typedef T type; + }; + + template + struct member_class + { + typedef void type; + }; + + template + struct member_class + { + typedef C type; + }; + + template + struct remove_any_pointer + : public remove_member_pointer::type> + {}; + + template + struct is_any_function + : public boost::is_function::type> + {}; + +# define BOOST_PP_ITERATION_PARAMS_1 (4, (0, 10, \ + SENF_ABSOLUTE_INCLUDE_PATH(Utils/type_traits.mpp), \ + 1)) +# include BOOST_PP_ITERATE() + +} + +///////////////////////////////hh.e//////////////////////////////////////// +//#include "type_traits.cci" +//#include "type_traits.ct" +//#include "type_traits.cti" +#endif + + +// Local Variables: +// mode: c++ +// fill-column: 100 +// comment-column: 40 +// c-file-style: "senf" +// indent-tabs-mode: nil +// ispell-local-dictionary: "american" +// compile-command: "scons -u test" +// End: diff --git a/Utils/type_traits.mpp b/Utils/type_traits.mpp new file mode 100644 index 0000000..8648d7a --- /dev/null +++ b/Utils/type_traits.mpp @@ -0,0 +1,97 @@ +// $Id$ +// +// Copyright (C) 2008 +// Fraunhofer Institute for Open Communication Systems (FOKUS) +// Competence Center NETwork research (NET), St. Augustin, GERMANY +// Stefan Bund +// +// This program is free software; you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation; either version 2 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the +// Free Software Foundation, Inc., +// 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +/** \file + \brief type_traits Boost.Preprocesser external iteration include */ + +#if !BOOST_PP_IS_ITERATING && !defined(MPP_type_traits_) +#define MPP_type_traits_ 1 + +// Custom includes +#include +#include +#include +#include +#include +#include +#include +#include + +// ///////////////////////////mpp.p//////////////////////////////////////// +#elif BOOST_PP_IS_ITERATING // //////////////////////////////////////////// +// //////////////////////////////////////////////////////////////////////// +// Local Macros + +#define mpp_Arg(n) BOOST_PP_CAT(BOOST_PP_CAT(arg, BOOST_PP_INC(n)), _type) + +#define mpp_OtherArgs_(z,n,d) BOOST_PP_COMMA_IF( BOOST_PP_DEC(n) ) typename traits::mpp_Arg(n) +#define mpp_OtherArgs() BOOST_PP_REPEAT_FROM_TO( 1, BOOST_PP_ITERATION(), mpp_OtherArgs_, _ ) + +// //////////////////////////////////////////////////////////////////////// +#if BOOST_PP_ITERATION_FLAGS()==1 // ////////////////////////////////////// +// //////////////////////////////////////////////////////////////////////// + +template +struct function_traits_remove_arg +{ + typedef Traits traits; + typedef boost::function_traits type; +}; + +template < class C, class RV + BOOST_PP_ENUM_TRAILING_PARAMS( BOOST_PP_ITERATION(), class A ) > +struct remove_member_pointer +{ + typedef RV type (BOOST_PP_ENUM_PARAMS( BOOST_PP_ITERATION(), A )); +}; + +template < class C, class RV + BOOST_PP_ENUM_TRAILING_PARAMS( BOOST_PP_ITERATION(), class A ) > +struct member_class +{ + typedef C type; +}; + +// //////////////////////////////////////////////////////////////////////// +#endif // ///////////////////////////////////////////////////////////////// +// //////////////////////////////////////////////////////////////////////// +// Undefine local Macros + +#undef mpp_Args +#undef mpp_Args_ + +#undef mpp_Arg + +// //////////////////////////////////////////////////////////////////////// +#endif // ///////////////////////////////////////////////////////////////// +// ///////////////////////////mpp.e//////////////////////////////////////// + + +// Local Variables: +// mode: c++ +// fill-column: 100 +// comment-column: 40 +// c-file-style: "senf" +// indent-tabs-mode: nil +// ispell-local-dictionary: "american" +// compile-command: "scons -u test" +// End: diff --git a/config.hh b/config.hh index c4459cd..976f691 100644 --- a/config.hh +++ b/config.hh @@ -80,6 +80,10 @@ # ifndef SENF_DEBUG_BACKTRACE_NUMCALLERS # define SENF_DEBUG_BACKTRACE_NUMCALLERS 64 # endif +# +# ifndef SENF_CONSOLE_MAX_COMMAND_ARITY +# define SENF_CONSOLE_MAX_COMMAND_ARITY 6 +# endif # # ///////////////////////////////hh.e//////////////////////////////////////// # endif diff --git a/doclib/SConscript b/doclib/SConscript index 66de21b..9cb4bac 100644 --- a/doclib/SConscript +++ b/doclib/SConscript @@ -216,7 +216,7 @@ def indices(): if doc.name == "search.idx" ] def writeTemplate(target = None, source = None, env = None): - file(target[0].abspath,"w").write(yaptu.process(str(env['TEMPLATE']), globals(), env.Dictionary())) + file(target[0].abspath,"w").write(source[0].read()) writeTemplate = env.Action(writeTemplate, varlist = [ 'TEMPLATE' ]) @@ -304,13 +304,22 @@ function paths() { } ?>""" -env.Command('doxy-header.html', 'SConscript', writeTemplate, - TEMPLATE = Literal(HEADER), - TITLE = "Documentation and API reference") -env.Command('doxy-footer.html', 'SConscript', writeTemplate, - TEMPLATE = Literal(FOOTER)) +header = yaptu.process(HEADER, globals(), env.Dictionary(), + TITLE = "Documentation and API reference") + +footer = yaptu.process(FOOTER, globals(), env.Dictionary()) + +search_php = yaptu.process(HEADER + SEARCH_PHP.replace('',']]') + FOOTER, + globals(), env.Dictionary(), + TITLE = "Search results") + +search_paths_php = yaptu.process(SEARCH_PATHS_PHP, globals(), env.Dictionary()) + +env.Command('doxy-header.html', Value(header), writeTemplate) +env.Command('doxy-footer.html', Value(footer), writeTemplate) + env.Alias('all_docs', - env.Command('search.php', [ 'html-munge.xsl', 'SConscript' ], + env.Command('search.php', [ Value(search_php), 'html-munge.xsl' ], [ writeTemplate, 'xsltproc --nonet --html --stringparam topdir .. -o - $SOURCE $TARGET 2>/dev/null' + "| sed" @@ -318,14 +327,10 @@ env.Alias('all_docs', + r" -e 's/\$$projectname/Overview/g'" + r" -e 's/\$$title/Search results/g'" + "> ${TARGETS[0]}.tmp", - 'mv ${TARGET}.tmp ${TARGET}' ], - TEMPLATE = Literal(HEADER - + SEARCH_PHP.replace('',']]') - + FOOTER), - TITLE = "Search results")) + 'mv ${TARGET}.tmp ${TARGET}' ] )) + env.Alias('all_docs', - env.Command('search_paths.php', 'SConscript', writeTemplate, - TEMPLATE = Literal(SEARCH_PATHS_PHP))) + env.Command('search_paths.php', Value(search_paths_php), writeTemplate)) env.Alias('install_all', env.Install( '$DOCINSTALLDIR/doclib', [ 'favicon.ico', diff --git a/doclib/yaptu.py b/doclib/yaptu.py index 5c8d14f..f7e1720 100644 --- a/doclib/yaptu.py +++ b/doclib/yaptu.py @@ -84,9 +84,10 @@ _RE_BEGIN = re.compile('{{') _RE_END = re.compile('}}') _RE_CONT = re.compile(r'\|\|') -def process(text,*args): +def process(text,*args,**kw): vardict = {} for arg in args : vardict.update(arg) + vardict.update(kw) output = StringIO() c = copier(_RE_EXPR, vardict, _RE_BEGIN, _RE_END, _RE_CONT, ouf = output) diff --git a/include/senf/Console b/include/senf/Console new file mode 120000 index 0000000..e9ae21b --- /dev/null +++ b/include/senf/Console @@ -0,0 +1 @@ +../../Console \ No newline at end of file diff --git a/include/senf/Console.hh b/include/senf/Console.hh new file mode 100644 index 0000000..2b11670 --- /dev/null +++ b/include/senf/Console.hh @@ -0,0 +1,34 @@ +// $Id$ +// +// Copyright (C) 2007 +// Fraunhofer Institut fuer offene Kommunikationssysteme (FOKUS) +// Kompetenzzentrum fuer Satelitenkommunikation (SatCom) +// Stefan Bund +// +// This program is free software; you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation; either version 2 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the +// Free Software Foundation, Inc., +// 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +#include "Console/Console.hh" + + +// Local Variables: +// mode: c++ +// fill-column: 100 +// comment-column: 40 +// c-file-style: "senf" +// indent-tabs-mode: nil +// ispell-local-dictionary: "american" +// compile-command: "scons -u test" +// End: