/* */ #ifndef _D_REQUEST_SLOT_H_ #define _D_REQUEST_SLOT_H_ #include "common.h" #include "Time.h" class RequestSlot { private: Time 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) { if(this != &requestSlot) { copy(requestSlot); } return *this; } bool operator==(const RequestSlot& requestSlot) const { return index == requestSlot.index && begin == requestSlot.begin && length == requestSlot.length; } void setDispatchedTime(); bool isTimeout(int timeoutSec) const; int getLatencyInMillis() 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_