proxygen
folly::FlatCombining< T, Mutex, Atom, Req >::Rec Class Reference

Combining request record. More...

#include <FlatCombining.h>

Public Member Functions

 Rec ()
 
void setValid ()
 
void clearValid ()
 
bool isValid () const
 
void setDone ()
 
void clearDone ()
 
bool isDone () const
 
void awaitDone ()
 
void setDisconnected ()
 
void clearDisconnected ()
 
bool isDisconnected () const
 
void setIndex (const size_t index)
 
size_t getIndex () const
 
void setNext (const size_t next)
 
size_t getNext () const
 
void setLast (const uint64_t pass)
 
uint64_t getLast () const
 
ReqgetReq ()
 
template<typename Func >
void setFn (Func &&fn)
 
void clearFn ()
 
SavedFngetFn ()
 
void complete ()
 

Private Attributes

folly::SaturatingSemaphore< false, Atomvalid_
 
folly::SaturatingSemaphore< false, Atomdone_
 
folly::SaturatingSemaphore< false, Atomdisconnected_
 
size_t index_
 
size_t next_
 
uint64_t last_
 
Req req_
 
SavedFn fn_
 

Detailed Description

template<typename T, typename Mutex = std::mutex, template< typename > class Atom = std::atomic, typename Req = bool>
class folly::FlatCombining< T, Mutex, Atom, Req >::Rec

Combining request record.

Definition at line 114 of file FlatCombining.h.

Constructor & Destructor Documentation

Member Function Documentation

template<typename T, typename Mutex = std::mutex, template< typename > class Atom = std::atomic, typename Req = bool>
void folly::FlatCombining< T, Mutex, Atom, Req >::Rec::awaitDone ( )
inline

Definition at line 155 of file FlatCombining.h.

References folly::SaturatingSemaphore< MayBlock, Atom >::wait().

Referenced by folly::FlatCombining< FcSimpleExample< Mutex, Atom >, Mutex, Atom >::drainAll(), and folly::FlatCombining< FcSimpleExample< Mutex, Atom >, Mutex, Atom >::requestOp().

155  {
156  done_.wait();
157  }
FOLLY_ALWAYS_INLINE void wait(const WaitOptions &opt=wait_options()) noexcept
folly::SaturatingSemaphore< false, Atom > done_
template<typename T, typename Mutex = std::mutex, template< typename > class Atom = std::atomic, typename Req = bool>
void folly::FlatCombining< T, Mutex, Atom, Req >::Rec::clearDisconnected ( )
inline

Definition at line 163 of file FlatCombining.h.

References folly::SaturatingSemaphore< MayBlock, Atom >::reset().

163  {
165  }
folly::SaturatingSemaphore< false, Atom > disconnected_
template<typename T, typename Mutex = std::mutex, template< typename > class Atom = std::atomic, typename Req = bool>
void folly::FlatCombining< T, Mutex, Atom, Req >::Rec::clearDone ( )
inline

Definition at line 147 of file FlatCombining.h.

References folly::SaturatingSemaphore< MayBlock, Atom >::reset().

147  {
148  done_.reset();
149  }
folly::SaturatingSemaphore< false, Atom > done_
template<typename T, typename Mutex = std::mutex, template< typename > class Atom = std::atomic, typename Req = bool>
void folly::FlatCombining< T, Mutex, Atom, Req >::Rec::clearFn ( )
inline

Definition at line 213 of file FlatCombining.h.

213  {
214  fn_ = {};
215  assert(!fn_);
216  }
template<typename T, typename Mutex = std::mutex, template< typename > class Atom = std::atomic, typename Req = bool>
void folly::FlatCombining< T, Mutex, Atom, Req >::Rec::clearValid ( )
inline
template<typename T, typename Mutex = std::mutex, template< typename > class Atom = std::atomic, typename Req = bool>
void folly::FlatCombining< T, Mutex, Atom, Req >::Rec::complete ( )
inline
template<typename T, typename Mutex = std::mutex, template< typename > class Atom = std::atomic, typename Req = bool>
SavedFn& folly::FlatCombining< T, Mutex, Atom, Req >::Rec::getFn ( )
inline

Definition at line 218 of file FlatCombining.h.

References folly::FlatCombining< T, Mutex, Atom, Req >::Rec::fn_.

218  {
219  return fn_;
220  }
template<typename T, typename Mutex = std::mutex, template< typename > class Atom = std::atomic, typename Req = bool>
size_t folly::FlatCombining< T, Mutex, Atom, Req >::Rec::getIndex ( ) const
inline

Definition at line 175 of file FlatCombining.h.

References folly::FlatCombining< T, Mutex, Atom, Req >::Rec::index_.

175  {
176  return index_;
177  }
template<typename T, typename Mutex = std::mutex, template< typename > class Atom = std::atomic, typename Req = bool>
uint64_t folly::FlatCombining< T, Mutex, Atom, Req >::Rec::getLast ( ) const
inline

Definition at line 191 of file FlatCombining.h.

References folly::FlatCombining< T, Mutex, Atom, Req >::Rec::last_.

191  {
192  return last_;
193  }
template<typename T, typename Mutex = std::mutex, template< typename > class Atom = std::atomic, typename Req = bool>
size_t folly::FlatCombining< T, Mutex, Atom, Req >::Rec::getNext ( ) const
inline

Definition at line 183 of file FlatCombining.h.

References folly::FlatCombining< T, Mutex, Atom, Req >::Rec::next_.

183  {
184  return next_;
185  }
template<typename T, typename Mutex = std::mutex, template< typename > class Atom = std::atomic, typename Req = bool>
Req& folly::FlatCombining< T, Mutex, Atom, Req >::Rec::getReq ( )
inline

Definition at line 195 of file FlatCombining.h.

References folly::FlatCombining< T, Mutex, Atom, Req >::Rec::req_.

195  {
196  return req_;
197  }
template<typename T, typename Mutex = std::mutex, template< typename > class Atom = std::atomic, typename Req = bool>
bool folly::FlatCombining< T, Mutex, Atom, Req >::Rec::isDisconnected ( ) const
inline

Definition at line 167 of file FlatCombining.h.

References folly::SaturatingSemaphore< MayBlock, Atom >::ready().

167  {
168  return disconnected_.ready();
169  }
FOLLY_ALWAYS_INLINE bool ready() const noexcept
folly::SaturatingSemaphore< false, Atom > disconnected_
template<typename T, typename Mutex = std::mutex, template< typename > class Atom = std::atomic, typename Req = bool>
bool folly::FlatCombining< T, Mutex, Atom, Req >::Rec::isDone ( ) const
inline

Definition at line 151 of file FlatCombining.h.

References folly::SaturatingSemaphore< MayBlock, Atom >::ready().

Referenced by folly::FlatCombining< T, Mutex, Atom, Req >::Rec::complete().

151  {
152  return done_.ready();
153  }
FOLLY_ALWAYS_INLINE bool ready() const noexcept
folly::SaturatingSemaphore< false, Atom > done_
template<typename T, typename Mutex = std::mutex, template< typename > class Atom = std::atomic, typename Req = bool>
bool folly::FlatCombining< T, Mutex, Atom, Req >::Rec::isValid ( ) const
inline

Definition at line 139 of file FlatCombining.h.

References folly::SaturatingSemaphore< MayBlock, Atom >::ready(), and folly::FlatCombining< T, Mutex, Atom, Req >::Rec::valid_.

139  {
140  return valid_.ready();
141  }
FOLLY_ALWAYS_INLINE bool ready() const noexcept
folly::SaturatingSemaphore< false, Atom > valid_
template<typename T, typename Mutex = std::mutex, template< typename > class Atom = std::atomic, typename Req = bool>
void folly::FlatCombining< T, Mutex, Atom, Req >::Rec::setDisconnected ( )
inline

Definition at line 159 of file FlatCombining.h.

References folly::SaturatingSemaphore< MayBlock, Atom >::post().

Referenced by folly::FlatCombining< T, Mutex, Atom, Req >::Rec::Rec().

159  {
161  }
folly::SaturatingSemaphore< false, Atom > disconnected_
FOLLY_ALWAYS_INLINE void post() noexcept
template<typename T, typename Mutex = std::mutex, template< typename > class Atom = std::atomic, typename Req = bool>
void folly::FlatCombining< T, Mutex, Atom, Req >::Rec::setDone ( )
inline

Definition at line 143 of file FlatCombining.h.

References folly::SaturatingSemaphore< MayBlock, Atom >::post().

Referenced by folly::FlatCombining< T, Mutex, Atom, Req >::Rec::complete(), and folly::FlatCombining< T, Mutex, Atom, Req >::Rec::Rec().

143  {
144  done_.post();
145  }
FOLLY_ALWAYS_INLINE void post() noexcept
folly::SaturatingSemaphore< false, Atom > done_
template<typename T, typename Mutex = std::mutex, template< typename > class Atom = std::atomic, typename Req = bool>
template<typename Func >
void folly::FlatCombining< T, Mutex, Atom, Req >::Rec::setFn ( Func &&  fn)
inline

Definition at line 200 of file FlatCombining.h.

References folly::value().

200  {
201  static_assert(
202  std::is_nothrow_constructible<
203  folly::Function<void()>,
204  _t<std::decay<Func>>>::value,
205  "Try using a smaller function object that can fit in folly::Function "
206  "without allocation, or use the custom interface of requestFC() to "
207  "manage the requested function's arguments and results explicitly "
208  "in a custom request structure without allocation.");
209  fn_ = std::forward<Func>(fn);
210  assert(fn_);
211  }
typename T::type _t
Definition: Traits.h:171
uint64_t value(const typename LockFreeRingBuffer< T, Atom >::Cursor &rbcursor)
template<typename T, typename Mutex = std::mutex, template< typename > class Atom = std::atomic, typename Req = bool>
void folly::FlatCombining< T, Mutex, Atom, Req >::Rec::setIndex ( const size_t  index)
inline

Definition at line 171 of file FlatCombining.h.

171  {
172  index_ = index;
173  }
template<typename T, typename Mutex = std::mutex, template< typename > class Atom = std::atomic, typename Req = bool>
void folly::FlatCombining< T, Mutex, Atom, Req >::Rec::setLast ( const uint64_t  pass)
inline

Definition at line 187 of file FlatCombining.h.

187  {
188  last_ = pass;
189  }
template<typename T, typename Mutex = std::mutex, template< typename > class Atom = std::atomic, typename Req = bool>
void folly::FlatCombining< T, Mutex, Atom, Req >::Rec::setNext ( const size_t  next)
inline

Definition at line 179 of file FlatCombining.h.

References cpp.ast::next().

179  {
180  next_ = next;
181  }
def next(obj)
Definition: ast.py:58
template<typename T, typename Mutex = std::mutex, template< typename > class Atom = std::atomic, typename Req = bool>
void folly::FlatCombining< T, Mutex, Atom, Req >::Rec::setValid ( )
inline

Definition at line 131 of file FlatCombining.h.

References folly::SaturatingSemaphore< MayBlock, Atom >::post(), and folly::FlatCombining< T, Mutex, Atom, Req >::Rec::valid_.

131  {
132  valid_.post();
133  }
folly::SaturatingSemaphore< false, Atom > valid_
FOLLY_ALWAYS_INLINE void post() noexcept

Member Data Documentation

template<typename T, typename Mutex = std::mutex, template< typename > class Atom = std::atomic, typename Req = bool>
folly::SaturatingSemaphore<false, Atom> folly::FlatCombining< T, Mutex, Atom, Req >::Rec::disconnected_
private

Definition at line 118 of file FlatCombining.h.

template<typename T, typename Mutex = std::mutex, template< typename > class Atom = std::atomic, typename Req = bool>
folly::SaturatingSemaphore<false, Atom> folly::FlatCombining< T, Mutex, Atom, Req >::Rec::done_
private

Definition at line 117 of file FlatCombining.h.

template<typename T, typename Mutex = std::mutex, template< typename > class Atom = std::atomic, typename Req = bool>
SavedFn folly::FlatCombining< T, Mutex, Atom, Req >::Rec::fn_
private
template<typename T, typename Mutex = std::mutex, template< typename > class Atom = std::atomic, typename Req = bool>
size_t folly::FlatCombining< T, Mutex, Atom, Req >::Rec::index_
private
template<typename T, typename Mutex = std::mutex, template< typename > class Atom = std::atomic, typename Req = bool>
uint64_t folly::FlatCombining< T, Mutex, Atom, Req >::Rec::last_
private
template<typename T, typename Mutex = std::mutex, template< typename > class Atom = std::atomic, typename Req = bool>
size_t folly::FlatCombining< T, Mutex, Atom, Req >::Rec::next_
private
template<typename T, typename Mutex = std::mutex, template< typename > class Atom = std::atomic, typename Req = bool>
Req folly::FlatCombining< T, Mutex, Atom, Req >::Rec::req_
private
template<typename T, typename Mutex = std::mutex, template< typename > class Atom = std::atomic, typename Req = bool>
folly::SaturatingSemaphore<false, Atom> folly::FlatCombining< T, Mutex, Atom, Req >::Rec::valid_
private

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