Public Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
PLMD::Stopwatch::Handler Class Reference

Auxiliary class for handling exception-safe start/pause and start/stop. More...

#include <Stopwatch.h>

Public Member Functions

 Handler ()=default
 Default constructor. More...
 
 Handler (const Handler &handler)=delete
 Default copy constructor is deleted (not copyable) More...
 
 Handler (Handler &&handler) noexcept
 Move constructor. More...
 
 ~Handler ()
 Destructor either stops or pauses the watch. More...
 
Handleroperator= (const Handler &handler)=delete
 Default copy assignment is deleted (not copyable) More...
 
Handleroperator= (Handler &&handler) noexcept
 Move assignment. More...
 

Private Member Functions

 Handler (Watch *watch, bool stop)
 Private constructor. More...
 

Private Attributes

bool stop =false
 stop (true) or pause (false). More...
 
Watchwatch =nullptr
 

Friends

class Stopwatch
 Allows usage of private constructor. More...
 

Detailed Description

Auxiliary class for handling exception-safe start/pause and start/stop.

Constructor & Destructor Documentation

◆ Handler() [1/4]

PLMD::Stopwatch::Handler::Handler ( Watch watch,
bool  stop 
)
inlineprivate

Private constructor.

This is kept private to avoid misuse. Handler objects should only be created using startPause() or startStop(). stop is required to know if the destructor should stop or pause the watch.

◆ Handler() [2/4]

PLMD::Stopwatch::Handler::Handler ( )
default

Default constructor.

◆ Handler() [3/4]

PLMD::Stopwatch::Handler::Handler ( const Handler handler)
delete

Default copy constructor is deleted (not copyable)

◆ Handler() [4/4]

PLMD::Stopwatch::Handler::Handler ( Handler &&  handler)
inlinenoexcept

Move constructor.

◆ ~Handler()

PLMD::Stopwatch::Handler::~Handler ( )
inline

Destructor either stops or pauses the watch.

Member Function Documentation

◆ operator=() [1/2]

Handler& PLMD::Stopwatch::Handler::operator= ( const Handler handler)
delete

Default copy assignment is deleted (not copyable)

◆ operator=() [2/2]

Stopwatch::Handler & PLMD::Stopwatch::Handler::operator= ( Handler &&  handler)
inlinenoexcept

Move assignment.

Friends And Related Function Documentation

◆ Stopwatch

friend class Stopwatch
friend

Allows usage of private constructor.

Member Data Documentation

◆ stop

bool PLMD::Stopwatch::Handler::stop =false
private

stop (true) or pause (false).

might be changed to an enum if clearer.

◆ watch

Watch* PLMD::Stopwatch::Handler::watch =nullptr
private

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