#ifndef NET_H #define NET_H #if defined __GNUC__ && (__GNUC__ >= 3) #include #else #include #endif class Queue { public: Queue(){sendpos = 0; receivepos = 0;} char send[1024]; char receive[1024]; int sendpos; int receivepos; }; class Net { public: Net(); ~Net(); enum SpecialOpcodes { begin = -1001, end = -1002, flush = -1003, channel = -1004, input = -1005 }; Net &operator<<(SpecialOpcodes value); Net &operator<<(int value); Net &operator<<(const char* value); Net &operator>>(int* value); Net &operator>>(char** value); int empty(); private: void forceinput(); int m_fd; int waitforchannel; int buffered; #if defined __GNUC__ && (__GNUC__ >= 3) __gnu_cxx::hash_map queues; #else hash_map queues; #endif }; #endif