proxygen
TerminateTestCallback Class Reference
Inheritance diagram for TerminateTestCallback:
folly::EventBase::LoopCallback folly::EventHandler

Public Member Functions

 TerminateTestCallback (EventBase *eventBase, int fd)
 
void reset (uint32_t maxLoopInvocations, uint32_t maxEventInvocations)
 
void handlerReady (uint16_t) noexceptoverride
 
void runLoopCallback () noexceptoverride
 
uint32_t getLoopInvocations () const
 
uint32_t getEventInvocations () const
 
- Public Member Functions inherited from folly::EventBase::LoopCallback
virtual ~LoopCallback ()=default
 
void cancelLoopCallback ()
 
bool isLoopCallbackScheduled () const
 
- Public Member Functions inherited from folly::EventHandler
 EventHandler (EventBase *eventBase, int fd)
 
 EventHandler (EventBase *eventBase=nullptr, NetworkSocket fd=NetworkSocket())
 
virtual ~EventHandler ()
 
bool registerHandler (uint16_t events)
 
void unregisterHandler ()
 
bool isHandlerRegistered () const
 
void attachEventBase (EventBase *eventBase)
 
void detachEventBase ()
 
void changeHandlerFD (int fd)
 
void changeHandlerFD (NetworkSocket fd)
 
void initHandler (EventBase *eventBase, int fd)
 
void initHandler (EventBase *eventBase, NetworkSocket fd)
 
uint16_t getRegisteredEvents () const
 
bool registerInternalHandler (uint16_t events)
 
bool isPending () const
 

Private Attributes

EventBaseeventBase_
 
uint32_t loopInvocations_
 
uint32_t maxLoopInvocations_
 
uint32_t eventInvocations_
 
uint32_t maxEventInvocations_
 

Additional Inherited Members

- Public Types inherited from folly::EventHandler
enum  EventFlags {
  NONE = 0, READ = EV_READ, WRITE = EV_WRITE, READ_WRITE = (READ | WRITE),
  PERSIST = EV_PERSIST
}
 

Detailed Description

Definition at line 1468 of file EventBaseTest.cpp.

Constructor & Destructor Documentation

TerminateTestCallback::TerminateTestCallback ( EventBase eventBase,
int  fd 
)
inline

Definition at line 1471 of file EventBaseTest.cpp.

1472  : EventHandler(eventBase, fd),
1473  eventBase_(eventBase),
1474  loopInvocations_(0),
1476  eventInvocations_(0),
1477  maxEventInvocations_(0) {}
EventHandler(EventBase *eventBase, int fd)
Definition: EventHandler.h:65

Member Function Documentation

uint32_t TerminateTestCallback::getEventInvocations ( ) const
inline

Definition at line 1513 of file EventBaseTest.cpp.

Referenced by TEST().

1513  {
1514  return eventInvocations_;
1515  }
uint32_t TerminateTestCallback::getLoopInvocations ( ) const
inline

Definition at line 1510 of file EventBaseTest.cpp.

Referenced by TEST().

1510  {
1511  return loopInvocations_;
1512  }
void TerminateTestCallback::handlerReady ( uint16_t  events)
inlineoverridevirtualnoexcept

handlerReady() is invoked when the handler is ready.

Parameters
eventsA bitset indicating the events that are ready.

Implements folly::EventHandler.

Definition at line 1489 of file EventBaseTest.cpp.

References ASSERT_FALSE.

1489  {
1490  // We didn't register with PERSIST, so we will have been automatically
1491  // unregistered already.
1493 
1496  return;
1497  }
1498 
1499  eventBase_->runInLoop(this);
1500  }
void runInLoop(LoopCallback *callback, bool thisIteration=false)
Definition: EventBase.cpp:520
#define ASSERT_FALSE(condition)
Definition: gtest.h:1868
bool isHandlerRegistered() const
Definition: EventHandler.h:112
void TerminateTestCallback::reset ( uint32_t  maxLoopInvocations,
uint32_t  maxEventInvocations 
)
inline

Definition at line 1479 of file EventBaseTest.cpp.

Referenced by TEST().

1479  {
1480  loopInvocations_ = 0;
1481  maxLoopInvocations_ = maxLoopInvocations;
1482  eventInvocations_ = 0;
1483  maxEventInvocations_ = maxEventInvocations;
1484 
1487  }
void TerminateTestCallback::runLoopCallback ( )
inlineoverridevirtualnoexcept

Implements folly::EventBase::LoopCallback.

Definition at line 1501 of file EventBaseTest.cpp.

1501  {
1502  ++loopInvocations_;
1504  return;
1505  }
1506 
1508  }
bool registerHandler(uint16_t events)
Definition: EventHandler.h:100

Member Data Documentation

EventBase* TerminateTestCallback::eventBase_
private

Definition at line 1518 of file EventBaseTest.cpp.

uint32_t TerminateTestCallback::eventInvocations_
private

Definition at line 1521 of file EventBaseTest.cpp.

uint32_t TerminateTestCallback::loopInvocations_
private

Definition at line 1519 of file EventBaseTest.cpp.

uint32_t TerminateTestCallback::maxEventInvocations_
private

Definition at line 1522 of file EventBaseTest.cpp.

uint32_t TerminateTestCallback::maxLoopInvocations_
private

Definition at line 1520 of file EventBaseTest.cpp.


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