threadinfo (1053B)
1 #ifndef _THREADINFO_ 2 #define _THREADINFO_ 3 4 #include "sys/sys" 5 #include "timestamp/timestamp" 6 #include "ThreadsAndMutexes/mutex/mutex" 7 8 class Threadinfo { 9 public: 10 Threadinfo(): 11 th_desc(), th_tm(), th_backend(-1), th_backendfd(-1), th_clientfd(-1) 12 { 13 memset(&th_clientip, 0, sizeof(th_clientip)); 14 } 15 16 void desc(string s) { th_desc = s; } 17 string const &desc() const { return th_desc; } 18 19 Timestamp const ×tamp() const { return th_tm; } 20 21 void backend(int b) { th_backend = b; } 22 int backend() const { return th_backend; } 23 24 void backendfd(int f) { th_backendfd = f; } 25 int backendfd() const { return th_backendfd; } 26 27 void clientfd(int f) { th_clientfd = f; } 28 int clientfd() const { return th_clientfd; } 29 30 void clientip(struct in_addr c) { th_clientip = c; } 31 struct in_addr clientip() const { return th_clientip; } 32 33 private: 34 string th_desc; 35 Timestamp th_tm; 36 int th_backend, th_backendfd, th_clientfd; 37 struct in_addr th_clientip; 38 }; 39 40 #endif