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.
23 /** \mainpage The Configuration and Runtime Control Framework
25 The Console library implements a runtime interactive (network) console which allows to
26 configure, control and manipulate a running application in any way. Additionally this library
27 provides support for configuration files and command line parsing which can be used with or
28 without the network console.
30 \section console_intro Introduction
32 There are two components to the Config/console framework:
34 \li Building the node tree by registering objects and callbacks
35 \li Utilizing the config/console framework by writing configuration files or using the
38 Basic data structure of the console and config framework is the config/console node tree. This
39 tree. This tree works like a file-system. Commands are added to this tree and can then be called
40 from configuration files or from the interactive console.
42 To get started using the config/console library, see
44 \li \ref console_parser
46 \section console_example Example
48 The following example shows a \e very short summary on how to integrate the config/console
49 library. See above links for more:
52 // Define callback function.
53 void mycommand(std::ostream & os, senf::console::ParseCommandInfo const & command)
56 os << "!! Important message ...\n";
61 // Provide global documentation
63 .doc("This is someServer server");
67 .add("mycommand", &mycommand)
68 .doc("mycommand <foo> [<bar>]\n\n"
69 "If <bar> is given, flurgle the <foo>, otherwise burgle it");
71 // Start the interactive console server
72 senf::console::Server::start(senf::INet4SocketAddress(senf::INet4Address::None, 23232u))
77 after this registration, the console can be accessed easily via telnet:
80 $ telnet localhost 23232
82 Connected to localhost.
83 Escape character is '^]'
84 xxxx-xx-xx xx:xx:xx.xxxxxx-0000 [NOTICE][senf::console::Server] Registered new client 0xxxxxxx
87 someServer:/# mycommand
88 !! Important message ...
90 xxxx-xx-xx xx:xx:xx.xxxxxx-0000 [NOTICE][senf::console::Server] Disposing client 0xxxxxxx
91 Connection closed by foreign host.
100 // comment-column: 40
101 // c-file-style: "senf"
102 // indent-tabs-mode: nil
103 // ispell-local-dictionary: "american"
104 // compile-command: "scons -u test"