Rosetta  2020.37
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Types | Public Member Functions | Protected Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
utility::signals::PausableSignalHub< ResultType, Signal > Class Template Reference

forward declaration for PausableSignalHub More...

#include <PausableSignalHub.hh>

Inheritance diagram for utility::signals::PausableSignalHub< ResultType, Signal >:
Inheritance graph
[legend]

Public Types

typedef Super::Size Size
 
- Public Types inherited from utility::signals::BufferedSignalHub< ReturnType, Signal >
typedef Super::Size Size
 
typedef std::vector< SignalBuffer
 
- Public Types inherited from utility::signals::SignalHub< ReturnType, Signal >
typedef platform::Size Size
 

Public Member Functions

 PausableSignalHub ()
 default constructor More...
 
 ~PausableSignalHub () override=default
 default destructor More...
 
void pause ()
 "pause" by waiting for stdin after a signal is sent More...
 
void unpause ()
 do not wait for stdin after a signal is sent More...
 
bool pausing () const
 will a pause occur after sending a signal? More...
 
- Public Member Functions inherited from utility::signals::BufferedSignalHub< ReturnType, Signal >
 BufferedSignalHub ()
 default constructor More...
 
 ~BufferedSignalHub () override=default
 default destructor More...
 
void buffer ()
 block signals and buffer them for release upon unblocking More...
 
void unblock () override
 allow signals to be sent and release any signals that were buffered More...
 
bool buffering () const
 are signals being buffered? More...
 
void clear_buffer ()
 clear the buffer More...
 
Size buffer_size () const
 number of signals left in the buffer More...
 
- Public Member Functions inherited from utility::signals::SignalHub< ReturnType, Signal >
 SignalHub ()
 default constructor More...
 
virtual ~SignalHub ()
 default destructor More...
 
void operator() (Signal s)
 send signal to all observers connected to the hub More...
 
Size size () const
 number of connections to the hub More...
 
void block ()
 block signals from being sent More...
 
bool blocked () const
 are signals blocked? More...
 
void clear ()
 clear all connections More...
 
Link connect (MemFn fn, Ptr ptr)
 connect an observer's member function to this hub More...
 
bool disconnect (MemFn fn, Ptr ptr)
 disconnect an observer's member function from this hub More...
 
Size receive_linkunits_from (SignalHub const &src)
 transfer linkunits from source to this SignalHub More...
 
Links current_links () const
 return a copy of the list of links currently being managed by this SignalHub More...
 

Protected Member Functions

void after_send () override
 wait for stdin after sending a signal More...
 
- Protected Member Functions inherited from utility::signals::BufferedSignalHub< ReturnType, Signal >
void release_buffer ()
 release the signals in the buffer More...
 
bool signal_allowed (Signal const s) override
 is signal allowed to be passed? More...
 
- Protected Member Functions inherited from utility::signals::SignalHub< ReturnType, Signal >
Link connect (MemFn fn, Ptr ptr, LinkUnits &links) const
 connect an observer's member function to the given LinkUnits More...
 
bool disconnect (MemFn fn, Ptr ptr, LinkUnits &links) const
 disconnect an observer's member function from the given LinkUnits More...
 
virtual void send_signal (Signal s)
 send signal to all observers More...
 
LinkUnits::iterator find_connection (Functor f, LinkUnits &links) const
 find a specific connection to this hub More...
 
void send (Signal s, LinkUnits &links) const
 send signal to all links taking into account validity and local blocking More...
 
void invalidate_all (LinkUnits &links) const
 invalidate and destroy internals of all links More...
 
void remove_invalid (LinkUnits &links) const
 remove and destroy internals of invalid links More...
 
void deallocate (LinkUnit &lu) const
 deallocate function stored in a LinkUnit More...
 
LinkUnitslinkunits ()
 returns the list of LinkUnits More...
 

Private Types

typedef BufferedSignalHub
< ReturnType, Signal
Super
 

Private Member Functions

 PausableSignalHub (PausableSignalHub const &rval)
 disallow copy constructor More...
 
PausableSignalHuboperator= (PausableSignalHub const &rval)
 disallow copy assignment More...
 

Private Attributes

bool pausing_
 flag indicating blocked signals should be buffered More...
 

Additional Inherited Members

- Protected Types inherited from utility::signals::SignalHub< ReturnType, Signal >
typedef boost::function1
< ReturnType, Signal
Function
 
typedef std::vector< LinkUnitOPLinkUnits
 
typedef std::vector< LinkLinks
 

Detailed Description

template<typename ResultType, typename Signal>
class utility::signals::PausableSignalHub< ResultType, Signal >

forward declaration for PausableSignalHub

BufferedSignalHub capable of pausing and waiting for stdin.

When pause is set, a Signal that's passed in to the Hub will first be sent to all observers, and then afterwards the Hub will attempt to read from stdin, waiting for the user to press enter. Please see BufferedSignalHub documentation for other usage.

Note
If #define BOINC pause behavior is non-operative.
Warning
PausableSignalHub objects are not copyable.

Member Typedef Documentation

template<typename ResultType , typename Signal >
typedef Super::Size utility::signals::PausableSignalHub< ResultType, Signal >::Size
template<typename ResultType , typename Signal >
typedef BufferedSignalHub< ReturnType, Signal > utility::signals::PausableSignalHub< ResultType, Signal >::Super
private

Constructor & Destructor Documentation

template<typename ResultType , typename Signal >
utility::signals::PausableSignalHub< ResultType, Signal >::PausableSignalHub ( )
inline

default constructor

template<typename ResultType , typename Signal >
utility::signals::PausableSignalHub< ResultType, Signal >::~PausableSignalHub ( )
inlineoverridedefault

default destructor

template<typename ResultType , typename Signal >
utility::signals::PausableSignalHub< ResultType, Signal >::PausableSignalHub ( PausableSignalHub< ResultType, Signal > const &  rval)
private

disallow copy constructor

Member Function Documentation

template<typename ResultType , typename Signal >
void utility::signals::PausableSignalHub< ResultType, Signal >::after_send ( )
inlineoverrideprotectedvirtual

wait for stdin after sending a signal

user presses enter to continue

Returns
true if successful, false otherwise

Reimplemented from utility::signals::SignalHub< ReturnType, Signal >.

References utility::io::ic::cin, utility::io::icstream::clear(), utility::io::oc::cout, and utility::signals::PausableSignalHub< ResultType, Signal >::pausing_.

template<typename ResultType , typename Signal >
PausableSignalHub& utility::signals::PausableSignalHub< ResultType, Signal >::operator= ( PausableSignalHub< ResultType, Signal > const &  rval)
private

disallow copy assignment

template<typename ResultType , typename Signal >
void utility::signals::PausableSignalHub< ResultType, Signal >::pause ( )
inline

"pause" by waiting for stdin after a signal is sent

References utility::signals::PausableSignalHub< ResultType, Signal >::pausing_.

template<typename ResultType , typename Signal >
bool utility::signals::PausableSignalHub< ResultType, Signal >::pausing ( ) const
inline

will a pause occur after sending a signal?

References utility::signals::PausableSignalHub< ResultType, Signal >::pausing_.

template<typename ResultType , typename Signal >
void utility::signals::PausableSignalHub< ResultType, Signal >::unpause ( )
inline

do not wait for stdin after a signal is sent

References utility::signals::PausableSignalHub< ResultType, Signal >::pausing_.

Member Data Documentation

template<typename ResultType , typename Signal >
bool utility::signals::PausableSignalHub< ResultType, Signal >::pausing_
private

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