sptk2 logo
SPTK Home Page
Public Member Functions | List of all members
sptk::Flag Class Reference

#include <Flag.h>

Public Member Functions

 Flag (bool startingValue=false)
 
virtual ~Flag ()
 
bool get () const
 
void set (bool value)
 
 operator bool () const
 
Flagoperator= (bool value)
 
bool wait_for (bool value, std::chrono::milliseconds timeout)
 
bool wait_until (bool value, DateTime timeout)
 

Detailed Description

Generic flag class

Constructor & Destructor Documentation

◆ Flag()

sptk::Flag::Flag ( bool  startingValue = false)
explicit

Constructor

Creates flag with starting value (default false)

Parameters
startingValueStarting flag value

◆ ~Flag()

virtual sptk::Flag::~Flag ( )
virtual

Destructor

Member Function Documentation

◆ get()

bool sptk::Flag::get ( ) const

Get the flag value

Parameters
valueNew flag value

◆ operator bool()

sptk::Flag::operator bool ( ) const
inline

Adaptor

◆ operator=()

Flag & sptk::Flag::operator= ( bool  value)
inline

Assignment

◆ set()

void sptk::Flag::set ( bool  value)

Set the flag value

Parameters
valueNew flag value

◆ wait_for()

bool sptk::Flag::wait_for ( bool  value,
std::chrono::milliseconds  timeout 
)

Wait until the flag has the value

Parameters
valueValue to wait for
timeoutWait timeout
Returns
true if flag received the value, or false if timeout occurs

◆ wait_until()

bool sptk::Flag::wait_until ( bool  value,
DateTime  timeout 
)

Wait until the flag has the value

Parameters
valueValue to wait for
timeoutWait timeout
Returns
true if flag received the value, or false if timeout occurs

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

Fri Oct 14 2022 09:58:42: SPTK 5.4.1