chain_of_responsibility_pattern::AbstractHandler

class AbstractHandler : public chain_of_responsibility_pattern::Handler

Abstract base class that implements the chaining mechanism.

Subclassed by chain_of_responsibility_pattern::ConcreteHandlerA, chain_of_responsibility_pattern::ConcreteHandlerB

Public Functions

inline virtual Handler *setNext(std::shared_ptr<Handler> next) override

Sets the next handler in the chain.

Parameters:

next – The next handler.

Returns:

A reference to the current handler for chaining.

inline virtual void handleRequest(const std::string &request) const override

Forwards the request to the next handler if available.

Parameters:

request – The request to handle.