#ifndef IONOTIFIER
#define IONOTIFIER

//for signals
#include <sigc++/signal_system.h>
using namespace SigC;
//for threads
#include <pthread.h>

class IONotifier
{
public:
    
    Signal0<void> againWritable;
    Signal0<void> readable;
    IONotifier(int fd_);
    ~IONotifier();
private:
    int fd;
    pthread_t thread;
    bool againWritableEmited;
    bool fdIsValid;
    pthread_mutex_t mutex;
    
    static void * watchFor( void* arg);
};


    



#endif
