Firmware  0.0.0
Loading...
Searching...
No Matches
http::Endpoints Class Reference

#include <endpoints.hpp>

Inheritance diagram for http::Endpoints:
Collaboration diagram for http::Endpoints:

Classes

struct  key_compare
 

Public Member Functions

template<typename T , typename F >
void subscribe (key_type const &key, std::shared_ptr< T > t, F &&f)
 

Protected Member Functions

Response syncResponse (httpd_req_t *req)
 
esp_err_t asyncResponse (httpd_req_t *req)
 

Private Types

using key_type = httpd_uri_t
 
using sync_mapped_type = std::vector<std::function<Response(Request const&)>>
 Mapped type for HTTP requests.
 
using async_mapped_type = std::vector<std::function<esp_err_t(Message&)>>
 Mapped type for WebSockets.
 

Private Member Functions

httpd_uri_t req2key (httpd_req_t *req) const
 

Private Attributes

std::map< key_type, sync_mapped_type, key_compare_sync_map
 
std::map< key_type, async_mapped_type, key_compare_async_map
 

Member Typedef Documentation

◆ async_mapped_type

using http::Endpoints::async_mapped_type = std::vector<std::function<esp_err_t(Message&)>>
private

◆ key_type

using http::Endpoints::key_type = httpd_uri_t
private

◆ sync_mapped_type

using http::Endpoints::sync_mapped_type = std::vector<std::function<Response(Request const&)>>
private

Member Function Documentation

◆ asyncResponse()

esp_err_t http::Endpoints::asyncResponse ( httpd_req_t * req)
inlineprotected
Todo
document

◆ req2key()

httpd_uri_t http::Endpoints::req2key ( httpd_req_t * req) const
inlineprivate
Todo
document

◆ subscribe()

template<typename T , typename F >
void http::Endpoints::subscribe ( key_type const & key,
std::shared_ptr< T > t,
F && f )
inline
Todo
document

◆ syncResponse()

Response http::Endpoints::syncResponse ( httpd_req_t * req)
inlineprotected
Todo
document
Todo
properly iterating over vector...

Member Data Documentation

◆ _async_map

std::map<key_type, async_mapped_type, key_compare> http::Endpoints::_async_map
private

◆ _sync_map

std::map<key_type, sync_mapped_type, key_compare> http::Endpoints::_sync_map
private

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