ProcessorMngr.h

Go to the documentation of this file.
00001 /***************************************************************************
00002  *
00003  * Copyright (C) 2009-2011 Cassio Neri Moreira
00004  *
00005  * This file is part of the KeyValue library.
00006  *
00007  * The KeyValue library is free software; you can redistribute it and/or
00008  * modify it under the terms of the GNU General Public License as published
00009  * by the Free Software Foundation, either version 3 of the License, or (at
00010  * your option) any later version.
00011  *
00012  * The KeyValue library is distributed in the hope that it will be useful,
00013  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00014  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
00015  * Public License for more details.
00016  *
00017  * You should have received a copy of the GNU General Public License along
00018  * with KeyValue. If not, see <http://www.gnu.org/licenses/>.
00019  *
00020  * If you modify this library, or any covered work, by linking or combining
00021  * it with Excel (or a modified version of that program), containing parts
00022  * covered by the terms of End-User License Agreement for Microsoft
00023  * Software, the licensors of KeyValue grant you additional permission to
00024  * convey the resulting work.
00025  *
00026  **************************************************************************/
00027 
00034 #ifndef KEYVALUE_MNGT_PROCESSORMNGR_H_
00035 #define KEYVALUE_MNGT_PROCESSORMNGR_H_
00036 
00037 #include <map>
00038 #include <typeinfo>
00039 
00040 #include <boost/utility.hpp>
00041 
00042 #include "keyvalue/extern/SharedPtr.h"
00043 #include "keyvalue/extern/String.h"
00044 #include "keyvalue/value/Vector.h"
00045 
00046 namespace keyvalue {
00047 
00048 // Forward declarations
00049 class DataSet;
00050 class Processor;
00051 class Command;
00052 class AbstractBuilder;
00053 
00067 class ProcessorMngr :
00068 
00069   private ::boost::noncopyable {
00070 
00071 public:
00072 
00078   void
00079   add(const Processor& processor);
00080 
00091   const Processor&
00092   getProcessor(const string& name) const;
00093 
00105   const AbstractBuilder*
00106   findBuilder(const ::std::type_info& type) const;
00107 
00118   const Command&
00119   getCommand(const string& name) const;
00120 
00126   value::Vector
00127   getCmdList() const;
00128 
00129 private:
00130 
00131   // string -> Processor
00132   typedef ::std::map<string, const Processor*> PrcMapType_;
00133   PrcMapType_ prcMap_;
00134 
00135   // string -> Command
00136   typedef ::std::map<string, const Command*> CmdMapType_;
00137   CmdMapType_ cmdMap_;
00138 
00139   // type_info -> Builder
00140   typedef ::std::map<const std::type_info*, const AbstractBuilder*>
00141     BldMapType_;
00142   BldMapType_ bldMap_;
00143 
00144 }; // class ProcessorMngr
00145 
00146 } // namespace keyvalue
00147 
00148 #endif // KEYVALUE_MNGT_PROCESSORMNGR_H_