module_manager_factory.cpp

00001 
00002 /***************************************************************************
00003  *  module_manager_factory.h - factory for module managers
00004  *
00005  *  Generated: Sun Sep 10 15:48:23 2006
00006  *  Copyright  2006  Tim Niemueller [www.niemueller.de]
00007  *
00008  ****************************************************************************/
00009 
00010 /*  This program is free software; you can redistribute it and/or modify
00011  *  it under the terms of the GNU General Public License as published by
00012  *  the Free Software Foundation; either version 2 of the License, or
00013  *  (at your option) any later version. A runtime exception applies to
00014  *  this software (see LICENSE.GPL_WRE file mentioned below for details).
00015  *
00016  *  This program is distributed in the hope that it will be useful,
00017  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00018  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00019  *  GNU Library General Public License for more details.
00020  *
00021  *  Read the full text in the LICENSE.GPL_WRE file in the doc directory.
00022  */
00023 
00024 #include <utils/system/dynamic_module/module_manager_factory.h>
00025 #include <utils/system/dynamic_module/module_manager_template.h>
00026 #include <utils/system/dynamic_module/module_dl.h>
00027 
00028 namespace fawkes {
00029 
00030 /** @class ModuleManagerFactory utils/system/dynamic_module/module_manager_factory.h
00031  * Class with just one static method to retrieve a module manager for the
00032  * specified type.
00033  * The main reason for this class is to hide the ModuleManagerTemplate
00034  * definition from ordinary processes.
00035  */
00036 
00037 
00038 /** Retrieve an module manager instance of the desired type
00039  * @param mmt ModuleManagerType
00040  * @param module_base_dir The base directory where to look for modules, plainly copied
00041  * to the module manager, defaults to the empty string which is in most cases not desired
00042  * @return Returns an instance of a ModuleManager implementation. Delete after you are
00043  * done with this!
00044  */
00045 ModuleManager *
00046 ModuleManagerFactory::getInstance(ModuleManagerType mmt, const char *module_base_dir)
00047 {
00048   switch (mmt) {
00049   case MMT_DL:
00050     return new ModuleManagerTemplate<ModuleDL>(module_base_dir);
00051   default:
00052     return NULL;
00053   }
00054 }
00055 
00056 } // end namespace fawkes

Generated on Tue Feb 22 13:32:28 2011 for Fawkes API by  doxygen 1.4.7