Lunchbox  1.16.0
Multi-threaded C++ toolbox library for all application developers creating high-performance multi-threaded programs.
lunchbox::FutureBool< value > Class Template Reference

A boolean future with a known value. More...

#include <readyFuture.h>

+ Inheritance diagram for lunchbox::FutureBool< value >:
+ Collaboration diagram for lunchbox::FutureBool< value >:

Protected Member Functions

bool wait (const uint32_t) final
 Wait for the promise to be fullfilled. More...
 
bool isReady () const final
 
- Protected Member Functions inherited from lunchbox::Referenced
 Referenced ()
 Construct a new reference-counted object. More...
 
 Referenced (const Referenced &)
 Construct a new copy of a reference-counted object. More...
 
virtual ~Referenced ()
 Destruct a reference-counted object. More...
 
Referencedoperator= (const Referenced &)
 Assign another object to this object. More...
 
virtual void notifyFree ()
 

Additional Inherited Members

- Public Member Functions inherited from lunchbox::FutureImpl< bool >
virtual ~FutureImpl ()
 Destruct the future. More...
 
- Public Member Functions inherited from lunchbox::Referenced
void ref (const void *holder=0) const
 Increase the reference count. More...
 
bool unref (const void *holder=0) const
 Decrease the reference count. More...
 
int32_t getRefCount () const
 
void printHolders (std::ostream &) const
 

Detailed Description

template<bool value>
class lunchbox::FutureBool< value >

A boolean future with a known value.

Fully thread safe.

Definition at line 27 of file readyFuture.h.

Member Function Documentation

template<bool value>
bool lunchbox::FutureBool< value >::isReady ( ) const
inlinefinalprotectedvirtual
Returns
true if the future has been fulfilled, false if it is pending.

Implements lunchbox::FutureImpl< bool >.

Definition at line 31 of file readyFuture.h.

template<bool value>
bool lunchbox::FutureBool< value >::wait ( const uint32_t  timeout)
inlinefinalprotectedvirtual

Wait for the promise to be fullfilled.

May be called multiple times.

Parameters
timeoutoptional timeout in milliseconds. If the future is not ready when the timer goes off a timeout exception is thrown.

Implements lunchbox::FutureImpl< bool >.

Definition at line 30 of file readyFuture.h.


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