KiCad PCB EDA Suite
PNS::TIME_LIMIT Class Reference

#include <time_limit.h>

Public Member Functions

 TIME_LIMIT (int aMilliseconds=0)
 
 ~TIME_LIMIT ()
 
bool Expired () const
 
void Restart ()
 
void Set (int aMilliseconds)
 
int Get () const
 

Private Attributes

int m_limitMs
 
int64_t m_startTics
 

Detailed Description

Definition at line 29 of file time_limit.h.

Constructor & Destructor Documentation

PNS::TIME_LIMIT::TIME_LIMIT ( int  aMilliseconds = 0)

Definition at line 28 of file time_limit.cpp.

References Restart().

28  :
29  m_limitMs( aMilliseconds )
30 {
31  Restart();
32 }
PNS::TIME_LIMIT::~TIME_LIMIT ( )

Definition at line 35 of file time_limit.cpp.

36 {}

Member Function Documentation

bool PNS::TIME_LIMIT::Expired ( ) const

Definition at line 39 of file time_limit.cpp.

References m_limitMs, and m_startTics.

Referenced by PNS::SHOVE::shoveMainLoop().

40 {
41  return ( wxGetLocalTimeMillis().GetValue() - m_startTics ) >= m_limitMs;
42 }
int64_t m_startTics
Definition: time_limit.h:43
int PNS::TIME_LIMIT::Get ( ) const
inline

Definition at line 39 of file time_limit.h.

References m_limitMs.

Referenced by PNS::ROUTING_SETTINGS::Save().

39 { return m_limitMs; }
void PNS::TIME_LIMIT::Restart ( )

Definition at line 45 of file time_limit.cpp.

References m_startTics.

Referenced by PNS::SHOVE::shoveMainLoop(), and TIME_LIMIT().

46 {
47  m_startTics = wxGetLocalTimeMillis().GetValue();
48 }
int64_t m_startTics
Definition: time_limit.h:43
void PNS::TIME_LIMIT::Set ( int  aMilliseconds)

Definition at line 51 of file time_limit.cpp.

References m_limitMs.

Referenced by PNS::ROUTING_SETTINGS::Load().

52 {
53  m_limitMs = aMilliseconds;
54 }

Member Data Documentation

int PNS::TIME_LIMIT::m_limitMs
private

Definition at line 42 of file time_limit.h.

Referenced by Expired(), Get(), and Set().

int64_t PNS::TIME_LIMIT::m_startTics
private

Definition at line 43 of file time_limit.h.

Referenced by Expired(), and Restart().


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