ChimeraTK-cppext 01.07.01
Loading...
Searching...
No Matches
cppext Namespace Reference

Namespaces

namespace  detail
 Implementation of shared_state_ptr.
 
namespace  experimental
 
namespace  ranges
 

Classes

class  barrier
 
class  final_act
 
class  future_queue
 A lockfree multi-producer single-consumer queue of a fixed length which the receiver can wait on in case the queue is empty. More...
 
class  future_queue_base
 Type-independent base class for future_queue which does not depend on the template argument. More...
 
class  MOVE_DATA
 Feature tag for future_queue: use std::move to store and retreive data to/from the queue. More...
 
class  semaphore
 
class  SWAP_DATA
 Feature tag for future_queue: use std::swap to store and retreive data to/from the queue. More...
 

Functions

template<class F >
final_act< Ffinally (const F &f) noexcept
 
template<class F >
final_act< Ffinally (F &&f) noexcept
 
template<typename ITERATOR_TYPE >
future_queue< size_twhen_any (ITERATOR_TYPE begin, ITERATOR_TYPE end)
 Implementations of non-member functions.
 
template<typename ITERATOR_TYPE >
future_queue< voidwhen_all (ITERATOR_TYPE begin, ITERATOR_TYPE end)
 This function expects two forward iterators pointing to a region of a container of future_queue objects.
 
void setThreadName (const std::string &name)
 Set name of the current thread.
 

Function Documentation

◆ finally() [1/2]

template<class F >
final_act< F > cppext::finally ( const F f)
inlinenoexcept

Definition at line 32 of file finally.hpp.

◆ finally() [2/2]

template<class F >
final_act< F > cppext::finally ( F &&  f)
inlinenoexcept

Definition at line 37 of file finally.hpp.

◆ setThreadName()

void cppext::setThreadName ( const std::string &  name)
inline

Set name of the current thread.

Note
: This function contains platform-dependent code and may need adjustment for new platforms. On unsupported platforms, this function does nothing.

Definition at line 17 of file threadName.hpp.

◆ when_all()

template<typename ITERATOR_TYPE >
future_queue< void > cppext::when_all ( ITERATOR_TYPE  begin,
ITERATOR_TYPE  end 
)

This function expects two forward iterators pointing to a region of a container of future_queue objects.

It returns a future_queue<void> which will receive a notification when all of the queues in the region have received a new value.

Definition at line 590 of file future_queue.hpp.

◆ when_any()

template<typename ITERATOR_TYPE >
future_queue< size_t > cppext::when_any ( ITERATOR_TYPE  begin,
ITERATOR_TYPE  end 
)

Implementations of non-member functions.

This function expects two forward iterators pointing to a region of a container of future_queue objects. It returns a future_queue which will receive the index of each queue relative to the iterator begin when the respective queue has new data available for reading. This way the returned queue can be used to get notified about each data written to any of the queues. The order of the indices in this queue is guaranteed to be in the same order the data has been written to the queues. If the same queue gets written to multiple times its index will be present in the returned queue the same number of times.

Behaviour is unspecified if, after the call to when_any(), data is popped from one of the participating queues without retreiving its index previously from the returned queue. Behaviour is also unspecified if the same queue is passed to different calls to this function, or occurres multiple times.

If push_overwrite() is used on one of the participating queues, the notifications received through the returned queue might be in a different order (i.e. when data is overwritten, the corresponding queue index is not moved to the correct place later in the notfication queue). Also, a notification for a value written to a queue with push_overwrite() might appear in the notification queue before the value can be retrieved from the data queue. It is therefore recommended to use pop_wait() to retrieve the values from the data queues if push_overwrite() is used. Otherwise failed pop() have to be retried until the data is received.

If data is already available in the queues before calling when_any(), the appropriate number of notifications are placed in the notifyer queue in arbitrary order.

Definition at line 562 of file future_queue.hpp.