/**
 * @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_SERVICEHANDLE_H
#define __IWEAR_SERVICEHANDLE_H

#ifndef __IWEAR_PLUGINHANDLE_H
#include <iwear/pluginhandle.h>
#endif

namespace iwear {

class Service;
/**
 * This is a ServiceHandle for dynamic loading services as plugins from not
 * compile time linked files.
 */
class ServiceHandle : public PluginHandle
{
public:
   /**
    * This loads the actual handle from a file. It throws an exception in case
    * the handle was already loaded, or in case it was not possible to load it.
    */
    Service* create_service( void );
    void destroy_service( Service* );
    const char * get_service_name( void );
    const char * get_service_version( void );
    uint32_t get_service_type( void );

    /**
     * wat ?
     */
    ServiceHandle();
    ~ServiceHandle();
protected:
private:
   /**
    * The actual handle for the library
    */
    /**
     * Pointers for the real functions
     */
    Service* (*c_s)(void);
    void (*d_s)( Service* );
    const char * (*s_n)( void );
    const char * (*s_v)( void );
    uint32_t (*s_t)( void );
};
}
#endif

