/**
 * @file
 * $Id$
 * $Revision$
 * $Author$
 * $Date$
 *
 */

#ifndef __ACTUALIZER_H
#define __ACTUALIZER_H

#include <mapper/config.h>
#ifndef __THREAD_H
#include <iwear/thread.h>
#endif

#ifndef __SERVICE_H
#include <iwear/service.h>
#endif

#include <locationlister.h>

#include <queue>
using namespace std;

namespace iwear
{
    namespace sensor
    {
	namespace location
	{
class Actualizer : public Thread, public Service
{
private:
protected:
    virtual void Run( void );
    void actualize_data( void );

    LocationLister* ll;
public:
    /**
     * yep... nech... tjoa...
     */
    Actualizer( ServiceManager*, LocationLister*, EventDispatcher& );
    ~Actualizer();
    virtual void Final( void );

    /**
     * Starts execution of the dispatcher and its thread.
     */
    virtual void Start( void );

    /**
     * Initializes needed resources
     */
    virtual void Init( void );

    /**
     * Stops the thread and empties all queues (delivers pending events but
     * does not accept new ones).
     */
    virtual void Stop( void );

    /**
     * Resets the Event Dispatcher.
     * @warning All events in the queue will be removed without beeing delivered ! 
     */
    virtual void Reset( void );

    /**
     * Suspends execution. This means, empties all queues(and deliveres pending
     * events) and then does not accept new ones.
     */
    virtual void Suspend( void );

    /**
     * Paused event delivery. New events will be accepted and queued, but
     * delivered after resume.
     */
    virtual void Pause( void );

    /**
     * Goes on with event accepting and event delivery.
     */
    virtual void Resume( void );

    /**
     * Returns our name ;)
     */
    virtual const string get_name( void );
    virtual service_type get_type( void ) { return service_system; }
};

}
}
}
#endif

