RTBKit  0.9
Open-source framework to create real-time ad bidding systems.
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator
Public Member Functions
Datacratic::HttpMonitorHandler< Handler, Arg > Struct Template Reference

#include <http_monitor.h>

Inheritance diagram for Datacratic::HttpMonitorHandler< Handler, Arg >:
Datacratic::HttpConnectionHandler Datacratic::PassiveConnectionHandler Datacratic::ConnectionHandler

List of all members.

Public Member Functions

 HttpMonitorHandler (const std::string &name, Arg arg)
virtual void handleHttpPayload (const HttpHeader &header, const std::string &payload)
virtual void doGet (const std::string &resource)
virtual void doPost (const std::string &resource, const std::string &payload)
virtual void doDelete (const std::string &resource, const std::string &payload)
void sendResponse (const Json::Value &response)
void sendErrorResponse (int code, const std::string &error)
void sendErrorResponse (int code, const Json::Value &error)
Arg getArg ()
const std::string & name () const

Detailed Description

template<typename Handler, typename Arg = void*>
struct Datacratic::HttpMonitorHandler< Handler, Arg >

Connection handler for an HttpMonitor.

Subclass and overwrite either the doGet() and doPost() function or only the handleHttpPayload() if you want access to the header.

This template uses the curiosly recurring templat pattern so Handler should be the subclass.

Definition at line 79 of file http_monitor.h.


Member Function Documentation

template<typename Handler, typename Arg = void*>
virtual void Datacratic::HttpMonitorHandler< Handler, Arg >::doDelete ( const std::string &  resource,
const std::string &  payload 
) [inline, virtual]

Handle a DELETE message on the given resource and payload.

Should call either sendResponse() or sendErrorResponse().

Definition at line 107 of file http_monitor.h.

template<typename Handler, typename Arg = void*>
virtual void Datacratic::HttpMonitorHandler< Handler, Arg >::doGet ( const std::string &  resource) [inline, virtual]

Handle a GET message on the given resource.

Should call either sendResponse() or sendErrorResponse().

Reimplemented in RTBKIT::RouterRestApiConnection.

Definition at line 93 of file http_monitor.h.

template<typename Handler, typename Arg = void*>
virtual void Datacratic::HttpMonitorHandler< Handler, Arg >::doPost ( const std::string &  resource,
const std::string &  payload 
) [inline, virtual]

Handle a POST message on the given resource and payload.

Should call either sendResponse() or sendErrorResponse().

Reimplemented in RTBKIT::RouterRestApiConnection.

Definition at line 100 of file http_monitor.h.

template<typename Handler , typename arg >
void Datacratic::HttpMonitorHandler< Handler, arg >::handleHttpPayload ( const HttpHeader header,
const std::string &  payload 
) [virtual]

Override to access the full header.

Reimplemented from Datacratic::HttpConnectionHandler.

Definition at line 139 of file http_monitor.h.


The documentation for this struct was generated from the following file:
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator