Scroom 0.14-49-gb7ae7a6d
Loading...
Searching...
No Matches
Invalidator Class Reference
Collaboration diagram for Invalidator:
Collaboration graph

Public Member Functions

 Invalidator (unsigned int secs)
 
bool operator() ()
 

Private Attributes

unsigned int secs
 
bool started {false}
 
struct timespec t = {0, 0}
 

Constructor & Destructor Documentation

◆ Invalidator()

Invalidator::Invalidator ( unsigned int  secs)
explicit
77 : secs(secs_)
78{
79}
unsigned int secs
Definition measure-framerate-tests.cc:32

Member Function Documentation

◆ operator()()

bool Invalidator::operator() ( )
82{
83 invalidate();
84
85 if(!started && 0 == clock_gettime(CLOCK_REALTIME, &t))
86 {
87 started = true;
88 return true;
89 }
90
91 struct timespec now = {0, 0};
92 if(0 == clock_gettime(CLOCK_REALTIME, &now))
93 {
94 if(now.tv_sec > t.tv_sec + secs)
95 {
96 return false;
97 }
98 }
99
100 return true;
101}
struct timespec t
Definition measure-framerate-tests.cc:34
bool started
Definition measure-framerate-tests.cc:33
void invalidate()
Definition measure-framerate-callbacks.cc:98
Here is the call graph for this function:

Member Data Documentation

◆ secs

unsigned int Invalidator::secs
private

Referenced by operator()().

◆ started

bool Invalidator::started {false}
private
33{false};

Referenced by operator()().

◆ t

struct timespec Invalidator::t = {0, 0}
private
34{0, 0};

Referenced by operator()().


The documentation for this class was generated from the following file: