Thrill  0.1

Detailed Description

Request that is aware of threads waiting for it to complete.

Definition at line 29 of file request_with_waiters.hpp.

+ Inheritance diagram for request_with_waiters:
+ Collaboration diagram for request_with_waiters:

#include <request_with_waiters.hpp>

Public Member Functions

 request_with_waiters (const completion_handler &on_complete, file *file, void *buffer, offset_type offset, size_type bytes, read_or_write op)
 
- Public Member Functions inherited from request
 request (const completion_handler &on_complete, file *file, void *buffer, offset_type offset, size_type bytes, read_or_write op)
 
 request (const request &)=delete
 non-copyable: delete copy-constructor More...
 
 request (request &&)=default
 move-constructor: default More...
 
virtual ~request ()
 
requestoperator= (const request &)=delete
 non-copyable: delete assignment operator More...
 
requestoperator= (request &&)=default
 move-assignment operator: default More...
 
fileget_file () const
 
void * buffer () const
 
offset_type offset () const
 
size_type bytes () const
 
read_or_write op () const
 
void check_alignment () const
 
std::ostream & print (std::ostream &out) const final
 Dumps properties of a request. More...
 
void error_occured (const char *msg)
 
void error_occured (const std::string &msg)
 
void check_errors ()
 Rises an exception if there were error with the I/O. More...
 
const char * io_type () const override
 Identifies the type of I/O implementation. More...
 
void release_file_reference ()
 
- Public Member Functions inherited from request_interface
 request_interface ()=default
 
 request_interface (const request_interface &)=delete
 non-copyable: delete copy-constructor More...
 
virtual ~request_interface ()
 
virtual bool cancel ()=0
 Cancel a request. More...
 
request_interfaceoperator= (const request_interface &)=delete
 non-copyable: delete assignment operator More...
 
virtual bool poll ()=0
 
virtual void wait (bool measure_time=true)=0
 Suspends calling thread until completion of the request. More...
 
- Public Member Functions inherited from ReferenceCounter
 ReferenceCounter () noexcept
 new objects have zero reference count More...
 
 ReferenceCounter (const ReferenceCounter &) noexcept
 coping still creates a new object with zero reference count More...
 
 ~ReferenceCounter ()
 
bool dec_reference () const noexcept
 Call whenever resetting (i.e. More...
 
void inc_reference () const noexcept
 Call whenever setting a pointer to the object. More...
 
ReferenceCounteroperator= (const ReferenceCounter &) noexcept
 assignment operator, leaves pointers unchanged More...
 
size_t reference_count () const noexcept
 Return the number of references to this object (for debugging) More...
 
bool unique () const noexcept
 Test if the ReferenceCounter is referenced by only one CountingPtr. More...
 

Protected Member Functions

bool add_waiter (onoff_switch *sw) final
 
void delete_waiter (onoff_switch *sw) final
 
void notify_waiters () final
 
size_t num_waiters ()
 returns number of waiters More...
 
- Protected Member Functions inherited from request
void check_nref (bool after=false)
 
- Protected Member Functions inherited from request_interface
virtual void completed (bool canceled)=0
 

Private Attributes

std::set< onoff_switch * > waiters_
 
std::mutex waiters_mutex_
 

Additional Inherited Members

- Public Types inherited from request_interface
using offset_type = uint64_t
 type for offsets within a file More...
 
enum  read_or_write { READ, WRITE }
 
using size_type = size_t
 type for block transfer sizes More...
 
- Protected Attributes inherited from request
std::unique_ptr< io_errorerror_
 
completion_handler on_complete_
 
filefile_
 file implementation to perform I/O with More...
 
void * buffer_
 data buffer to transfer More...
 
offset_type offset_
 offset within file More...
 
size_type bytes_
 number of bytes at buffer_ to transfer More...
 
read_or_write op_
 READ or WRITE. More...
 

Constructor & Destructor Documentation

◆ request_with_waiters()

request_with_waiters ( const completion_handler on_complete,
file file,
void *  buffer,
offset_type  offset,
size_type  bytes,
read_or_write  op 
)
inline

Definition at line 43 of file request_with_waiters.hpp.

Member Function Documentation

◆ add_waiter()

bool add_waiter ( onoff_switch sw)
finalprotectedvirtual

◆ delete_waiter()

void delete_waiter ( onoff_switch sw)
finalprotectedvirtual

◆ notify_waiters()

void notify_waiters ( )
finalprotectedvirtual

◆ num_waiters()

size_t num_waiters ( )
protected

returns number of waiters

Definition at line 56 of file request_with_waiters.cpp.

References request_with_waiters::waiters_, and request_with_waiters::waiters_mutex_.

Member Data Documentation

◆ waiters_

◆ waiters_mutex_


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