Webserv
Loading...
Searching...
No Matches
network::InitiationDispatcher Class Reference

Centralised event demultiplexer and dispatcher for managing I/O events. More...

#include <InitiationDispatcher.hpp>

Public Member Functions

void registerHandler (AEventHandler *handler)
void removeHandler (int fd)
void handleEvents ()
void requestShutdown ()
EpollManagergetEpollManager ()

Static Public Member Functions

static InitiationDispatchergetInstance ()

Private Member Functions

 InitiationDispatcher ()
 ~InitiationDispatcher ()
 InitiationDispatcher (const InitiationDispatcher &)
InitiationDispatcheroperator= (const InitiationDispatcher &)

Private Attributes

EpollManager epollManager_
std::map< int, AEventHandler * > handlers_

Detailed Description

Centralised event demultiplexer and dispatcher for managing I/O events.

InitiationDispatcher coordinates between the event detection mechanism (epoll) and register event handlers. It maintains a registry of handlers, waits for events to occur on monitored file descriptors, and dispatches events to appropriate handlers. This implements the core of the Reactor pattern for non-blocking, event-driven I/O.

Constructor & Destructor Documentation

◆ InitiationDispatcher() [1/2]

network::InitiationDispatcher::InitiationDispatcher ( )
private

◆ ~InitiationDispatcher()

network::InitiationDispatcher::~InitiationDispatcher ( )
private

◆ InitiationDispatcher() [2/2]

network::InitiationDispatcher::InitiationDispatcher ( const InitiationDispatcher & )
private

Member Function Documentation

◆ getEpollManager()

EpollManager & network::InitiationDispatcher::getEpollManager ( )

◆ getInstance()

InitiationDispatcher & network::InitiationDispatcher::getInstance ( )
static

◆ handleEvents()

void network::InitiationDispatcher::handleEvents ( )

◆ operator=()

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

◆ registerHandler()

void network::InitiationDispatcher::registerHandler ( AEventHandler * handler)

◆ removeHandler()

void network::InitiationDispatcher::removeHandler ( int fd)

◆ requestShutdown()

void network::InitiationDispatcher::requestShutdown ( )

Member Data Documentation

◆ epollManager_

EpollManager network::InitiationDispatcher::epollManager_
private

◆ handlers_

std::map<int, AEventHandler *> network::InitiationDispatcher::handlers_
private

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