/* */ #ifndef _D_REQUEST_SLOT_H_ #define _D_REQUEST_SLOT_H_ #include "common.h" #include class RequestSlot { private: struct timeval dispatchedTime; int index; int begin; int length; int blockIndex; void copy(const RequestSlot& requestSlot); public: RequestSlot(int index, int begin, int legnth, int blockIndex); RequestSlot(const RequestSlot& requestSlot); ~RequestSlot() {} RequestSlot& operator=(const RequestSlot& requestSlot); void setDispatchedTime(); bool isTimeout(int timeoutSec) const; bool operator==(const RequestSlot& requestSlot) const; int getIndex() const { return index; } void setIndex(int index) { this->index = index; } int getBegin() const { return begin; } void setBegin(int begin) { this->begin = begin; } int getLength() const { return length; } void setLength(int length) { this->length = length; } int getBlockIndex() const { return blockIndex; } void setBlockIndex(int blockIndex) { this->blockIndex = blockIndex; } static RequestSlot nullSlot; static bool isNull(const RequestSlot& requestSlot); }; #endif // _D_REQUEST_SLOT_H_