proxygen
folly::EventBaseThread Class Reference

#include <EventBaseThread.h>

Public Member Functions

 EventBaseThread ()
 
 EventBaseThread (bool autostart, EventBaseManager *ebm=nullptr, folly::StringPiece threadName=folly::StringPiece())
 
 EventBaseThread (EventBaseManager *ebm)
 
 ~EventBaseThread ()
 
 EventBaseThread (EventBaseThread &&) noexcept
 
EventBaseThreadoperator= (EventBaseThread &&) noexcept
 
EventBasegetEventBase () const
 
bool running () const
 
void start (folly::StringPiece threadName=folly::StringPiece())
 
void stop ()
 

Private Member Functions

 EventBaseThread (EventBaseThread const &)=default
 
EventBaseThreadoperator= (EventBaseThread const &)=default
 

Private Attributes

EventBaseManagerebm_
 
std::unique_ptr< ScopedEventBaseThreadth_
 

Detailed Description

Definition at line 28 of file EventBaseThread.h.

Constructor & Destructor Documentation

folly::EventBaseThread::EventBaseThread ( )

Definition at line 24 of file EventBaseThread.cpp.

Referenced by EventBaseThread().

folly::EventBaseThread::EventBaseThread ( bool  autostart,
EventBaseManager ebm = nullptr,
folly::StringPiece  threadName = folly::StringPiece() 
)
explicit

Definition at line 26 of file EventBaseThread.cpp.

References start().

30  : ebm_(ebm) {
31  if (autostart) {
32  start(threadName);
33  }
34 }
EventBaseManager * ebm_
void start(folly::StringPiece threadName=folly::StringPiece())
folly::EventBaseThread::EventBaseThread ( EventBaseManager ebm)
explicit
folly::EventBaseThread::~EventBaseThread ( )
default

Referenced by EventBaseThread().

folly::EventBaseThread::EventBaseThread ( EventBaseThread &&  )
defaultnoexcept
folly::EventBaseThread::EventBaseThread ( EventBaseThread const &  )
privatedefault

Member Function Documentation

EventBase * folly::EventBaseThread::getEventBase ( ) const

Definition at line 45 of file EventBaseThread.cpp.

References th_.

Referenced by TEST_F().

45  {
46  return th_ ? th_->getEventBase() : nullptr;
47 }
std::unique_ptr< ScopedEventBaseThread > th_
EventBaseThread & folly::EventBaseThread::operator= ( EventBaseThread &&  )
defaultnoexcept

Referenced by EventBaseThread().

EventBaseThread& folly::EventBaseThread::operator= ( EventBaseThread const &  )
privatedefault
bool folly::EventBaseThread::running ( ) const

Definition at line 49 of file EventBaseThread.cpp.

References th_.

49  {
50  return !!th_;
51 }
std::unique_ptr< ScopedEventBaseThread > th_
void folly::EventBaseThread::start ( folly::StringPiece  threadName = folly::StringPiece())

Definition at line 53 of file EventBaseThread.cpp.

References ebm_, and th_.

Referenced by EventBaseThread(), and TEST_F().

53  {
54  if (th_) {
55  return;
56  }
57  th_ = std::make_unique<ScopedEventBaseThread>(ebm_, threadName);
58 }
EventBaseManager * ebm_
std::unique_ptr< ScopedEventBaseThread > th_
void folly::EventBaseThread::stop ( )

Definition at line 60 of file EventBaseThread.cpp.

References th_.

Referenced by TEST_F().

60  {
61  th_ = nullptr;
62 }
std::unique_ptr< ScopedEventBaseThread > th_

Member Data Documentation

EventBaseManager* folly::EventBaseThread::ebm_
private

Definition at line 51 of file EventBaseThread.h.

Referenced by start().

std::unique_ptr<ScopedEventBaseThread> folly::EventBaseThread::th_
private

Definition at line 52 of file EventBaseThread.h.

Referenced by getEventBase(), running(), start(), and stop().


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