proxygen
PCQ< T > Class Template Reference

Public Member Functions

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

Private Attributes

folly::ProducerConsumerQueue< Tq_
 

Detailed Description

template<typename T>
class PCQ< T >

Definition at line 477 of file DynamicBoundedQueueTest.cpp.

Constructor & Destructor Documentation

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

Definition at line 481 of file DynamicBoundedQueueTest.cpp.

481 : q_(capacity) {}
folly::ProducerConsumerQueue< T > q_
template<typename T >
PCQ< T >::PCQ ( )
inline

Definition at line 432 of file UnboundedQueueTest.cpp.

References testing::Args().

432 : q_(FLAGS_capacity) {}
folly::ProducerConsumerQueue< T > q_

Member Function Documentation

template<typename T >
void PCQ< T >::dequeue ( T )
inline

Definition at line 441 of file UnboundedQueueTest.cpp.

References ASSERT_TRUE.

441  {
442  ASSERT_TRUE(false);
443  }
#define ASSERT_TRUE(condition)
Definition: gtest.h:1865
template<typename T >
void PCQ< T >::dequeue ( T )
inline

Definition at line 500 of file DynamicBoundedQueueTest.cpp.

References ASSERT_TRUE.

500  {
501  ASSERT_TRUE(false);
502  }
#define ASSERT_TRUE(condition)
Definition: gtest.h:1865
template<typename T >
template<typename... Args>
void PCQ< T >::enqueue ( Args &&...  args)
inline

Definition at line 435 of file UnboundedQueueTest.cpp.

References folly::ProducerConsumerQueue< T >::write().

435  {
436  while (!q_.write(std::forward<Args>(args)...)) {
437  /* keep trying*/;
438  }
439  }
folly::ProducerConsumerQueue< T > q_
template<typename T >
void PCQ< T >::enqueue ( const T )
inline

Definition at line 483 of file DynamicBoundedQueueTest.cpp.

References ASSERT_TRUE.

483  {
484  ASSERT_TRUE(false);
485  }
#define ASSERT_TRUE(condition)
Definition: gtest.h:1865
template<typename T >
bool PCQ< T >::try_dequeue ( T item)
inline

Definition at line 445 of file UnboundedQueueTest.cpp.

References folly::ProducerConsumerQueue< T >::read().

445  {
446  return q_.read(item);
447  }
folly::ProducerConsumerQueue< T > q_
template<typename T >
bool PCQ< T >::try_dequeue ( T item)
inline

Definition at line 504 of file DynamicBoundedQueueTest.cpp.

References folly::ProducerConsumerQueue< T >::read().

504  {
505  return q_.read(item);
506  }
folly::ProducerConsumerQueue< T > q_
template<typename T >
template<typename Rep , typename Period >
bool PCQ< T >::try_dequeue_for ( T ,
const std::chrono::duration< Rep, Period > &   
)
inlinenoexcept

Definition at line 450 of file UnboundedQueueTest.cpp.

450  {
451  return false;
452  }
template<typename T >
template<typename Rep , typename Period >
bool PCQ< T >::try_dequeue_for ( T ,
const std::chrono::duration< Rep, Period > &   
)
inline

Definition at line 509 of file DynamicBoundedQueueTest.cpp.

509  {
510  return false;
511  }
template<typename T >
bool PCQ< T >::try_enqueue ( const T v)
inline

Definition at line 487 of file DynamicBoundedQueueTest.cpp.

References folly::ProducerConsumerQueue< T >::write().

487  {
488  return q_.write(v);
489  }
folly::ProducerConsumerQueue< T > q_
template<typename T >
bool PCQ< T >::try_enqueue ( T &&  v)
inline

Definition at line 491 of file DynamicBoundedQueueTest.cpp.

References folly::gen::move, and folly::ProducerConsumerQueue< T >::write().

491  {
492  return q_.write(std::move(v));
493  }
folly::ProducerConsumerQueue< T > q_
constexpr detail::Map< Move > move
Definition: Base-inl.h:2567
template<typename T >
template<typename Rep , typename Period >
bool PCQ< T >::try_enqueue_for ( const T ,
const std::chrono::duration< Rep, Period > &   
)
inline

Definition at line 496 of file DynamicBoundedQueueTest.cpp.

496  {
497  return false;
498  }

Member Data Documentation

template<typename T >
folly::ProducerConsumerQueue< T > PCQ< T >::q_
private

Definition at line 478 of file DynamicBoundedQueueTest.cpp.


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