pmirror/ocelot — pull request #7 by film42 (2014-08-25 03:35:52+00:00)
Title: Router and Controllers

[WIP]

Now that we have a great Request object, we can break each *route* into a controller. From there, it will be easier to refactor each component.

Current Controller example (It will be easier to change once they're in a common state):

```c++

class SomeController {
public:
SomeController( const Request & request ) : m_request(request) {}

static std::string on_request( const Request & request ) {
return ScrapeController( request ).get_response();
}

std::string get_response() { return ""; }

private:
Request m_request;
};

// USAGE
...
case SOME_THING:
return SomeController::on_request( request );
...
```