OdbDesign
OdbDesign ODB++ Parser - C++ library, gRPC/REST server, CLI, tests
 
Loading...
Searching...
No Matches
Odb::Lib::App::RouteController Class Referenceabstract

#include <RouteController.h>

Inheritance diagram for Odb::Lib::App::RouteController:
[legend]
Collaboration diagram for Odb::Lib::App::RouteController:
[legend]

Public Types

typedef std::vector< std::shared_ptr< RouteController > > Vector
 

Public Member Functions

virtual ~RouteController ()=default
 
virtual void register_routes ()=0
 

Protected Types

typedef std::function< crow::response(const crow::request &req)> TRouteHandlerFunction
 

Protected Member Functions

 RouteController (IOdbServerApp &serverApp)
 
void register_route_handler (std::string route, TRouteHandlerFunction handler)
 
crow::response makeLoadedFileModelsResponse (bool) const
 
std::optional< crow::response > checkConditionalGet (const crow::request &req, const std::string &designName, const std::string &endpointPath, std::string &etag) const
 
crow::response withCacheHeaders (crow::response response, const std::string &etag) const
 

Protected Attributes

IOdbServerApp & m_serverApp
 

Static Protected Attributes

static constexpr const char * CACHE_CONTROL_DATA_VALUE = "private, max-age=3600"
 

Detailed Description

Definition at line 13 of file RouteController.h.

Member Typedef Documentation

◆ TRouteHandlerFunction

typedef std::function<crow::response(const crow::request& req)> Odb::Lib::App::RouteController::TRouteHandlerFunction
protected

Definition at line 27 of file RouteController.h.

◆ Vector

typedef std::vector<std::shared_ptr<RouteController> > Odb::Lib::App::RouteController::Vector

Definition at line 20 of file RouteController.h.

Constructor & Destructor Documentation

◆ ~RouteController()

virtual Odb::Lib::App::RouteController::~RouteController ( )
virtualdefault

◆ RouteController()

Odb::Lib::App::RouteController::RouteController ( IOdbServerApp &  serverApp)
protected

Definition at line 7 of file RouteController.cpp.

Member Function Documentation

◆ checkConditionalGet()

std::optional< crow::response > Odb::Lib::App::RouteController::checkConditionalGet ( const crow::request &  req,
const std::string &  designName,
const std::string &  endpointPath,
std::string &  etag 
) const
protected

Definition at line 92 of file RouteController.cpp.

Here is the call graph for this function:

◆ makeLoadedFileModelsResponse()

crow::response Odb::Lib::App::RouteController::makeLoadedFileModelsResponse ( bool  created) const
protected

Definition at line 44 of file RouteController.cpp.

Here is the caller graph for this function:

◆ register_route_handler()

void Odb::Lib::App::RouteController::register_route_handler ( std::string  route,
TRouteHandlerFunction  handler 
)
protected

Definition at line 12 of file RouteController.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ register_routes()

◆ withCacheHeaders()

crow::response Odb::Lib::App::RouteController::withCacheHeaders ( crow::response  response,
const std::string &  etag 
) const
protected

Definition at line 129 of file RouteController.cpp.

Member Data Documentation

◆ CACHE_CONTROL_DATA_VALUE

constexpr const char* Odb::Lib::App::RouteController::CACHE_CONTROL_DATA_VALUE = "private, max-age=3600"
inlinestaticconstexprprotected

Definition at line 52 of file RouteController.h.

◆ m_serverApp

IOdbServerApp& Odb::Lib::App::RouteController::m_serverApp
protected

Definition at line 23 of file RouteController.h.


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