# pion::net::WebService Class Reference

`#include <WebService.hpp>`

Inherited by pion::plugins::AllowNothingService, pion::plugins::CookieService, pion::plugins::EchoService, pion::plugins::FileService, pion::plugins::HelloService, and pion::plugins::LogService.

List of all members.

## Detailed Description

WebService: interface class for web services

Definition at line 28 of file WebService.hpp.

## Public Member Functions

| WebService (void)
| default constructor
virtual | ~WebService ()
| virtual destructor
virtual void | operator() (HTTPRequestPtr &request, TCPConnectionPtr &tcp_conn)=0
virtual void | setOption (const std::string &name, const std::string &value)
virtual void | start (void)
| called when the web service's server is starting
virtual void | stop (void)
| called when the web service's server is stopping
void | setResource (const std::string &str)
| sets the URI stem or resource that is bound to the web service
const std::string & | getResource (void) const
| returns the URI stem or resource that is bound to the web service
std::string | getRelativeResource (const std::string &resource_requested) const
| returns the path to the resource requested, relative to the web service's location

## Classes

class | UnknownOptionException
| exception thrown if the service does not recognize a configuration option More...

## Member Function Documentation

virtual void pion::net::WebService::operator() | ( | HTTPRequestPtr & | request,
|  | TCPConnectionPtr & | tcp_conn |
| ) |  |  | `[pure virtual]`

attempts to handle a new HTTP request

Parameters:

  | request | the new HTTP request to handle
  | tcp_conn | the TCP connection that has the new request

Implemented in pion::plugins::AllowNothingService, pion::plugins::CookieService, pion::plugins::EchoService, pion::plugins::FileService, pion::plugins::HelloService, and pion::plugins::LogService.

virtual void pion::net::WebService::setOption | ( | const std::string & | name,
|  | const std::string & | value |
| ) |  |  | `[inline, virtual]`

sets a configuration option

Parameters:

  | name | the name of the option to change
  | value | the value of the option

Reimplemented in pion::plugins::FileService.

Definition at line 60 of file WebService.hpp.

Referenced by pion::net::WebServer::setServiceOption().

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

- net/include/pion/net/WebService.hpp