#ifndef _THREADINFO_
#define _THREADINFO_

#include "sys/sys"
#include "timestamp/timestamp"
#include "ThreadsAndMutexes/mutex/mutex"

class Threadinfo {
public:
    Threadinfo():
        th_desc(), th_tm(), th_backend(-1), th_backendfd(-1), th_clientfd(-1)
        {
	    memset(&th_clientip, 0, sizeof(th_clientip));
	}
	
    void desc(string s) 			{ th_desc = s; }
    string const &desc() const			{ return th_desc; }
    
    Timestamp const &timestamp() const		{ return th_tm; }
    
    void backend(int b)				{ th_backend = b; }
    int backend() const   			{ return th_backend; }

    void backendfd(int f)			{ th_backendfd = f; }
    int backendfd() const			{ return th_backendfd; }

    void clientfd(int f)			{ th_clientfd = f; }
    int clientfd() const			{ return th_clientfd; }

    void clientip(struct in_addr c)		{ th_clientip = c; }
    struct in_addr clientip() const		{ return th_clientip; }

private:
    string th_desc;
    Timestamp th_tm;
    int th_backend, th_backendfd, th_clientfd;
    struct in_addr th_clientip;
};

#endif
