Search:

SENF Extensible Network Framework

  • Home
  • Download
  • Wiki
  • BerliOS
  • ChangeLog
  • Browse SVN
  • Bug Tracker
  • Overview
  • Examples
  • HowTos
  • Glossary
  • PPI
  • Packets
  • Scheduler
  • Socket
  • Utils
  • Console
  • Daemon
  • Logger
  • Termlib
  • Main Page
  • Related Pages
  • Modules
  • Namespaces
  • Classes
  • Files
  • File List
  • File Members

Config.hh

Go to the documentation of this file.
00001 // $Id: Config.hh 1742 2010-11-04 14:51:56Z g0dil $
00002 //
00003 // Copyright (C) 2008
00004 // Fraunhofer (FOKUS)
00005 // Competence Center NETwork research (NET), St. Augustin, GERMANY
00006 //     Stefan Bund <g0dil@berlios.de>
00007 //
00008 // This program is free software; you can redistribute it and/or modify
00009 // it under the terms of the GNU General Public License as published by
00010 // the Free Software Foundation; either version 2 of the License, or
00011 // (at your option) any later version.
00012 //
00013 // This program is distributed in the hope that it will be useful,
00014 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00015 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00016 // GNU General Public License for more details.
00017 //
00018 // You should have received a copy of the GNU General Public License
00019 // along with this program; if not, write to the
00020 // Free Software Foundation, Inc.,
00021 // 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
00022 
00026 #ifndef HH_SENF_Scheduler_Console_Config_
00027 #define HH_SENF_Scheduler_Console_Config_ 1
00028 
00029 // Custom includes
00030 #include <boost/utility.hpp>
00031 #include <list>
00032 #include "Executor.hh"
00033 
00034 //#include "Config.mpp"
00035 #include "Config.ih"
00036 //-/////////////////////////////////////////////////////////////////////////////////////////////////
00037 
00038 namespace senf {
00039 namespace console {
00040 
00062     class ConfigBundle
00063     {
00064     public:
00065         //-////////////////////////////////////////////////////////////////////////
00067         //\{
00068 
00069         ConfigBundle();                     
00070         ConfigBundle(DirectoryNode & root); 
00071 
00072         //\}
00073         //-////////////////////////////////////////////////////////////////////////
00074 
00075         template <class Source>
00076         Source & add(boost::intrusive_ptr<Source> source);
00078 
00079         void parse();                   
00080 
00081         void parse(DirectoryNode & restrict); 
00082 
00085         bool complete() const;          
00086         bool parsed(GenericNode & node) const; 
00087         void reset();                   
00088 
00092         DirectoryNode & root() const;
00093         void chroot(DirectoryNode & node);
00094 
00095     protected:
00096 
00097     private:
00098         void parseInternal();
00099 
00100         typedef std::list<detail::ConfigSource::ptr> Sources;
00101 
00102         Sources sources_;
00103         detail::RestrictedExecutor executor_;
00104     };
00105 
00106 namespace detail {
00107     // hrmpf ... Can't place this into Config.ih ...
00108 
00115     class BundleMixin
00116     {
00117     public:
00118         BundleMixin();
00119         BundleMixin(DirectoryNode & root);
00120 
00121         void parse();                   
00122 
00123         void parse(DirectoryNode & restrict); 
00124 
00127         bool complete() const;          
00128         bool parsed(GenericNode & node) const; 
00129         void reset();                   
00130 
00134     protected:
00135         template <class Source>
00136         Source & add(boost::intrusive_ptr<Source> source);
00137 
00138     private:
00139         ConfigBundle bundle_;
00140     };
00141 
00142 }}}
00143 
00144 //-/////////////////////////////////////////////////////////////////////////////////////////////////
00145 #include "Config.cci"
00146 //#include "Config.ct"
00147 #include "Config.cti"
00148 #endif
00149 
00150 
00151 // Local Variables:
00152 // mode: c++
00153 // fill-column: 100
00154 // comment-column: 40
00155 // c-file-style: "senf"
00156 // indent-tabs-mode: nil
00157 // ispell-local-dictionary: "american"
00158 // compile-command: "scons -u test"
00159 // End:

Contact: senf-dev@lists.berlios.de | © 2006-2010 Fraunhofer Institute for Open Communication Systems, Network Research