Scroom  0.14
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
73  : secs(secs_)
74 {
75 }

Member Function Documentation

◆ operator()()

bool Invalidator::operator() ( )
78 {
79  invalidate();
80 
81  if(!started && 0 == clock_gettime(CLOCK_REALTIME, &t))
82  {
83  started = true;
84  return true;
85  }
86 
87  struct timespec now = {0, 0};
88  if(0 == clock_gettime(CLOCK_REALTIME, &now))
89  {
90  if(now.tv_sec > t.tv_sec + secs)
91  {
92  return false;
93  }
94  }
95 
96  return true;
97 }
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

Referenced by operator()().

◆ t

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

Referenced by operator()().


The documentation for this class was generated from the following file:
Invalidator::secs
unsigned int secs
Definition: measure-framerate-tests.cc:28
invalidate
void invalidate()
Definition: measure-framerate-callbacks.cc:100
Invalidator::t
struct timespec t
Definition: measure-framerate-tests.cc:30
Invalidator::started
bool started
Definition: measure-framerate-tests.cc:29