-
Notifications
You must be signed in to change notification settings - Fork 0
/
requests_required.cpp
38 lines (32 loc) · 1.18 KB
/
requests_required.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#include "requests_required.hpp"
query_service::CRequestsRequired::CRequestsRequired(bool initial_value) : values(request_response_type::num_of_items), available(values.size()), last_request_time(values.size())
{
QDateTime now = QDateTime::currentDateTimeUtc();
for(qint32 i = 0; i < values.size(); i++)
{
values[i] = initial_value;
last_request_time[i] = now;
available[i] = true;
}
}
bool &query_service::CRequestsRequired::operator [](request_response_type request_response_type)
{
return values[request_response_type];
}
QChar query_service::CRequestsRequired::getOpCode(request_response_type request_response_type)
{
return op_codes[request_response_type];
}
QDateTime query_service::CRequestsRequired::getLastRequestTime(request_response_type request_response_type)
{
return last_request_time[request_response_type];
}
void query_service::CRequestsRequired::setLastRequestTime(request_response_type request_response_type)
{
last_request_time[request_response_type] = QDateTime::currentDateTimeUtc();
}
void query_service::CRequestsRequired::lock(request_response_type request_response_type)
{
available[request_response_type] = false;
values[request_response_type] = false;
}