moved statistics classes from NetEmu to SENF
[senf.git] / Utils / Console / Config.cci
1 // $Id$
2 //
3 // Copyright (C) 2008 
4 // Fraunhofer Institute for Open Communication Systems (FOKUS)
5 // Competence Center NETwork research (NET), St. Augustin, GERMANY
6 //     Stefan Bund <g0dil@berlios.de>
7 //
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.
12 //
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.
17 //
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.
22
23 /** \file
24     \brief Config inline non-template implementation */
25
26 #include "Config.ih"
27
28 // Custom includes
29 #include "../../Utils/membind.hh"
30
31 #define prefix_ inline
32 ///////////////////////////////cci.p///////////////////////////////////////
33
34 ///////////////////////////////////////////////////////////////////////////
35 // senf::console::detail::RestrictedExecutor
36
37 prefix_ bool senf::console::detail::RestrictedExecutor::complete()
38     const
39 {
40     return parsedNodes_.size() == 1 
41         && ! parsedNodes_[0].expired() 
42         && *parsedNodes_[0].lock() == executor_.chroot();
43 }
44
45 prefix_ void senf::console::detail::RestrictedExecutor::reset()
46 {
47     parsedNodes_.clear();
48 }
49
50 prefix_ senf::console::DirectoryNode & senf::console::detail::RestrictedExecutor::root()
51     const
52 {
53     return executor_.chroot();
54 }
55
56 prefix_ std::ostream & senf::console::detail::RestrictedExecutor::stream()
57 {
58     return stream_;
59 }
60
61 ///////////////////////////////////////////////////////////////////////////
62 // senf::console::ConfigBundle
63
64 prefix_ senf::console::ConfigBundle::ConfigBundle()
65 {}
66
67 prefix_ senf::console::ConfigBundle::ConfigBundle(DirectoryNode & root)
68     : executor_ (root)
69 {}
70
71 prefix_ bool senf::console::ConfigBundle::complete()
72     const
73 {
74     return executor_.complete();
75 }
76
77 prefix_ bool senf::console::ConfigBundle::parsed(GenericNode & node)
78     const
79 {
80     return executor_.parsed(node);
81 }
82
83 prefix_ void senf::console::ConfigBundle::reset()
84 {
85     executor_.reset();
86 }
87
88 ///////////////////////////////////////////////////////////////////////////
89 // senf::console::detail::ConfigSource
90
91 prefix_ void senf::console::detail::ConfigSource::parse(RestrictedExecutor & executor)
92 {
93     v_parse(executor);
94 }
95
96 ///////////////////////////////////////////////////////////////////////////
97 // senf::console::detail::BundleMixin
98
99 prefix_ senf::console::detail::BundleMixin::BundleMixin()
100 {}
101
102 prefix_ senf::console::detail::BundleMixin::BundleMixin(DirectoryNode & root)
103     : bundle_ (root)
104 {}
105
106 prefix_ void senf::console::detail::BundleMixin::parse()
107 {
108     bundle_.parse();
109 }
110
111 prefix_ void senf::console::detail::BundleMixin::parse(DirectoryNode & restrict)
112 {
113     bundle_.parse(restrict);
114 }
115
116 prefix_ bool senf::console::detail::BundleMixin::complete()
117     const
118 {
119     return bundle_.complete();
120 }
121
122 prefix_ bool senf::console::detail::BundleMixin::parsed(GenericNode & node)
123     const
124 {
125     return bundle_.parsed(node);
126 }
127
128 prefix_ void senf::console::detail::BundleMixin::reset()
129 {
130     bundle_.reset();
131 }
132
133 ///////////////////////////////cci.e///////////////////////////////////////
134 #undef prefix_
135
136 \f
137 // Local Variables:
138 // mode: c++
139 // fill-column: 100
140 // comment-column: 40
141 // c-file-style: "senf"
142 // indent-tabs-mode: nil
143 // ispell-local-dictionary: "american"
144 // compile-command: "scons -u test"
145 // End: