/***************************************************************************
                           cmanager.h  -  description
                             -------------------
    begin                : Thu Jan 23 2003
    copyright            : (C) 2003 by Mathias Küster
    email                : mathen@users.berlios.de
 ***************************************************************************/

/***************************************************************************
 *                                                                         *
 *   This program 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; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 ***************************************************************************/

#ifndef CMANAGER_H
#define CMANAGER_H

/**
  *@author Mathias Küster
  */

#include <dclib/dcos.h>
#include <dclib/core/cobject.h>
#include <dclib/core/cplugin.h>
#include <dclib/core/clist.h>
#include <dclib/core/ccallback.h>
#include <dclib/core/csingleton.h>

class CManager;

#ifdef WIN32
template class DLL_EXPORT CSingleton<CManager>;
#endif

class DLL_EXPORT CManager : public CSingleton<CManager>, public CThread {
public:
	/** */
	CManager();
	/** */
	virtual ~CManager();

	/** */
	void Add( _CCallback * callback );
	/** */
	void Remove( _CCallback * callback );

	/** */
	virtual void Thread( CObject * pObject );

private:
	/** */
	friend class CSingleton<CManager>;

	/** */
	CThreadList<_CCallback> m_ThreadList;
};

#endif
