proxygen
MPMC< T > Class Template Reference

Public Member Functions

 MPMC (uint64_t capacity)
 
void enqueue (const T &v)
 
void enqueue (T &&v)
 
bool try_enqueue (const T &v)
 
bool try_enqueue (const T &&v)
 
template<typename Rep , typename Period >
bool try_enqueue_for (const T &v, const std::chrono::duration< Rep, Period > &duration)
 
void dequeue (T &item)
 
bool try_dequeue (T &item)
 
template<typename Rep , typename Period >
bool try_dequeue_for (T &item, const std::chrono::duration< Rep, Period > &duration)
 
 MPMC ()
 
template<typename... Args>
void enqueue (Args &&...args)
 
void dequeue (T &item)
 
bool try_dequeue (T &item)
 
template<typename Rep , typename Period >
bool try_dequeue_for (T &item, const std::chrono::duration< Rep, Period > &duration) noexcept
 

Private Attributes

folly::MPMCQueue< Tq_
 

Detailed Description

template<typename T>
class MPMC< T >

Definition at line 428 of file DynamicBoundedQueueTest.cpp.

Constructor & Destructor Documentation

template<typename T >
MPMC< T >::MPMC ( uint64_t  capacity)
inlineexplicit

Definition at line 432 of file DynamicBoundedQueueTest.cpp.

432 : q_(capacity) {}
folly::MPMCQueue< T > q_
template<typename T >
MPMC< T >::MPMC ( )
inline

Definition at line 400 of file UnboundedQueueTest.cpp.

References testing::Args().

400 : q_(FLAGS_capacity) {}
folly::MPMCQueue< T > q_

Member Function Documentation

template<typename T >
void MPMC< T >::dequeue ( T item)
inline

Definition at line 407 of file UnboundedQueueTest.cpp.

407  {
408  q_.blockingRead(item);
409  }
folly::MPMCQueue< T > q_
template<typename T >
void MPMC< T >::dequeue ( T item)
inline

Definition at line 457 of file DynamicBoundedQueueTest.cpp.

457  {
458  q_.blockingRead(item);
459  }
folly::MPMCQueue< T > q_
template<typename T >
template<typename... Args>
void MPMC< T >::enqueue ( Args &&...  args)
inline

Definition at line 403 of file UnboundedQueueTest.cpp.

403  {
404  q_.blockingWrite(std::forward<Args>(args)...);
405  }
folly::MPMCQueue< T > q_
template<typename T >
void MPMC< T >::enqueue ( const T v)
inline

Definition at line 434 of file DynamicBoundedQueueTest.cpp.

434  {
435  q_.blockingWrite(v);
436  }
folly::MPMCQueue< T > q_
template<typename T >
void MPMC< T >::enqueue ( T &&  v)
inline

Definition at line 438 of file DynamicBoundedQueueTest.cpp.

References folly::gen::move.

438  {
439  q_.blockingWrite(std::move(v));
440  }
constexpr detail::Map< Move > move
Definition: Base-inl.h:2567
folly::MPMCQueue< T > q_
template<typename T >
bool MPMC< T >::try_dequeue ( T item)
inline

Definition at line 411 of file UnboundedQueueTest.cpp.

411  {
412  return q_.read(item);
413  }
folly::MPMCQueue< T > q_
template<typename T >
bool MPMC< T >::try_dequeue ( T item)
inline

Definition at line 461 of file DynamicBoundedQueueTest.cpp.

461  {
462  return q_.read(item);
463  }
folly::MPMCQueue< T > q_
template<typename T >
template<typename Rep , typename Period >
bool MPMC< T >::try_dequeue_for ( T item,
const std::chrono::duration< Rep, Period > &  duration 
)
inlinenoexcept

Definition at line 416 of file UnboundedQueueTest.cpp.

References now().

418  {
419  auto deadline = std::chrono::steady_clock::now() + duration;
420  return q_.tryReadUntil(deadline, item);
421  }
std::chrono::steady_clock::time_point now()
folly::MPMCQueue< T > q_
template<typename T >
template<typename Rep , typename Period >
bool MPMC< T >::try_dequeue_for ( T item,
const std::chrono::duration< Rep, Period > &  duration 
)
inline

Definition at line 466 of file DynamicBoundedQueueTest.cpp.

References now().

468  {
469  return q_.tryReadUntil(std::chrono::steady_clock::now() + duration, item);
470  }
std::chrono::steady_clock::time_point now()
folly::MPMCQueue< T > q_
template<typename T >
bool MPMC< T >::try_enqueue ( const T v)
inline

Definition at line 442 of file DynamicBoundedQueueTest.cpp.

442  {
443  return q_.write(v);
444  }
folly::MPMCQueue< T > q_
template<typename T >
bool MPMC< T >::try_enqueue ( const T &&  v)
inline

Definition at line 446 of file DynamicBoundedQueueTest.cpp.

References folly::gen::move.

446  {
447  return q_.write(std::move(v));
448  }
constexpr detail::Map< Move > move
Definition: Base-inl.h:2567
folly::MPMCQueue< T > q_
template<typename T >
template<typename Rep , typename Period >
bool MPMC< T >::try_enqueue_for ( const T v,
const std::chrono::duration< Rep, Period > &  duration 
)
inline

Definition at line 451 of file DynamicBoundedQueueTest.cpp.

References now().

453  {
454  return q_.tryWriteUntil(std::chrono::steady_clock::now() + duration, v);
455  }
std::chrono::steady_clock::time_point now()
folly::MPMCQueue< T > q_

Member Data Documentation

template<typename T >
folly::MPMCQueue< T > MPMC< T >::q_
private

Definition at line 429 of file DynamicBoundedQueueTest.cpp.


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