Open
Graph Drawing
Framework

 v. 2023.09 (Elderberry)
 

Timeouter.h
Go to the documentation of this file.
1 
32 #pragma once
33 
34 #include <ogdf/basic/basic.h>
35 
36 namespace ogdf {
37 
39 
47 public:
49  Timeouter() : m_timeLimit(-1) { }
50 
52  explicit Timeouter(double t) : m_timeLimit(t) { }
53 
55  explicit Timeouter(bool t) : m_timeLimit(t ? 0 : -1) { }
56 
57  Timeouter(const Timeouter& t) : m_timeLimit(t.m_timeLimit) { }
58 
59  ~Timeouter() { }
60 
62  m_timeLimit = t.m_timeLimit;
63  return *this;
64  }
65 
67  void timeLimit(double t) { m_timeLimit = t; }
68 
70  void timeLimit(bool t) { m_timeLimit = t ? 0 : -1; }
71 
73  double timeLimit() const { return m_timeLimit; }
74 
76  bool isTimeLimit() const { return m_timeLimit >= 0; }
77 
78 protected:
79  double m_timeLimit;
80 };
81 
82 }
ogdf
The namespace for all OGDF objects.
Definition: multilevelmixer.cpp:39
ogdf::Timeouter::operator=
Timeouter & operator=(const Timeouter &t)
Definition: Timeouter.h:61
ogdf::Timeouter::Timeouter
Timeouter(double t)
timeout is set to the given value (seconds)
Definition: Timeouter.h:52
ogdf::Timeouter::Timeouter
Timeouter(bool t)
timeout is turned off (false) or on (true) (with 0 second)
Definition: Timeouter.h:55
ogdf::Timeouter::timeLimit
double timeLimit() const
returns the current time limit for the call
Definition: Timeouter.h:73
ogdf::Timeouter::Timeouter
Timeouter(const Timeouter &t)
Definition: Timeouter.h:57
ogdf::Timeouter::isTimeLimit
bool isTimeLimit() const
returns whether any time limit is set or not
Definition: Timeouter.h:76
ogdf::Timeouter::m_timeLimit
double m_timeLimit
Time limit for module calls (< 0 means no limit).
Definition: Timeouter.h:79
basic.h
Basic declarations, included by all source files.
OGDF_EXPORT
#define OGDF_EXPORT
Specifies that a function or class is exported by the OGDF DLL.
Definition: config.h:101
ogdf::Timeouter::Timeouter
Timeouter()
timeout is turned of by default
Definition: Timeouter.h:49
ogdf::Timeouter
class for timeout funtionality.
Definition: Timeouter.h:46
ogdf::Timeouter::~Timeouter
~Timeouter()
Definition: Timeouter.h:59
ogdf::Timeouter::timeLimit
void timeLimit(bool t)
shorthand to turn timelimit off or on (with 0 seconds)
Definition: Timeouter.h:70
ogdf::Timeouter::timeLimit
void timeLimit(double t)
sets the time limit for the call (in seconds); <0 means no limit.
Definition: Timeouter.h:67