ReCodEx - Task Broker
ReCodEx is complex programmer testing solution, primary targeted to technical universities. It's highly customizable and based on modern technologies.
handler_wrapper Class Reference

#include <reactor.h>

+ Inheritance diagram for handler_wrapper:

Public Member Functions

 handler_wrapper (reactor &reactor_ref, std::shared_ptr< handler_interface > handler)
 
virtual ~handler_wrapper ()
 
virtual void operator() (const message_container &message)
 

Protected Attributes

std::shared_ptr< handler_interfacehandler_
 
reactorreactor_
 

Detailed Description

A basic wrapper for reactor event handlers, which just calls the handler callback directly This class is meant to be extended to provide more complicated calling strategies (e.g. async callbacks).

Definition at line 20 of file reactor.h.

Constructor & Destructor Documentation

§ handler_wrapper()

handler_wrapper::handler_wrapper ( reactor reactor_ref,
std::shared_ptr< handler_interface handler 
)
Parameters
reactor_refreactor object which owns the handler
handlerthe handler object

Definition at line 137 of file reactor.cpp.

§ ~handler_wrapper()

handler_wrapper::~handler_wrapper ( )
virtual

A virtual destructor

Definition at line 142 of file reactor.cpp.

Member Function Documentation

§ operator()()

void handler_wrapper::operator() ( const message_container message)
virtual

Pass a message to the handler by calling it directly

Parameters
messageThe message to be passed

Reimplemented in asynchronous_handler_wrapper.

Definition at line 146 of file reactor.cpp.

Member Data Documentation

§ handler_

std::shared_ptr<handler_interface> handler_wrapper::handler_
protected

The wrapped handler

Definition at line 42 of file reactor.h.

§ reactor_

reactor& handler_wrapper::reactor_
protected

The reactor that owns the wrapper

Definition at line 45 of file reactor.h.


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