proxygen
folly::detail::MPMCPipelineStageImpl< T > Class Template Reference

#include <MPMCPipelineDetail.h>

Public Types

typedef T value_type
 

Public Member Functions

 MPMCPipelineStageImpl (size_t capacity)
 
 MPMCPipelineStageImpl ()
 
template<class... Args>
void blockingWrite (Args &&...args) noexcept
 
template<class... Args>
bool write (Args &&...args) noexcept
 
template<class... Args>
void blockingWriteWithTicket (uint64_t ticket, Args &&...args) noexcept
 
uint64_t blockingRead (T &elem) noexcept
 
bool read (T &elem) noexcept
 
template<class... Args>
bool readAndGetTicket (uint64_t &ticket, T &elem) noexcept
 
uint64_t writeCount () const noexcept
 
uint64_t readCount () const noexcept
 

Private Attributes

MPMCQueue< Tqueue_
 

Friends

template<class U , class... Stages>
class MPMCPipeline
 

Detailed Description

template<class T>
class folly::detail::MPMCPipelineStageImpl< T >

Wrapper around MPMCQueue (friend) that keeps track of tickets.

Definition at line 55 of file MPMCPipelineDetail.h.

Member Typedef Documentation

template<class T >
typedef T folly::detail::MPMCPipelineStageImpl< T >::value_type

Definition at line 57 of file MPMCPipelineDetail.h.

Constructor & Destructor Documentation

template<class T >
folly::detail::MPMCPipelineStageImpl< T >::MPMCPipelineStageImpl ( size_t  capacity)
inline

Definition at line 62 of file MPMCPipelineDetail.h.

62 : queue_(capacity) {}

Definition at line 63 of file MPMCPipelineDetail.h.

References testing::Args().

63 {}

Member Function Documentation

template<class T >
uint64_t folly::detail::MPMCPipelineStageImpl< T >::blockingRead ( T elem)
inlinenoexcept

Definition at line 82 of file MPMCPipelineDetail.h.

References ticket, and uint64_t.

82  {
84  queue_.blockingReadWithTicket(ticket, elem);
85  return ticket;
86  }
static constexpr StringPiece ticket
template<class T >
template<class... Args>
void folly::detail::MPMCPipelineStageImpl< T >::blockingWrite ( Args &&...  args)
inlinenoexcept

Definition at line 68 of file MPMCPipelineDetail.h.

References testing::Args().

68  {
69  queue_.blockingWrite(std::forward<Args>(args)...);
70  }
template<class T >
template<class... Args>
void folly::detail::MPMCPipelineStageImpl< T >::blockingWriteWithTicket ( uint64_t  ticket,
Args &&...  args 
)
inlinenoexcept

Definition at line 78 of file MPMCPipelineDetail.h.

78  {
79  queue_.enqueueWithTicket(ticket, std::forward<Args>(args)...);
80  }
static constexpr StringPiece ticket
template<class T >
bool folly::detail::MPMCPipelineStageImpl< T >::read ( T elem)
inlinenoexcept

Definition at line 88 of file MPMCPipelineDetail.h.

References testing::Args().

88  { // only use on last stage, won't track ticket
89  return queue_.read(elem);
90  }
template<class T >
template<class... Args>
bool folly::detail::MPMCPipelineStageImpl< T >::readAndGetTicket ( uint64_t ticket,
T elem 
)
inlinenoexcept

Definition at line 93 of file MPMCPipelineDetail.h.

References ticket.

93  {
94  return queue_.readAndGetTicket(ticket, elem);
95  }
static constexpr StringPiece ticket
template<class T >
uint64_t folly::detail::MPMCPipelineStageImpl< T >::readCount ( ) const
inlinenoexcept

Definition at line 102 of file MPMCPipelineDetail.h.

102  {
103  return queue_.readCount();
104  }
template<class T >
template<class... Args>
bool folly::detail::MPMCPipelineStageImpl< T >::write ( Args &&...  args)
inlinenoexcept

Definition at line 73 of file MPMCPipelineDetail.h.

References testing::Args().

73  {
74  return queue_.write(std::forward<Args>(args)...);
75  }
template<class T >
uint64_t folly::detail::MPMCPipelineStageImpl< T >::writeCount ( ) const
inlinenoexcept

Definition at line 98 of file MPMCPipelineDetail.h.

98  {
99  return queue_.writeCount();
100  }

Friends And Related Function Documentation

template<class T >
template<class U , class... Stages>
friend class MPMCPipeline
friend

Definition at line 59 of file MPMCPipelineDetail.h.

Member Data Documentation

template<class T >
MPMCQueue<T> folly::detail::MPMCPipelineStageImpl< T >::queue_
private

Definition at line 107 of file MPMCPipelineDetail.h.


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