/**
 * @file
 * $Id$
 * $Revision$
 * $Author$
 * $Date$
 *
 * This file is part of The iWear Framework.
 *
 * 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_PMANBASE_H
#define __IWEAR_PMANBASE_H

#ifndef __IWEAR_THREADLOCKED_H
#include <iwear/threadlocked.h>
#endif

namespace iwear
{
class Module;
/**
 * Plugin Manager Base or so... this interface is probably needed for, ehm,
 * plugins ? Through its functions the registration process of modules should
 * be managed.
 */
class PManBase : public virtual ThreadLocked
{
friend class Module;
private:
protected:
public:
    PManBase() { /*cout << "CREATING PMANBASE AT " << (void*)this << endl;*/ }

    virtual ~PManBase() { }
    /**
     * With this an external module is registered, which was not created by the
     * usual process of passing an appropriate manager. This is usually only
     * necessary if the module was created from a plugin, otherwise this
     * interface should never be used.
     * It then tries to register the module at a higher level manager and so
     * on, until it reaches the manager thats responsible for its main type.
     */
    virtual void register_external_module( Module* ) = 0;


    /**
     * This is used to internally register a module. It will then register the
     * module by its master manager too, which then too registers at its master
     * manager and so on.
     */
    virtual void register_internal_module( Module* ) = 0;

    virtual void deregister_module( Module* ) = 0;
};

}

#endif
