// $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. /** \mainpage The Configuration and Runtime Control Framework The Console library implements a runtime interactive (network) console which allows to configure, control and manipulate a running application in any way. Additionally this library provides support for configuration files and command line parsing which can be used with or without the network console. \section console_intro Introduction There are two components to the Config/console framework: \li Building the node tree by registering objects and callbacks \li Utilizing the config/console framework by writing configuration files or using the interactive console. Basic data structure of the console and config framework is the config/console node tree. This tree. This tree works like a file-system. Commands are added to this tree and can then be called from configuration files or from the interactive console. To get started using the config/console library, see \li \ref node_tree \li \ref console_parser \section console_example Example The following example shows a \e very short summary on how to integrate the config/console library. See above links for more: \code // Define callback function. void mycommand(std::ostream & os, senf::console::Arguments const & args) { // ... os << "!! Important message ...\n"; } int main(int, char**) { // Provide global documentation senf::console::root() .doc("This is someServer server"); // Add a command senf::console::root() .add("mycommand", &mycommand) .doc("mycommand []\n\n" "If is given, flurgle the , otherwise burgle it"); // Start the interactive console server senf::console::Server::start(senf::INet4SocketAddress(senf::INet4Address::None, 23232u)) .name("someServer"); } \endcode after this registration, the console can be accessed easily via telnet:
    $ telnet localhost 23232
    Trying 127.0.0.1...
    Connected to localhost.
    Escape character is '^]'
    xxxx-xx-xx xx:xx:xx.xxxxxx-0000 [NOTICE][senf::console::Server] Registered new client 0xxxxxxx
    someServer:/# ls
    mycommand
    someServer:/# mycommand
    !! Important message  ...
    someServer:/# exit
    xxxx-xx-xx xx:xx:xx.xxxxxx-0000 [NOTICE][senf::console::Server] Disposing client 0xxxxxxx
    Connection closed by foreign host.
    $
    
*/ // 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" // mode: flyspell // mode: auto-fill // End: