/**
 * @file
 * $Id$
 * $Revision$
 * $Author$
 * $Date$
 *
 * This file is part of The iWear Framework.
 * In particular this file is part of the Framework Core Library
 *
 * The iWear Framework is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by the
 * Free Software Foundation as in version 2 of the License.

 * 
 * The iWear Framework is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
 * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
 * more details.
 * 
 * You should have received a copy of the GNU General Public License along with
 * The iWear Framework; if not, write to the Free Software Foundation, Inc., 59
 * Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */

#ifndef __IWEAR_BASEMODULEMANAGER_H
#define __IWEAR_BASEMODULEMANAGER_H

#ifndef __IWEAR_MODULEMANAGER_H
#include <iwear/modulemanager.h>
#endif

#ifndef __IWEAR_MODULE_H
#include <iwear/module.h>
#endif

namespace iwear
{
/**
 * This Manager is responsible for handling the modules on their lowest level,
 * i.e. every module as Module. It will delegate all the given modules to their
 * most specific manager, so this can be seen as an entry point for plugged in
 * modules.
 */
class BaseModuleManager : public ModuleManager<module_type,Module, void>
{
private:
protected:
public:
    /**
     * This is the function to be called if a module was created without a
     * manager. The only circumstance where this might happen is when loading
     * from within a plugin, although there it shouldnt be needed any more...
     * @warning This function is subject to be changed, probably hidden as
     * protected or even private.
     */
    virtual void register_external_module( Module* );

    /**
     * This function is used for the internal process of registration of a
     * module.
     */
    virtual void register_internal_module( Module* );

    virtual void deregister_module( Module* );

    BaseModuleManager( Configuration& );
    virtual ~BaseModuleManager(); 
   /**
    * All Modules have a module_type which we return at this level when asking
    * for the type. @see module_enums.h for details.
    */
    inline virtual module_type get_type( const Module& mod ) const
    {
	return mod.get_module_type();
    }
};

}
#endif
