OrcaSlicer latest
OrcaSlicer
Loading...
Searching...
No Matches
Slic3r::Timing::TimeLimitAlarm Class Reference

#include </home/runner/work/OrcaSlicer/OrcaSlicer/src/libslic3r/Timer.hpp>

Collaboration diagram for Slic3r::Timing::TimeLimitAlarm:

Public Member Functions

 TimeLimitAlarm (uint64_t time_limit_nanoseconds, std::string_view limit_exceeded_message)
 ~TimeLimitAlarm ()

Static Public Member Functions

static TimeLimitAlarm new_nanos (uint64_t time_limit_nanoseconds, std::string_view limit_exceeded_message)
static TimeLimitAlarm new_millis (uint64_t time_limit_millis, std::string_view limit_exceeded_message)
static TimeLimitAlarm new_seconds (uint64_t time_limit_seconds, std::string_view limit_exceeded_message)

Private Member Functions

void report_time_exceeded () const

Private Attributes

Timer m_timer
uint64_t m_time_limit_nanoseconds
std::string_view m_limit_exceeded_message

Detailed Description

Constructor & Destructor Documentation

◆ TimeLimitAlarm()

Slic3r::Timing::TimeLimitAlarm::TimeLimitAlarm ( uint64_t time_limit_nanoseconds,
std::string_view limit_exceeded_message )
inline
64 :
65 m_time_limit_nanoseconds(time_limit_nanoseconds), m_limit_exceeded_message(limit_exceeded_message) {
66 m_timer.start();
67 }
uint64_t m_time_limit_nanoseconds
Definition Timer.hpp:86
std::string_view m_limit_exceeded_message
Definition Timer.hpp:87
Timer m_timer
Definition Timer.hpp:85

References m_limit_exceeded_message, m_time_limit_nanoseconds, and m_timer.

Referenced by new_millis(), new_nanos(), and new_seconds().

Here is the caller graph for this function:

◆ ~TimeLimitAlarm()

Slic3r::Timing::TimeLimitAlarm::~TimeLimitAlarm ( )
inline
68 {
69 auto elapsed = m_timer.elapsed_nanoseconds();
70 if (elapsed > m_time_limit_nanoseconds)
72 }
void report_time_exceeded() const
Definition Timer.cpp:19

References m_time_limit_nanoseconds, m_timer, and report_time_exceeded().

Here is the call graph for this function:

Member Function Documentation

◆ new_millis()

TimeLimitAlarm Slic3r::Timing::TimeLimitAlarm::new_millis ( uint64_t time_limit_millis,
std::string_view limit_exceeded_message )
inlinestatic
76 {
77 return TimeLimitAlarm(uint64_t(time_limit_millis) * 1000000l, limit_exceeded_message);
78 }
TimeLimitAlarm(uint64_t time_limit_nanoseconds, std::string_view limit_exceeded_message)
Definition Timer.hpp:64

References TimeLimitAlarm().

Here is the call graph for this function:

◆ new_nanos()

TimeLimitAlarm Slic3r::Timing::TimeLimitAlarm::new_nanos ( uint64_t time_limit_nanoseconds,
std::string_view limit_exceeded_message )
inlinestatic
73 {
74 return TimeLimitAlarm(time_limit_nanoseconds, limit_exceeded_message);
75 }

References TimeLimitAlarm().

Here is the call graph for this function:

◆ new_seconds()

TimeLimitAlarm Slic3r::Timing::TimeLimitAlarm::new_seconds ( uint64_t time_limit_seconds,
std::string_view limit_exceeded_message )
inlinestatic
79 {
80 return TimeLimitAlarm(uint64_t(time_limit_seconds) * 1000000000l, limit_exceeded_message);
81 }

References TimeLimitAlarm().

Here is the call graph for this function:

◆ report_time_exceeded()

void Slic3r::Timing::TimeLimitAlarm::report_time_exceeded ( ) const
private
19 {
20 BOOST_LOG_TRIVIAL(error) << "Time limit exceeded for " << m_limit_exceeded_message << ": " << m_timer.elapsed_seconds() << "s";
21}

References m_limit_exceeded_message, m_timer, and report_time_exceeded().

Referenced by ~TimeLimitAlarm(), and report_time_exceeded().

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ m_limit_exceeded_message

std::string_view Slic3r::Timing::TimeLimitAlarm::m_limit_exceeded_message
private

◆ m_time_limit_nanoseconds

uint64_t Slic3r::Timing::TimeLimitAlarm::m_time_limit_nanoseconds
private

Referenced by TimeLimitAlarm(), and ~TimeLimitAlarm().

◆ m_timer

Timer Slic3r::Timing::TimeLimitAlarm::m_timer
private

The documentation for this class was generated from the following files:
  • /home/runner/work/OrcaSlicer/OrcaSlicer/src/libslic3r/Timer.hpp
  • /home/runner/work/OrcaSlicer/OrcaSlicer/src/libslic3r/Timer.cpp