Wrapper around TimeLimit to make it thread safe and add Stop() support.
More...
Wrapper around TimeLimit to make it thread safe and add Stop() support.
Definition at line 325 of file time_limit.h.
#include <time_limit.h>
◆ SharedTimeLimit()
operations_research::SharedTimeLimit::SharedTimeLimit |
( |
TimeLimit * | time_limit | ) |
|
|
inlineexplicit |
We use the one already registered if present or ours otherwise.
Definition at line 327 of file time_limit.h.
◆ ~SharedTimeLimit()
operations_research::SharedTimeLimit::~SharedTimeLimit |
( |
| ) |
|
|
inline |
◆ AdvanceDeterministicTime()
void operations_research::SharedTimeLimit::AdvanceDeterministicTime |
( |
double | deterministic_duration | ) |
|
|
inline |
◆ ExternalBooleanAsLimit()
std::atomic< bool > * operations_research::SharedTimeLimit::ExternalBooleanAsLimit |
( |
| ) |
const |
|
inline |
We can simply return the "external bool" and remain thread-safe because it's wrapped in std::atomic.
Definition at line 375 of file time_limit.h.
◆ GetElapsedDeterministicTime()
double operations_research::SharedTimeLimit::GetElapsedDeterministicTime |
( |
| ) |
const |
|
inline |
◆ GetTimeLeft()
double operations_research::SharedTimeLimit::GetTimeLeft |
( |
| ) |
const |
|
inline |
◆ LimitReached()
bool operations_research::SharedTimeLimit::LimitReached |
( |
| ) |
const |
|
inline |
Note, time_limit_->LimitReached() is not const, and changes internal state of time_limit_, hence we need a writer's lock.
Definition at line 343 of file time_limit.h.
◆ Stop()
void operations_research::SharedTimeLimit::Stop |
( |
| ) |
|
|
inline |
◆ UpdateLocalLimit()
void operations_research::SharedTimeLimit::UpdateLocalLimit |
( |
TimeLimit * | local_limit | ) |
|
|
inline |
The documentation for this class was generated from the following file: