proxygen
PartialWriteHandler Class Reference
Inheritance diagram for PartialWriteHandler:
TestHandler folly::EventHandler

Public Member Functions

 PartialWriteHandler (EventBase *eventBase, int fd, size_t writeLength)
 
void handlerReady (uint16_t events) noexceptoverride
 
- Public Member Functions inherited from TestHandler
 TestHandler (EventBase *eventBase, int fd)
 
- 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

int fd_
 
size_t writeLength_
 

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
}
 
- Public Attributes inherited from TestHandler
deque< EventRecordlog
 

Detailed Description

Definition at line 712 of file EventBaseTest.cpp.

Constructor & Destructor Documentation

PartialWriteHandler::PartialWriteHandler ( EventBase eventBase,
int  fd,
size_t  writeLength 
)
inline

Definition at line 714 of file EventBaseTest.cpp.

715  : TestHandler(eventBase, fd), fd_(fd), writeLength_(writeLength) {}
TestHandler(EventBase *eventBase, int fd)

Member Function Documentation

void PartialWriteHandler::handlerReady ( uint16_t  events)
inlineoverridevirtualnoexcept

handlerReady() is invoked when the handler is ready.

Parameters
eventsA bitset indicating the events that are ready.

Reimplemented from TestHandler.

Definition at line 717 of file EventBaseTest.cpp.

References writeToFD().

717  {
718  assert(events == EventHandler::WRITE);
719  ssize_t bytesWritten = writeToFD(fd_, writeLength_);
720  log.emplace_back(events, 0, bytesWritten);
721  }
ssize_t writeToFD(int fd, size_t length)
deque< EventRecord > log

Member Data Documentation

int PartialWriteHandler::fd_
private

Definition at line 724 of file EventBaseTest.cpp.

size_t PartialWriteHandler::writeLength_
private

Definition at line 725 of file EventBaseTest.cpp.


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