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

◆ TIME_LIMIT()

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

Definition at line 28 of file time_limit.cpp.

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

References Restart().

◆ ~TIME_LIMIT()

PNS::TIME_LIMIT::~TIME_LIMIT ( )

Definition at line 35 of file time_limit.cpp.

36 {}

Member Function Documentation

◆ Expired()

bool PNS::TIME_LIMIT::Expired ( ) const

Definition at line 39 of file time_limit.cpp.

40 {
41  return ( wxGetLocalTimeMillis().GetValue() - m_startTics ) >= m_limitMs;
42 }
int64_t m_startTics
Definition: time_limit.h:43

References m_limitMs, and m_startTics.

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

◆ Get()

int PNS::TIME_LIMIT::Get ( ) const
inline

Definition at line 39 of file time_limit.h.

39 { return m_limitMs; }

References m_limitMs.

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

◆ Restart()

void PNS::TIME_LIMIT::Restart ( )

Definition at line 45 of file time_limit.cpp.

46 {
47  m_startTics = wxGetLocalTimeMillis().GetValue();
48 }
int64_t m_startTics
Definition: time_limit.h:43

References m_startTics.

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

◆ Set()

void PNS::TIME_LIMIT::Set ( int  aMilliseconds)

Definition at line 51 of file time_limit.cpp.

52 {
53  m_limitMs = aMilliseconds;
54 }

References m_limitMs.

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

Member Data Documentation

◆ m_limitMs

int PNS::TIME_LIMIT::m_limitMs
private

Definition at line 42 of file time_limit.h.

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

◆ m_startTics

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: