/**
 * @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_DEBUGMODULE_H
#define __IWEAR_DEBUGMODULE_H

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

namespace iwear
{
class debugmanager;
/**
 * Base class for debug output modules. They will be attached to the manager at construction time.
 */
class debugmodule: public virtual ThreadLocked
{
private:
protected:
   /**
    * This is the debugmanager we are attached to.
    */
    debugmanager& DbgMan;
public:

   /**
    * The manager we are attached to.
    * @param dbman is the debugmanager this module should attach itself to.
    * This causes every module to be attached to a manager.
    */
    debugmodule( debugmanager& dbman);
    
   /**
    * This also detaches from the manager, so it won't poke into nothing.
    */
    virtual ~debugmodule( );

   /**
    * Every derived class will have to handle c-string log messages. Where they
    * are logged, is their part.
    */
    virtual int log( const char * ) = 0;
};

}
#endif
