Webserv
Loading...
Searching...
No Matches
network::IEventHandler Class Referenceabstract

Abstract base class defining the interface for event-driven service handlers. More...

#include <IEventHandler.hpp>

Inheritance diagram for network::IEventHandler:
network::Acceptor network::CGIHandler network::ClientHandler

Public Member Functions

virtual ~IEventHandler ()
virtual void handleEvent (uint32_t events)=0
virtual int getFd () const =0

Protected Member Functions

 IEventHandler ()

Private Member Functions

 IEventHandler (const IEventHandler &)
IEventHandleroperator= (const IEventHandler &)

Private Attributes

uint32_t registeredEvents_
 Shadow State. Stores the events currently registered in epoll. Prevents redundant syscalls.

Friends

class EventDispatcher

Detailed Description

Abstract base class defining the interface for event-driven service handlers.

Provides the hook method interface that concrete handlers (Acceptor, ClientHandler) must implement to process specific types of events. Event handlers register with the InitiationDispatcher and receive callbacks when events occur, detected by the epoll() mechanism, on their associated file descriptors (listeningFd, clientFd). This forms the core abstraction in the ClientHandler pattern for service-specific processing.

virtual void handleEvent(uint32_t events) = 0; // Pure virtual - must implement virtual int getFd() const = 0; // Returns file

Constructor & Destructor Documentation

◆ ~IEventHandler()

network::IEventHandler::~IEventHandler ( )
virtual

◆ IEventHandler() [1/2]

network::IEventHandler::IEventHandler ( )
protected

◆ IEventHandler() [2/2]

network::IEventHandler::IEventHandler ( const IEventHandler & )
private

Member Function Documentation

◆ getFd()

virtual int network::IEventHandler::getFd ( ) const
pure virtual

◆ handleEvent()

virtual void network::IEventHandler::handleEvent ( uint32_t events)
pure virtual

◆ operator=()

IEventHandler & network::IEventHandler::operator= ( const IEventHandler & )
private

◆ EventDispatcher

friend class EventDispatcher
friend

Member Data Documentation

◆ registeredEvents_

uint32_t network::IEventHandler::registeredEvents_
private

Shadow State. Stores the events currently registered in epoll. Prevents redundant syscalls.


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