Welcome to udho’s documentation!¶
Udho API¶
Class Hierarchy¶
-
- Namespace udho
- Namespace udho::activities
- Namespace udho::activities::detail
- Template Struct after
- Template Struct after< subtask< ActivityT, DependenciesT... > >
- Template Struct after< udho::start_< ContextT, T... > >
- Template Struct apply_helper_
- Template Struct apply_helper_< false, FunctorT, TargetsT... >
- Template Struct final_intermediate
- Template Struct accessor
- Template Struct after
- Template Struct after< HeadT >
- Struct after_none
- Template Struct apply_helper
- Template Struct collector
- Template Struct collector< ContextT, dataset< T... > >
- Template Struct combinator
- Template Struct combinator< NextT, start< ContextT, T... > >
- Template Struct dataset
- Template Struct fixed_key_accessor
- Template Struct joined
- Template Struct joined< CallbackT, activities::collector< ContextT, dataset< T... > > >
- Template Struct junction
- Template Struct perform
- Template Struct perform::require
- Template Struct require
- Template Struct result
- Template Struct result_data
- Template Struct start
- Template Struct subtask
- Template Struct subtask< ActivityT >
- Template Class analyzer
- Enum state
- Template Struct activity
- Template Struct subtask< start< ContextT, T... > >
- Namespace udho::activities::detail
- Namespace udho::cache
- Namespace udho::cache::storage
- Template Struct abstract_engine
- Template Struct content
- Template Struct content< void >
- Template Struct driver
- Template Struct engine
- Template Struct flake
- Template Struct generator
- Template Struct generator< boost::uuids::uuid >
- Template Struct master
- Template Struct registry
- Template Struct shadow
- Template Struct store
- Namespace udho::compositors
- Template Struct deferred
- Template Struct mimed
- Template Struct transparent
- Namespace udho::configs
- Template Struct form_
- Template Struct logger_
- Template Struct router_
- Template Struct server_
- Struct server_::document_root_t
- Struct server_::mime_default_t
- Struct server_::mimes_t
- Struct server_::template_root_t
- Template Struct session_
- Struct session_::extension_t
- Struct session_::id_t
- Struct session_::path_t
- Struct session_::serialization_t
- Namespace udho::detail
- Template Struct association
- Template Struct association_group
- Template Struct association_group< U, void >
- Template Struct association_group_visitor
- Template Struct association_group_visitor< association_group< U, V >, false >
- Template Struct association_group_visitor< association_group< U, V >, true >
- Template Struct association_group_visitor< association_group< U, void >, false >
- Struct association_leaf
- Template Struct association_lexical_extractor
- Template Struct association_value_extractor
- Template Struct async_result
- Template Struct client_connection_wrapper
- Template Struct context_common
- Template Struct context_impl
- Template Struct http_client_connection
- Template Struct https_client_connection
- Struct interaction_
- Template Struct is_prepared
- Template Struct responder
- Template Struct responder< F, std::map< U, V > >
- Template Struct responder< F, std::vector< V > >
- Struct route
- Template Struct url_data_
- Struct url_data_::host_t
- Struct url_data_::path_t
- Struct url_data_::port_t
- Struct url_data_::protocol_t
- Struct url_data_::query_t
- Struct url_data_::target_t
- Template Class is_streamable
- Namespace udho::exceptions
- Struct http_error
- Struct reroute
- Namespace udho::form
- Namespace udho::form::validators
- Struct all_digit
- Struct date_time
- Struct exact_length
- Struct max_length
- Struct min_length
- Struct no_space
- Template Struct validated
- Template Struct validated< void >
- Namespace udho::form::validators
- Namespace udho::forms
- Namespace udho::forms::constraints
- Struct all_digits
- Template Struct basic_constrain
- Template Struct eq
- Template Struct gt
- Template Struct gt< std::string >
- Template Struct gte
- Template Struct gte< std::string >
- Template Struct in
- Struct length_eq
- Template Struct lt
- Template Struct lt< std::string >
- Template Struct lte
- Template Struct lte< std::string >
- Template Struct neq
- Struct no_space
- Namespace udho::forms::detail
- Template Struct basic_field
- Template Struct constrained_field
- Template Struct constrained_field< ValidatorT, constrained_field< T... > >
- Template Struct constraint_visitor_
- Template Struct constraint_visitor_< ConstrainedFieldT, 0 >
- Struct field_common
- Template Struct field_data
- Namespace udho::forms::drivers
- Namespace udho::forms::drivers::detail
- Template Struct extract_multipart_boundary
- Template Struct combo
- Template Struct multipart
- Template Struct multipart_
- Struct multipart_::form_part
- Template Struct urlencoded
- Template Struct urlencoded_
- Namespace udho::forms::drivers::detail
- Struct accumulated
- Template Struct deserializer
- Template Struct deserializer< std::chrono::time_point< std::chrono::system_clock, DurationT >, std::string >
- Template Struct deserializer< std::string, std::chrono::time_point< std::chrono::system_clock, DurationT > >
- Template Struct deserializer< std::string, std::string >
- Template Struct deserializer< std::string, U >
- Template Struct deserializer< U, U >
- Template Struct deserializer< V, std::string >
- Template Struct field
- Template Struct field< std::chrono::time_point< std::chrono::system_clock, DurationT >, false >
- Template Struct field< std::chrono::time_point< std::chrono::system_clock, DurationT >, true >
- Template Struct field< T, false >
- Template Struct field< T, true >
- Template Struct form
- Template Struct parser
- Template Struct validated
- Template Struct validated< form< DriverT > >
- Namespace udho::forms::constraints
- Namespace udho::internal
- Template Struct actual_callback_type
- Template Struct arg_to_tuple
- Template Struct arg_to_tuple< TupleT, 0 >
- Template Struct bind_first
- Template Struct bind_first< boost::function< R(Args...)> >
- Template Struct callable1
- Template Struct callable1< A1, R(*)(A1 &, V...)>
- Template Struct cast_optionally
- Template Struct function_signature
- Template Struct function_signature< boost::function< R(Args...)> >
- Template Struct function_signature< R(*)(Args...)>
- Template Struct member_
- Template Struct member_< R C::* >
- Template Struct reduced_
- Template Struct reduced_< R(C::*)(Args...) const >
- Template Struct reduced_< R(C::*)(Args...)>
- Template Struct reducer
- Namespace udho::loggers
- Template Struct plain
- Namespace udho::logging
- Namespace udho::logging::features
- Struct colored
- Namespace udho::logging::messages
- Namespace udho::logging::messages::formatted
- Template Struct message
- Namespace udho::logging::messages::formatted
- Template Struct message
- Enum segment
- Enum status
- Namespace udho::logging::features
- Namespace udho::servers
- Namespace udho::servers::ostreamed
- Template Struct ostreamed_helper
- Template Struct logged
- Template Struct stateful
- Namespace udho::servers::ostreamed
- Namespace udho::util
- Template Struct is_invocable
- Namespace udho::view
- Namespace udho::view::parsing
- Namespace udho::view::parsing::attrs
- Namespace udho::view::parsing::tags
- Template Struct expression
- Struct token
- Template Struct xml
- Template Struct parser
- Namespace udho::view::parsing
- Namespace udho::visitors
- Template Struct printing_visitor
- Template Struct printing_visitor_html
- Template Struct target_application
- Template Struct target_application< F, Visitables, 0 >
- Template Struct target_module
- Template Struct target_module< F, Visitables, 0 >
- Template Struct targetted_visitor
- Struct visitable
- Template Struct app_
- Template Struct app_< AppT, true >
- Struct assoc
- Template Struct attachment
- Template Struct attachment< AuxT, LoggerT, void >
- Template Struct attachment< AuxT, void, CacheT >
- Template Struct attachment< AuxT, void, void >
- Template Struct basic_router
- Template Struct bounded_str
- Template Struct bridge
- Template Struct client_options_
- Template Struct config
- Template Struct config< configs::server_<> >
- Template Struct configuration
- Template Struct content_wrapper0
- Template Struct content_wrapper1
- Template Struct context
- Template Struct context< AuxT, RequestT, void >
- Template Struct cookie_
- Template Struct cookies_
- Template Struct data_helper
- Template Struct data_helper< H, T, false >
- Template Struct data_helper< H, T, true >
- Struct declaration
- Template Struct field
- Template Struct field< T, false >
- Template Struct field< T, true >
- Struct field_common
- Template Struct field_value_extractor
- Template Struct field_value_extractor< std::chrono::time_point< std::chrono::system_clock, std::chrono::microseconds > >
- Template Struct form_
- Template Struct is_application
- Template Struct lookup_table
- Template Struct lookup_table< udho::prepared< DataT > >
- Template Struct lookup_table< udho::prepared_group< U, V > >
- Template Struct module_evaluator
- Template Struct module_evaluator< VisitorT, ModuleT, false >
- Template Struct module_evaluator< VisitorT, ModuleT, true >
- Struct module_info
- Template Struct module_overload
- Template Struct module_overload< Function, compositors::deferred >
- Template Struct multipart_form
- Struct multipart_form::form_part
- Template Struct overload_group
- Template Struct overload_group< U, app_< V, Ref > >
- Template Struct overload_group< U, overload_terminal< V > >
- Template Struct overload_group< U, overload_terminal< void > >
- Template Struct overload_group_helper
- Template Struct overload_group_helper< OverloadT, void >
- Template Struct overload_terminal
- Template Struct overload_terminal< void >
- Template Struct prepare
- Template Struct prepared
- Template Struct prepared< T, true >
- Template Struct prepared_group
- Template Struct prepared_group< H, void >
- Template Struct proxy
- Template Struct proxy< configs::server_<>::mimes_t, config< configs::server_<> > >
- Struct reroute
- Template Struct server
- Template Struct server< AuxT, void, CacheT >
- Template Struct session_
- Template Struct session_< RequestT, void >
- Template Struct start
- Template Struct start_
- Struct url
- Class url::param
- Template Struct urlencoded_form
- Template Struct visitor
- Template Struct watch
- Template Struct watcher
- Template Class application
- Template Class connection
- Struct connection::send_lambda
- Template Class listener
- Enum form_type
- Namespace udho::activities
- Namespace udho
File Hierarchy¶
-
- Directory includes
- Directory udho
- File access.h
- File activities.h
- File application.h
- File attachment.h
- File bridge.h
- File cache.h
- File client.h
- File compositors.h
- File configuration.h
- File connection.h
- File context.h
- File contexts.h
- File cookie.h
- File defs.h
- File form.hxx
- File forms.h
- File listener.h
- File logging.h
- File page.h
- File parser.h
- File router.h
- File scope.h
- File server.h
- File session.h
- File termcolor.hpp
- File url.h
- File util.h
- File visitor.h
- File watcher.h
- Directory udho
- Directory includes
Full API¶
Namespaces¶
Namespace udho¶
Contents
Namespaces¶
Classes¶
Template Struct lookup_table< udho::prepared_group< U, V > >
Template Struct module_evaluator< VisitorT, ModuleT, false >
Template Struct module_overload< Function, compositors::deferred >
Template Struct overload_group< U, overload_terminal< void > >
Template Struct proxy< configs::server_<>::mimes_t, config< configs::server_<> > >
Enums¶
Functions¶
Template Function udho::data(const H&, const T&, const Rest&…)
Template Function udho::operator<<(const overload_group<U, V>&, const F&)
Template Function udho::operator<<(StreamT&, const overload_group<U, V>&)
Template Function udho::operator<<(session_<RequestT, ShadowT>&, const T&)
Template Function udho::operator<<(std::ostream&, const proxy<K, C>&)
Template Function udho::operator<<(cookies_<RequestT>&, const udho::cookie_<V>&)
Template Function udho::operator<<(module_overload<Function, CompositorT>, const char(&))
Template Function udho::operator>>(const session_<RequestT, ShadowT>&, T&)
Template Function udho::operator>>(const char(&), module_overload<Function, CompositorT>)
Template Function udho::operator|(const prepared_group<U, V>&, const udho::prepared<P>&)
Template Function udho::operator|(const udho::prepared<U>&, const udho::prepared<V>&)
Template Function udho::operator|(const overload_group<U, V>&, const F&)
Namespace udho::activities¶
Contents
Namespaces¶
Enums¶
Functions¶
Function udho::activities::operator<<(std::ostream&, const state&)
Template Function udho::activities::operator<<(collector<ContextT, dataset<T…>>&, const U&)
Template Function udho::activities::operator<<(accessor<T…>&, const U&)
Template Function udho::activities::operator>>(const collector<ContextT, dataset<T…>>&, U&)
Template Function udho::activities::operator>>(const accessor<T…>&, U&)
Namespace udho::cache::storage¶
Contents
Namespace udho::contexts¶
Contents
Namespace udho::defs¶
Contents
Namespace udho::form¶
Contents
Namespaces¶
Functions¶
Template Function udho::form::operator<<(validated<>&, field<T, Required>&)
Template Function udho::form::operator<<(validated<udho::form_<RequestT>>&, field<T, Required>&)
Template Function udho::form::validate(const udho::multipart_form<IteratorT>&)
Template Function udho::form::validate(udho::form_<RequestT>&)
Namespace udho::form::validators¶
Contents
Namespace udho::forms¶
Contents
Namespaces¶
Classes¶
Functions¶
Typedefs¶
Namespace udho::forms::drivers::detail¶
Contents
Namespace udho::internal¶
Namespace udho::logging::messages¶
Contents
Namespace udho::servers::ostreamed¶
Namespace udho::servers::quiet¶
Contents
Namespace udho::servers::stateless¶
Contents
Namespace udho::view::parsing¶
Contents
Namespace udho::view::parsing::attrs¶
Contents
Namespace udho::view::parsing::tags¶
Contents
Classes and Structs¶
Template Struct accessor¶
Defined in File activities.h
Inheritance Relationships¶
public udho::activities::fixed_key_accessor< udho::cache::shadow< std::string, T::result_type... > >
(Template Struct fixed_key_accessor)
Struct Documentation¶
-
template<typename ...
T
>
structudho::activities
::
accessor
: public udho::activities::fixed_key_accessor<udho::cache::shadow<std::string, T::result_type...>>¶ Access a subset of data from the collector
Public Types
-
typedef fixed_key_accessor<udho::cache::shadow<std::string, typename T::result_type...>>
base_type
¶
Public Functions
-
std::string
name
() const¶
-
shadow_type &
shadow
()¶
-
const shadow_type &
shadow
() const¶
-
template<typename
V
>
boolexists
() const¶ Whether there exists any data for activity V
- Template Parameters
V
: Activity Type
-
template<typename
V
>
const V::result_type &get
() const¶ get data associated with activity V
- Template Parameters
V
: activity type
-
template<typename
V
>
boolcompleted
() const¶ Check whether activity V has completed.
- Template Parameters
V
: activity type
-
template<typename
V
>
boolcanceled
() const¶ Check whether activity V has been canceled.
- Template Parameters
V
: activity type
-
template<typename
V
>
boolfailed
() const¶ Check whether activity V has failed (only the failure data of V is valid).
- Template Parameters
V
: activity type
-
template<typename
V
>
boolokay
() const¶ Check whether activity V is okay.
- Template Parameters
V
: activity type
-
template<typename
V
>
V::result_type::success_typesuccess
() const¶ get success data for activity V
- Template Parameters
V
: activity type
Public Members
-
shadow_type
_shadow
¶
-
typedef fixed_key_accessor<udho::cache::shadow<std::string, typename T::result_type...>>
Template Struct activity¶
Defined in File activities.h
Inheritance Relationships¶
public std::enable_shared_from_this< DerivedT >
public udho::activities::result< SuccessDataT, FailureDataT >
(Template Struct result)
Struct Documentation¶
-
template<typename
DerivedT
, typenameSuccessDataT
= void, typenameFailureDataT
= void>
structudho::activities
::
activity
: public std::enable_shared_from_this<DerivedT>, public udho::activities::result<SuccessDataT, FailureDataT>¶ An activity
A
must subclass fromactivity<A, SuccessA, FailureA>
assumingSuccessA
andFailureA
are the types that contains the relevant information regarding its success or failure. The activityA
must overload a no argumentoperator()()
which initiates the activity. After the activity is initiated eithersuccess()
orfailure()
methods must be called in order to signal its completion. The activityA
must take the collector as the first argument to its constructor, which is passed to the base classactivity<A, SuccessA, FailureA>
. Hence its prefered to take the first parameter to the constructor as template parameter.- Template Parameters
DerivedT
: Activity ClassSuccessDataT
: data associated to the activity if the activity succeedsFailureDataT
: data associated to the activity if the activity fails
Public Functions
-
derived_ptr_type
self
()¶ shared_ptr to this
Template Struct after¶
Defined in File activities.h
Inheritance Relationships¶
public udho::activities::detail::after< HeadT >
(Template Struct after)
Struct Documentation¶
Template Struct after< HeadT >¶
Defined in File activities.h
Inheritance Relationships¶
public udho::activities::detail::after< HeadT >
(Template Struct after)
Struct Documentation¶
Template Struct apply_helper¶
Defined in File activities.h
Inheritance Relationships¶
public udho::activities::detail::apply_helper_< FunctorT >
(Template Struct apply_helper_)public udho::activities::detail::apply_helper_< FunctorT, SuccessT >
(Template Struct apply_helper_)public udho::activities::detail::apply_helper_< FunctorT, FailureT >
(Template Struct apply_helper_)public udho::activities::detail::apply_helper_< FunctorT, SuccessT, FailureT >
(Template Struct apply_helper_)
Struct Documentation¶
-
template<typename
FunctorT
, typenameSuccessT
, typenameFailureT
>
structudho::activities
::
apply_helper
: public udho::activities::detail::apply_helper_<FunctorT>, public udho::activities::detail::apply_helper_<FunctorT, SuccessT>, public udho::activities::detail::apply_helper_<FunctorT, FailureT>, public udho::activities::detail::apply_helper_<FunctorT, SuccessT, FailureT>¶ Public Functions
-
void
operator()
()¶
-
void
Template Struct collector¶
Defined in File activities.h
Template Struct collector< ContextT, dataset< T… > >¶
Defined in File activities.h
Inheritance Relationships¶
public udho::activities::dataset< T... >
(Template Struct dataset)public std::enable_shared_from_this< collector< ContextT, dataset< T... > > >
Struct Documentation¶
-
template<typename
ContextT
, typename ...T
>
structudho::activities
::
collector
<ContextT, dataset<T...>> : public udho::activities::dataset<T...>, public std::enable_shared_from_this<collector<ContextT, dataset<T...>>>¶ Collects data associated with all activities involved in the subtask graph
Public Functions
-
collector
(context_type ctx, const std::string &name)¶
-
context_type &
context
()¶
-
const context_type &
context
() const¶
Public Members
-
context_type
_context
¶
-
Template Struct combinator¶
Defined in File activities.h
Inheritance Relationships¶
public udho::activities::junction< DependenciesT::result_type >
(Template Struct junction)
Struct Documentation¶
-
template<typename
NextT
, typename ...DependenciesT
>
structudho::activities
::
combinator
: public udho::activities::junction<DependenciesT::result_type>¶ A combinator combines multiple activities and proceeds towards the next activity
- Template Parameters
NextT
: next activityDependenciesT
: dependencies
Public Types
Public Functions
-
template<typename
U
>
voidoperator()
(const U &u)¶ whenever a subtask finishes the
operator()
of the combinator is called. which doesn’t start the next subtask untill all the dependencies have completed. Before starting the next activity the next activity is prepared if any preparator is passed through theprepare()
function
-
void
cancel
()¶
-
void
propagate
()¶
-
template<typename
PreparatorT
>
voidprepare
(PreparatorT prep)¶ set a preparator callback which will be called with a reference to teh next activity. The preparator callback is supposed to prepare the next activity by using the data callected till that time.
Template Struct combinator< NextT, start< ContextT, T… > >¶
Defined in File activities.h
Struct Documentation¶
Template Struct dataset¶
Defined in File activities.h
Inheritance Relationships¶
public udho::activities::fixed_key_accessor< udho::cache::shadow< std::string, T::result_type... > >
(Template Struct fixed_key_accessor)
Struct Documentation¶
-
template<typename ...
T
>
structudho::activities
::
dataset
: public udho::activities::fixed_key_accessor<udho::cache::shadow<std::string, T::result_type...>>¶ Public Types
-
typedef fixed_key_accessor<udho::cache::shadow<std::string, typename T::result_type...>>
base_type
¶
-
typedef udho::cache::store<udho::cache::storage::memory, std::string, typename T::result_type...>
store_type
¶
-
typedef store_type::shadow_type
shadow_type
¶
Public Functions
-
dataset
(const udho::configuration_type &config, const std::string &name)¶
-
std::string
name
() const¶
-
shadow_type &
shadow
()¶
-
const shadow_type &
shadow
() const¶
-
typedef fixed_key_accessor<udho::cache::shadow<std::string, typename T::result_type...>>
Template Struct after¶
Defined in File activities.h
Inheritance Relationships¶
public udho::activities::after< HeadT, TailT >
(Template Struct after)
Struct Documentation¶
-
template<typename
T
>
structafter
¶ Subclassed by udho::activities::after< HeadT, TailT >
Template Struct after< subtask< ActivityT, DependenciesT… > >¶
Defined in File activities.h
Struct Documentation¶
-
template<typename
ActivityT
, typename ...DependenciesT
>
structudho::activities::detail
::
after
<subtask<ActivityT, DependenciesT...>>¶ Public Functions
-
after
(subtask<ActivityT, DependenciesT...> &before)¶
-
template<typename
OtherActivityT
, typename ...OtherDependenciesT
>
voidattach
(subtask<OtherActivityT, OtherDependenciesT...> &sub)¶
Public Members
-
subtask<ActivityT, DependenciesT...> &
_before
¶
-
Template Struct after< udho::start_< ContextT, T… > >¶
Defined in File activities.h
Struct Documentation¶
-
template<typename
ContextT
, typename ...T
>
structudho::activities::detail
::
after
<udho::start_<ContextT, T...>>¶ Public Functions
-
template<typename
OtherActivityT
, typename ...OtherDependenciesT
>
voidattach
(subtask<OtherActivityT, OtherDependenciesT...> &sub)¶
-
template<typename
Template Struct apply_helper_¶
Defined in File activities.h
Inheritance Relationships¶
public udho::activities::apply_helper< FunctorT, SuccessT, FailureT >
(Template Struct apply_helper)public udho::activities::apply_helper< FunctorT, SuccessT, FailureT >
(Template Struct apply_helper)public udho::activities::apply_helper< FunctorT, SuccessT, FailureT >
(Template Struct apply_helper)public udho::activities::apply_helper< FunctorT, SuccessT, FailureT >
(Template Struct apply_helper)
Struct Documentation¶
-
template<bool
invocable
, typenameFunctorT
, typename ...TargetsT
>
structudho::activities::detail
::
apply_helper_
¶ Subclassed by udho::activities::apply_helper< FunctorT, SuccessT, FailureT >, udho::activities::apply_helper< FunctorT, SuccessT, FailureT >, udho::activities::apply_helper< FunctorT, SuccessT, FailureT >, udho::activities::apply_helper< FunctorT, SuccessT, FailureT >
Template Struct apply_helper_< false, FunctorT, TargetsT… >¶
Defined in File activities.h
Template Struct final_intermediate¶
Defined in File activities.h
Struct Documentation¶
-
template<typename
CollectorT
, typename ...DependenciesT
>
structudho::activities::detail
::
final_intermediate
¶ Public Functions
-
template<typename
CallbackT
>
subtask<joined<CallbackT, CollectorT>, DependenciesT...>exec
(CallbackT callback)¶
Public Members
-
std::shared_ptr<CollectorT>
_collector
¶
-
template<typename
Template Struct joined¶
Defined in File activities.h
Template Struct joined< CallbackT, activities::collector< ContextT, dataset< T… > > >¶
Defined in File activities.h
Template Struct junction¶
Defined in File activities.h
Struct Documentation¶
-
template<typename
DependencyT
>
structudho::activities
::
junction
¶ Public Functions
-
void
operator()
(const DependencyT&)¶
-
void
Template Struct perform¶
Defined in File activities.h
Struct Documentation¶
-
template<typename
ActivityT
>
structudho::activities
::
perform
¶ create a subtask to perform activity ActivityT
- Template Parameters
ActivityT
: the activity to perform
Public Static Functions
-
template<typename ...
DependenciesT
>
structrequire
¶ mention the activities that has to be performed before executing this subtask.
- Template Parameters
DependenciesT
: dependencies
Public Static Functions
-
template<typename ...
U
>
subtask<ActivityT, DependenciesT...>with
(U&&... u)¶ arguments for the activity constructor
Template Struct perform::require¶
Defined in File activities.h
Nested Relationships¶
This struct is a nested type of Template Struct perform.
Struct Documentation¶
-
template<typename ...
DependenciesT
>
structudho::activities::perform
::
require
¶ mention the activities that has to be performed before executing this subtask.
- Template Parameters
DependenciesT
: dependencies
Public Static Functions
-
template<typename ...
U
>
subtask<ActivityT, DependenciesT...>with
(U&&... u)¶ arguments for the activity constructor
Template Struct require¶
Defined in File activities.h
Template Struct result¶
Defined in File activities.h
Inheritance Relationships¶
public udho::activities::result_data< SuccessT, FailureT >
(Template Struct result_data)
Struct Documentation¶
-
template<typename
SuccessT
, typenameFailureT
>
structudho::activities
::
result
: public udho::activities::result_data<SuccessT, FailureT>¶ Completion handler for an activity.
- Template Parameters
SuccessT
: success data associated with the activityFailureT
: failure data associated with the activity
Public Types
-
typedef result_data<SuccessT, FailureT>
data_type
¶
-
typedef boost::signals2::signal<void()>
cancelation_signal_type
¶
-
typedef boost::function<bool(const success_type&)>
cancel_if_ftor
¶
-
typedef boost::function<bool(const success_type&)>
abort_error_ftor
¶
-
typedef boost::function<bool(const failure_type&)>
abort_failure_ftor
¶
Public Functions
-
template<typename
CombinatorT
>
voiddone
(CombinatorT cmb)¶ attach another subtask as done callback which will be executed once this subtask finishes
- Parameters
cmb
: next subtask
-
void
required
(bool flag)¶ mark the activity as required or optional
- Parameters
flag
:
-
void
cancel_if
(cancel_if_ftor f)¶ Force cancelation of the activity even after it is successful to stop propagating to the next activities
- Parameters
f
: callback which should return true to signal cancelation
-
void
if_errored
(abort_error_ftor ftor)¶
-
void
if_failed
(abort_failure_ftor ftor)¶
Public Members
-
accessor_type
_shadow
¶
-
signal_type
_signal
¶
-
bool
_required
¶
-
cancelation_signal_type
_cancelation_signals
¶
-
cancel_if_ftor
_cancel_if
¶
-
abort_error_ftor
_abort_error
¶
-
abort_failure_ftor
_abort_failure
¶
Protected Functions
-
void
success
(const success_type &data)¶ signal successful completion of the activity with success data of type SuccessT
- Parameters
data
: success data
-
void
failure
(const failure_type &data)¶ signal failed completion of the activity with failure data of type FailureT
- Parameters
data
: failure data
Friends
- friend struct combinator
Template Struct result_data¶
Defined in File activities.h
Inheritance Relationships¶
public udho::activities::result< SuccessT, FailureT >
(Template Struct result)
Struct Documentation¶
-
template<typename
SuccessT
, typenameFailureT
>
structudho::activities
::
result_data
¶ Contains Copiable Success or Failure data for an activity.
- Template Parameters
SuccessT
: success data typeFailureT
: failure data type
Subclassed by udho::activities::result< SuccessT, FailureT >
Public Types
-
typedef result_data<SuccessT, FailureT>
self_type
¶
Public Functions
-
result_data
()¶
-
bool
completed
() const¶ either success or failure data set
-
bool
failed
() const¶ whether the activity has failed
-
bool
canceled
() const¶ check whether the activity has been canceled
-
bool
okay
() const¶
-
const success_type &
success_data
() const¶ Success data
-
const failure_type &
failure_data
() const¶ Failure data
-
template<typename
CallableT
>
voidapply
(CallableT callback)¶ Apply a callable to the result data which will be invoked exactly once with appropriate arguments. The invocation of the callback depends on the state as shown below.
Incomplete: callback()
Canceled: callback(const SuccessT&, const FailureT&)
Failed: callback(const FailureT&)
Successful: callback(const SuccessT&)
The callback may not have all the overloads.
- Parameters
callback
:
Public Members
-
bool
_completed
¶
-
bool
_success
¶
-
bool
_canceled
¶
-
success_type
_sdata
¶
-
failure_type
_fdata
¶
Protected Functions
-
void
success
(const success_type &data)¶ Set Success Data
-
void
failure
(const failure_type &data)¶ Set Failure Data
-
void
cancel
()¶ mark as canceled
Template Struct start¶
Defined in File activities.h
Struct Documentation¶
-
template<typename
ContextT
, typename ...T
>
structudho::activities
::
start
¶ Public Types
-
typedef std::shared_ptr<collector_type>
collector_ptr
¶
-
typedef boost::signals2::signal<void()>
signal_type
¶
Public Functions
-
collector_ptr
collector
() const¶
-
const accessor_type &
accessor
() const¶
-
accessor_type &
accessor
()¶
-
void
operator()
()¶
-
template<typename
CombinatorT
>
voiddone
(CombinatorT cmb)¶
-
void
success
()¶
-
typedef std::shared_ptr<collector_type>
Template Struct subtask¶
Defined in File activities.h
Struct Documentation¶
-
template<typename
ActivityT
, typename ...DependenciesT
>
structudho::activities
::
subtask
¶ A
subtask
is an instantiation of anactivity
. The subtask reuses an activity to model different use cases by attaching dependencies. A subtask contains two shared pointers, one to the activity and another one to the combinator. The subtask cannot be instantiated directly by calling the subtask constructor. Instead call the staticwith
method to instantiate.- Template Parameters
ActivityT
: The activityDependenciesT
: The activities that has to be performed before performing ActivityT
Public Types
-
typedef combinator<ActivityT, DependenciesT...>
combinator_type
¶
-
typedef subtask<ActivityT, DependenciesT...>
self_type
¶
Public Functions
-
std::shared_ptr<activity_type>
activity
()¶ shared pointer to the activity
-
template<typename
V
, typename ...DependenciesV
>
self_type &done
(subtask<V, DependenciesV...> &next)¶ execute task next after the current one
- Parameters
next
: the next subtask
-
template<typename
V
, typename ...DependenciesV
>
self_type &after
(subtask<V, DependenciesV...> &previous)¶ t2.after(t1) is equivalent to t1.done(t2)
- Parameters
previous
: the previous subtask
-
template<typename
PreparatorT
>
self_type &prepare
(PreparatorT prep)¶ attach a callback which will be called with a reference to the activity after it has been instantiated and all its dependencies have completed.
-
self_type &
required
(bool flag)¶ Set required flag on or off. If a required subtask fails then all intermediate subtask that depend on it fails and the final callback is called immediately. By default all subtasks are required
-
self_type &
cancel_if
(typename activity_type::cancel_if_ftor cancelor)¶ Force cancelation of the activity even after it is successful to stop propagating to the next activities
- Parameters
f
: callback which should return true to signal cancelation
-
std::shared_ptr<activity_type>
operator->
()¶ returns the shared pointer to the actiivity
-
template<typename
FunctionT
>
self_type &if_errored
(FunctionT ftor)¶ abort if canceled if ftor returns false. f will be called with the success if it has been canceled due to error
Public Static Functions
-
template<typename
CollectorT
, typename ...U
>
self_typewith
(CollectorT collector, U&&... u)¶ Arguments for the constructor of the Activity
Friends
- friend struct subtask
Template Struct subtask< ActivityT >¶
Defined in File activities.h
Struct Documentation¶
-
template<typename
ActivityT
>
structudho::activities
::
subtask
<ActivityT>¶ Spetialization for the root subtask in the task graph
- Template Parameters
ActivityT
: The activity
Public Functions
-
std::shared_ptr<activity_type>
activity
()¶
-
template<typename
V
, typename ...DependenciesV
>
self_type &done
(subtask<V, DependenciesV...> &next)¶ execute task next after the current one
- Parameters
next
: the next subtask
-
template<typename ...
U
>
voidoperator()
(U&&... u)¶ calls the
operator()()
of the activity and starts executing the graph
-
self_type &
required
(bool flag)¶ Set required flag on or off. If a required subtask fails then all intermediate subtask that depend on it fails and the final callback is called immediately. By default all subtasks are required
-
self_type &
cancel_if
(typename activity_type::cancel_if_ftor cancelor)¶ Force cancelation of the activity even after it is successful to stop propagating to the next activities
- Parameters
f
: callback which should return true to signal cancelation
-
std::shared_ptr<activity_type>
operator->
()¶ returns the shared pointer to the actiivity
-
template<typename
FunctionT
>
self_type &if_errored
(FunctionT ftor)¶ abort if canceled if ftor returns false. f will be called with the success if it has been canceled due to error
Public Static Functions
-
template<typename
CollectorT
, typename ...U
>
self_typewith
(CollectorT collector, U&&... u)¶ Arguments for the constructor of the Activity
Friends
- friend struct subtask
Template Struct subtask< start< ContextT, T… > >¶
Defined in File activities.h
Struct Documentation¶
-
template<typename
ContextT
, typename ...T
>
structudho::activities
::
subtask
<start<ContextT, T...>>¶ Public Types
Public Functions
-
std::shared_ptr<activity_type>
activity
()¶
-
template<typename
V
, typename ...DependenciesV
>
self_type &done
(subtask<V, DependenciesV...> &next)¶ execute task next after the current one
- Parameters
next
: the next subtask
-
void
operator()
()¶ calls the
operator()()
of the activity and starts executing the graph
-
std::shared_ptr<activity_type>
operator->
()¶ returns the shared pointer to the actiivity
Public Static Functions
Protected Attributes
-
std::shared_ptr<activity_type>
_activity
¶
Friends
- friend struct subtask
-
std::shared_ptr<activity_type>
Template Struct app_¶
Defined in File application.h
Struct Documentation¶
-
template<typename
AppT
, boolRef
= false>
structudho
::
app_
¶
Template Struct app_< AppT, true >¶
Defined in File application.h
Struct Documentation¶
Struct assoc¶
Defined in File access.h
Inheritance Relationships¶
public udho::detail::association_group< detail::association_leaf, void >
(Template Struct association_group)
Struct Documentation¶
-
struct
udho
::
assoc
: public udho::detail::association_group<detail::association_leaf, void>¶ Public Functions
-
assoc
()¶
-
Template Struct attachment¶
Defined in File attachment.h
Struct Documentation¶
-
template<typename
AuxT
, typenameLoggerT
= void, typenameCacheT
= void>
structudho
::
attachment
: public AuxT, public CacheT, public LoggerT¶ logged stateful
Public Types
-
typedef attachment<AuxT, LoggerT, CacheT>
self_type
¶
-
typedef auxiliary_type::configuration_type
configuration_type
¶
-
typedef cache_type::shadow_type
shadow_type
¶
-
typedef attachment<AuxT, LoggerT, CacheT>
Template Struct attachment< AuxT, LoggerT, void >¶
Defined in File attachment.h
Struct Documentation¶
-
template<typename
AuxT
, typenameLoggerT
>
structudho
::
attachment
<AuxT, LoggerT, void> : public AuxT, public LoggerT¶ logged stateless
Public Types
-
typedef attachment<AuxT, LoggerT, void>
self_type
¶
-
typedef auxiliary_type::configuration_type
configuration_type
¶
-
typedef void
shadow_type
¶
Public Members
-
boost::asio::io_service &
_io
¶
-
typedef attachment<AuxT, LoggerT, void>
Template Struct attachment< AuxT, void, CacheT >¶
Defined in File attachment.h
Struct Documentation¶
-
template<typename
AuxT
, typenameCacheT
>
structudho
::
attachment
<AuxT, void, CacheT> : public AuxT, public CacheT¶ quiet stateful
Public Types
-
typedef attachment<AuxT, void, CacheT>
self_type
¶
-
typedef void
logger_type
¶
-
typedef auxiliary_type::configuration_type
configuration_type
¶
-
typedef cache_type::shadow_type
shadow_type
¶
Public Functions
-
attachment
(boost::asio::io_service &io)¶
-
shadow_type &
shadow
()¶
-
boost::asio::io_service &
io
()¶
-
typedef attachment<AuxT, void, CacheT>
Template Struct attachment< AuxT, void, void >¶
Defined in File attachment.h
Struct Documentation¶
-
template<typename
AuxT
>
structudho
::
attachment
<AuxT, void, void> : public AuxT¶ quiet stateless
Public Types
-
typedef attachment<AuxT, void, void>
self_type
¶
-
typedef void
logger_type
¶
-
typedef void
cache_type
¶
-
typedef void
shadow_type
¶
-
typedef auxiliary_type::configuration_type
configuration_type
¶
Public Functions
-
attachment
(boost::asio::io_service &io)¶
-
int
shadow
()¶
-
boost::asio::io_service &
io
()¶
Public Members
-
boost::asio::io_service &
_io
¶
-
typedef attachment<AuxT, void, void>
Template Struct basic_router¶
Defined in File router.h
Inheritance Relationships¶
public udho::overload_group< void, overload_terminal< AuxT > >
(Template Struct overload_group)
Struct Documentation¶
-
template<typename
AuxT
= void>
structudho
::
basic_router
: public udho::overload_group<void, overload_terminal<AuxT>>¶ router maps HTTP requests with the callbacks
auto router = udho::router() | (udho::get(add).plain() = "^/add/(\\d+)/(\\d+)$") | (udho::get(hello).plain() = "^/hello$");
Public Types
-
typedef overload_group<void, overload_terminal<AuxT>>
base_type
¶
Friends
-
template<typename
U
, typenameV
, typenameF
>
friend overload_group<overload_group<U, V>, F>operator|
(const overload_group<U, V> &group, const F &method)¶ adds a callback url mapping to the router by conjugating an overload in the overload meta-chain. The url mapping is provided by content wrappers like content_wrapper0 content_wrapper1 which attaches feasibility criteria like http resource path, http verb with a callback function. The url mapping can be built using get post put head etc.. See router for an example
- Parameters
group
: the overload group (which is actually the router or router attached with some url mappings)method
: url mapping
-
typedef overload_group<void, overload_terminal<AuxT>>
Template Struct bounded_str¶
Defined in File util.h
Struct Documentation¶
-
template<typename
Iterator
>
structudho
::
bounded_str
¶ Public Types
-
typedef bounded_str<Iterator>
self_type
¶
Public Functions
-
bool
invalid
() const¶
-
bool
valid
() const¶
-
template<typename
ContainerT
>
ContainerTcopied
() const¶
-
std::size_t
size
() const¶
-
typedef bounded_str<Iterator>
Template Struct bridge¶
Defined in File bridge.h
Struct Documentation¶
-
template<typename
ConfigT
>
structudho
::
bridge
¶ - Todo:
write docs
Public Functions
-
bridge
(boost::asio::io_service &io)¶
-
configuration_type &
config
()¶
-
const configuration_type &
config
() const¶
-
boost::filesystem::path
docroot
() const¶
-
boost::filesystem::path
tmplroot
() const¶
-
std::string
contents
(const boost::filesystem::path &local_path) const¶
-
boost::beast::http::response<boost::beast::http::file_body>
file
(const std::string &path, const ::udho::defs::request_type &req, std::string mime = "") const¶
-
template<typename
RequestT
, typenameGroupT
>
std::stringrender
(const std::string &path, const udho::detail::context_common<self_type, RequestT> &ctx, ::udho::lookup_table<GroupT> &scope) const¶
-
template<typename
RequestT
, typenameDataT
>
std::stringrender
(const std::string &path, const udho::detail::context_common<self_type, RequestT> &ctx, ::udho::prepared<DataT> &data) const¶
-
template<typename
RequestT
, typenameU
, typenameV
>
std::stringrender
(const std::string &path, const udho::detail::context_common<self_type, RequestT> &ctx, ::udho::prepared_group<U, V> &group) const¶
-
template<typename
RequestT
, typename ...DataT
>
std::stringrender
(const std::string &path, const udho::detail::context_common<self_type, RequestT> &ctx, const DataT&... data) const¶
-
std::string
render
(const std::string &path) const¶
-
template<typename
ContextT
>
detail::client_connection_wrapper<ContextT>client
(ContextT ctx, udho::config<udho::client_options> options)¶
Template Struct abstract_engine¶
Defined in File cache.h
Struct Documentation¶
-
template<typename
KeyT
, typenameValueT
= void>
structudho::cache
::
abstract_engine
¶ Public Types
-
typedef abstract_engine<KeyT, ValueT>
self_type
¶
Public Functions
-
std::size_t
size
() const = 0¶
-
void
create
(const key_type &key, const content_type &content) = 0¶
-
content_type
retrieve
(const key_type &key) const = 0¶
-
bool
update
(const key_type &key, const content_type &content) = 0¶
-
template<typename
U
= value_type>
std::enable_if<!std::is_same<U, void>::value>::typeinsert
(const key_type &key, const U &value)¶
-
template<typename
U
= value_type>
std::enable_if<std::is_same<U, void>::value>::typeinsert
(const key_type &key)¶
-
template<typename
U
= value_type>
std::enable_if<!std::is_same<U, void>::value, bool>::typeupdate
(const key_type &key, const U &value)¶
-
typedef abstract_engine<KeyT, ValueT>
Template Struct content¶
Defined in File cache.h
Struct Documentation¶
-
template<typename
T
= void>
structudho::cache
::
content
¶ -
Public Functions
-
content
()¶
-
content
(const value_type &value)¶
-
boost::posix_time::ptime
created
() const¶
-
boost::posix_time::ptime
updated
() const¶
-
boost::posix_time::time_duration
age
() const¶
-
boost::posix_time::time_duration
idle
() const¶
-
const value_type &
value
() const¶
-
void
update
(const value_type &value)¶
-
void
update
()¶
Public Members
-
boost::posix_time::ptime
_created
¶
-
boost::posix_time::ptime
_updated
¶
-
value_type
_value
¶
Friends
- friend class boost::serialization::access
-
Template Struct content< void >¶
Defined in File cache.h
Struct Documentation¶
-
template<>
structudho::cache
::
content
<void>¶ -
Public Functions
-
content
()¶
-
boost::posix_time::ptime
created
() const¶
-
boost::posix_time::ptime
updated
() const¶
-
boost::posix_time::time_duration
age
() const¶
-
boost::posix_time::time_duration
idle
() const¶
-
void
update
()¶
Friends
- friend class boost::serialization::access
-
Template Struct driver¶
Defined in File cache.h
Struct Documentation¶
-
template<typename
KeyT
, typenameValueT
= void>
structudho::cache
::
driver
¶ Public Types
-
typedef abstract_engine<KeyT, ValueT>
abstract_engine_type
¶
Public Functions
-
driver
(abstract_engine_type &e)¶
-
std::size_t
size
() const¶
-
template<typename
U
= value_type>
std::enable_if<!std::is_same<U, void>::value>::typeinsert
(const key_type &key, const U &value)¶
-
template<typename
U
= value_type>
std::enable_if<std::is_same<U, void>::value>::typeinsert
(const key_type &key)¶
-
content_type
retrieve
(const key_type &key) const¶
-
bool
update
(const key_type &key, const content_type &content)¶
Public Members
-
abstract_engine_type &
_engine
¶
-
typedef abstract_engine<KeyT, ValueT>
Template Struct engine¶
Defined in File cache.h
Inheritance Relationships¶
private StorageT
public udho::cache::abstract_engine< StorageT::key_type, StorageT::value_type >
(Template Struct abstract_engine)
Struct Documentation¶
-
template<typename
StorageT
>
structudho::cache
::
engine
: private StorageT, public udho::cache::abstract_engine<StorageT::key_type, StorageT::value_type>¶ Public Types
-
typedef abstract_engine<typename StorageT::key_type, typename StorageT::value_type>
abstract_engine_type
¶
Public Functions
-
engine
(const config_type &config)¶
-
std::size_t
size
() const final¶
-
void
create
(const key_type &key, const content_type &content) final¶
-
content_type
retrieve
(const key_type &key) const final¶
-
bool
update
(const key_type &key, const content_type &content) final¶
-
typedef abstract_engine<typename StorageT::key_type, typename StorageT::value_type>
Template Struct flake¶
Defined in File cache.h
Inheritance Relationships¶
public udho::cache::shadow< KeyT, T >
(Template Struct shadow)
Struct Documentation¶
-
template<typename
KeyT
, typenameT
>
structudho::cache
::
flake
¶ copiable flake containes a reference to the actual registry object
Subclassed by udho::cache::shadow< KeyT, T >
Public Types
-
typedef flake_type
self_type
¶
Public Functions
-
template<template<typename, typename> class
StorageT
, typename ...X
>flake
(store<StorageT, KeyT, X...> &store)¶
-
value_type
at
(const key_type &key) const¶
-
void
insert
(const key_type &key, const value_type &value)¶
-
void
update
(const key_type &key, const value_type &value)¶
-
typedef flake_type
Template Struct generator¶
Defined in File cache.h
Template Struct master¶
Defined in File cache.h
Inheritance Relationships¶
public udho::cache::driver< KeyT >
(Template Struct driver)
protected udho::cache::store< StorageT, KeyT, T >
(Template Struct store)
Struct Documentation¶
Template Struct registry¶
Defined in File cache.h
Inheritance Relationships¶
public udho::cache::driver< KeyT, T >
(Template Struct driver)
public udho::cache::store< StorageT, KeyT, T >
(Template Struct store)
Struct Documentation¶
-
template<typename
KeyT
, typenameT
>
structudho::cache
::
registry
: public udho::cache::driver<KeyT, T>¶ Subclassed by udho::cache::store< StorageT, KeyT, T >
Public Types
-
typedef abstract_engine<KeyT, T>
abstract_engine_type
¶
-
typedef abstract_engine<KeyT, T>
Template Struct shadow¶
Defined in File cache.h
Inheritance Relationships¶
public udho::cache::flake< KeyT, T >
(Template Struct flake)
Struct Documentation¶
-
template<typename
KeyT
, typename ...T
>
structudho::cache
::
shadow
: public udho::cache::flake<KeyT, T>¶ copiable shadow of a store reference.
user u("Neel"); appearence a("red"); udho::cache::store<std::string, user, appearence> store; udho::cache::shadow<std::string, user, appearence> shadow_ua(store); shadow_ua.insert("x", u); shadow_ua.insert("x", a); std::cout << std::boolalpha << shadow_ua.exists<user>("x") << std::endl; // true std::cout << std::boolalpha << shadow_ua.exists<appearence>("x") << std::endl; // true std::cout << shadow_ua.get<user>("x").name << std::endl; // Neel std::cout << shadow_ua.get<appearence>("x").color << std::endl; // red udho::cache::shadow<std::string, user> shadow_u(store); std::cout << std::boolalpha << shadow_u.exists<user>("x") << std::endl; // true std::cout << std::boolalpha << shadow_u.get<user>("x").name << std::endl; // true std::cout << shadow_u.exists<appearence>("x") << std::endl; // won't compile udho::cache::shadow<std::string, user> shadow_u2(shadow_u); // copiable udho::cache::shadow<std::string, user> shadow_u3(shadow_ua); // narrowable udho::cache::shadow<std::string, appearence> shadow_a(store); // unordered std::cout << shadow_a.exists<appearence>("x") << std::endl; // true std::cout << shadow_a.get<appearence>("x").color << std::endl; // red udho::cache::shadow<std::string> shadow_none(shadow_ua);
Public Types
Public Functions
-
template<template<typename, typename> class
StorageT
, typename ...X
>shadow
(store<StorageT, key_type, X...> &store)¶
-
std::size_t
size
() const¶
Public Members
-
master_type &
_master
¶
-
template<template<typename, typename> class
Template Struct disk¶
Defined in File cache.h
Struct Documentation¶
-
template<typename
KeyT
, typenameValueT
= void>
structudho::cache::storage
::
disk
¶ Public Types
-
typedef std::map<key_type, content_type>
map_type
¶
-
typedef session_config_type
config_type
¶
Public Functions
-
disk
(const session_config_type &config)¶
-
std::size_t
size
() const¶
-
void
create
(const key_type &key, const content_type &content)¶
-
content_type
retrieve
(const key_type &key) const¶
-
bool
update
(const key_type &key, const content_type &content)¶
Protected Functions
-
boost::filesystem::path
storage
() const¶
-
std::string
extension
() const¶
-
void
save
(udho::configs::session::format format, std::ofstream &file, const content_type &content)¶
-
void
load
(udho::configs::session::format format, std::ifstream &file, content_type &content) const¶
-
void
save
(std::ofstream &file, const content_type &content)¶
-
void
load
(std::ifstream &file, content_type &content) const¶
-
typedef std::map<key_type, content_type>
Template Struct memory¶
Defined in File cache.h
Struct Documentation¶
-
template<typename
KeyT
, typenameValueT
= void>
structudho::cache::storage
::
memory
¶ Public Types
-
typedef std::map<key_type, content_type>
map_type
¶
-
typedef session_config_type
config_type
¶
Public Functions
-
memory
(const session_config_type &config)¶
-
std::size_t
size
() const¶
-
void
create
(const key_type &key, const content_type &content)¶
-
content_type
retrieve
(const key_type &key) const¶
-
bool
update
(const key_type &key, const content_type &content)¶
-
typedef std::map<key_type, content_type>
Template Struct store¶
Defined in File cache.h
Inheritance Relationships¶
private udho::cache::engine< StorageT< KeyT, void > >
(Template Struct engine)private udho::cache::engine< StorageT< KeyT, T > >
(Template Struct engine)protected udho::cache::master< KeyT >
(Template Struct master)public udho::cache::registry< KeyT, T >
(Template Struct registry)
Struct Documentation¶
-
template<template<typename, typename> class
StorageT
, typenameKeyT
, typename ...T
>
structudho::cache
::
store
: private udho::cache::engine<StorageT<KeyT, void>>, private udho::cache::engine<StorageT<KeyT, T>>, protected udho::cache::master<KeyT>, public udho::cache::registry<KeyT, T>¶ A type safe non-copiable storage
user u("Neel"); appearence a("red"); udho::cache::store<std::string, user, appearence> store; store.insert("x", u); store.insert("x", a); store.exists<user>();
Public Types
Public Functions
-
store
(const config_type &config)¶
Friends
- friend struct shadow< KeyT, T… >
-
Template Struct client_options_¶
Defined in File client.h
Nested Relationships¶
Inheritance Relationships¶
public udho::config< udho::client_options >
(Template Struct config)
Struct Documentation¶
-
template<typename
T
= void>
structudho
::
client_options_
¶ Subclassed by udho::config< udho::client_options >
Public Functions
-
client_options_
()¶
-
void
set
(verify_certificate_t, bool v)¶
-
bool
get
(verify_certificate_t) const¶
-
void
set
(follow_redirect_t, bool v)¶
-
bool
get
(follow_redirect_t) const¶
-
void
set
(http_version_t, int v)¶
-
int
get
(http_version_t) const¶
Public Static Attributes
-
const struct udho::client_options_::verify_certificate_t
verify_certificate
¶
-
const struct udho::client_options_::follow_redirect_t
follow_redirect
¶
-
const struct udho::client_options_::http_version_t
http_version
¶
-
struct
follow_redirect_t
¶ Public Types
-
typedef client_options_<T>
component
¶
-
typedef client_options_<T>
-
struct
http_version_t
¶ Public Types
-
typedef client_options_<T>
component
¶
-
typedef client_options_<T>
-
struct
verify_certificate_t
¶ Public Types
-
typedef client_options_<T>
component
¶
-
typedef client_options_<T>
-
Struct client_options_::follow_redirect_t¶
Defined in File client.h
Nested Relationships¶
This struct is a nested type of Template Struct client_options_.
Struct Documentation¶
-
struct
udho::client_options_
::
follow_redirect_t
¶ Public Types
-
typedef client_options_<T>
component
¶
-
typedef client_options_<T>
Struct client_options_::http_version_t¶
Defined in File client.h
Nested Relationships¶
This struct is a nested type of Template Struct client_options_.
Struct Documentation¶
-
struct
udho::client_options_
::
http_version_t
¶ Public Types
-
typedef client_options_<T>
component
¶
-
typedef client_options_<T>
Struct client_options_::verify_certificate_t¶
Defined in File client.h
Nested Relationships¶
This struct is a nested type of Template Struct client_options_.
Struct Documentation¶
-
struct
udho::client_options_
::
verify_certificate_t
¶ Public Types
-
typedef client_options_<T>
component
¶
-
typedef client_options_<T>
Template Struct deferred¶
Defined in File compositors.h
Template Struct mimed¶
Defined in File compositors.h
Struct Documentation¶
-
template<typename
OutputT
>
structudho::compositors
::
mimed
¶ mimed content. The returned output will be sent with the given mime type
Public Types
-
typedef boost::beast::http::response<boost::beast::http::string_body>
response_type
¶
Public Functions
-
mimed
(const std::string &mime)¶
-
template<typename
ContextT
>
response_typeoperator()
(const ContextT &ctx, const OutputT &out)¶
-
std::string
name
() const¶
Public Members
-
std::string
_mime
¶
-
typedef boost::beast::http::response<boost::beast::http::string_body>
Template Struct transparent¶
Defined in File compositors.h
Template Struct config¶
Defined in File configuration.h
Inheritance Relationships¶
public T
public udho::configuration< detail::url_data >
(Template Struct configuration)public udho::configuration< T >
(Template Struct configuration)
Struct Documentation¶
-
template<typename
T
>
structudho
::
config
: public T¶ Subclassed by udho::configuration< detail::url_data >, udho::configuration< T >
Template Struct config< configs::server_<> >¶
Defined in File configuration.h
Inheritance Relationships¶
public udho::configs::server_<>
(Template Struct server_)
Struct Documentation¶
Template Struct form_¶
Defined in File configuration.h
Template Struct logger_¶
Defined in File configuration.h
Template Struct router_¶
Defined in File configuration.h
Template Struct server_¶
Defined in File configuration.h
Nested Relationships¶
Struct Documentation¶
-
template<typename
T
= void>
structudho::configs
::
server_
¶ Public Types
-
typedef std::map<std::string, std::string>
mime_map
¶
Public Functions
-
server_
()¶
-
void
set
(document_root_t, const boost::filesystem::path &v)¶
-
boost::filesystem::path
get
(document_root_t) const¶
-
void
set
(template_root_t, const boost::filesystem::path &v)¶
-
boost::filesystem::path
get
(template_root_t) const¶
-
void
set
(mime_default_t, std::string v)¶
-
std::string
get
(mime_default_t) const¶
-
std::string
mime
(const std::string &extension) const¶
-
void
mime
(const std::string &extension, const std::string &type)¶
Public Members
-
boost::filesystem::path
_document_root
¶
-
boost::filesystem::path
_template_root
¶
-
std::string
_mime_default
¶
Public Static Attributes
-
const struct udho::configs::server_::document_root_t
document_root
¶
-
const struct udho::configs::server_::template_root_t
template_root
¶
-
const struct udho::configs::server_::mime_default_t
mime_default
¶
-
struct
document_root_t
¶
-
struct
mime_default_t
¶
-
struct
mimes_t
¶
-
struct
template_root_t
¶
-
typedef std::map<std::string, std::string>
Struct server_::document_root_t¶
Defined in File configuration.h
Nested Relationships¶
This struct is a nested type of Template Struct server_.
Struct server_::mime_default_t¶
Defined in File configuration.h
Nested Relationships¶
This struct is a nested type of Template Struct server_.
Struct server_::mimes_t¶
Defined in File configuration.h
Nested Relationships¶
This struct is a nested type of Template Struct server_.
Struct server_::template_root_t¶
Defined in File configuration.h
Nested Relationships¶
This struct is a nested type of Template Struct server_.
Template Struct session_¶
Defined in File configuration.h
Nested Relationships¶
Struct Documentation¶
-
template<typename
T
= void>
structudho::configs
::
session_
¶ -
Public Functions
-
session_
()¶
-
void
set
(extension_t, const std::string &e)¶
-
std::string
get
(extension_t) const¶
-
void
set
(serialization_t, format v)¶
-
format
get
(serialization_t) const¶
Public Static Attributes
-
const struct udho::configs::session_::extension_t
extension
¶
-
const struct udho::configs::session_::serialization_t
serialization
¶
-
struct
extension_t
¶
-
struct
id_t
¶
-
struct
path_t
¶
-
struct
serialization_t
¶
-
Struct session_::extension_t¶
Defined in File configuration.h
Nested Relationships¶
This struct is a nested type of Template Struct session_.
Struct session_::id_t¶
Defined in File configuration.h
Nested Relationships¶
This struct is a nested type of Template Struct session_.
Struct session_::path_t¶
Defined in File configuration.h
Nested Relationships¶
This struct is a nested type of Template Struct session_.
Struct session_::serialization_t¶
Defined in File configuration.h
Nested Relationships¶
This struct is a nested type of Template Struct session_.
Template Struct configuration¶
Defined in File configuration.h
Inheritance Relationships¶
public udho::config< T >
(Template Struct config)
Struct Documentation¶
-
template<typename ...
T
>
structudho
::
configuration
: public udho::config<T>¶ typedef udho::configuration<udho::config::server, udho::config::router, udho::config::logging, udho::config::view> configuration; configuration config; config[udho::configs::server::document_root] = “/path/to/document/root”;
Struct connection::send_lambda¶
Defined in File connection.h
Nested Relationships¶
This struct is a nested type of Template Class connection.
Template Struct content_wrapper0¶
Defined in File router.h
Struct Documentation¶
-
template<typename
F
>
structudho
::
content_wrapper0
¶ mapping of an url with a http request defined by http method and the url pattern
A content wrapper is defined by a HTTP verb, a callback and a url pattern. A content wrapper uses a compositor that prepares a HTTP response based on the callbacks return
- Template Parameters
F
: callback type
Public Types
-
typedef content_wrapper0<F>
self_type
¶
Public Functions
-
template<template<typename> class
CompositorT
= compositors::transparent>
autounwrap
(CompositorT<typename internal::function_signature<F>::return_type> compositor = CompositorT<typename internal::function_signature<F>::return_type>())¶
-
auto
deferred
()¶
-
auto
raw
()¶ raw content delivery using transparent compositor
-
auto
operator=
(const std::string &pattern)¶ attach an url pattern
-
auto
mimed
(std::string mime)¶ applies a mimed compositor on the return
- Parameters
mime
: returned mime type
-
auto
html
()¶ shorthand for html mime type
-
auto
plain
()¶ shorthand for plain text mime type
-
auto
json
()¶ shorthand for json mime type
Template Struct content_wrapper1¶
Defined in File router.h
Struct Documentation¶
-
template<typename
F
, typenameA1
>
structudho
::
content_wrapper1
¶ mapping of an url with a http request defined by http method and the url pattern
A content wrapper is defined by a HTTP verb, a callback and a url pattern. A content wrapper uses a compositor that prepares a HTTP response based on the callbacks return
- Note
binds a variable by reference with the mapping, which might be a database connection or some persistent stateful object
- Template Parameters
F
: callback typeA1
: type of the passed value which will be passed by reference
Public Types
-
typedef content_wrapper1<F, A1>
self_type
¶
Public Functions
-
template<template<typename> class
CompositorT
= compositors::transparent>
autounwrap
(CompositorT<typename internal::function_signature<F>::return_type> compositor = CompositorT<typename internal::function_signature<F>::return_type>())¶
-
auto
raw
()¶ raw content delivery using transparent compositor
-
auto
operator=
(const std::string &pattern)¶ attach an url pattern
-
auto
mimed
(std::string mime)¶ applies a mimed compositor on the return
- Parameters
mime
: returned mime type
-
auto
html
()¶ shorthand for html mime type
-
auto
plain
()¶ shorthand for plain text mime type
-
auto
json
()¶ shorthand for json mime type
Template Struct context¶
Defined in File context.h
Inheritance Relationships¶
public udho::detail::context_common< AuxT, RequestT >
(Template Struct context_common)
Struct Documentation¶
-
template<typename
AuxT
, typenameRequestT
, typenameShadowT
>
structudho
::
context
: public udho::detail::context_common<AuxT, RequestT>¶ A Stateful context passed to all callables along with the arguments. The context is always the first argument to the callable. Even if the callable takes no arguments, it must take the context as the first argument. A stateful context should be used in callables that need to use session states.
- Note
instead of instantiating this template directly use udho::contexts::stateful
- Template Parameters
AuxT
: bridge between the server and the callableRequestT
: HTTP request typeShadowT
: the session data structure
Public Types
-
typedef detail::context_common<AuxT, RequestT>
base_type
¶
-
typedef shadow_type::key_type
key_type
¶
-
typedef context<AuxT, request_type, shadow_type>
self_type
¶
-
typedef udho::session_<request_type, shadow_type>
session_type
¶
Public Functions
-
template<typename ...
V
>context
(AuxT &aux, const RequestT &request, udho::cache::shadow<key_type, V...> &shadow)¶
-
template<typename
OtherShadowT
>context
(context<AuxT, RequestT, OtherShadowT> &other)¶
-
session_type &
session
()¶ access the HTTP Session
Public Members
-
session_type
_session
¶
Template Struct context< AuxT, RequestT, void >¶
Defined in File context.h
Inheritance Relationships¶
public udho::detail::context_common< AuxT, RequestT >
(Template Struct context_common)
Struct Documentation¶
-
template<typename
AuxT
, typenameRequestT
>
structudho
::
context
<AuxT, RequestT, void> : public udho::detail::context_common<AuxT, RequestT>¶ A Stateless context passed to all callables along with the arguments. he context is always the first argument to the callable. Even if the callable takes no arguments, it must take the context as the first argument. A stateless context should be used in callables that need not to use session states.
- Note
instead of instantiating this template directly use udho::contexts::stateless
- Template Parameters
AuxT
: bridge between the server and the callableRequestT
: HTTP request type
Public Functions
-
template<typename
OtherShadowT
>context
(context<AuxT, RequestT, OtherShadowT> &other)¶
Template Struct cookie_¶
Defined in File cookie.h
Struct Documentation¶
Public Types
Public Functions
Public Members
Template Struct cookies_¶
Defined in File cookie.h
Struct Documentation¶
Public Types
Public Functions
Public Members
Template Struct data_helper¶
Defined in File access.h
Struct Documentation¶
-
template<typename
H
, typenameT
, boolIsPrepared
= detail::is_prepared<H>::value>
structdata_helper
¶
Template Struct data_helper< H, T, false >¶
Defined in File access.h
Struct Documentation¶
-
template<typename
H
, typenameT
>
structudho
::
data_helper
<H, T, false>¶ Public Types
-
typedef prepared_group<udho::prepared<T>, prepared_group<H, void>>
result_type
¶
Public Static Functions
-
result_type
data
(const H &head, const T &tail)¶
-
typedef prepared_group<udho::prepared<T>, prepared_group<H, void>>
Template Struct data_helper< H, T, true >¶
Defined in File access.h
Struct Documentation¶
-
template<typename
H
, typenameT
>
structudho
::
data_helper
<H, T, true>¶ Public Types
-
typedef prepared_group<udho::prepared<T>, prepared_group<udho::prepared<H>, void>>
result_type
¶
Public Static Functions
-
result_type
data
(const H &head, const T &tail)¶
-
typedef prepared_group<udho::prepared<T>, prepared_group<udho::prepared<H>, void>>
Struct declaration¶
Defined in File scope.h
Template Struct association¶
Defined in File access.h
Inheritance Relationships¶
public udho::detail::responder< F, F::result_type >
(Template Struct responder)
Struct Documentation¶
-
template<typename
F
>
structudho::detail
::
association
: public udho::detail::responder<F, F::result_type>¶ Public Types
-
typedef responder_type::result_type
result_type
¶
Public Functions
-
association
(const std::string &key, callback_type callback)¶
-
bool
matched
(const std::string &key) const¶
Public Members
-
std::string
_key
¶
-
typedef responder_type::result_type
Template Struct association_group¶
Defined in File access.h
Struct Documentation¶
-
template<typename
U
, typenameV
= void>
structudho::detail
::
association_group
¶ association_group<X, void> | Y => association_group<Y, association_group<X, void>> association_group<Y, association_group<X, void>> | Z => association_group<Z, association_group<Y, association_group<X, void>>> association_group<Z, association_group<Y, association_group<X, void>>> | T => association_group<T, association_group<Z, association_group<Y, association_group<X, void>>>>
Public Types
-
typedef association_group<U, V>
self_type
¶
-
typedef association_group<U, V>
Template Struct association_group< U, void >¶
Defined in File access.h
Struct Documentation¶
Template Struct association_group_visitor¶
Defined in File access.h
Struct Documentation¶
-
template<typename
GroupT
, boolIsPrepared
= is_prepared<typename GroupT::head_type::result_type>::value>
structassociation_group_visitor
¶ An association group visitor visits the association group returned by T::index() where T is a subclass of udho::prepare
Template Struct association_group_visitor< association_group< U, V >, false >¶
Defined in File access.h
Struct Documentation¶
-
template<typename
U
, typenameV
>
structudho::detail
::
association_group_visitor
<association_group<U, V>, false>¶ not the last association, does not have nested objects
Public Types
-
typedef association_group<U, V>
group_type
¶
-
typedef association_group_visitor<tail_type>
tail_visitor_type
¶
Public Functions
-
association_group_visitor
(const group_type &group)¶
-
std::size_t
count
(const std::string &key) const¶
-
std::vector<std::string>
keys
(const std::string &key) const¶
-
typedef association_group<U, V>
Template Struct association_group_visitor< association_group< U, V >, true >¶
Defined in File access.h
Struct Documentation¶
-
template<typename
U
, typenameV
>
structudho::detail
::
association_group_visitor
<association_group<U, V>, true>¶ not the last association, have nested objects
Public Types
-
typedef association_group<U, V>
group_type
¶
-
typedef group_type::result_type
result_type
¶
-
typedef association_group_visitor<tail_type>
tail_visitor_type
¶
Public Functions
-
association_group_visitor
(const group_type &group)¶
-
std::size_t
count
(const std::string &key) const¶
-
std::vector<std::string>
keys
(const std::string &key) const¶
-
typedef association_group<U, V>
Template Struct association_group_visitor< association_group< U, void >, false >¶
Defined in File access.h
Struct Documentation¶
-
template<typename
U
>
structudho::detail
::
association_group_visitor
<association_group<U, void>, false>¶ last association, does not have nested object
Public Types
-
typedef association_group<U, void>
group_type
¶
Public Functions
-
association_group_visitor
(const group_type &group)¶
-
std::size_t
count
(const std::string&) const¶
-
std::vector<std::string>
keys
(const std::string&) const¶
Public Members
-
const group_type &
_group
¶
-
typedef association_group<U, void>
Struct association_leaf¶
Defined in File access.h
Template Struct association_lexical_extractor¶
Defined in File access.h
Struct Documentation¶
-
template<typename
ValueT
>
structudho::detail
::
association_lexical_extractor
¶ Public Functions
-
association_lexical_extractor
()¶
-
template<typename
T
>
std::enable_if<!std::is_same<ValueT, T>::value && is_streamable<std::stringstream, T>::value>::typeoperator()
(const T &value)¶
-
template<typename
T
>
std::enable_if<!std::is_same<ValueT, T>::value && !is_streamable<std::stringstream, T>::value>::typeoperator()
(const T &value)¶
-
void
clear
()¶
-
Template Struct async_result¶
Defined in File client.h
Inheritance Relationships¶
public udho::detail::http_client_connection< ContextT >
(Template Struct http_client_connection)public udho::detail::https_client_connection< ContextT >
(Template Struct https_client_connection)
Struct Documentation¶
-
template<typename
ContextT
>
structudho::detail
::
async_result
¶ Subclassed by udho::detail::http_client_connection< ContextT >, udho::detail::https_client_connection< ContextT >
Public Types
-
typedef async_result<ContextT>
self_type
¶
-
typedef udho::config<udho::client_options>
options_type
¶
-
typedef boost::function<void(ContextT, const boost::beast::http::response<boost::beast::http::string_body>&)>
success_callback_type
¶
-
typedef boost::function<void(const boost::beast::error_code&)>
error_callback_type_aux
¶
-
typedef boost::function<void(const boost::beast::http::response<boost::beast::http::string_body>&)>
success_callback_type_aux_r
¶
-
typedef boost::function<void(ContextT, boost::beast::http::status, const std::string&)>
success_callback_type_aux_xsc
¶
-
typedef boost::function<void(boost::beast::http::status, const std::string&)>
success_callback_type_aux_sc
¶
-
typedef boost::function<void(const std::string&)>
success_callback_type_aux_c
¶
-
typedef boost::function<void()>
finally_callback_type
¶
Public Functions
-
async_result
() = delete¶
-
async_result
(const context_type &ctx, options_type options)¶
-
void
success
(const boost::beast::http::response<boost::beast::http::string_body> &res)¶
-
void
failure
(const boost::beast::error_code &ec)¶
-
void
finish
()¶
-
self_type &
then
(success_callback_type cb)¶
-
self_type &
failed
(error_callback_type cb)¶
-
self_type &
finally
(finally_callback_type f)¶
-
self_type &
error
(error_callback_type_aux cb)¶
-
self_type &
fetch
(success_callback_type_aux_xsc cb)¶
-
self_type &
body
(success_callback_type_aux_xc cb)¶
-
self_type &
after
(success_callback_type_aux_r cb)¶
-
self_type &
done
(success_callback_type_aux_sc cb)¶
-
self_type &
content
(success_callback_type_aux_c cb)¶
-
context_type &
context
()¶
Public Members
-
context_type
_ctx
¶
-
success_callback_type
_callback
¶
-
error_callback_type
_ecallback
¶
-
finally_callback_type
_fcallback
¶
-
options_type
_options
¶
-
typedef async_result<ContextT>
Template Struct client_connection_wrapper¶
Defined in File client.h
Struct Documentation¶
-
template<typename
ContextT
>
structudho::detail
::
client_connection_wrapper
¶ Public Types
-
typedef client_connection_wrapper<ContextT>
self_type
¶
-
typedef udho::detail::async_result<ContextT>
result_type
¶
-
typedef udho::config<udho::client_options>
options_type
¶
Public Functions
-
client_connection_wrapper
(boost::asio::io_service &io, ContextT ctx, options_type options)¶
-
result_type &
request
(boost::beast::http::verb method, udho::url url)¶
-
result_type &
get
(udho::url url)¶
-
result_type &
post
(udho::url url)¶
-
result_type &
put
(udho::url url)¶
-
result_type &
get
(const std::string &url)¶
-
result_type &
post
(const std::string &url)¶
-
result_type &
put
(const std::string &url)¶
-
typedef client_connection_wrapper<ContextT>
Template Struct context_common¶
Defined in File context.h
Inheritance Relationships¶
public udho::context< AuxT, RequestT, ShadowT >
(Template Struct context)public udho::context< AuxT, RequestT, void >
(Template Struct context< AuxT, RequestT, void >)
Struct Documentation¶
-
template<typename
AuxT
, typenameRequestT
>
structudho::detail
::
context_common
¶ Subclassed by udho::context< AuxT, RequestT, ShadowT >, udho::context< AuxT, RequestT, void >
Public Types
-
typedef context_common<AuxT, request_type>
self_type
¶
-
typedef detail::context_impl<request_type>
impl_type
¶
Public Functions
-
interaction_ &
interaction
()¶
-
const request_type &
request
() const¶ returns the boost beast HTTP request
-
template<class
Body
, classFields
>
voidpatch
(boost::beast::http::message<false, Body, Fields> &res) const¶ patches the response with the headers added in the context from inside the callable
accesses the HTTP cookies
-
operator request_type
() const¶ conversion operator to convert to the corresponding beast request type
-
template<udho::logging::status
Status
>
voidlog
(const udho::logging::message<Status> &msg) const¶ Logs a message to the logger attached with the server. A logging message can be passed to the
log
method or theoperator<<
can be used to log a message.ctx << udho::logging::messages::formatted::debug("data", "testing log functionality of %1% Hi %2%") % "Neel Basu" % 42; ctx << udho::logging::messages::formatted::info("data", "testing log functionality of %1% Hi %2%") % "Neel Basu" % 42; ctx << udho::logging::messages::formatted::warning("data", "testing log functionality of %1% Hi %2%") % "Neel Basu" % 42; ctx << udho::logging::messages::formatted::error("data", "testing log functionality of %1% Hi %2%") % "Neel Basu" % 42;
-
template<typename
AttachmentT
>
voidattach
(AttachmentT &attachment)¶ attaches a context with its server counter part
-
void
respond
(udho::defs::response_type &response)¶ respond with a http status. The responded output will be put inside a beast HTTP response object and a content type header of type mime will be attached
-
template<typename
OutputT
>
voidrespond
(const OutputT &output, const std::string &mime)¶ the responded output will be put inside a beast HTTP response object and a content type header of type mime will be attached
-
template<typename
OutputT
>
voidrespond
(boost::beast::http::status s, const OutputT &output, const std::string &mime)¶ respond with a http status. The responded output will be put inside a beast HTTP response object and a content type header of type mime will be attached
-
void
status
(boost::beast::http::status s)¶ set a status code for the HTTP response
-
std::string
target
() const¶ target of the HTTP request including the
?
if the request includes get parameters// https://localhost/user/profile?id=245 ctx.target() // /user/profile?id=245
-
std::string
path
() const¶ path of the HTTP request before
?
if any// https://localhost/user/profile?id=245 ctx.path() // /user/profile
-
const query_parser_type &
query
() const¶ The get query of the HTTP request.
if(!ctx.query().has("type") || ctx.query().field<std::string>("type") == "json"){ // respond with JSON content }else if(ctx.query().field<std::string>("type") == "xml") // respond with xml content }
-
void
clear
()¶
-
void
reroute
(const std::string &path)¶ Internally reroute an HTTP request to another request
-
bool
rerouted
() const¶ check whether this is a rerouted request or not
-
std::string
alt_path
() const¶
-
std::string
render
(const std::string &path) const¶ render a file in path
-
template<typename ...
DataT
>
std::stringrender
(const std::string &path, const DataT&... data) const¶ render a template in path
-
std::size_t
reroutes
() const¶
-
detail::client_connection_wrapper<self_type>
client
(udho::config<udho::client_options> options = udho::config<udho::client_options>())¶
-
boost::asio::io_service &
io
()¶
-
typedef context_common<AuxT, request_type>
Template Struct context_impl¶
Defined in File context.h
Inheritance Relationships¶
public udho::detail::interaction_
(Struct interaction_)
Struct Documentation¶
-
template<typename
RequestT
>
structudho::detail
::
context_impl
: public udho::detail::interaction_¶ Public Types
-
typedef context_impl<request_type>
self_type
¶
-
typedef udho::forms::form_<request_type>
form_type
¶
-
typedef boost::beast::http::header<true>
headers_type
¶
Public Functions
-
context_impl
(const request_type &request)¶
-
interaction_ &
interaction
()¶
-
const request_type &
request
() const¶
-
template<class
Body
, classFields
>
voidpatch
(boost::beast::http::message<false, Body, Fields> &res) const¶
-
void
status
(boost::beast::http::status status)¶
-
void
clear
()¶
-
void
reroute
(const std::string &path)¶
-
bool
rerouted
() const¶
-
std::string
alt_path
() const¶
-
std::string
target
() const¶
-
std::string
path
() const¶
-
std::string
query_string
() const¶
-
const query_parser_type &
query
() const¶
-
std::size_t
reroutes
() const¶
Public Members
-
const request_type &
_request
¶
-
std::string
_query_string
¶
-
query_parser_type
_query
¶
-
headers_type
_headers
¶
-
route_stack_type
_routes
¶
-
boost::beast::http::status
_status
¶
-
typedef context_impl<request_type>
Template Struct http_client_connection¶
Defined in File client.h
Inheritance Relationships¶
public std::enable_shared_from_this< http_client_connection< ContextT > >
public udho::detail::async_result< ContextT >
(Template Struct async_result)
Struct Documentation¶
-
template<typename
ContextT
>
structudho::detail
::
http_client_connection
: public std::enable_shared_from_this<http_client_connection<ContextT>>, public udho::detail::async_result<ContextT>¶ - Todo:
write docs
Public Types
-
typedef std::enable_shared_from_this<http_client_connection<ContextT>>
base
¶
-
typedef async_result<ContextT>
result_type
¶
-
typedef http_client_connection<ContextT>
self_type
¶
-
typedef udho::config<udho::client_options>
options_type
¶
-
typedef boost::function<void(const std::string&)>
redirector_type
¶
Public Functions
-
http_client_connection
(ContextT context, const udho::url &u, boost::asio::executor ex, options_type options)¶
-
void
start
(boost::beast::http::verb method = boost::beast::http::verb::get)¶
-
void
on_resolve
(boost::beast::error_code ec, boost::asio::ip::tcp::resolver::results_type results)¶
-
void
on_connect
(boost::beast::error_code ec)¶
-
void
on_write
(boost::beast::error_code ec, std::size_t)¶
-
void
on_read
(boost::beast::error_code ec, std::size_t)¶
-
void
on_shutdown
(boost::beast::error_code ec)¶
-
result_type &
result
()¶
Public Members
-
boost::asio::ip::tcp::resolver
resolver
¶
-
boost::asio::ip::tcp::socket
socket
¶
-
boost::beast::flat_buffer
buffer
¶
-
boost::beast::http::request<boost::beast::http::empty_body>
req
¶
-
boost::beast::http::response<boost::beast::http::string_body>
res
¶
Public Static Functions
-
std::shared_ptr<self_type>
create
(boost::asio::io_service &io, ContextT ctx, udho::url url, options_type options)¶
Template Struct https_client_connection¶
Defined in File client.h
Inheritance Relationships¶
public std::enable_shared_from_this< https_client_connection< ContextT > >
public udho::detail::async_result< ContextT >
(Template Struct async_result)
Struct Documentation¶
-
template<typename
ContextT
>
structudho::detail
::
https_client_connection
: public std::enable_shared_from_this<https_client_connection<ContextT>>, public udho::detail::async_result<ContextT>¶ - Todo:
write docs
Public Types
-
typedef std::enable_shared_from_this<https_client_connection<ContextT>>
base
¶
-
typedef async_result<ContextT>
result_type
¶
-
typedef https_client_connection<ContextT>
self_type
¶
-
typedef udho::config<udho::client_options>
options_type
¶
-
typedef boost::function<void(const std::string&)>
redirector_type
¶
Public Functions
-
https_client_connection
(ContextT context, const udho::url &u, boost::asio::executor ex, boost::asio::ssl::context &ssl_ctx, options_type options)¶
-
void
start
(boost::beast::http::verb method = boost::beast::http::verb::get)¶
-
void
on_resolve
(boost::beast::error_code ec, boost::asio::ip::tcp::resolver::results_type results)¶
-
void
on_connect
(boost::beast::error_code ec)¶
-
void
on_handshake
(boost::beast::error_code ec)¶
-
void
on_write
(boost::beast::error_code ec, std::size_t)¶
-
void
on_read
(boost::beast::error_code ec, std::size_t)¶
-
void
on_shutdown
(boost::beast::error_code ec)¶
-
result_type &
result
()¶
Public Members
-
boost::asio::ip::tcp::resolver
resolver
¶
-
boost::asio::ssl::context &
_ssl_ctx
¶
-
boost::asio::ssl::stream<boost::asio::ip::tcp::socket>
stream
¶
-
boost::beast::flat_buffer
buffer
¶
-
boost::beast::http::request<boost::beast::http::empty_body>
req
¶
-
boost::beast::http::response<boost::beast::http::string_body>
res
¶
Public Static Functions
-
std::shared_ptr<self_type>
create
(boost::asio::io_service &io, ContextT ctx, udho::url url, options_type options)¶
Struct interaction_¶
Defined in File context.h
Inheritance Relationships¶
public udho::detail::context_impl< RequestT >
(Template Struct context_impl)
Struct Documentation¶
-
struct
udho::detail
::
interaction_
¶ Subclassed by udho::detail::context_impl< RequestT >
Public Functions
-
template<typename
AuxT
, typenameLoggerT
, typenameCacheT
>
voidattach
(udho::attachment<AuxT, LoggerT, CacheT> &attachment)¶
-
void
respond
(udho::defs::response_type &response)¶
Public Members
-
boost::signals2::signal<void(udho::defs::response_type&)>
_respond
¶
-
template<typename
Template Struct responder¶
Defined in File access.h
Struct Documentation¶
-
template<typename
F
, typenameR
>
structudho::detail
::
responder
¶ -
Public Functions
-
responder
() = delete¶
-
responder
(callback_type callback)¶
-
result_type
call
(const std::string&) const¶
-
result_type
call
(const std::string&)¶
-
bool
iterable
() const¶
-
bool
leaf
() const¶
-
std::size_t
count
() const¶
-
std::vector<std::string>
keys
() const¶
Public Members
-
callback_type
_callback
¶
-
Template Struct responder< F, std::map< U, V > >¶
Defined in File access.h
Struct Documentation¶
-
template<typename
F
, typenameU
, typenameV
>
structudho::detail
::
responder
<F, std::map<U, V>>¶ Public Types
-
typedef container_type::size_type
size_type
¶
Public Functions
-
responder
(callback_type callback)¶
-
result_type
call
(const std::string &key) const¶
-
result_type
call
(const std::string &key)¶
-
bool
iterable
() const¶
-
bool
leaf
() const¶
-
std::size_t
count
() const¶
-
std::vector<std::string>
keys
() const¶
Public Members
-
callback_type
_callback
¶
-
typedef container_type::size_type
Template Struct responder< F, std::vector< V > >¶
Defined in File access.h
Struct Documentation¶
-
template<typename
F
, typenameV
>
structudho::detail
::
responder
<F, std::vector<V>>¶ Public Types
-
typedef container_type::size_type
size_type
¶
Public Functions
-
responder
(callback_type callback)¶
-
result_type
call
(const std::string &key) const¶
-
result_type
call
(const std::string &key)¶
-
bool
iterable
() const¶
-
bool
leaf
() const¶
-
std::size_t
count
() const¶
-
std::vector<std::string>
keys
() const¶
Public Members
-
callback_type
_callback
¶
-
typedef container_type::size_type
Struct route¶
Defined in File util.h
Template Struct url_data_¶
Defined in File url.h
Nested Relationships¶
Struct Documentation¶
-
template<typename
T
= void>
structudho::detail
::
url_data_
¶ Public Functions
-
url_data_
()¶
-
void
set
(protocol_t, const std::string &v)¶
-
std::string
get
(protocol_t) const¶
Public Members
-
std::string
_protocol
¶
-
std::string
_host
¶
-
std::size_t
_port
¶
-
std::string
_path
¶
-
std::string
_target
¶
-
std::string
_query
¶
Public Static Attributes
-
const struct udho::detail::url_data_::protocol_t
protocol
¶
-
struct
host_t
¶
-
struct
path_t
¶
-
struct
port_t
¶
-
struct
protocol_t
¶
-
struct
query_t
¶
-
struct
target_t
¶
-
Struct url_data_::host_t¶
Defined in File url.h
Nested Relationships¶
This struct is a nested type of Template Struct url_data_.
Struct url_data_::path_t¶
Defined in File url.h
Nested Relationships¶
This struct is a nested type of Template Struct url_data_.
Struct url_data_::port_t¶
Defined in File url.h
Nested Relationships¶
This struct is a nested type of Template Struct url_data_.
Struct url_data_::protocol_t¶
Defined in File url.h
Nested Relationships¶
This struct is a nested type of Template Struct url_data_.
Struct url_data_::query_t¶
Defined in File url.h
Nested Relationships¶
This struct is a nested type of Template Struct url_data_.
Struct url_data_::target_t¶
Defined in File url.h
Nested Relationships¶
This struct is a nested type of Template Struct url_data_.
Struct http_error¶
Defined in File page.h
Struct Documentation¶
-
struct
udho::exceptions
::
http_error
: public exception¶ throw HTTP error exception in order to send a HTTP response other than 200 OK. Uncaught exceptions are presented as html page with routing sumary
http_error(boost::beast::http::status::notfound)
Public Types
-
typedef boost::beast::http::header<false>
headers_type
¶
Public Functions
-
http_error
(boost::beast::http::status status, const std::string &message = "")¶
-
void
add_header
(boost::beast::http::field key, const std::string &value)¶
-
void
redirect
(const std::string &url)¶
-
template<typename
T
>
boost::beast::http::response<boost::beast::http::string_body>response
(const boost::beast::http::request<T> &request) const¶
-
template<typename
AuxT
, typenameU
, typenameV
>
boost::beast::http::response<boost::beast::http::string_body>response
(const udho::context<AuxT, U, V> &ctx) const¶
-
template<typename
T
, typenameRouterT
>
boost::beast::http::response<boost::beast::http::string_body>response
(const boost::beast::http::request<T> &request, RouterT &router) const¶
-
template<typename
AuxT
, typenameU
, typenameV
, typenameRouterT
>
boost::beast::http::response<boost::beast::http::string_body>response
(const udho::context<AuxT, U, V> &ctx, RouterT &router) const¶
-
std::string
page
(const std::string &target, std::string content = "") const¶
-
const char *
what
() const noexcept¶
-
boost::beast::http::status
result
() const¶
-
typedef boost::beast::http::header<false>
Template Struct field¶
Defined in File form.hxx
Template Struct field< T, false >¶
Defined in File form.hxx
Inheritance Relationships¶
public udho::field_common
(Struct field_common)public udho::field_value_extractor< T >
(Template Struct field_value_extractor)
Struct Documentation¶
-
template<typename
T
>
structudho
::
field
<T, false> : public udho::field_common, public udho::field_value_extractor<T>¶ Public Types
-
typedef field_common
common_type
¶
-
typedef boost::function<bool(const std::string&, std::string&)>
function_type
¶
-
typedef field_value_extractor<T>
extractor_type
¶
-
typedef std::vector<function_type>
validators_collection_type
¶
-
typedef field_common
Template Struct field< T, true >¶
Defined in File form.hxx
Inheritance Relationships¶
public udho::field_common
(Struct field_common)public udho::field_value_extractor< T >
(Template Struct field_value_extractor)
Struct Documentation¶
-
template<typename
T
>
structudho
::
field
<T, true> : public udho::field_common, public udho::field_value_extractor<T>¶ Public Types
-
typedef field_common
common_type
¶
-
typedef boost::function<bool(const std::string&, std::string&)>
function_type
¶
-
typedef field_value_extractor<T>
extractor_type
¶
-
typedef std::vector<function_type>
validators_collection_type
¶
-
typedef field_common
Struct field_common¶
Defined in File form.hxx
Inheritance Relationships¶
public udho::prepare< field_common >
(Template Struct prepare)
public udho::field< T, false >
(Template Struct field< T, false >)public udho::field< T, true >
(Template Struct field< T, true >)
Struct Documentation¶
-
struct
udho
::
field_common
: public udho::prepare<field_common>¶ common meta parameters of a form field
Subclassed by udho::field< T, false >, udho::field< T, true >
Template Struct field_value_extractor¶
Defined in File form.hxx
Inheritance Relationships¶
public udho::field< T, false >
(Template Struct field< T, false >)public udho::field< T, true >
(Template Struct field< T, true >)
Struct Documentation¶
-
template<typename
T
>
structudho
::
field_value_extractor
¶ Subclassed by udho::field< T, false >, udho::field< T, true >
Public Functions
-
field_value_extractor
(const std::string &message = "Extraction Failed")¶
-
bool
operator()
(const std::string &input, value_type &value) const¶
-
std::string
message
() const¶
Public Members
-
std::string
_message
¶
-
Template Struct field_value_extractor< std::chrono::time_point< std::chrono::system_clock, std::chrono::microseconds > >¶
Defined in File form.hxx
Struct Documentation¶
-
template<>
structudho
::
field_value_extractor
<std::chrono::time_point<std::chrono::system_clock, std::chrono::microseconds>>¶ Public Types
-
typedef std::chrono::time_point<std::chrono::system_clock, std::chrono::microseconds>
value_type
¶
Public Functions
-
field_value_extractor
(const std::string &format, const std::string &message = "Extraction Failed")¶
-
bool
operator()
(const std::string &input, value_type &value) const¶
-
std::string
message
() const¶
-
typedef std::chrono::time_point<std::chrono::system_clock, std::chrono::microseconds>
Template Struct validated¶
Defined in File form.hxx
Inheritance Relationships¶
public udho::prepare< validated< FormT > >
(Template Struct prepare)
Struct Documentation¶
-
template<typename
FormT
= void>
structudho::form
::
validated
: public udho::prepare<validated<FormT>>¶ Public Types
Public Functions
-
void
add
(const field_common &fld)¶
-
bool
valid
() const¶
-
const std::vector<std::string> &
errors
() const¶
-
const field_common &
operator[]
(const std::string &name) const¶
-
void
Template Struct validated< void >¶
Defined in File form.hxx
Inheritance Relationships¶
public udho::prepare< validated< void > >
(Template Struct prepare)
Struct Documentation¶
-
template<>
structudho::form
::
validated
<void> : public udho::prepare<validated<void>>¶ -
Public Functions
-
validated
()¶
-
void
add
(const field_common &fld)¶
-
bool
valid
() const¶
-
const std::vector<std::string> &
errors
() const¶
-
const field_common &
operator[]
(const std::string &name) const¶
Public Members
-
bool
_submitted
¶
-
bool
_valid
¶
-
std::vector<std::string>
_errors
¶
-
std::map<std::string, field_common>
_fields
¶
-
Struct date_time¶
Defined in File form.hxx
Struct exact_length¶
Defined in File form.hxx
Struct max_length¶
Defined in File form.hxx
Struct min_length¶
Defined in File form.hxx
Template Struct form_¶
Defined in File form.hxx
Struct Documentation¶
-
template<typename
RequestT
>
structudho
::
form_
¶ unified form accessor that can extract field from both urlencoded as well as multipart forms.
Public Types
-
typedef request_type::body_type::value_type
body_type
¶
-
typedef std::map<std::string, std::string>
fields_map_type
¶
Public Functions
-
form_
(const request_type &request)¶
-
void
parse_urlencoded
()¶ parse the beast request body as urlencoded form data
-
void
parse_multipart
()¶ parse the beast request body as multipart form data
-
bool
is_urlencoded
() const¶ check whether the submitted form is urlencoded
-
bool
is_multipart
() const¶ check whether the submitted form is multipart
-
const urlencoded_form<std::string::const_iterator> &
urlencoded
() const¶ return the urlencoded specific form accessor
-
const multipart_form<std::string::const_iterator> &
multipart
() const¶ return the multipart specific form accessor
-
bool
parsed
() const¶ returns true once the form is parsed
-
bool
has
(const std::string &name) const¶ checks whether the form contains any field with matching name
- Parameters
name
: name of the form field
-
template<typename
V
>
Vfield
(const std::string &name) const¶ returns a form field object for a given field
-
fields_map_type::size_type
count
() const¶ returns number of fields in the form
Public Members
-
const request_type &
_request
¶
-
urlencoded_form<std::string::const_iterator>
_urlencoded
¶
-
multipart_form<std::string::const_iterator>
_multipart
¶
-
typedef request_type::body_type::value_type
Struct accumulated¶
Defined in File forms.h
Inheritance Relationships¶
public udho::prepare< accumulated >
(Template Struct prepare)
public udho::forms::validated< form< DriverT > >
(Template Struct validated< form< DriverT > >)
Struct Documentation¶
-
struct
udho::forms
::
accumulated
: public udho::prepare<accumulated>¶ Subclassed by udho::forms::validated< form< DriverT > >
Public Functions
-
accumulated
()¶
-
template<typename
ValidatorT
, typenameTailT
>
self_type &add
(const detail::constrained_field<ValidatorT, TailT> &cf)¶
-
self_type &
add
(const detail::field_common &common)¶
-
bool
valid
() const¶
-
void
add_error
(const std::string &err)¶
-
const std::vector<std::string> &
errors
() const¶
-
const detail::field_common &
operator[]
(const std::string &name) const¶
-
Struct all_digits¶
Defined in File forms.h
Inheritance Relationships¶
public udho::forms::constraints::basic_constrain< all_digits >
(Template Struct basic_constrain)
Struct Documentation¶
-
struct
udho::forms::constraints
::
all_digits
: public udho::forms::constraints::basic_constrain<all_digits>¶ Public Types
-
typedef basic_constrain<all_digits>
base
¶
-
typedef basic_constrain<all_digits>
Template Struct basic_constrain¶
Defined in File forms.h
Struct Documentation¶
-
template<typename
DerivedT
>
structudho::forms::constraints
::
basic_constrain
¶ -
Public Functions
-
basic_constrain
(const std::string &m)¶
-
derived_type &
self
()¶
-
derived_type &
error
(const std::string &m)¶
-
derived_type &
message
(const std::string &m)¶
-
const std::string &
message
() const¶
-
Template Struct eq¶
Defined in File forms.h
Inheritance Relationships¶
public udho::forms::constraints::basic_constrain< eq< T > >
(Template Struct basic_constrain)
Struct Documentation¶
Template Struct gt¶
Defined in File forms.h
Inheritance Relationships¶
public udho::forms::constraints::basic_constrain< gt< T > >
(Template Struct basic_constrain)
Struct Documentation¶
Template Struct gt< std::string >¶
Defined in File forms.h
Inheritance Relationships¶
public udho::forms::constraints::basic_constrain< gt< std::string > >
(Template Struct basic_constrain)
Struct Documentation¶
-
template<>
structudho::forms::constraints
::
gt
<std::string> : public udho::forms::constraints::basic_constrain<gt<std::string>>¶ Public Types
-
typedef basic_constrain<gt<std::string>>
base
¶
Public Functions
-
gt
(const std::size_t &value, const std::string &message = "")¶
-
bool
operator()
(const std::string &input) const¶
Public Members
-
std::size_t
_value
¶
-
typedef basic_constrain<gt<std::string>>
Template Struct gte¶
Defined in File forms.h
Inheritance Relationships¶
public udho::forms::constraints::basic_constrain< gte< T > >
(Template Struct basic_constrain)
Struct Documentation¶
Template Struct gte< std::string >¶
Defined in File forms.h
Inheritance Relationships¶
public udho::forms::constraints::basic_constrain< gte< std::string > >
(Template Struct basic_constrain)
Struct Documentation¶
-
template<>
structudho::forms::constraints
::
gte
<std::string> : public udho::forms::constraints::basic_constrain<gte<std::string>>¶ Public Types
-
typedef basic_constrain<gte<std::string>>
base
¶
Public Functions
-
gte
(const std::size_t &value, const std::string &message = "")¶
-
bool
operator()
(const std::string &input) const¶
Public Members
-
std::size_t
_value
¶
-
typedef basic_constrain<gte<std::string>>
Template Struct in¶
Defined in File forms.h
Inheritance Relationships¶
public udho::forms::constraints::basic_constrain< in< T > >
(Template Struct basic_constrain)
Struct Documentation¶
-
template<typename
T
>
structudho::forms::constraints
::
in
: public udho::forms::constraints::basic_constrain<in<T>>¶ Public Types
-
typedef basic_constrain<in<T>>
base
¶
Public Functions
-
typedef basic_constrain<in<T>>
Struct length_eq¶
Defined in File forms.h
Inheritance Relationships¶
public udho::forms::constraints::basic_constrain< length_eq >
(Template Struct basic_constrain)
Struct Documentation¶
-
struct
udho::forms::constraints
::
length_eq
: public udho::forms::constraints::basic_constrain<length_eq>¶ Public Types
-
typedef basic_constrain<length_eq>
base
¶
Public Functions
-
length_eq
(std::size_t length, std::string message = "")¶
-
bool
operator()
(const std::string &value) const¶
Public Members
-
std::size_t
_length
¶
-
typedef basic_constrain<length_eq>
Template Struct lt¶
Defined in File forms.h
Inheritance Relationships¶
public udho::forms::constraints::basic_constrain< lt< T > >
(Template Struct basic_constrain)
Struct Documentation¶
Template Struct lt< std::string >¶
Defined in File forms.h
Inheritance Relationships¶
public udho::forms::constraints::basic_constrain< lt< std::string > >
(Template Struct basic_constrain)
Struct Documentation¶
-
template<>
structudho::forms::constraints
::
lt
<std::string> : public udho::forms::constraints::basic_constrain<lt<std::string>>¶ Public Types
-
typedef basic_constrain<lt<std::string>>
base
¶
Public Functions
-
lt
(const std::size_t &value, const std::string &message = "")¶
-
bool
operator()
(const std::string &input) const¶
Public Members
-
std::size_t
_value
¶
-
typedef basic_constrain<lt<std::string>>
Template Struct lte¶
Defined in File forms.h
Inheritance Relationships¶
public udho::forms::constraints::basic_constrain< lte< T > >
(Template Struct basic_constrain)
Struct Documentation¶
Template Struct lte< std::string >¶
Defined in File forms.h
Inheritance Relationships¶
public udho::forms::constraints::basic_constrain< lte< std::string > >
(Template Struct basic_constrain)
Struct Documentation¶
-
template<>
structudho::forms::constraints
::
lte
<std::string> : public udho::forms::constraints::basic_constrain<lte<std::string>>¶ Public Types
-
typedef basic_constrain<lte<std::string>>
base
¶
Public Functions
-
lte
(const std::size_t &value, const std::string &message = "")¶
-
bool
operator()
(const std::string &input) const¶
Public Members
-
std::size_t
_value
¶
-
typedef basic_constrain<lte<std::string>>
Template Struct neq¶
Defined in File forms.h
Inheritance Relationships¶
public udho::forms::constraints::basic_constrain< neq< T > >
(Template Struct basic_constrain)
Struct Documentation¶
Struct no_space¶
Defined in File forms.h
Inheritance Relationships¶
public udho::forms::constraints::basic_constrain< no_space >
(Template Struct basic_constrain)
Struct Documentation¶
-
struct
udho::forms::constraints
::
no_space
: public udho::forms::constraints::basic_constrain<no_space>¶ Public Types
-
typedef basic_constrain<no_space>
base
¶
-
typedef basic_constrain<no_space>
Template Struct deserializer¶
Defined in File forms.h
Template Struct deserializer< std::chrono::time_point< std::chrono::system_clock, DurationT >, std::string >¶
Defined in File forms.h
Struct Documentation¶
-
template<typename
DurationT
>
structudho::forms
::
deserializer
<std::chrono::time_point<std::chrono::system_clock, DurationT>, std::string>¶ -
Public Static Functions
-
bool
check
(const std::string &input, const std::string &format = default_datetime_format)¶
-
time_type
deserialize
(const std::string &input, const std::string &format = default_datetime_format)¶
-
bool
Template Struct deserializer< std::string, std::chrono::time_point< std::chrono::system_clock, DurationT > >¶
Defined in File forms.h
Struct Documentation¶
-
template<typename
DurationT
>
structudho::forms
::
deserializer
<std::string, std::chrono::time_point<std::chrono::system_clock, DurationT>>¶ -
Public Static Functions
-
bool
check
(const std::chrono::time_point<std::chrono::system_clock, DurationT> &input, const std::string &format = default_datetime_format)¶
-
std::string
deserialize
(const std::chrono::time_point<std::chrono::system_clock, DurationT> &input, const std::string &format = default_datetime_format)¶
-
bool
Template Struct basic_field¶
Defined in File forms.h
Inheritance Relationships¶
public udho::forms::detail::field_data< ValueT >
(Template Struct field_data)
Struct Documentation¶
-
template<typename
ValueT
, typenameDerivedT
>
structudho::forms::detail
::
basic_field
: public udho::forms::detail::field_data<ValueT>¶ Public Types
-
typedef field_data<ValueT>
data_type
¶
Public Functions
-
basic_field
(const std::string &name)¶
-
derived_type &
absent
(const std::string &message)¶
-
derived_type &
unparsable
(const std::string &message)¶
-
template<typename
ValidatorT
>
detail::constrained_field<ValidatorT, derived_type>constrain
(const ValidatorT &validator)¶
-
template<template<typename> class
ValidatorT
, typename ...ArgsT
>
detail::constrained_field<ValidatorT<value_type>, derived_type>constrain
(ArgsT&&... args)¶
Protected Functions
-
template<typename
ValidatorT
>
boolvalidate
(const ValidatorT &validator)¶
-
derived_type &
self
()¶
-
const derived_type &
self
() const¶
-
typedef field_data<ValueT>
Template Struct constrained_field¶
Defined in File forms.h
Struct Documentation¶
-
template<typename
ValidatorT
, typenameFieldT
>
structudho::forms::detail
::
constrained_field
¶ Public Types
-
typedef field_type::value_type
value_type
¶
-
typedef ValidatorT
validator_type
¶
-
typedef constrained_field<validator_type, field_type>
self_type
¶
Public Functions
-
constrained_field
(const validator_type &validator, const FieldT &field)¶
-
const field_type &
field
() const¶
-
field_type &
field
()¶
-
bool
valid
() const¶
-
value_type
value
() const¶
-
std::string
message
() const¶
-
value_type
operator*
() const¶
-
bool
operator!
() const¶
-
std::string
name
() const¶
-
template<typename
ValidatorU
>
detail::constrained_field<ValidatorU, self_type>constrain
(const ValidatorU &validator)¶
-
template<template<typename> class
ValidatorU
, typename ...ArgsT
>
detail::constrained_field<ValidatorU<value_type>, self_type>constrain
(ArgsT&&... args)¶
-
template<unsigned
Depth
>
udho::forms::detail::constraint_visitor<self_type, Depth>::validator_type &constrain
()¶
-
typedef field_type::value_type
Template Struct constrained_field< ValidatorT, constrained_field< T… > >¶
Defined in File forms.h
Struct Documentation¶
-
template<typename
ValidatorT
, typename ...T
>
structudho::forms::detail
::
constrained_field
<ValidatorT, constrained_field<T...>>¶ Public Types
-
typedef constrained_field<T...>
head_type
¶
-
typedef field_type::value_type
value_type
¶
-
typedef ValidatorT
validator_type
¶
-
typedef constrained_field<validator_type, head_type>
self_type
¶
Public Functions
-
constrained_field
(const validator_type &validator, const head_type &head)¶
-
field_type &
field
()¶
-
const field_type &
field
() const¶
-
bool
valid
() const¶
-
value_type
value
() const¶
-
std::string
message
() const¶
-
value_type
operator*
() const¶
-
bool
operator!
() const¶
-
std::string
name
() const¶
-
template<typename
ValidatorU
>
detail::constrained_field<ValidatorU, self_type>constrain
(const ValidatorU &validator)¶
-
template<template<typename> class
ValidatorU
, typename ...ArgsT
>
detail::constrained_field<ValidatorU<value_type>, self_type>constrain
(ArgsT&&... args)¶
-
template<unsigned
Depth
>
udho::forms::detail::constraint_visitor<self_type, Depth>::validator_type &constrain
()¶
-
typedef constrained_field<T...>
Template Struct constraint_visitor_¶
Defined in File forms.h
Struct Documentation¶
-
template<typename
ConstrainedFieldT
, unsignedDepth
>
structudho::forms::detail
::
constraint_visitor_
¶ Public Types
-
typedef constraint_visitor_<typename ConstrainedFieldT::head_type, Depth - 1>::validator_type
validator_type
¶
Public Static Functions
-
validator_type &
validator
(ConstrainedFieldT &cf)¶
-
typedef constraint_visitor_<typename ConstrainedFieldT::head_type, Depth - 1>::validator_type
Template Struct constraint_visitor_< ConstrainedFieldT, 0 >¶
Defined in File forms.h
Struct Documentation¶
-
template<typename
ConstrainedFieldT
>
structudho::forms::detail
::
constraint_visitor_
<ConstrainedFieldT, 0>¶ Public Types
-
typedef ConstrainedFieldT::validator_type
validator_type
¶
Public Static Functions
-
validator_type &
validator
(ConstrainedFieldT &cf)¶
-
typedef ConstrainedFieldT::validator_type
Struct field_common¶
Defined in File forms.h
Inheritance Relationships¶
public udho::prepare< field_common >
(Template Struct prepare)
public udho::forms::detail::field_data< std::chrono::time_point< std::chrono::system_clock, DurationT > >
(Template Struct field_data)public udho::forms::detail::field_data< T >
(Template Struct field_data)public udho::forms::detail::field_data< ValueT >
(Template Struct field_data)
Struct Documentation¶
-
struct
udho::forms::detail
::
field_common
: public udho::prepare<field_common>¶ Subclassed by udho::forms::detail::field_data< std::chrono::time_point< std::chrono::system_clock, DurationT > >, udho::forms::detail::field_data< T >, udho::forms::detail::field_data< ValueT >
Public Functions
-
field_common
(const std::string &name)¶
-
bool
absent
() const¶
-
bool
unparsable
() const¶
-
bool
fetched
() const¶
-
const std::string &
name
() const¶
-
std::string
value_serialized
() const¶
-
bool
valid
() const¶
-
const std::string &
message
() const¶
-
const std::string &
error
() const¶
-
bool
operator!
() const¶
-
Template Struct field_data¶
Defined in File forms.h
Inheritance Relationships¶
public udho::forms::detail::field_common
(Struct field_common)
public udho::forms::detail::basic_field< ValueT, DerivedT >
(Template Struct basic_field)
Struct Documentation¶
-
template<typename
ValueT
>
structudho::forms::detail
::
field_data
: public udho::forms::detail::field_common¶ Subclassed by udho::forms::detail::basic_field< ValueT, DerivedT >
Public Functions
-
const value_type &
value
() const¶
-
const value_type &
operator*
() const¶
-
template<typename ...
ArgsT
>
voidvalue
(const value_type &v, const ArgsT&... args)¶
-
field_common &
common
()¶
-
const field_common &
common
() const¶
-
const value_type &
Template Struct combo¶
Defined in File forms.h
Inheritance Relationships¶
private udho::forms::drivers::urlencoded_< RequestT::body_type::value_type::const_iterator >
(Template Struct urlencoded_)private udho::forms::drivers::multipart_< RequestT::body_type::value_type::const_iterator >
(Template Struct multipart_)
Struct Documentation¶
-
template<typename
RequestT
>
structudho::forms::drivers
::
combo
: private udho::forms::drivers::urlencoded_<RequestT::body_type::value_type::const_iterator>, private udho::forms::drivers::multipart_<RequestT::body_type::value_type::const_iterator>¶ Public Types
-
typedef urlencoded_<typename request_type::body_type::value_type::const_iterator>
urlencoded_type
¶
-
typedef multipart_<typename request_type::body_type::value_type::const_iterator>
multipart_type
¶
-
typedef request_type::body_type::value_type
body_type
¶
Public Functions
-
combo
(const request_type &request)¶
-
void
parse_urlencoded
()¶ parse the beast request body as urlencoded form data
-
void
parse_multipart
()¶ parse the beast request body as multipart form data
-
bool
is_urlencoded
() const¶ check whether the submitted form is urlencoded
-
bool
is_multipart
() const¶ check whether the submitted form is multipart
-
const urlencoded_type &
urlencoded
() const
-
const multipart_type &
multipart
() const return the multipart specific form accessor
-
bool
empty
(const std::string name) const¶ checks whether the value for the field is empty
-
bool
exists
(const std::string name) const¶ checks whether there exists any field with the name provided
-
typedef urlencoded_<typename request_type::body_type::value_type::const_iterator>
Template Struct extract_multipart_boundary¶
Defined in File forms.h
Template Struct multipart¶
Defined in File forms.h
Inheritance Relationships¶
public udho::forms::drivers::multipart_< RequestT::body_type::value_type::const_iterator >
(Template Struct multipart_)
Struct Documentation¶
-
template<typename
RequestT
>
structudho::forms::drivers
::
multipart
: public udho::forms::drivers::multipart_<RequestT::body_type::value_type::const_iterator>¶ Public Types
-
typedef request_type::body_type::value_type
body_type
¶
-
typedef multipart_<typename request_type::body_type::value_type::const_iterator>
multipart_type
¶
Public Functions
-
multipart
(const request_type &request)¶
Public Members
-
const request_type &
_request
¶
-
typedef request_type::body_type::value_type
Template Struct multipart_¶
Defined in File forms.h
Struct Documentation¶
-
template<typename
Iterator
= std::string::const_iterator>
structudho::forms::drivers
::
multipart_
¶ Form accessor for multipart forms
Public Types
-
typedef std::iterator_traits<iterator_type>::value_type
value_type
¶
-
typedef std::basic_string<value_type>
string_type
¶
-
typedef bounded_str<iterator_type>
bounded_string_type
¶
-
typedef std::map<string_type, bounded_string_type>
header_map_type
¶
-
typedef bounded_string_type
bounded_string
¶
Public Functions
-
void
parse
(const std::string &boundary, iterator_type begin, iterator_type end)¶
-
void
parse_part
(iterator_type begin, iterator_type end)¶
-
std::size_t
count
() const¶ number of fields in the form
-
bool
exists
(const std::string name) const¶ checks whether the form has any field with the given name
-
bool
empty
(const std::string name) const¶
-
const form_part &
part
(const std::string &name) const¶ returns the part associated with the given name
-
struct
form_part
¶ A part in the multipart form data
Public Functions
-
form_part
(iterator_type begin, iterator_type end)¶
-
void
set_header
(const header_map_type &headers)¶
-
const bounded_string_type &
header
(const std::string &key) const¶ returns the value associated with the key in the header of the part
header("Content-Disposition").copied<std::string>();
-
bounded_string_type
header
(const std::string &key, const std::string &sub) const¶ returns the value associated with the key and sub key in the header of the part
header("Content-Disposition", "name").copied<std::string>();
-
bounded_string_type
name
() const¶ name of the part
name().copied<std::string>();
-
bounded_string_type
filename
() const¶ filename of the part
name().copied<std::string>();
-
const bounded_string_type &
body
() const¶ body of the part returned as a pair of string iterators
body().copied<std::string>();
-
std::string
str
() const¶ returns the body of the part as string
-
template<typename
T
, typenameParserT
= udho::forms::parser<T>, typename ...ArgsT
>
boolparsable
(const ArgsT&... args) const¶
-
bool
empty
() const¶
-
-
typedef std::iterator_traits<iterator_type>::value_type
Struct multipart_::form_part¶
Defined in File forms.h
Nested Relationships¶
This struct is a nested type of Template Struct multipart_.
Struct Documentation¶
-
struct
udho::forms::drivers::multipart_
::
form_part
¶ A part in the multipart form data
Public Functions
-
form_part
(iterator_type begin, iterator_type end)¶
-
void
set_header
(const header_map_type &headers)¶
-
const bounded_string_type &
header
(const std::string &key) const¶ returns the value associated with the key in the header of the part
header("Content-Disposition").copied<std::string>();
-
bounded_string_type
header
(const std::string &key, const std::string &sub) const¶ returns the value associated with the key and sub key in the header of the part
header("Content-Disposition", "name").copied<std::string>();
-
bounded_string_type
name
() const¶ name of the part
name().copied<std::string>();
-
bounded_string_type
filename
() const¶ filename of the part
name().copied<std::string>();
-
const bounded_string_type &
body
() const¶ body of the part returned as a pair of string iterators
body().copied<std::string>();
-
std::string
str
() const¶ returns the body of the part as string
-
template<typename
T
, typenameParserT
= udho::forms::parser<T>, typename ...ArgsT
>
boolparsable
(const ArgsT&... args) const¶
-
bool
empty
() const¶
-
Template Struct urlencoded¶
Defined in File forms.h
Inheritance Relationships¶
public udho::forms::drivers::urlencoded_< RequestT::body_type::value_type::const_iterator >
(Template Struct urlencoded_)
Struct Documentation¶
-
template<typename
RequestT
>
structudho::forms::drivers
::
urlencoded
: public udho::forms::drivers::urlencoded_<RequestT::body_type::value_type::const_iterator>¶ Public Types
-
typedef request_type::body_type::value_type
body_type
¶
-
typedef urlencoded_<typename request_type::body_type::value_type::const_iterator>
urlencoded_type
¶
Public Functions
-
urlencoded
(const request_type &request)¶
Public Members
-
const request_type &
_request
¶
-
typedef request_type::body_type::value_type
Template Struct urlencoded_¶
Defined in File forms.h
Inheritance Relationships¶
public udho::url
(Struct url)
Struct Documentation¶
-
template<typename
Iterator
= std::string::const_iterator>
structudho::forms::drivers
::
urlencoded_
¶ Form driver for urlencoded forms
Subclassed by udho::url
Public Types
-
typedef std::iterator_traits<iterator_type>::value_type
value_type
¶
-
typedef std::basic_string<value_type>
string_type
¶
-
typedef bounded_str<iterator_type>
bounded_string_type
¶
-
typedef std::map<string_type, bounded_string_type>
header_map_type
¶
-
typedef bounded_string_type
bounded_string
¶
Public Functions
-
void
parse
(iterator_type begin, iterator_type end)¶
-
bool
empty
(const std::string &name) const¶ checks whether the value for the field is empty
-
bool
exists
(const std::string &name) const¶ checks whether there exists any field with the name provided
-
typedef std::iterator_traits<iterator_type>::value_type
Template Struct field¶
Defined in File forms.h
Template Struct field< std::chrono::time_point< std::chrono::system_clock, DurationT >, false >¶
Defined in File forms.h
Inheritance Relationships¶
public udho::forms::detail::basic_field< std::chrono::time_point< std::chrono::system_clock, DurationT >, field< std::chrono::time_point< std::chrono::system_clock, DurationT >, false > >
(Template Struct basic_field)
Struct Documentation¶
-
template<typename
DurationT
>
structudho::forms
::
field
<std::chrono::time_point<std::chrono::system_clock, DurationT>, false> : public udho::forms::detail::basic_field<std::chrono::time_point<std::chrono::system_clock, DurationT>, field<std::chrono::time_point<std::chrono::system_clock, DurationT>, false>>¶ Public Types
-
typedef detail::basic_field<std::chrono::time_point<std::chrono::system_clock, DurationT>, field<std::chrono::time_point<std::chrono::system_clock, DurationT>, false>>
base
¶
Public Functions
-
field
(const std::string &name, const std::string &format = default_datetime_format, const value_type &def = value_type())¶
-
const value_type &
def
() const¶
-
template<typename
FormT
, typenameValidatorT
>
boolvalidate
(const FormT &form, const ValidatorT &validator)¶
Public Members
-
std::string
_format
¶
Protected Attributes
-
value_type
_def
¶
-
typedef detail::basic_field<std::chrono::time_point<std::chrono::system_clock, DurationT>, field<std::chrono::time_point<std::chrono::system_clock, DurationT>, false>>
Template Struct field< std::chrono::time_point< std::chrono::system_clock, DurationT >, true >¶
Defined in File forms.h
Inheritance Relationships¶
public udho::forms::detail::basic_field< std::chrono::time_point< std::chrono::system_clock, DurationT >, field< std::chrono::time_point< std::chrono::system_clock, DurationT >, true > >
(Template Struct basic_field)
Struct Documentation¶
-
template<typename
DurationT
>
structudho::forms
::
field
<std::chrono::time_point<std::chrono::system_clock, DurationT>, true> : public udho::forms::detail::basic_field<std::chrono::time_point<std::chrono::system_clock, DurationT>, field<std::chrono::time_point<std::chrono::system_clock, DurationT>, true>>¶ Public Types
-
typedef detail::basic_field<std::chrono::time_point<std::chrono::system_clock, DurationT>, field<std::chrono::time_point<std::chrono::system_clock, DurationT>, true>>
base
¶
Public Functions
-
field
(const std::string &name, const std::string &format = default_datetime_format)¶
-
template<typename
FormT
, typenameValidatorT
>
boolvalidate
(const FormT &form, const ValidatorT &validator)¶
Public Members
-
std::string
_format
¶
-
typedef detail::basic_field<std::chrono::time_point<std::chrono::system_clock, DurationT>, field<std::chrono::time_point<std::chrono::system_clock, DurationT>, true>>
Template Struct field< T, false >¶
Defined in File forms.h
Inheritance Relationships¶
public udho::forms::detail::basic_field< T, field< T, false > >
(Template Struct basic_field)
Struct Documentation¶
-
template<typename
T
>
structudho::forms
::
field
<T, false> : public udho::forms::detail::basic_field<T, field<T, false>>¶ Public Types
-
typedef detail::basic_field<T, field<T, false>>
base
¶
Public Functions
-
field
(const std::string &name, const value_type &def = value_type())¶
-
const value_type &
def
() const¶
-
template<typename
FormT
, typenameValidatorT
>
boolvalidate
(const FormT &form, const ValidatorT &validator)¶
Protected Attributes
-
value_type
_def
¶
-
typedef detail::basic_field<T, field<T, false>>
Template Struct field< T, true >¶
Defined in File forms.h
Inheritance Relationships¶
public udho::forms::detail::basic_field< T, field< T, true > >
(Template Struct basic_field)
Struct Documentation¶
Template Struct form¶
Defined in File forms.h
Struct Documentation¶
-
template<typename
DriverT
>
structudho::forms
::
form
: public DriverT¶ Public Functions
-
bool
has
(const std::string &name) const¶
-
template<typename
T
, typenameParserT
= udho::forms::parser<T>>
Tfield
(const std::string &name, bool *ok = 0x0) const¶
-
bool
Template Struct parser¶
Defined in File forms.h
Template Struct validated¶
Defined in File forms.h
Template Struct validated< form< DriverT > >¶
Defined in File forms.h
Inheritance Relationships¶
public udho::forms::accumulated
(Struct accumulated)
Struct Documentation¶
-
template<typename
DriverT
>
structudho::forms
::
validated
<form<DriverT>> : public udho::forms::accumulated¶
Template Struct arg_to_tuple¶
Defined in File router.h
Template Struct bind_first¶
Defined in File util.h
Template Struct bind_first< boost::function< R(Args…)> >¶
Defined in File util.h
Struct Documentation¶
-
template<typename
R
, typename ...Args
>
structudho::internal
::
bind_first
<boost::function<R(Args...)>>¶ Public Types
-
typedef reducer_type::object_type
object_type
¶
-
typedef reducer_type::function_type
reduced_function_type
¶
Public Functions
-
bind_first
(object_type that, base_function_type base)¶
-
reduced_function_type
reduced
()¶
-
typedef reducer_type::object_type
Template Struct callable1¶
Defined in File router.h
Template Struct function_signature¶
Defined in File router.h
Template Struct function_signature< boost::function< R(Args…)> >¶
Defined in File router.h
Template Struct function_signature< R(*)(Args…)>¶
Defined in File router.h
Template Struct member_¶
Defined in File util.h
Template Struct member_< R C::* >¶
Defined in File util.h
Struct Documentation¶
-
template<typename
R
, typenameC
>
structudho::internal
::
member_
<R C::*>¶ Public Types
-
RC::* actual_function_type
-
typedef bind_first<const_base_function_type>
const_binder_type
¶
-
typedef const_binder_type::object_type
object_type
¶
-
typedef const_binder_type::reduced_function_type
const_reduced_function_type
¶
Public Functions
-
member_
(actual_function_type function)¶
-
const_reduced_function_type
reduced
(const C *that)¶
Public Members
-
const_base_function_type
_function
¶
-
Template Struct reduced_¶
Defined in File util.h
Template Struct reduced_< R(C::*)(Args…) const >¶
Defined in File util.h
Struct Documentation¶
-
template<typename
R
, typenameC
, typename ...Args
>
structudho::internal
::
reduced_
<R (C::*)(Args...) const>¶ Public Types
-
typedef bind_first<base_function_type>
binder_type
¶
-
typedef const binder_type::object_type
object_type
¶
-
typedef binder_type::reduced_function_type
reduced_function_type
¶
Public Functions
-
reduced_
(actual_function_type function)¶
-
reduced_function_type
reduced
(const C *that)¶
Public Members
-
base_function_type
_function
¶
-
typedef bind_first<base_function_type>
Template Struct reduced_< R(C::*)(Args…)>¶
Defined in File util.h
Struct Documentation¶
-
template<typename
R
, typenameC
, typename ...Args
>
structudho::internal
::
reduced_
<R (C::*)(Args...)>¶ Public Types
-
typedef bind_first<base_function_type>
binder_type
¶
-
typedef binder_type::object_type
object_type
¶
-
typedef binder_type::reduced_function_type
reduced_function_type
¶
Public Members
-
base_function_type
_function
¶
-
typedef bind_first<base_function_type>
Template Struct reducer¶
Defined in File util.h
Struct Documentation¶
-
template<typename
R
, typenameFirst
, typename ...Rest
>
structudho::internal
::
reducer
¶ Public Types
Public Functions
-
reducer
(object_type that, actual_function_type actual)¶
-
Template Struct plain¶
Defined in File logging.h
Template Struct message¶
Defined in File logging.h
Inheritance Relationships¶
public udho::logging::messages::formatted::message< Status >
(Template Struct message)
Struct Documentation¶
-
template<udho::logging::status
Status
>
structudho::logging
::
message
¶ A logging message
- Template Parameters
Status
:
Subclassed by udho::logging::messages::formatted::message< Status >
Public Types
-
typedef std::chrono::system_clock::time_point
time_type
¶
Public Functions
-
message
(const std::string &segment, unsigned level = 0)¶
-
message
(const std::string &segment, const std::string &content, unsigned level = 0)¶
-
std::string
what
() const¶
Template Struct message¶
Defined in File logging.h
Inheritance Relationships¶
public udho::logging::message< Status >
(Template Struct message)
Struct Documentation¶
-
template<udho::logging::status
Status
>
structudho::logging::messages::formatted
::
message
: public udho::logging::message<Status>¶ Public Types
Public Functions
-
message
(const std::string &segment, const std::string &format, unsigned level = 0)¶
-
std::string
what
() const¶
Public Members
-
boost::format
_format
¶
-
Template Struct lookup_table¶
Defined in File scope.h
Struct Documentation¶
-
template<typename
DataT
>
structlookup_table
¶ Accepts a prepared object that can be queried through string keys. Maintains a lookup table which contains aliases of such keys. So that the keys can be with both the real name as well as through the alias names. An unsigned integer depth value associated with every aliases. Based on which all aliases of some depth can be cleared. The
up
anddown
increases and decreases the value of depth.add
will add an alias with the current depth. It can be used in a scoped environment where the entering to and leaving from an inner scope will call the down and up functions respectively. Calling up will clear the aliases set in the depth below
Template Struct lookup_table< udho::prepared< DataT > >¶
Defined in File scope.h
Struct Documentation¶
-
template<typename
DataT
>
structudho
::
lookup_table
<udho::prepared<DataT>>¶ Public Types
-
typedef boost::multi_index_container<declaration, boost::multi_index::indexed_by<boost::multi_index::ordered_unique<boost::multi_index::identity<declaration>>, boost::multi_index::ordered_unique<boost::multi_index::member<declaration, std::string, &declaration::_id>>, boost::multi_index::ordered_non_unique<boost::multi_index::member<declaration, std::size_t, &declaration::_depth>>>>
storage_type
¶
-
typedef storage_type::nth_index<1>::type
named_storage_type
¶
-
typedef storage_type::nth_index<2>::type
depth_storage_type
¶
Public Functions
-
lookup_table
(const prepared_type &p)¶
-
bool
valid
(const std::string &key) const¶
-
std::string
lookup
(const std::string &key) const¶
-
bool
add
(const std::string &key, const std::string &ref, std::size_t depth)¶
-
std::size_t
clear
(std::size_t depth)¶
-
std::string
eval
(const std::string &key) const¶
-
std::string
operator[]
(const std::string &key) const¶
-
std::vector<std::string>
keys
(const std::string &key) const¶
-
std::size_t
count
(const std::string &key) const¶
-
std::size_t
down
()¶
-
std::size_t
up
()¶
-
bool
add
(const std::string &key, const std::string &ref)¶
Public Members
-
const prepared_type &
_prepared
¶
-
storage_type
_storage
¶
-
named_storage_type &
_storage_named
¶
-
depth_storage_type &
_storage_depth
¶
-
std::size_t
_level
¶
-
typedef boost::multi_index_container<declaration, boost::multi_index::indexed_by<boost::multi_index::ordered_unique<boost::multi_index::identity<declaration>>, boost::multi_index::ordered_unique<boost::multi_index::member<declaration, std::string, &declaration::_id>>, boost::multi_index::ordered_non_unique<boost::multi_index::member<declaration, std::size_t, &declaration::_depth>>>>
Template Struct lookup_table< udho::prepared_group< U, V > >¶
Defined in File scope.h
Struct Documentation¶
-
template<typename
U
, typenameV
>
structudho
::
lookup_table
<udho::prepared_group<U, V>>¶ Public Types
-
typedef udho::prepared_group<U, V>
prepared_type
¶
-
typedef boost::multi_index_container<declaration, boost::multi_index::indexed_by<boost::multi_index::ordered_unique<boost::multi_index::identity<declaration>>, boost::multi_index::ordered_unique<boost::multi_index::member<declaration, std::string, &declaration::_id>>, boost::multi_index::ordered_non_unique<boost::multi_index::member<declaration, std::size_t, &declaration::_depth>>>>
storage_type
¶
-
typedef storage_type::nth_index<1>::type
named_storage_type
¶
-
typedef storage_type::nth_index<2>::type
depth_storage_type
¶
Public Functions
-
lookup_table
(const prepared_type &p)¶
-
bool
valid
(const std::string &key) const¶
-
std::string
lookup
(const std::string &key) const¶
-
bool
add
(const std::string &key, const std::string &ref, std::size_t depth)¶
-
std::size_t
clear
(std::size_t depth)¶
-
std::string
eval
(const std::string &key) const¶
-
std::string
operator[]
(const std::string &key) const¶
-
std::vector<std::string>
keys
(const std::string &key) const¶
-
std::size_t
count
(const std::string &key) const¶
-
std::size_t
down
()¶
-
std::size_t
up
()¶
-
bool
add
(const std::string &key, const std::string &ref)¶
Public Members
-
const prepared_type &
_prepared
¶
-
storage_type
_storage
¶
-
named_storage_type &
_storage_named
¶
-
depth_storage_type &
_storage_depth
¶
-
std::size_t
_level
¶
-
typedef udho::prepared_group<U, V>
Template Struct module_evaluator¶
Defined in File visitor.h
Struct Documentation¶
-
template<typename
VisitorT
, typenameModuleT
, boolIsApplication
= is_application<ModuleT>::value>
structmodule_evaluator
¶
Template Struct module_evaluator< VisitorT, ModuleT, false >¶
Defined in File visitor.h
Template Struct module_evaluator< VisitorT, ModuleT, true >¶
Defined in File visitor.h
Struct module_info¶
Defined in File util.h
Template Struct module_overload¶
Defined in File router.h
Struct Documentation¶
-
template<typename
Function
, template<typename> classCompositorT
= compositors::transparent>
structudho
::
module_overload
¶ Public Types
-
typedef module_overload<Function, CompositorT>
self_type
¶
-
typedef internal::function_signature<Function>::return_type
return_type
¶
-
typedef internal::function_signature<Function>::tuple_type
tuple_type
¶
-
typedef internal::function_signature<Function>::arguments_type
arguments_type
¶
-
typedef CompositorT<return_type>
compositor_type
¶
-
typedef compositor_type::response_type
response_type
¶
Public Functions
-
module_overload
(boost::beast::http::verb request_method, function_type f, compositor_type compositor = compositor_type())¶
-
std::string
pattern
() const¶
-
bool
feasible
(boost::beast::http::verb request_method, const std::string &subject) const¶ check number of arguments supplied on runtime and number of arguments with which this overload has been prepared at compile time.
-
template<typename
T
>
return_typecall
(T &value, const std::vector<std::string> &args)¶
-
template<typename
T
>
response_typeoperator()
(T &value, const std::vector<std::string> &args)¶
-
template<typename
T
>
response_typeoperator()
(T &value, const std::string &subject)¶
-
module_info
info
() const¶
Public Members
-
boost::beast::http::verb
_request_method
¶
-
std::string
_pattern
¶
-
function_type
_function
¶
-
compositor_type
_compositor
¶
-
typedef module_overload<Function, CompositorT>
Template Struct module_overload< Function, compositors::deferred >¶
Defined in File router.h
Struct Documentation¶
-
template<typename
Function
>
structudho
::
module_overload
<Function, compositors::deferred>¶ Public Types
-
typedef module_overload<Function, compositors::deferred>
self_type
¶
-
typedef internal::function_signature<Function>::return_type
return_type
¶
-
typedef internal::function_signature<Function>::tuple_type
tuple_type
¶
-
typedef internal::function_signature<Function>::arguments_type
arguments_type
¶
-
typedef compositors::deferred<return_type>
compositor_type
¶
-
typedef compositor_type::response_type
response_type
¶
Public Functions
-
module_overload
(boost::beast::http::verb request_method, function_type f, compositor_type compositor = compositor_type())¶
-
std::string
pattern
() const¶
-
bool
feasible
(boost::beast::http::verb request_method, const std::string &subject) const¶ check number of arguments supplied on runtime and number of arguments with which this overload has been prepared at compile time.
-
module_info
info
() const¶
Public Members
-
boost::beast::http::verb
_request_method
¶
-
std::string
_pattern
¶
-
function_type
_function
¶
-
compositor_type
_compositor
¶
-
typedef module_overload<Function, compositors::deferred>
Template Struct multipart_form¶
Defined in File form.hxx
Struct Documentation¶
-
template<typename
Iterator
>
structudho
::
multipart_form
¶ Form accessor for multipart forms
Public Types
-
typedef std::iterator_traits<iterator_type>::value_type
value_type
¶
-
typedef std::basic_string<value_type>
string_type
¶
-
typedef bounded_str<iterator_type>
bounded_string_type
¶
-
typedef std::map<string_type, bounded_string_type>
header_map_type
¶
-
typedef bounded_string_type
bounded_string
¶
Public Functions
-
void
parse
(const std::string &boundary, iterator_type begin, iterator_type end)¶
-
void
parse_part
(iterator_type begin, iterator_type end)¶
-
std::size_t
count
() const¶ number of fields in the form
-
bool
has
(const std::string name) const¶ checks whether the form has any field with the given name
-
struct
form_part
¶ A part in the multipart form data
Public Functions
-
form_part
(iterator_type begin, iterator_type end)¶
-
void
set_header
(const header_map_type &headers)¶
-
const bounded_string_type &
header
(const std::string &key) const¶ returns the value associated with the key in the header of the part
header("Content-Disposition").copied<std::string>();
-
bounded_string_type
header
(const std::string &key, const std::string &sub) const¶ returns the value associated with the key and sub key in the header of the part
header("Content-Disposition", "name").copied<std::string>();
-
bounded_string_type
name
() const¶ name of the part
name().copied<std::string>();
-
bounded_string_type
filename
() const¶ filename of the part
name().copied<std::string>();
-
const bounded_string_type &
body
() const¶ body of the part returned as a pair of string iterators
body().copied<std::string>();
-
std::string
str
() const¶ returns the body of the part as string
-
-
typedef std::iterator_traits<iterator_type>::value_type
Struct multipart_form::form_part¶
Defined in File form.hxx
Nested Relationships¶
This struct is a nested type of Template Struct multipart_form.
Struct Documentation¶
-
struct
udho::multipart_form
::
form_part
¶ A part in the multipart form data
Public Functions
-
form_part
(iterator_type begin, iterator_type end)¶
-
void
set_header
(const header_map_type &headers)¶
-
const bounded_string_type &
header
(const std::string &key) const¶ returns the value associated with the key in the header of the part
header("Content-Disposition").copied<std::string>();
-
bounded_string_type
header
(const std::string &key, const std::string &sub) const¶ returns the value associated with the key and sub key in the header of the part
header("Content-Disposition", "name").copied<std::string>();
-
bounded_string_type
name
() const¶ name of the part
name().copied<std::string>();
-
bounded_string_type
filename
() const¶ filename of the part
name().copied<std::string>();
-
const bounded_string_type &
body
() const¶ body of the part returned as a pair of string iterators
body().copied<std::string>();
-
std::string
str
() const¶ returns the body of the part as string
-
Template Struct overload_group¶
Defined in File router.h
Struct Documentation¶
-
template<typename
U
, typenameV
>
structudho
::
overload_group
¶ compile time chain of url mappings
Public Types
-
typedef overload_group<U, V>
self_type
¶ type of this overload
-
typedef parent_type::terminal_type
terminal_type
¶
Public Functions
-
overload_group
(const parent_type &parent, const overload_type &overload)¶
-
template<typename
ContextT
, typenameLambda
>
intserve
(ContextT &ctx, boost::beast::http::verb request_method, const std::string &subject, Lambda send)¶ serves the content if the http request matches with the content’s request method and path. Calls the callback in
_overload
if it is feasible for the current request. Otherwise bubbles the request meta-recursively if some other overload group is feasible.- Parameters
req
: the http request to serverequest_method
: http vmethod get post put head etc …subject
: http resource pathsend
: the write callback
-
void
summary
(std::vector<module_info> &stack) const¶
-
template<typename
AttachmentT
>
self_type &listen
(boost::asio::io_service &io, AttachmentT &attachment, int port = 9198)¶
-
const terminal_type &
terminal
() const¶
-
typedef overload_group<U, V>
Template Struct overload_group< U, app_< V, Ref > >¶
Defined in File application.h
Struct Documentation¶
-
template<typename
U
, typenameV
, boolRef
>
structudho
::
overload_group
<U, app_<V, Ref>>¶ Public Types
-
typedef parent_type::terminal_type
terminal_type
¶
Public Functions
-
overload_group
(const parent_type &parent, const overload_type &overload)¶
-
template<typename
ContextT
, typenameLambda
>
intserve
(ContextT &ctx, boost::beast::http::verb request_method, const std::string &subject, Lambda send)¶
-
void
summary
(std::vector<module_info> &stack) const¶
-
template<typename
AttachmentT
>
self_type &listen
(boost::asio::io_service &io, AttachmentT &attachment, int port = 9198)¶
-
const terminal_type &
terminal
() const¶
-
typedef parent_type::terminal_type
Template Struct overload_group< U, overload_terminal< V > >¶
Defined in File router.h
Struct Documentation¶
-
template<typename
U
, typenameV
>
structudho
::
overload_group
<U, overload_terminal<V>>¶ terminal node of the compile time chain of url mappings
Public Types
-
typedef overload_group<U, overload_terminal<V>>
self_type
¶ type of this overload
-
typedef overload_terminal<V>
terminal_type
¶
Public Functions
-
template<typename
ContextT
, typenameLambda
>
intserve
(ContextT &ctx, boost::beast::http::verb request_method, const std::string &subject, Lambda send)¶
-
void
summary
(std::vector<module_info>&) const¶
-
const terminal_type &
terminal
() const¶
Public Members
-
terminal_type
_terminal
¶
-
typedef overload_group<U, overload_terminal<V>>
Template Struct overload_group< U, overload_terminal< void > >¶
Defined in File router.h
Struct Documentation¶
-
template<typename
U
>
structudho
::
overload_group
<U, overload_terminal<void>>¶ Public Types
-
typedef overload_group<U, overload_terminal<void>>
self_type
¶ type of this overload
-
typedef void
overload_type
¶ type of parent in the overoad meta-chain
-
typedef overload_terminal<void>
terminal_type
¶
Public Functions
-
template<typename
ContextT
, typenameLambda
>
intserve
(ContextT&, boost::beast::http::verb, const std::string&, Lambda)¶
-
void
summary
(std::vector<module_info>&) const¶
-
const terminal_type &
terminal
() const¶
Public Members
-
terminal_type
_terminal
¶
-
typedef overload_group<U, overload_terminal<void>>
Template Struct overload_group_helper< OverloadT, void >¶
Defined in File router.h
Struct Documentation¶
Template Struct prepare¶
Defined in File access.h
Template Struct prepared¶
Defined in File access.h
Struct Documentation¶
-
template<typename
T
, boolIsPrepared
= detail::is_prepared<T>::value>
structprepared
¶ prepared<T> keeps a copy of the string based index returned by the T::index() function and const references the actual data object of type T. It also instantiates a visitor for travarsing that data object and extracting the values.
Template Struct prepared< T, true >¶
Defined in File access.h
Struct Documentation¶
-
template<typename
T
>
structudho
::
prepared
<T, true>¶ Public Types
-
typedef std::result_of<decltype(&derived_type::index)(const derived_type*)>::type
index_type
¶
-
typedef detail::association_group_visitor<index_type>
visitor_type
¶
Public Functions
-
prepared
(const derived_type &data)¶
-
prepared
(const prepared<T, true> &other)¶ a visitor keeps a reference to the index, So while copy constructing if the other object is going to be destructed then the copied visitor will have a dangling reference to the other._index hence the copy constructor instantiates a visitor again from the copied index
-
std::string
stringify
(const std::string &key, bool *okay = 0x0) const¶
-
std::string
operator[]
(const std::string &key) const¶
-
std::size_t
count
(const std::string &key) const¶
-
std::vector<std::string>
keys
(const std::string &key) const¶
-
typedef std::result_of<decltype(&derived_type::index)(const derived_type*)>::type
Template Struct prepared_group¶
Defined in File access.h
Struct Documentation¶
-
template<typename
H
, typenameT
= void>
structudho
::
prepared_group
¶ Fold expression containing multiple prepared objects. Head is always type of udho::prepared<X> where X subclasses from udho::prepare<X> Tail is another prepared_group The actual prepared object is copied so it works even if the actual prepared object is an rvalue
Template Struct prepared_group< H, void >¶
Defined in File access.h
Struct Documentation¶
Template Struct proxy¶
Defined in File configuration.h
Struct Documentation¶
-
template<typename
K
, typenameC
>
structudho
::
proxy
¶ -
Public Functions
-
proxy
(config_type &conf)¶
-
value_type
value
() const¶
-
operator value_type
() const¶
-
template<typename
V
>
proxy_type &operator=
(V value)¶
-
Template Struct proxy< configs::server_<>::mimes_t, config< configs::server_<> > >¶
Defined in File configuration.h
Struct Documentation¶
-
template<>
structudho
::
proxy
<configs::server_<>::mimes_t, config<configs::server_<>>>¶ Public Types
-
typedef proxy<key_type, config_type>
proxy_type
¶
Public Functions
-
proxy
(config_type &conf)¶
-
value_type
value
() const¶
-
operator value_type
() const¶
-
template<typename
V
>
proxy_type &operator=
(V value)¶
-
std::string
at
(const std::string &key) const¶
-
std::string
of
(const std::string &key) const¶
-
void
set
(const std::string &ext, const std::string &mime)¶
-
typedef proxy<key_type, config_type>
Struct reroute¶
Defined in File router.h
Struct Documentation¶
Template Struct server¶
Defined in File server.h
Struct Documentation¶
-
template<typename
AuxT
, typenameLoggerT
= void, typenameCacheT
= void>
structudho
::
server
¶ - Todo:
write docs
Public Types
-
typedef udho::attachment<auxiliary_type, logger_type, cache_type>
attachment_type
¶
-
typedef server<auxiliary_type, logger_type, cache_type>
self_type
¶
-
typedef attachment_type::configuration_type
configuration_type
¶
-
using
context_type
= udho::context<auxiliary_type, RequestT, attachment_type>¶
-
typedef udho::defs::request_type
http_request_type
¶
-
typedef http_request_type
request_type
¶
Public Functions
-
server
(boost::asio::io_service &io, logger_type &logger)¶
-
configuration_type &
config
()¶
-
const configuration_type &
config
() const¶
-
template<typename
ConfigKeyT
>
autooperator[]
(const ConfigKeyT &k)¶
-
template<typename
ConfigKeyT
>
autooperator[]
(const ConfigKeyT &k) const¶
Template Struct server< AuxT, void, CacheT >¶
Defined in File server.h
Struct Documentation¶
-
template<typename
AuxT
, typenameCacheT
>
structudho
::
server
<AuxT, void, CacheT>¶ Public Types
-
typedef udho::attachment<auxiliary_type, void, cache_type>
attachment_type
¶
-
typedef server<auxiliary_type, void, cache_type>
self_type
¶
-
typedef attachment_type::configuration_type
configuration_type
¶
-
using
context_type
= udho::context<auxiliary_type, RequestT, attachment_type>¶
-
typedef udho::defs::request_type
http_request_type
¶
-
typedef context_type<http_request_type>
context
¶
-
typedef http_request_type
request_type
¶
Public Functions
-
server
(boost::asio::io_service &io)¶
-
configuration_type &
config
()¶
-
const configuration_type &
config
() const¶
-
template<typename
ConfigKeyT
>
autooperator[]
(const ConfigKeyT &k)¶
-
template<typename
ConfigKeyT
>
autooperator[]
(const ConfigKeyT &k) const¶
-
typedef udho::attachment<auxiliary_type, void, cache_type>
Template Struct logged¶
Defined in File server.h
Struct Documentation¶
-
template<typename
T
>
structudho::servers
::
logged
¶ Public Types
-
using
stateful
= server<udho::bridge<udho::configuration_type>, logger_type, udho::cache::store<StorageT, boost::uuids::uuid, U...>>¶
-
using
stateless
= server<udho::bridge<udho::configuration_type>, logger_type, void>¶
-
using
Template Struct ostreamed_helper¶
Defined in File server.h
Struct Documentation¶
-
template<typename
CacheT
>
structudho::servers::ostreamed
::
ostreamed_helper
¶ Public Types
-
typedef server_type::logger_type
logger_type
¶
-
typedef server_type::cache_type
cache_type
¶
-
typedef server_type::attachment_type
attachment_type
¶
-
typedef server_type::http_request_type
request_type
¶
Public Functions
-
server_type::configuration_type &
config
()¶
-
const server_type::configuration_type &
config
() const¶
-
template<typename
ConfigKeyT
>
autooperator[]
(const ConfigKeyT &k)¶
-
template<typename
ConfigKeyT
>
autooperator[]
(const ConfigKeyT &k) const¶
-
typedef server_type::logger_type
Template Struct stateful¶
Defined in File server.h
Struct Documentation¶
-
template<template<typename, typename> class
StorageT
, typename ...T
>
structudho::servers
::
stateful
¶ Public Types
-
using
logged
= server<udho::bridge<udho::configuration_type>, LoggerT, cache_type>¶
-
using
quiet
= server<udho::bridge<udho::configuration_type>, void, cache_type>¶
-
using
Template Struct session_¶
Defined in File session.h
Struct Documentation¶
-
template<typename
RequestT
, typenameShadowT
>
structudho
::
session_
¶ Public Types
-
typedef shadow_type::key_type
key_type
¶
-
typedef session_<request_type, shadow_type>
self_type
¶
Public Functions
-
template<typename ...
T
>session_
(session_<request_type, udho::cache::shadow<key_type, T...>> &other)¶
-
void
identify
()¶
-
const session_config_type &
config
() const¶
-
bool
returning
() const¶
-
template<typename
V
>
boolexists
() const¶
-
std::size_t
size
() const¶
-
bool
remove
()¶
-
template<typename
V
>
boolremove
()¶
-
boost::posix_time::ptime
created
() const¶
-
boost::posix_time::ptime
updated
() const¶
-
boost::posix_time::time_duration
age
() const¶
-
boost::posix_time::time_duration
idle
() const¶
-
template<typename
V
>
boost::posix_time::ptimecreated
() const¶
-
template<typename
V
>
boost::posix_time::ptimeupdated
() const¶
-
template<typename
V
>
boost::posix_time::time_durationage
() const¶
-
template<typename
V
>
boost::posix_time::time_durationidle
() const¶
-
std::string
sessid
() const¶
Public Members
-
const session_config_type &
_config
¶
-
shadow_type
_shadow
¶
-
bool
_returning
¶
-
bool
_identified
¶
-
generator_type
_generator
¶
-
typedef shadow_type::key_type
Template Struct start¶
Defined in File activities.h
Template Struct start_¶
Defined in File activities.h
Inheritance Relationships¶
public udho::activities::subtask< activities::start< ContextT, T... > >
(Template Struct subtask)
Struct Documentation¶
-
template<typename
ContextT
, typename ...T
>
structudho
::
start_
: public udho::activities::subtask<activities::start<ContextT, T...>>¶ Public Types
-
typedef activities::subtask<activity_type>
base
¶
-
typedef activity_type::collector_type
collector_type
¶
-
typedef activity_type::accessor_type
accessor_type
¶
-
typedef activities::subtask<activity_type>
Struct url¶
Defined in File url.h
Inheritance Relationships¶
public udho::configuration< detail::url_data >
(Template Struct configuration)public udho::forms::drivers::urlencoded_< Iterator >
(Template Struct urlencoded_)
Struct Documentation¶
-
struct
udho
::
url
: public udho::configuration<detail::url_data>, public udho::forms::drivers::urlencoded_<Iterator>¶ Public Types
-
typedef udho::forms::drivers::urlencoded_raw
urlencoded_type
¶
Public Static Functions
-
class
param
Public Functions
-
param
(const std::string &k, const std::string &v)
-
std::string
key
() const
-
std::string
value
() const
-
std::string
to_string
() const
-
-
typedef udho::forms::drivers::urlencoded_raw
Template Struct urlencoded_form¶
Defined in File form.hxx
Struct Documentation¶
-
template<typename
Iterator
>
structudho
::
urlencoded_form
¶ Form accessor for urlencoded forms
Public Types
-
typedef std::iterator_traits<iterator_type>::value_type
value_type
¶
-
typedef std::basic_string<value_type>
string_type
¶
-
typedef bounded_str<iterator_type>
bounded_string_type
¶
-
typedef std::map<string_type, bounded_string_type>
header_map_type
¶
-
typedef bounded_string_type
bounded_string
¶
Public Functions
-
void
parse
(iterator_type begin, iterator_type end)¶
-
std::size_t
count
() const¶ number of fields in the form
-
bool
has
(const std::string name) const¶ checks whether there exists any field with the name provided
Public Members
-
header_map_type
_fields
¶
-
typedef std::iterator_traits<iterator_type>::value_type
Template Struct is_invocable¶
Defined in File util.h
Template Struct parser¶
Defined in File parser.h
Struct Documentation¶
-
template<typename
ScopeT
, typenameContextT
>
structudho::view
::
parser
¶ Public Types
-
typedef parsing::expression<table_type>
evaluator_type
¶
-
typedef parsing::tags::block<table_type, ContextT>
block_directive_type
¶
-
typedef parsing::tags::var<table_type, ContextT>
var_directive_type
¶
-
typedef parsing::tags::loop<table_type, ContextT>
loop_directive_type
¶
-
typedef parsing::tags::condition<table_type, ContextT>
condition_directive_type
¶
-
typedef parsing::tags::text<table_type, ContextT>
text_directive_type
¶
-
typedef parsing::tags::html<table_type, ContextT>
html_directive_type
¶
-
typedef parsing::tags::eval<table_type, ContextT>
eval_directive_type
¶
-
typedef parsing::tags::skip<table_type, ContextT>
skip_directive_type
¶
-
typedef parsing::attrs::target<table_type, ContextT>
target_directive_type
¶
-
typedef parsing::attrs::eval<table_type, ContextT>
eval_attr_directive_type
¶
-
typedef parsing::attrs::add_class<table_type, ContextT>
add_class_directive_type
¶
-
typedef parsing::attrs::condition<table_type, ContextT>
condition_attr_directive_type
¶
Public Functions
-
parser
(table_type &scope, const ContextT &ctx)¶
-
void
prepare
()¶
-
std::string
process
(const std::string &contents)¶
Public Members
-
table_type &
_table
¶
-
evaluator_type
_evaluator
¶
-
xml_parser_type
_xml_parser
¶
-
block_directive_type
_block
¶
-
var_directive_type
_var
¶
-
loop_directive_type
_loop
¶
-
condition_directive_type
_condition
¶
-
text_directive_type
_text
¶
-
html_directive_type
_html
¶
-
eval_directive_type
_eval
¶
-
skip_directive_type
_skip
¶
-
target_directive_type
_target
¶
-
eval_attr_directive_type
_eval_attr
¶
-
add_class_directive_type
_add_class
¶
-
condition_attr_directive_type
_condition_attr
¶
-
typedef parsing::expression<table_type>
Template Struct add_class¶
Defined in File parser.h
Struct Documentation¶
-
template<typename
ScopeT
, typenameContextT
>
structudho::view::parsing::attrs
::
add_class
¶ udho::add-class:NAME = EXPR will add a class named
NAME
if the expressionEXPR
is true.is transformed to<div udho:add-class:visible="count(books) > 1"></div>
<div class="visible"></div>
Template Struct condition¶
Defined in File parser.h
Struct Documentation¶
-
template<typename
ScopeT
, typenameContextT
>
structudho::view::parsing::attrs
::
condition
¶ works like the udho:if tag but can be used in attribute
Template Struct eval¶
Defined in File parser.h
Struct Documentation¶
-
template<typename
ScopeT
, typenameContextT
>
structudho::view::parsing::attrs
::
eval
¶ udho::eval:NAME = EXPR will add an attribute named
NAME
with value retrieved by evaluating the expressionEXPR
. It can have a conditional form too where the conditionexpr
is first evaluated and if expr is true then the attribute is added, otherwise notis transformed to<input type="text" udho:eval:value="count(books)"></input> <input type="text" udho:eval:title="expr ? count(books)"></input>
<input type="text" value="2"></input> <input type="text" value="2"></input>
Template Struct target¶
Defined in File parser.h
Struct Documentation¶
-
template<typename
ScopeT
, typenameContextT
>
structudho::view::parsing::attrs
::
target
¶ udho::target:NAME = KEY will add an attribute named
NAME
with value retrieved by resolvingKEY
through scope table. It can have a conditional form too where the conditionexpr
is first evaluated and if expr is true then the attribute is added, otherwise notis transformed to<div class="book" udho:target:title="book.title"></div> <div class="book" udho:target:title="expr ? book.title"></div>
<div class="book" title="Some title"></div> <div class="book" title="Some title"></div>
Template Struct expression¶
Defined in File parser.h
Struct Documentation¶
-
template<typename
ScopeT
>
structudho::view::parsing
::
expression
¶ -
Public Functions
-
expression
(scope_type &table)¶
Public Members
-
scope_type &
_table
¶
-
Template Struct block¶
Defined in File parser.h
Struct Documentation¶
udho::block
Public Types
Public Functions
Public Members
Template Struct condition¶
Defined in File parser.h
Struct Documentation¶
udho::if
Public Types
Public Functions
Public Members
Template Struct eval¶
Defined in File parser.h
Struct Documentation¶
udho::eval
Public Types
Public Functions
Public Members
Template Struct html¶
Defined in File parser.h
Struct Documentation¶
udho::html
Public Types
Public Functions
Public Members
Template Struct loop¶
Defined in File parser.h
Struct Documentation¶
udho::for
Public Types
Public Functions
Public Members
Template Struct skip¶
Defined in File parser.h
Struct Documentation¶
udho::template
Public Types
Public Functions
Public Members
Template Struct text¶
Defined in File parser.h
Struct Documentation¶
udho::text
Public Types
Public Functions
Public Members
Template Struct var¶
Defined in File parser.h
Struct Documentation¶
udho::var
Public Types
Public Functions
Public Members
Struct token¶
Defined in File parser.h
Struct Documentation¶
-
struct
udho::view::parsing
::
token
¶ Public Types
-
enum
type
¶ Values:
-
enumerator
op
¶
-
enumerator
function
¶
-
enumerator
call
¶
-
enumerator
comma
¶
-
enumerator
parenthesis_open
¶
-
enumerator
parenthesis_close
¶
-
enumerator
real
¶
-
enumerator
id
¶
-
enumerator
-
enum
category
¶ Values:
-
enumerator
none
¶
-
enumerator
arithmetic
¶
-
enumerator
logical
¶
-
enumerator
junction
¶
-
enumerator
-
typedef std::map<std::string, std::size_t>
operator_map_type
¶
-
typedef std::map<std::string, int>
function_map_type
¶
-
enum
Template Struct xml¶
Defined in File parser.h
Struct Documentation¶
-
template<typename
ContextT
>
structudho::view::parsing
::
xml
¶ Public Types
-
typedef boost::function<bool(pugi::xml_node, pugi::xml_node, const context_type&)>
tag_directive
¶
-
typedef boost::function<bool(pugi::xml_node, pugi::xml_node, pugi::xml_attribute, const context_type&)>
attr_directive
¶
-
typedef std::map<std::string, tag_directive>
tag_directive_map
¶
-
typedef std::map<std::string, attr_directive>
attr_directive_map
¶
Public Functions
-
xml
(const context_type &ctx)¶
-
void
open
(const std::string &contents)¶
-
void
clear
()¶
-
void
parse
(pugi::xml_node node, pugi::xml_node target)¶
-
void
step_in
(pugi::xml_node node, pugi::xml_node target)¶
-
void
travarse
(pugi::xml_node node, pugi::xml_node target)¶
-
void
parse
()¶
-
std::string
output
()¶
-
template<typename
DirectiveT
>
xml &add_directive_tag
(DirectiveT directive)¶
-
template<typename
DirectiveT
>
xml &add_directive_attr
(DirectiveT directive)¶
Public Members
-
const context_type &
_ctx
¶
-
pugi::xml_document
_source
¶
-
pugi::xml_document
_transformed
¶
-
tag_directive_map
_directives_tag
¶
-
attr_directive_map
_directives_attr
¶
-
typedef boost::function<bool(pugi::xml_node, pugi::xml_node, const context_type&)>
Template Struct printing_visitor¶
Defined in File visitor.h
Template Struct target_application¶
Defined in File visitor.h
Struct Documentation¶
-
template<typename
F
, std::uint8_tVisitables
, std::uint8_tHasApplication
= (Visitables & visitable::application)>
structudho::visitors
::
target_application
¶ Public Functions
Template Struct target_application< F, Visitables, 0 >¶
Defined in File visitor.h
Template Struct target_module¶
Defined in File visitor.h
Template Struct target_module< F, Visitables, 0 >¶
Defined in File visitor.h
Template Struct targetted_visitor¶
Defined in File visitor.h
Inheritance Relationships¶
public udho::visitors::target_module< F, Visitables >
(Template Struct target_module)public udho::visitors::target_application< F, Visitables >
(Template Struct target_application)
Struct Documentation¶
-
template<std::uint8_t
Visitables
, typenameF
>
structudho::visitors
::
targetted_visitor
: public udho::visitors::target_module<F, Visitables>, public udho::visitors::target_application<F, Visitables>¶
Struct visitable¶
Defined in File visitor.h
Template Struct watch¶
Defined in File watcher.h
Struct Documentation¶
Template Struct watcher¶
Defined in File watcher.h
Struct Documentation¶
-
template<typename
WatchT
>
structudho
::
watcher
¶ Public Types
-
typedef watch_type::key_type
key_type
¶
-
typedef std::list<watch_type>
container_type
¶
-
typedef container_type::iterator
iterator_type
¶
-
typedef std::multimap<key_type, iterator_type>
index_type
¶
-
typedef boost::posix_time::ptime
time_point_type
¶
-
typedef boost::posix_time::time_duration
time_duration_type
¶
Public Functions
-
watcher
(boost::asio::io_service &io, const time_duration_type &duration)¶
-
bool
insert
(watch_type watch)¶
-
void
expired
(const boost::system::error_code &err)¶
-
std::size_t
notify_all
()¶
-
void
async_notify_all
()¶
Public Members
-
boost::asio::io_service &
_io
¶
-
time_duration_type
_duration
¶
-
boost::asio::deadline_timer
_timer
¶
-
container_type
_watchers
¶
-
index_type
_index
¶
-
boost::mutex
_mutex
¶
-
typedef watch_type::key_type
Template Class analyzer¶
Defined in File activities.h
Class Documentation¶
-
template<typename
ActivityT
>
classudho::activities
::
analyzer
¶ - An analyzer can be applied on an activity to analyze its result data. The analyzer can be equipped with callbackss to handle different result states.
const udho::accessor<A1, A2i, A3i>& d; d.apply<A1>(udho::activities::analyzer<A1>() .canceled([](const A1SData& s, const A1FData& f){ std::cout << "CANCELED" << std::endl; }) .incomplete([](){ std::cout << "INCOMPLETE" << std::endl; }) .failure([](const A1FData& f){ std::cout << "FAILED" << std::endl; }) .success([](const A1SData& s){ std::cout << "SUCCESS" << std::endl; }) );
- See
state
Public Functions
-
void
operator()
()¶
-
void
operator()
(const success_type &s, const failure_type &f)¶
-
void
operator()
(const failure_type &f)¶
-
void
operator()
(const success_type &s)¶
-
self_type &
incomplete
(incomplete_ftor_type ftor)¶ If the activity is incomplete and an incomplete callback is set then the incomplete callback is invoked if any of the following holds
there is no error callback
there is an error callback but the task has not been canceled
there is an error callback and the task has been canceled (
- See
operator()(const success_type&, const failure_type&))
-
self_type &
canceled
(cancelation_ftor_type ftor)¶ If the activity is canceled and a canceled callback is set then the canceled callback is invoked if the following holds
there is no error callback
-
self_type &
error
(success_ftor_type ftor)¶ The error callback is called if the subtask has not failed but has been canceled (through cancel_if) Once the error callback is set failure and incomplete callbacks are invoked differently The error callback is called if the following holds
there is an error callback set and the activity is canceled and the activity has not failed
-
self_type &
failure
(failure_ftor_type ftor)¶ If the activity has failed and afailure callback is set then the failure callback is called if any of the following holds
there is no error callback
there is an error callback set and the activity is canceled
there is an error callback set and the activity is not canceled
-
self_type &
success
(success_ftor_type ftor)¶ If the activity is complete and neither failed nor canceled then the success callback is called if a a success callback is set
-
activity_state
apply
()¶
-
bool
successful
()¶
Template Class application¶
Defined in File application.h
Class Documentation¶
-
template<typename
DerivedT
>
classudho
::
application
¶ all applications derive from this class
applications are a class having a set of methods bound with urls
struct my_app: public udho::application<my_app>{ my_app(); int add(udho::request_type req, int a, int b); int mul(udho::request_type req, int a, int b); template <typename RouterT> auto route(RouterT& router){ return router | (get(&my_app::add).plain() = "^/add/(\\d+)/(\\d+)$") | (get(&my_app::mul).plain() = "^/mul/(\\d+)/(\\d+)$"); } };
- Template Parameters
DerivedT
: The derived application class
Public Functions
-
application
(const std::string &name)¶
-
std::string
name
() const¶
-
template<typename
F
>
autoget
(F f)¶ add a get method
- Template Parameters
F
: callback type
- Parameters
f
: callback
-
template<typename
F
>
autopost
(F f)¶ add a post method
- Template Parameters
F
: callback type
- Parameters
f
: callback
-
template<typename
F
>
autohead
(F f)¶ add a head method
- Template Parameters
F
: callback type
- Parameters
f
: callback
Template Class connection¶
Defined in File connection.h
Inheritance Relationships¶
public std::enable_shared_from_this< connection< RouterT, AttachmentT > >
Class Documentation¶
-
template<typename
RouterT
, typenameAttachmentT
>
classudho
::
connection
: public std::enable_shared_from_this<connection<RouterT, AttachmentT>>¶ Stateful HTTP Session
Public Functions
-
connection
(RouterT &router, attachment_type &attachment, socket_type socket)¶ session constructor
- Parameters
router
: routersocket
: TCP socket
-
~connection
()¶
-
void
run
()¶ start the read loop
-
void
do_read
()¶
-
void
on_read
(boost::system::error_code ec, std::size_t bytes_transferred)¶
-
void
on_write
(boost::system::error_code, std::size_t bytes_transferred, bool close)¶
-
void
do_close
()¶
-
void
respond
(udho::defs::response_type &msg)¶
-
Template Class is_streamable¶
Defined in File access.h
Template Class listener¶
Defined in File listener.h
Inheritance Relationships¶
public std::enable_shared_from_this< listener< RouterT, AttachmentT > >
Class Documentation¶
-
template<typename
RouterT
, typenameAttachmentT
>
classudho
::
listener
: public std::enable_shared_from_this<listener<RouterT, AttachmentT>>¶ listener runs accept loop for HTTP sockets
Public Functions
-
listener
(RouterT &router, boost::asio::io_service &service, attachment_type &attachment, const boost::asio::ip::tcp::endpoint &endpoint)¶ - Parameters
router
: HTTP url mapping routerservice
: I/O serviceendpoint
: HTTP server endpoint to listen on
-
void
stop
()¶ stops accepting incomming connections
-
~listener
()¶
-
void
run
()¶ starts the async accept loop
-
void
accept
()¶ accept an incomming connection
-
void
on_accept
(boost::system::error_code ec)¶
-
Class url::param¶
Defined in File url.h
Nested Relationships¶
This class is a nested type of Struct url.
Enums¶
Enum state¶
Defined in File activities.h
Enum Documentation¶
-
enum
udho::activities
::
state
¶ activity result states
Values:
-
enumerator
unknown
¶
-
enumerator
incomplete
¶ The activity is incomplete
-
enumerator
failure
¶ The activity has failed
-
enumerator
success
¶ The activity completed successfully
-
enumerator
canceled
¶ The activity is canceled
-
enumerator
error
¶ The activity is canceled but has not failed. The error state is only used when an error callback is passed to the analyzer
-
enumerator
Functions¶
Template Function udho::_search¶
Defined in File util.h
Function Documentation¶
-
template<class
ForwardIt1
, classForwardIt2
>
constexpr ForwardIt1udho
::
_search
(ForwardIt1 first, ForwardIt1 last, ForwardIt2 s_first, ForwardIt2 s_last)¶
Template Function udho::activities::operator<<(collector<ContextT, dataset<T…>>&, const U&)¶
Defined in File activities.h
Function Documentation¶
Warning
doxygenfunction: Unable to resolve multiple matches for function “udho::activities::operator<<” with arguments (collector<ContextT, dataset<T…>>&, const U&) in doxygen xml output for project “udho” from directory: dox/xml. Potential matches:
- std::ostream &operator<<(std::ostream &os, const state &s)
- template<typename U, typename ...T> accessor<T...> &operator<<(accessor<T...> &h, const U &data)
- template<typename U, typename ContextT, typename ...T> collector<ContextT, dataset<T...>> &operator<<(collector<ContextT, dataset<T...>> &h, const U &data)
Template Function udho::activities::operator<<(accessor<T…>&, const U&)¶
Defined in File activities.h
Function Documentation¶
Warning
doxygenfunction: Unable to resolve multiple matches for function “udho::activities::operator<<” with arguments (accessor<T…>&, const U&) in doxygen xml output for project “udho” from directory: dox/xml. Potential matches:
- std::ostream &operator<<(std::ostream &os, const state &s)
- template<typename U, typename ...T> accessor<T...> &operator<<(accessor<T...> &h, const U &data)
- template<typename U, typename ContextT, typename ...T> collector<ContextT, dataset<T...>> &operator<<(collector<ContextT, dataset<T...>> &h, const U &data)
Function udho::activities::operator<<(std::ostream&, const state&)¶
Defined in File activities.h
Function Documentation¶
Warning
doxygenfunction: Unable to resolve multiple matches for function “udho::activities::operator<<” with arguments (std::ostream&, const state&) in doxygen xml output for project “udho” from directory: dox/xml. Potential matches:
- std::ostream &operator<<(std::ostream &os, const state &s)
- template<typename U, typename ...T> accessor<T...> &operator<<(accessor<T...> &h, const U &data)
- template<typename U, typename ContextT, typename ...T> collector<ContextT, dataset<T...>> &operator<<(collector<ContextT, dataset<T...>> &h, const U &data)
Template Function udho::activities::operator>>(const collector<ContextT, dataset<T…>>&, U&)¶
Defined in File activities.h
Function Documentation¶
Warning
doxygenfunction: Unable to resolve multiple matches for function “udho::activities::operator>>” with arguments (const collector<ContextT, dataset<T…>>&, U&) in doxygen xml output for project “udho” from directory: dox/xml. Potential matches:
- template<typename U, typename ...T> const accessor<T...> &operator>>(const accessor<T...> &h, U &data)
- template<typename U, typename ContextT, typename ...T> const collector<ContextT, dataset<T...>> &operator>>(const collector<ContextT, dataset<T...>> &h, U &data)
Template Function udho::activities::operator>>(const accessor<T…>&, U&)¶
Defined in File activities.h
Function Documentation¶
Warning
doxygenfunction: Unable to resolve multiple matches for function “udho::activities::operator>>” with arguments (const accessor<T…>&, U&) in doxygen xml output for project “udho” from directory: dox/xml. Potential matches:
- template<typename U, typename ...T> const accessor<T...> &operator>>(const accessor<T...> &h, U &data)
- template<typename U, typename ContextT, typename ...T> const collector<ContextT, dataset<T...>> &operator>>(const collector<ContextT, dataset<T...>> &h, U &data)
Template Function udho::after(T&…)¶
Defined in File activities.h
Function Documentation¶
Warning
doxygenfunction: Unable to resolve multiple matches for function “udho::after” with arguments (T&…) in doxygen xml output for project “udho” from directory: dox/xml. Potential matches:
- template<typename ...T> udho::activities::after<T...> after(T&... dependencies)
- udho::activities::after_none after()
Function udho::after()¶
Defined in File activities.h
Function Documentation¶
-
udho::activities::after_none
udho
::
after
()¶
Template Function udho::analyze¶
Defined in File activities.h
Template Function udho::app(T…)¶
Defined in File application.h
Function Documentation¶
Warning
doxygenfunction: Unable to resolve multiple matches for function “udho::app” with arguments (T…) in doxygen xml output for project “udho” from directory: dox/xml. Potential matches:
- template<typename AppT, typename ...T> app_<AppT, false> app(T... args)
- template<typename AppT> app_<AppT, true> app(AppT &a)
Template Function udho::app(AppT&)¶
Defined in File application.h
Function Documentation¶
Warning
doxygenfunction: Unable to resolve multiple matches for function “udho::app” with arguments (AppT&) in doxygen xml output for project “udho” from directory: dox/xml. Potential matches:
- template<typename AppT, typename ...T> app_<AppT, false> app(T... args)
- template<typename AppT> app_<AppT, true> app(AppT &a)
Template Function udho::associate¶
Defined in File access.h
Function Documentation¶
-
template<typename
F
>
detail::association<F>udho
::
associate
(const std::string &key, F callback)¶
Template Function udho::collect¶
Defined in File activities.h
Template Function udho::data(const T&)¶
Defined in File access.h
Function Documentation¶
Warning
doxygenfunction: Unable to resolve multiple matches for function “udho::data” with arguments (const T&) in doxygen xml output for project “udho” from directory: dox/xml. Potential matches:
- template<typename H, typename T, typename ...Rest> auto data(const H &head, const T &tail, const Rest&... rest)
- template<typename H, typename T> data_helper<H, T>::result_type data(const H &head, const T &tail)
- template<typename T> prepared<T> data(const T &obj)
Template Function udho::data(const H&, const T&)¶
Defined in File access.h
Function Documentation¶
Warning
doxygenfunction: Unable to resolve multiple matches for function “udho::data” with arguments (const H&, const T&) in doxygen xml output for project “udho” from directory: dox/xml. Potential matches:
- template<typename H, typename T, typename ...Rest> auto data(const H &head, const T &tail, const Rest&... rest)
- template<typename H, typename T> data_helper<H, T>::result_type data(const H &head, const T &tail)
- template<typename T> prepared<T> data(const T &obj)
Template Function udho::data(const H&, const T&, const Rest&…)¶
Defined in File access.h
Function Documentation¶
Warning
doxygenfunction: Unable to resolve multiple matches for function “udho::data” with arguments (const H&, const T&, const Rest&…) in doxygen xml output for project “udho” from directory: dox/xml. Potential matches:
- template<typename H, typename T, typename ...Rest> auto data(const H &head, const T &tail, const Rest&... rest)
- template<typename H, typename T> data_helper<H, T>::result_type data(const H &head, const T &tail)
- template<typename T> prepared<T> data(const T &obj)
Template Function udho::del(F)¶
Defined in File router.h
Function Documentation¶
Warning
doxygenfunction: Unable to resolve multiple matches for function “udho::del” with arguments (F) in doxygen xml output for project “udho” from directory: dox/xml. Potential matches:
- template<typename F, typename A1> auto del(F ftor, A1 &a1)
- template<typename F> auto del(F ftor)
Template Function udho::del(F, A1&)¶
Defined in File router.h
Function Documentation¶
Warning
doxygenfunction: Unable to resolve multiple matches for function “udho::del” with arguments (F, A1&) in doxygen xml output for project “udho” from directory: dox/xml. Potential matches:
- template<typename F, typename A1> auto del(F ftor, A1 &a1)
- template<typename F> auto del(F ftor)
Template Function udho::detail::operator|¶
Defined in File access.h
Function Documentation¶
-
template<typename
U
, typenameV
, typenameF
>
association_group<association<F>, association_group<U, V>>udho::detail
::
operator|
(const association_group<U, V> &nonterminal, const association<F> &terminal)¶
Template Function udho::detail::visit¶
Defined in File access.h
Function Documentation¶
-
template<typename
U
, typenameV
>
association_group_visitor<association_group<U, V>>udho::detail
::
visit
(const association_group<U, V> &nonterminal)¶
Function udho::exceptions::http_redirection¶
Defined in File page.h
Function Documentation¶
-
http_error
udho::exceptions
::
http_redirection
(const std::string &location, boost::beast::http::status status = boost::beast::http::status::temporary_redirect)¶
Template Function udho::form::operator<<(validated<udho::form_<RequestT>>&, field<T, Required>&)¶
Defined in File form.hxx
Function Documentation¶
Warning
doxygenfunction: Unable to resolve multiple matches for function “udho::form::operator<<” with arguments (validated<udho::form_<RequestT>>&, field<T, Required>&) in doxygen xml output for project “udho” from directory: dox/xml. Potential matches:
- template<typename T, bool Required, typename IteratorT> validated<udho::multipart_form<IteratorT>> &operator<<(validated<udho::multipart_form<IteratorT>> &validator, field<T, Required> &field_)
- template<typename T, bool Required, typename RequestT> validated<udho::form_<RequestT>> &operator<<(validated<udho::form_<RequestT>> &validator, field<T, Required> &field_)
- template<typename T, bool Required> validated &operator<<(validated<> &validator, field<T, Required> &field_)
Template Function udho::form::operator<<(validated<udho::multipart_form<IteratorT>>&, field<T, Required>&)¶
Defined in File form.hxx
Function Documentation¶
Warning
doxygenfunction: Unable to resolve multiple matches for function “udho::form::operator<<” with arguments (validated<udho::multipart_form<IteratorT>>&, field<T, Required>&) in doxygen xml output for project “udho” from directory: dox/xml. Potential matches:
- template<typename T, bool Required, typename IteratorT> validated<udho::multipart_form<IteratorT>> &operator<<(validated<udho::multipart_form<IteratorT>> &validator, field<T, Required> &field_)
- template<typename T, bool Required, typename RequestT> validated<udho::form_<RequestT>> &operator<<(validated<udho::form_<RequestT>> &validator, field<T, Required> &field_)
- template<typename T, bool Required> validated &operator<<(validated<> &validator, field<T, Required> &field_)
Template Function udho::form::operator<<(validated<>&, field<T, Required>&)¶
Defined in File form.hxx
Function Documentation¶
Warning
doxygenfunction: Unable to resolve multiple matches for function “udho::form::operator<<” with arguments (validated<>&, field<T, Required>&) in doxygen xml output for project “udho” from directory: dox/xml. Potential matches:
- template<typename T, bool Required, typename IteratorT> validated<udho::multipart_form<IteratorT>> &operator<<(validated<udho::multipart_form<IteratorT>> &validator, field<T, Required> &field_)
- template<typename T, bool Required, typename RequestT> validated<udho::form_<RequestT>> &operator<<(validated<udho::form_<RequestT>> &validator, field<T, Required> &field_)
- template<typename T, bool Required> validated &operator<<(validated<> &validator, field<T, Required> &field_)
Function udho::form::validate()¶
Defined in File form.hxx
Template Function udho::form::validate(udho::form_<RequestT>&)¶
Defined in File form.hxx
Function Documentation¶
Warning
doxygenfunction: Unable to resolve multiple matches for function “udho::form::validate” with arguments (udho::form_<RequestT>&) in doxygen xml output for project “udho” from directory: dox/xml. Potential matches:
- template<typename IteratorT> validated<udho::multipart_form<IteratorT>> validate(const udho::multipart_form<IteratorT> &form)
- template<typename RequestT> validated<udho::form_<RequestT>> validate(udho::form_<RequestT> &form)
- validated<void> validate()
Template Function udho::form::validate(const udho::multipart_form<IteratorT>&)¶
Defined in File form.hxx
Function Documentation¶
Warning
doxygenfunction: Unable to resolve multiple matches for function “udho::form::validate” with arguments (const udho::multipart_form<IteratorT>&) in doxygen xml output for project “udho” from directory: dox/xml. Potential matches:
- template<typename IteratorT> validated<udho::multipart_form<IteratorT>> validate(const udho::multipart_form<IteratorT> &form)
- template<typename RequestT> validated<udho::form_<RequestT>> validate(udho::form_<RequestT> &form)
- validated<void> validate()
Template Function udho::forms::form_multipart¶
Defined in File forms.h
Function Documentation¶
-
template<typename
RequestT
>
form_multipart_<RequestT>udho::forms
::
form_multipart
(const RequestT &req)¶
Template Function udho::forms::operator<<(accumulated&, detail::constrained_field<ValidatorT, FieldT>&)¶
Defined in File forms.h
Function Documentation¶
Warning
doxygenfunction: Unable to resolve multiple matches for function “udho::forms::operator<<” with arguments (accumulated&, detail::constrained_field<ValidatorT, FieldT>&) in doxygen xml output for project “udho” from directory: dox/xml. Potential matches:
- template<typename T, bool Required> accumulated &operator<<(accumulated &acc, field<T, Required> &field)
- template<typename ValidatorT, typename FieldT> accumulated &operator<<(accumulated &acc, detail::constrained_field<ValidatorT, FieldT> &field)
Template Function udho::forms::operator<<(accumulated&, field<T, Required>&)¶
Defined in File forms.h
Function Documentation¶
Warning
doxygenfunction: Unable to resolve multiple matches for function “udho::forms::operator<<” with arguments (accumulated&, field<T, Required>&) in doxygen xml output for project “udho” from directory: dox/xml. Potential matches:
- template<typename T, bool Required> accumulated &operator<<(accumulated &acc, field<T, Required> &field)
- template<typename ValidatorT, typename FieldT> accumulated &operator<<(accumulated &acc, detail::constrained_field<ValidatorT, FieldT> &field)
Template Function udho::forms::operator>>(form<DriverT>&, detail::constrained_field<ValidatorT, FieldT>&)¶
Defined in File forms.h
Function Documentation¶
Warning
doxygenfunction: Unable to resolve multiple matches for function “udho::forms::operator>>” with arguments (form<DriverT>&, detail::constrained_field<ValidatorT, FieldT>&) in doxygen xml output for project “udho” from directory: dox/xml. Potential matches:
- template<typename DriverT, typename T, bool Required> form<DriverT> &operator>>(form<DriverT> &form, field<T, Required> &field)
- template<typename DriverT, typename T, bool Required> validated<form<DriverT>> &operator>>(validated<form<DriverT>> &vf, field<T, Required> &field)
- template<typename DriverT, typename ValidatorT, typename FieldT> form<DriverT> &operator>>(form<DriverT> &form, detail::constrained_field<ValidatorT, FieldT> &field)
- template<typename DriverT, typename ValidatorT, typename FieldT> validated<form<DriverT>> &operator>>(validated<form<DriverT>> &vf, detail::constrained_field<ValidatorT, FieldT> &field)
Template Function udho::forms::operator>>(form<DriverT>&, field<T, Required>&)¶
Defined in File forms.h
Function Documentation¶
Warning
doxygenfunction: Unable to resolve multiple matches for function “udho::forms::operator>>” with arguments (form<DriverT>&, field<T, Required>&) in doxygen xml output for project “udho” from directory: dox/xml. Potential matches:
- template<typename DriverT, typename T, bool Required> form<DriverT> &operator>>(form<DriverT> &form, field<T, Required> &field)
- template<typename DriverT, typename T, bool Required> validated<form<DriverT>> &operator>>(validated<form<DriverT>> &vf, field<T, Required> &field)
- template<typename DriverT, typename ValidatorT, typename FieldT> form<DriverT> &operator>>(form<DriverT> &form, detail::constrained_field<ValidatorT, FieldT> &field)
- template<typename DriverT, typename ValidatorT, typename FieldT> validated<form<DriverT>> &operator>>(validated<form<DriverT>> &vf, detail::constrained_field<ValidatorT, FieldT> &field)
Template Function udho::forms::operator>>(validated<form<DriverT>>&, detail::constrained_field<ValidatorT, FieldT>&)¶
Defined in File forms.h
Function Documentation¶
Warning
doxygenfunction: Unable to resolve multiple matches for function “udho::forms::operator>>” with arguments (validated<form<DriverT>>&, detail::constrained_field<ValidatorT, FieldT>&) in doxygen xml output for project “udho” from directory: dox/xml. Potential matches:
- template<typename DriverT, typename T, bool Required> form<DriverT> &operator>>(form<DriverT> &form, field<T, Required> &field)
- template<typename DriverT, typename T, bool Required> validated<form<DriverT>> &operator>>(validated<form<DriverT>> &vf, field<T, Required> &field)
- template<typename DriverT, typename ValidatorT, typename FieldT> form<DriverT> &operator>>(form<DriverT> &form, detail::constrained_field<ValidatorT, FieldT> &field)
- template<typename DriverT, typename ValidatorT, typename FieldT> validated<form<DriverT>> &operator>>(validated<form<DriverT>> &vf, detail::constrained_field<ValidatorT, FieldT> &field)
Template Function udho::forms::operator>>(validated<form<DriverT>>&, field<T, Required>&)¶
Defined in File forms.h
Function Documentation¶
Warning
doxygenfunction: Unable to resolve multiple matches for function “udho::forms::operator>>” with arguments (validated<form<DriverT>>&, field<T, Required>&) in doxygen xml output for project “udho” from directory: dox/xml. Potential matches:
- template<typename DriverT, typename T, bool Required> form<DriverT> &operator>>(form<DriverT> &form, field<T, Required> &field)
- template<typename DriverT, typename T, bool Required> validated<form<DriverT>> &operator>>(validated<form<DriverT>> &vf, field<T, Required> &field)
- template<typename DriverT, typename ValidatorT, typename FieldT> form<DriverT> &operator>>(form<DriverT> &form, detail::constrained_field<ValidatorT, FieldT> &field)
- template<typename DriverT, typename ValidatorT, typename FieldT> validated<form<DriverT>> &operator>>(validated<form<DriverT>> &vf, detail::constrained_field<ValidatorT, FieldT> &field)
Template Function udho::get(F)¶
Defined in File router.h
Function Documentation¶
Warning
doxygenfunction: Unable to resolve multiple matches for function “udho::get” with arguments (F) in doxygen xml output for project “udho” from directory: dox/xml. Potential matches:
- template<typename F, typename A1> auto get(F ftor, A1 &a1)
- template<typename F> auto get(F ftor)
Template Function udho::get(F, A1&)¶
Defined in File router.h
Function Documentation¶
Warning
doxygenfunction: Unable to resolve multiple matches for function “udho::get” with arguments (F, A1&) in doxygen xml output for project “udho” from directory: dox/xml. Potential matches:
- template<typename F, typename A1> auto get(F ftor, A1 &a1)
- template<typename F> auto get(F ftor)
Template Function udho::head(F)¶
Defined in File router.h
Function Documentation¶
Warning
doxygenfunction: Unable to resolve multiple matches for function “udho::head” with arguments (F) in doxygen xml output for project “udho” from directory: dox/xml. Potential matches:
- template<typename F, typename A1> auto head(F ftor, A1 &a1)
- template<typename F> auto head(F ftor)
Template Function udho::head(F, A1&)¶
Defined in File router.h
Function Documentation¶
Warning
doxygenfunction: Unable to resolve multiple matches for function “udho::head” with arguments (F, A1&) in doxygen xml output for project “udho” from directory: dox/xml. Potential matches:
- template<typename F, typename A1> auto head(F ftor, A1 &a1)
- template<typename F> auto head(F ftor)
Template Function udho::internal::arguments_to_tuple¶
Defined in File router.h
Template Function udho::internal::html_summary¶
Defined in File page.h
Function udho::internal::path_cat¶
Defined in File util.h
Function udho::internal::path_inside¶
Defined in File util.h
Template Function udho::internal::to_fusion(std::index_sequence<Is…>, T&&)¶
Defined in File router.h
Function Documentation¶
Warning
doxygenfunction: Unable to resolve multiple matches for function “udho::internal::to_fusion” with arguments (std::index_sequence<Is…>, T&&) in doxygen xml output for project “udho” from directory: dox/xml. Potential matches:
- template<class ...Ts> auto to_fusion(boost::tuple<Ts...> in)
- template<class ...Ts> boost::fusion::tuple<Ts...> to_fusion(std::tuple<Ts...> in)
- template<std::size_t... Is, class T> auto to_fusion(std::index_sequence<Is...>, T &&in)
Template Function udho::internal::to_fusion(boost::tuple<Ts…>)¶
Defined in File router.h
Function Documentation¶
Warning
doxygenfunction: Unable to resolve multiple matches for function “udho::internal::to_fusion” with arguments (boost::tuple<Ts…>) in doxygen xml output for project “udho” from directory: dox/xml. Potential matches:
- template<class ...Ts> auto to_fusion(boost::tuple<Ts...> in)
- template<class ...Ts> boost::fusion::tuple<Ts...> to_fusion(std::tuple<Ts...> in)
- template<std::size_t... Is, class T> auto to_fusion(std::index_sequence<Is...>, T &&in)
Template Function udho::internal::to_fusion(std::tuple<Ts…>)¶
Defined in File router.h
Function Documentation¶
Warning
doxygenfunction: Unable to resolve multiple matches for function “udho::internal::to_fusion” with arguments (std::tuple<Ts…>) in doxygen xml output for project “udho” from directory: dox/xml. Potential matches:
- template<class ...Ts> auto to_fusion(boost::tuple<Ts...> in)
- template<class ...Ts> boost::fusion::tuple<Ts...> to_fusion(std::tuple<Ts...> in)
- template<std::size_t... Is, class T> auto to_fusion(std::index_sequence<Is...>, T &&in)
Template Function udho::operator/=¶
Defined in File router.h
Function Documentation¶
-
template<typename
U
, typenameV
, typenameF
>
udho::overload_group<U, V> &udho
::
operator/=
(udho::overload_group<U, V> &group, F fixture)¶
Template Function udho::operator<<(attachment<AuxT, LoggerT, CacheT>&, const udho::logging::message<Status>&)¶
Defined in File attachment.h
Function Documentation¶
Warning
doxygenfunction: Unable to resolve multiple matches for function “udho::operator<<” with arguments (attachment<AuxT, LoggerT, CacheT>&, const udho::logging::message<Status>&) in doxygen xml output for project “udho” from directory: dox/xml. Potential matches:
- template<typename AuxT, typename LoggerT, typename CacheT, udho::logging::status Status> attachment<AuxT, LoggerT, CacheT> &operator<<(attachment<AuxT, LoggerT, CacheT> &attachment, const udho::logging::message<Status> &msg)
- template<typename AuxT, typename RequestT, typename ShadowT> udho::context<AuxT, RequestT, ShadowT> &operator<<(udho::context<AuxT, RequestT, ShadowT> &context, const exceptions::http_error &error)
- template<typename AuxT, typename RequestT, udho::logging::status Status> const detail::context_common<AuxT, RequestT> &operator<<(const detail::context_common<AuxT, RequestT> &ctx, const udho::logging::message<Status> &msg)
- template<typename Function, template<typename> class CompositorT, int N> module_overload<Function, CompositorT> operator<<(module_overload<Function, CompositorT> overload, const char (&expr)[N])
- template<typename K, typename C> std::ostream &operator<<(std::ostream &stream, const proxy<K, C> &p)
- template<typename RequestT, typename ShadowT, typename T> session_<RequestT, ShadowT> &operator<<(session_<RequestT, ShadowT> &session, const T &data)
- template<typename RequestT, typename V> cookies_<RequestT> &operator<<(cookies_<RequestT> &cookies, const udho::cookie_<V> &cookie)
- template<typename StreamT, typename U, typename V> StreamT &operator<<(StreamT &stream, const overload_group<U, V> &router)
- template<typename U, typename V, typename F> overload_group<overload_group<U, V>, F> operator<<(const overload_group<U, V> &group, const F &method)
Template Function udho::operator<<(std::ostream&, const proxy<K, C>&)¶
Defined in File configuration.h
Function Documentation¶
Warning
doxygenfunction: Unable to resolve multiple matches for function “udho::operator<<” with arguments (std::ostream&, const proxy<K, C>&) in doxygen xml output for project “udho” from directory: dox/xml. Potential matches:
- template<typename AuxT, typename LoggerT, typename CacheT, udho::logging::status Status> attachment<AuxT, LoggerT, CacheT> &operator<<(attachment<AuxT, LoggerT, CacheT> &attachment, const udho::logging::message<Status> &msg)
- template<typename AuxT, typename RequestT, typename ShadowT> udho::context<AuxT, RequestT, ShadowT> &operator<<(udho::context<AuxT, RequestT, ShadowT> &context, const exceptions::http_error &error)
- template<typename AuxT, typename RequestT, udho::logging::status Status> const detail::context_common<AuxT, RequestT> &operator<<(const detail::context_common<AuxT, RequestT> &ctx, const udho::logging::message<Status> &msg)
- template<typename Function, template<typename> class CompositorT, int N> module_overload<Function, CompositorT> operator<<(module_overload<Function, CompositorT> overload, const char (&expr)[N])
- template<typename K, typename C> std::ostream &operator<<(std::ostream &stream, const proxy<K, C> &p)
- template<typename RequestT, typename ShadowT, typename T> session_<RequestT, ShadowT> &operator<<(session_<RequestT, ShadowT> &session, const T &data)
- template<typename RequestT, typename V> cookies_<RequestT> &operator<<(cookies_<RequestT> &cookies, const udho::cookie_<V> &cookie)
- template<typename StreamT, typename U, typename V> StreamT &operator<<(StreamT &stream, const overload_group<U, V> &router)
- template<typename U, typename V, typename F> overload_group<overload_group<U, V>, F> operator<<(const overload_group<U, V> &group, const F &method)
Template Function udho::operator<<(const detail::context_common<AuxT, RequestT>&, const udho::logging::message<Status>&)¶
Defined in File context.h
Function Documentation¶
Warning
doxygenfunction: Unable to resolve multiple matches for function “udho::operator<<” with arguments (const detail::context_common<AuxT, RequestT>&, const udho::logging::message<Status>&) in doxygen xml output for project “udho” from directory: dox/xml. Potential matches:
- template<typename AuxT, typename LoggerT, typename CacheT, udho::logging::status Status> attachment<AuxT, LoggerT, CacheT> &operator<<(attachment<AuxT, LoggerT, CacheT> &attachment, const udho::logging::message<Status> &msg)
- template<typename AuxT, typename RequestT, typename ShadowT> udho::context<AuxT, RequestT, ShadowT> &operator<<(udho::context<AuxT, RequestT, ShadowT> &context, const exceptions::http_error &error)
- template<typename AuxT, typename RequestT, udho::logging::status Status> const detail::context_common<AuxT, RequestT> &operator<<(const detail::context_common<AuxT, RequestT> &ctx, const udho::logging::message<Status> &msg)
- template<typename Function, template<typename> class CompositorT, int N> module_overload<Function, CompositorT> operator<<(module_overload<Function, CompositorT> overload, const char (&expr)[N])
- template<typename K, typename C> std::ostream &operator<<(std::ostream &stream, const proxy<K, C> &p)
- template<typename RequestT, typename ShadowT, typename T> session_<RequestT, ShadowT> &operator<<(session_<RequestT, ShadowT> &session, const T &data)
- template<typename RequestT, typename V> cookies_<RequestT> &operator<<(cookies_<RequestT> &cookies, const udho::cookie_<V> &cookie)
- template<typename StreamT, typename U, typename V> StreamT &operator<<(StreamT &stream, const overload_group<U, V> &router)
- template<typename U, typename V, typename F> overload_group<overload_group<U, V>, F> operator<<(const overload_group<U, V> &group, const F &method)
Template Function udho::operator<<(cookies_<RequestT>&, const udho::cookie_<V>&)¶
Defined in File cookie.h
Function Documentation¶
Warning
doxygenfunction: Unable to resolve multiple matches for function “udho::operator<<” with arguments (cookies_<RequestT>&, const udho::cookie_<V>&) in doxygen xml output for project “udho” from directory: dox/xml. Potential matches:
- template<typename AuxT, typename LoggerT, typename CacheT, udho::logging::status Status> attachment<AuxT, LoggerT, CacheT> &operator<<(attachment<AuxT, LoggerT, CacheT> &attachment, const udho::logging::message<Status> &msg)
- template<typename AuxT, typename RequestT, typename ShadowT> udho::context<AuxT, RequestT, ShadowT> &operator<<(udho::context<AuxT, RequestT, ShadowT> &context, const exceptions::http_error &error)
- template<typename AuxT, typename RequestT, udho::logging::status Status> const detail::context_common<AuxT, RequestT> &operator<<(const detail::context_common<AuxT, RequestT> &ctx, const udho::logging::message<Status> &msg)
- template<typename Function, template<typename> class CompositorT, int N> module_overload<Function, CompositorT> operator<<(module_overload<Function, CompositorT> overload, const char (&expr)[N])
- template<typename K, typename C> std::ostream &operator<<(std::ostream &stream, const proxy<K, C> &p)
- template<typename RequestT, typename ShadowT, typename T> session_<RequestT, ShadowT> &operator<<(session_<RequestT, ShadowT> &session, const T &data)
- template<typename RequestT, typename V> cookies_<RequestT> &operator<<(cookies_<RequestT> &cookies, const udho::cookie_<V> &cookie)
- template<typename StreamT, typename U, typename V> StreamT &operator<<(StreamT &stream, const overload_group<U, V> &router)
- template<typename U, typename V, typename F> overload_group<overload_group<U, V>, F> operator<<(const overload_group<U, V> &group, const F &method)
Template Function udho::operator<<(udho::context<AuxT, RequestT, ShadowT>&, const exceptions::http_error&)¶
Defined in File page.h
Function Documentation¶
Warning
doxygenfunction: Unable to resolve multiple matches for function “udho::operator<<” with arguments (udho::context<AuxT, RequestT, ShadowT>&, const exceptions::http_error&) in doxygen xml output for project “udho” from directory: dox/xml. Potential matches:
- template<typename AuxT, typename LoggerT, typename CacheT, udho::logging::status Status> attachment<AuxT, LoggerT, CacheT> &operator<<(attachment<AuxT, LoggerT, CacheT> &attachment, const udho::logging::message<Status> &msg)
- template<typename AuxT, typename RequestT, typename ShadowT> udho::context<AuxT, RequestT, ShadowT> &operator<<(udho::context<AuxT, RequestT, ShadowT> &context, const exceptions::http_error &error)
- template<typename AuxT, typename RequestT, udho::logging::status Status> const detail::context_common<AuxT, RequestT> &operator<<(const detail::context_common<AuxT, RequestT> &ctx, const udho::logging::message<Status> &msg)
- template<typename Function, template<typename> class CompositorT, int N> module_overload<Function, CompositorT> operator<<(module_overload<Function, CompositorT> overload, const char (&expr)[N])
- template<typename K, typename C> std::ostream &operator<<(std::ostream &stream, const proxy<K, C> &p)
- template<typename RequestT, typename ShadowT, typename T> session_<RequestT, ShadowT> &operator<<(session_<RequestT, ShadowT> &session, const T &data)
- template<typename RequestT, typename V> cookies_<RequestT> &operator<<(cookies_<RequestT> &cookies, const udho::cookie_<V> &cookie)
- template<typename StreamT, typename U, typename V> StreamT &operator<<(StreamT &stream, const overload_group<U, V> &router)
- template<typename U, typename V, typename F> overload_group<overload_group<U, V>, F> operator<<(const overload_group<U, V> &group, const F &method)
Template Function udho::operator<<(module_overload<Function, CompositorT>, const char(&))¶
Defined in File router.h
Function Documentation¶
Warning
doxygenfunction: Unable to resolve multiple matches for function “udho::operator<<” with arguments (module_overload<Function, CompositorT>, const char(&)) in doxygen xml output for project “udho” from directory: dox/xml. Potential matches:
- template<typename AuxT, typename LoggerT, typename CacheT, udho::logging::status Status> attachment<AuxT, LoggerT, CacheT> &operator<<(attachment<AuxT, LoggerT, CacheT> &attachment, const udho::logging::message<Status> &msg)
- template<typename AuxT, typename RequestT, typename ShadowT> udho::context<AuxT, RequestT, ShadowT> &operator<<(udho::context<AuxT, RequestT, ShadowT> &context, const exceptions::http_error &error)
- template<typename AuxT, typename RequestT, udho::logging::status Status> const detail::context_common<AuxT, RequestT> &operator<<(const detail::context_common<AuxT, RequestT> &ctx, const udho::logging::message<Status> &msg)
- template<typename Function, template<typename> class CompositorT, int N> module_overload<Function, CompositorT> operator<<(module_overload<Function, CompositorT> overload, const char (&expr)[N])
- template<typename K, typename C> std::ostream &operator<<(std::ostream &stream, const proxy<K, C> &p)
- template<typename RequestT, typename ShadowT, typename T> session_<RequestT, ShadowT> &operator<<(session_<RequestT, ShadowT> &session, const T &data)
- template<typename RequestT, typename V> cookies_<RequestT> &operator<<(cookies_<RequestT> &cookies, const udho::cookie_<V> &cookie)
- template<typename StreamT, typename U, typename V> StreamT &operator<<(StreamT &stream, const overload_group<U, V> &router)
- template<typename U, typename V, typename F> overload_group<overload_group<U, V>, F> operator<<(const overload_group<U, V> &group, const F &method)
Template Function udho::operator<<(const overload_group<U, V>&, const F&)¶
Defined in File router.h
Function Documentation¶
Warning
doxygenfunction: Unable to resolve multiple matches for function “udho::operator<<” with arguments (const overload_group<U, V>&, const F&) in doxygen xml output for project “udho” from directory: dox/xml. Potential matches:
- template<typename AuxT, typename LoggerT, typename CacheT, udho::logging::status Status> attachment<AuxT, LoggerT, CacheT> &operator<<(attachment<AuxT, LoggerT, CacheT> &attachment, const udho::logging::message<Status> &msg)
- template<typename AuxT, typename RequestT, typename ShadowT> udho::context<AuxT, RequestT, ShadowT> &operator<<(udho::context<AuxT, RequestT, ShadowT> &context, const exceptions::http_error &error)
- template<typename AuxT, typename RequestT, udho::logging::status Status> const detail::context_common<AuxT, RequestT> &operator<<(const detail::context_common<AuxT, RequestT> &ctx, const udho::logging::message<Status> &msg)
- template<typename Function, template<typename> class CompositorT, int N> module_overload<Function, CompositorT> operator<<(module_overload<Function, CompositorT> overload, const char (&expr)[N])
- template<typename K, typename C> std::ostream &operator<<(std::ostream &stream, const proxy<K, C> &p)
- template<typename RequestT, typename ShadowT, typename T> session_<RequestT, ShadowT> &operator<<(session_<RequestT, ShadowT> &session, const T &data)
- template<typename RequestT, typename V> cookies_<RequestT> &operator<<(cookies_<RequestT> &cookies, const udho::cookie_<V> &cookie)
- template<typename StreamT, typename U, typename V> StreamT &operator<<(StreamT &stream, const overload_group<U, V> &router)
- template<typename U, typename V, typename F> overload_group<overload_group<U, V>, F> operator<<(const overload_group<U, V> &group, const F &method)
Template Function udho::operator<<(StreamT&, const overload_group<U, V>&)¶
Defined in File router.h
Function Documentation¶
Warning
doxygenfunction: Unable to resolve multiple matches for function “udho::operator<<” with arguments (StreamT&, const overload_group<U, V>&) in doxygen xml output for project “udho” from directory: dox/xml. Potential matches:
- template<typename AuxT, typename LoggerT, typename CacheT, udho::logging::status Status> attachment<AuxT, LoggerT, CacheT> &operator<<(attachment<AuxT, LoggerT, CacheT> &attachment, const udho::logging::message<Status> &msg)
- template<typename AuxT, typename RequestT, typename ShadowT> udho::context<AuxT, RequestT, ShadowT> &operator<<(udho::context<AuxT, RequestT, ShadowT> &context, const exceptions::http_error &error)
- template<typename AuxT, typename RequestT, udho::logging::status Status> const detail::context_common<AuxT, RequestT> &operator<<(const detail::context_common<AuxT, RequestT> &ctx, const udho::logging::message<Status> &msg)
- template<typename Function, template<typename> class CompositorT, int N> module_overload<Function, CompositorT> operator<<(module_overload<Function, CompositorT> overload, const char (&expr)[N])
- template<typename K, typename C> std::ostream &operator<<(std::ostream &stream, const proxy<K, C> &p)
- template<typename RequestT, typename ShadowT, typename T> session_<RequestT, ShadowT> &operator<<(session_<RequestT, ShadowT> &session, const T &data)
- template<typename RequestT, typename V> cookies_<RequestT> &operator<<(cookies_<RequestT> &cookies, const udho::cookie_<V> &cookie)
- template<typename StreamT, typename U, typename V> StreamT &operator<<(StreamT &stream, const overload_group<U, V> &router)
- template<typename U, typename V, typename F> overload_group<overload_group<U, V>, F> operator<<(const overload_group<U, V> &group, const F &method)
Template Function udho::operator<<(session_<RequestT, ShadowT>&, const T&)¶
Defined in File session.h
Function Documentation¶
Warning
doxygenfunction: Unable to resolve multiple matches for function “udho::operator<<” with arguments (session_<RequestT, ShadowT>&, const T&) in doxygen xml output for project “udho” from directory: dox/xml. Potential matches:
- template<typename AuxT, typename LoggerT, typename CacheT, udho::logging::status Status> attachment<AuxT, LoggerT, CacheT> &operator<<(attachment<AuxT, LoggerT, CacheT> &attachment, const udho::logging::message<Status> &msg)
- template<typename AuxT, typename RequestT, typename ShadowT> udho::context<AuxT, RequestT, ShadowT> &operator<<(udho::context<AuxT, RequestT, ShadowT> &context, const exceptions::http_error &error)
- template<typename AuxT, typename RequestT, udho::logging::status Status> const detail::context_common<AuxT, RequestT> &operator<<(const detail::context_common<AuxT, RequestT> &ctx, const udho::logging::message<Status> &msg)
- template<typename Function, template<typename> class CompositorT, int N> module_overload<Function, CompositorT> operator<<(module_overload<Function, CompositorT> overload, const char (&expr)[N])
- template<typename K, typename C> std::ostream &operator<<(std::ostream &stream, const proxy<K, C> &p)
- template<typename RequestT, typename ShadowT, typename T> session_<RequestT, ShadowT> &operator<<(session_<RequestT, ShadowT> &session, const T &data)
- template<typename RequestT, typename V> cookies_<RequestT> &operator<<(cookies_<RequestT> &cookies, const udho::cookie_<V> &cookie)
- template<typename StreamT, typename U, typename V> StreamT &operator<<(StreamT &stream, const overload_group<U, V> &router)
- template<typename U, typename V, typename F> overload_group<overload_group<U, V>, F> operator<<(const overload_group<U, V> &group, const F &method)
Template Function udho::operator>>(const char(&), module_overload<Function, CompositorT>)¶
Defined in File router.h
Function Documentation¶
Warning
doxygenfunction: Unable to resolve multiple matches for function “udho::operator>>” with arguments (const char(&), module_overload<Function, CompositorT>) in doxygen xml output for project “udho” from directory: dox/xml. Potential matches:
- template<typename Function, template<typename> class CompositorT, int N> module_overload<Function, CompositorT> operator>>(const char (&expr)[N], module_overload<Function, CompositorT> overload)
- template<typename RequestT, typename ShadowT, typename T> const session_<RequestT, ShadowT> &operator>>(const session_<RequestT, ShadowT> &session, T &data)
Template Function udho::operator>>(const session_<RequestT, ShadowT>&, T&)¶
Defined in File session.h
Function Documentation¶
Warning
doxygenfunction: Unable to resolve multiple matches for function “udho::operator>>” with arguments (const session_<RequestT, ShadowT>&, T&) in doxygen xml output for project “udho” from directory: dox/xml. Potential matches:
- template<typename Function, template<typename> class CompositorT, int N> module_overload<Function, CompositorT> operator>>(const char (&expr)[N], module_overload<Function, CompositorT> overload)
- template<typename RequestT, typename ShadowT, typename T> const session_<RequestT, ShadowT> &operator>>(const session_<RequestT, ShadowT> &session, T &data)
Template Function udho::operator|(const prepared_group<U, V>&, const udho::prepared<P>&)¶
Defined in File access.h
Function Documentation¶
Warning
doxygenfunction: Unable to resolve multiple matches for function “udho::operator|” with arguments (const prepared_group<U, V>&, const udho::prepared<P>&) in doxygen xml output for project “udho” from directory: dox/xml. Potential matches:
- template<typename U, typename V, typename F> overload_group<overload_group<U, V>, F> operator|(const overload_group<U, V> &group, const F &method)
- template<typename U, typename V, typename P> prepared_group<udho::prepared<P>, prepared_group<U, V>> operator|(const prepared_group<U, V> &nonterminal, const udho::prepared<P> &terminal)
- template<typename U, typename V> prepared_group<udho::prepared<V>, prepared_group<udho::prepared<U>, void>> operator|(const udho::prepared<U> &left, const udho::prepared<V> &right)
Template Function udho::operator|(const udho::prepared<U>&, const udho::prepared<V>&)¶
Defined in File access.h
Function Documentation¶
Warning
doxygenfunction: Unable to resolve multiple matches for function “udho::operator|” with arguments (const udho::prepared<U>&, const udho::prepared<V>&) in doxygen xml output for project “udho” from directory: dox/xml. Potential matches:
- template<typename U, typename V, typename F> overload_group<overload_group<U, V>, F> operator|(const overload_group<U, V> &group, const F &method)
- template<typename U, typename V, typename P> prepared_group<udho::prepared<P>, prepared_group<U, V>> operator|(const prepared_group<U, V> &nonterminal, const udho::prepared<P> &terminal)
- template<typename U, typename V> prepared_group<udho::prepared<V>, prepared_group<udho::prepared<U>, void>> operator|(const udho::prepared<U> &left, const udho::prepared<V> &right)
Template Function udho::operator|(const overload_group<U, V>&, const F&)¶
Defined in File router.h
Function Documentation¶
Warning
doxygenfunction: Unable to resolve multiple matches for function “udho::operator|” with arguments (const overload_group<U, V>&, const F&) in doxygen xml output for project “udho” from directory: dox/xml. Potential matches:
- template<typename U, typename V, typename F> overload_group<overload_group<U, V>, F> operator|(const overload_group<U, V> &group, const F &method)
- template<typename U, typename V, typename P> prepared_group<udho::prepared<P>, prepared_group<U, V>> operator|(const prepared_group<U, V> &nonterminal, const udho::prepared<P> &terminal)
- template<typename U, typename V> prepared_group<udho::prepared<V>, prepared_group<udho::prepared<U>, void>> operator|(const udho::prepared<U> &left, const udho::prepared<V> &right)
Template Function udho::overload(boost::beast::http::verb, F, CompositorT<typename internal::function_signature<F>::return_type>)¶
Defined in File router.h
Function Documentation¶
Warning
doxygenfunction: Unable to resolve multiple matches for function “udho::overload” with arguments (boost::beast::http::verb, F, CompositorT<typename internal::function_signature<F>::return_type>) in doxygen xml output for project “udho” from directory: dox/xml. Potential matches:
- template<typename F, template<typename> class CompositorT = compositors::transparent> module_overload<F, CompositorT> overload(boost::beast::http::verb request_method, F ftor, CompositorT<typename internal::function_signature<F>::return_type> compositor = CompositorT<typename internal::function_signature<F>::return_type>())
- template<typename F, typename A1, template<typename> class CompositorT = compositors::transparent> auto overload(boost::beast::http::verb request_method, F ftor, A1 &a1, CompositorT<typename internal::function_signature<F>::return_type> compositor = CompositorT<typename internal::function_signature<F>::return_type>())
Template Function udho::overload(boost::beast::http::verb, F, A1&, CompositorT<typename internal::function_signature<F>::return_type>)¶
Defined in File router.h
Function Documentation¶
Warning
doxygenfunction: Unable to resolve multiple matches for function “udho::overload” with arguments (boost::beast::http::verb, F, A1&, CompositorT<typename internal::function_signature<F>::return_type>) in doxygen xml output for project “udho” from directory: dox/xml. Potential matches:
- template<typename F, template<typename> class CompositorT = compositors::transparent> module_overload<F, CompositorT> overload(boost::beast::http::verb request_method, F ftor, CompositorT<typename internal::function_signature<F>::return_type> compositor = CompositorT<typename internal::function_signature<F>::return_type>())
- template<typename F, typename A1, template<typename> class CompositorT = compositors::transparent> auto overload(boost::beast::http::verb request_method, F ftor, A1 &a1, CompositorT<typename internal::function_signature<F>::return_type> compositor = CompositorT<typename internal::function_signature<F>::return_type>())
Template Function udho::post(F)¶
Defined in File router.h
Function Documentation¶
Warning
doxygenfunction: Unable to resolve multiple matches for function “udho::post” with arguments (F) in doxygen xml output for project “udho” from directory: dox/xml. Potential matches:
- template<typename F, typename A1> auto post(F ftor, A1 &a1)
- template<typename F> auto post(F ftor)
Template Function udho::post(F, A1&)¶
Defined in File router.h
Function Documentation¶
Warning
doxygenfunction: Unable to resolve multiple matches for function “udho::post” with arguments (F, A1&) in doxygen xml output for project “udho” from directory: dox/xml. Potential matches:
- template<typename F, typename A1> auto post(F ftor, A1 &a1)
- template<typename F> auto post(F ftor)
Template Function udho::put(F)¶
Defined in File router.h
Function Documentation¶
Warning
doxygenfunction: Unable to resolve multiple matches for function “udho::put” with arguments (F) in doxygen xml output for project “udho” from directory: dox/xml. Potential matches:
- template<typename F, typename A1> auto put(F ftor, A1 &a1)
- template<typename F> auto put(F ftor)
Template Function udho::put(F, A1&)¶
Defined in File router.h
Function Documentation¶
Warning
doxygenfunction: Unable to resolve multiple matches for function “udho::put” with arguments (F, A1&) in doxygen xml output for project “udho” from directory: dox/xml. Potential matches:
- template<typename F, typename A1> auto put(F ftor, A1 &a1)
- template<typename F> auto put(F ftor)
Template Function udho::scope¶
Defined in File scope.h
Function Documentation¶
-
template<typename
GroupT
>
lookup_table<GroupT>udho
::
scope
(const GroupT &p)¶ returns a table of strings mapped with value returning objects GroupT must be an instance of udho::prepare<T> which can be obtained by using udho::data(const T&)
Function udho::util::charToHex¶
Defined in File util.h
Function udho::util::hexToChar¶
Defined in File util.h
Template Function udho::view::expression¶
Defined in File parser.h
Function Documentation¶
-
template<typename
ScopeT
>
parsing::expression<ScopeT>udho::view
::
expression
(ScopeT &scope)¶
Template Function udho::view::processor¶
Defined in File parser.h
Template Function udho::visitors::print¶
Defined in File visitor.h
Function Documentation¶
-
template<std::uint8_t
Visitables
, typenameF
>
visitor<printing_visitor<Visitables, F>>udho::visitors
::
print
(F &callback)¶ prints the selected routes in the router
router /= budho::visitors::print<budho::visitors::visitable::callable | budho::visitors::visitable::application, std::ostream>(std::cout);
Template Function udho::visitors::print_html¶
Defined in File visitor.h
Function Documentation¶
-
template<std::uint8_t
Visitables
, typenameF
>
visitor<printing_visitor_html<Visitables, F>>udho::visitors
::
print_html
(F &callback)¶
Template Function udho::visitors::target¶
Defined in File visitor.h
Function Documentation¶
-
template<std::uint8_t
Visitables
, typenameF
>
visitor<targetted_visitor<Visitables, F>>udho::visitors
::
target
(F callback)¶
Variables¶
Variable udho::forms::default_datetime_format¶
Defined in File forms.h
Defines¶
Define UDHO_SESSION_COOKIE_NAME¶
Defined in File configuration.h
Define UDHO_SESSION_FILE_EXTENSION¶
Defined in File configuration.h
Typedefs¶
Typedef udho::accessor¶
Defined in File activities.h
Typedef Documentation¶
-
using
udho
::
accessor
= activities::accessor<T...>¶ shorthand for udho::activities::accessor
Typedef udho::activities::detail::apply_helper¶
Defined in File activities.h
Typedef Documentation¶
-
using
udho::activities::detail
::
apply_helper
= apply_helper_<udho::util::is_invocable<FunctorT, TargetsT...>::value, FunctorT, TargetsT...>¶
Typedef udho::activity¶
Defined in File activities.h
Typedef Documentation¶
-
using
udho
::
activity
= activities::activity<DerivedT, SuccessDataT, FailureDataT>¶ shorthand for udho::activities::activity
Typedef udho::client_options¶
Defined in File client.h
Typedef Documentation¶
-
typedef client_options_
udho
::
client_options
¶
Typedef udho::configs::form¶
Defined in File configuration.h
Typedef udho::configs::logger¶
Defined in File configuration.h
Typedef udho::configs::router¶
Defined in File configuration.h
Typedef udho::configs::server¶
Defined in File configuration.h
Typedef udho::configs::session¶
Defined in File configuration.h
Typedef udho::configuration_type¶
Defined in File configuration.h
Typedef udho::contexts::stateful¶
Defined in File contexts.h
Typedef Documentation¶
-
using
udho::contexts
::
stateful
= context<udho::bridge<udho::configuration_type>, udho::defs::request_type, udho::cache::shadow<udho::defs::session_key_type, T...>>¶ A stateful context for stateful callable using the default bridge and the default HTTP request type.
- See
- Template Parameters
T...
: Session states
Typedef udho::contexts::stateless¶
Defined in File contexts.h
Typedef Documentation¶
-
using
udho::contexts
::
stateless
= context<udho::bridge<udho::configuration_type>, udho::defs::request_type, void>¶ A stateless context for stateless callable using the default bridge and the default HTTP request type.
Typedef udho::defs::request_type¶
Defined in File defs.h
Typedef udho::defs::response_type¶
Defined in File defs.h
Typedef udho::defs::session_key_type¶
Defined in File defs.h
Typedef udho::detail::url_data¶
Defined in File url.h
Typedef udho::form::optional¶
Defined in File form.hxx
Typedef udho::form::required¶
Defined in File form.hxx
Typedef udho::forms::constraints::length_gt¶
Defined in File forms.h
Typedef udho::forms::constraints::length_gte¶
Defined in File forms.h
Typedef udho::forms::constraints::length_lt¶
Defined in File forms.h
Typedef udho::forms::constraints::length_lte¶
Defined in File forms.h
Typedef udho::forms::constraints::length_max¶
Defined in File forms.h
Typedef Documentation¶
-
typedef length_lte
udho::forms::constraints
::
length_max
¶
Typedef udho::forms::constraints::length_min¶
Defined in File forms.h
Typedef Documentation¶
-
typedef length_gte
udho::forms::constraints
::
length_min
¶
Typedef udho::forms::constraints::max¶
Defined in File forms.h
Typedef udho::forms::constraints::min¶
Defined in File forms.h
Typedef udho::forms::detail::constraint_visitor¶
Defined in File forms.h
Typedef Documentation¶
-
using
udho::forms::detail
::
constraint_visitor
= constraint_visitor_<ConstrainedFieldT, ConstrainedFieldT::depth - Depth>¶
Typedef udho::forms::drivers::multipart_raw¶
Defined in File forms.h
Typedef Documentation¶
-
typedef multipart_<std::string::const_iterator>
udho::forms::drivers
::
multipart_raw
¶
Typedef udho::forms::drivers::urlencoded_raw¶
Defined in File forms.h
Typedef Documentation¶
-
typedef urlencoded_<std::string::const_iterator>
udho::forms::drivers
::
urlencoded_raw
¶
Typedef udho::forms::form_multipart_¶
Defined in File forms.h
Typedef udho::forms::optional¶
Defined in File forms.h
Typedef udho::forms::query_¶
Defined in File forms.h
Typedef Documentation¶
-
using
udho::forms
::
query_
= form<drivers::urlencoded_raw>¶
Typedef udho::forms::required¶
Defined in File forms.h
Typedef udho::loggers::ostream¶
Defined in File logging.h
Typedef udho::perform¶
Defined in File activities.h
Typedef Documentation¶
-
using
udho
::
perform
= activities::perform<ActivityT>¶ shorthand for udho::activities::perform
Typedef udho::require¶
Defined in File activities.h
Typedef Documentation¶
-
using
udho
::
require
= activities::require<DependenciesT...>¶ shorthand for udho::activities::require
Typedef udho::router¶
Defined in File router.h
Typedef Documentation¶
-
typedef basic_router
udho
::
router
¶
Typedef udho::servers::ostreamed::stateful¶
Defined in File server.h
Typedef Documentation¶
-
using
udho::servers::ostreamed
::
stateful
= ostreamed_helper<udho::cache::store<StorageT, boost::uuids::uuid, U...>>¶
Typedef udho::servers::ostreamed::stateless¶
Defined in File server.h
Typedef Documentation¶
-
using
udho::servers::ostreamed
::
stateless
= ostreamed_helper<void>¶
Typedef udho::servers::quiet::stateful¶
Defined in File server.h
Typedef udho::servers::quiet::stateless¶
Defined in File server.h
Typedef Documentation¶
-
using
udho::servers::quiet
::
stateless
= server<udho::bridge<udho::configuration_type>, void, void>¶
Typedef udho::servers::stateless::logged¶
Defined in File server.h
Typedef Documentation¶
-
using
udho::servers::stateless
::
logged
= server<udho::bridge<udho::configuration_type>, LoggerT, void>¶
Typedef udho::servers::stateless::quiet¶
Defined in File server.h
Typedef Documentation¶
-
using
udho::servers::stateless
::
quiet
= server<udho::bridge<udho::configuration_type>, void, void>¶
Typedef udho::tcp¶
Defined in File connection.h
Typedef udho::visitors::targeted¶
Defined in File visitor.h
Typedef Documentation¶
-
using
udho::visitors
::
targeted
= visitor<targetted_visitor<Visitables, F>>¶
Quickstart¶
Building udho¶
udho can be built like a regular cmake library. The requirements of udho library are available in most *nix reposetories.
Requirements¶
boost >= 1.66
icu [optional]
git
cmake
c++ compiler
Ubuntu¶
sudo apt-get install git cmake build-essential boost-all-dev libicu-dev pugixml-dev
Fedora¶
sudo dnf install @development-tools
sudo dnf install git cmake boost-devel libicu-devel pugixml-devel
Arch Linux¶
sudo pacman -S base-devel git cmake boost icu pugixml
Mac¶
brew install git cmake boost icu pugixml
Build¶
After the dependencies are installed udho has to be cloned from the git reposetory and ompiled as a regular C++ library. use make tests
to execute the unit tests. The exemaples are inside examples
directory.
git clone https://gitlab.com/neel.basu/udho.git
cd udho
mkdir build
cd build
cmake ..
make
URL Routing¶
Request Context¶
A context wraps a raw HTTP request and is passed to all callables once its corresponding url pattern is matched. The context also associates the request with the underlying server.
So using the server the server common functions that are not specific any particular callable like logging, template rendering etc. can be performed. The context can be stateful
or stateless
.
With a stateless context session informations can not be accessed even if the server is stateful. A stateful context is instantiated with a set of states
that can be accessed from the callable.
The set of states with which the stateful context is created should be the subset of the states of a stateful server. As the stateful context contains a subset of server states only that subset of state information
is accessible through the stateful context.
Note
The context templates require the bridge and HTTP request type to be passed as the template parameters while instantiation. Its adviced to use the conveniance types instead of directly instiating these templates.
str::string profile(udho::contexts::stateful<user> ctx){
if(ctx.session().exists<user>()){
user data;
ctx.session() >> data;
// user logged in
}else{
// user not logged in
}
}
udho::contexts::stateful
is actually a typedef of udho::context
with default bridge and request type
std::string profile(udho::contexts::stateless ctx, std::size_t uid){
// view public profile of user uid
}
udho::contexts::stateless
is actually a typedef of udho::context
with default bridge and request type
Request¶
The request parameters can be accessed either through the conveniance methods or through the raw boost-beast request object. Use ctx.request()
to get the underlying request object from the context.
However for common tasks there are conveniance methods that extracts information from the request object and returns.
Warning
doxygenfunction: Cannot find function “udho::context::request” in doxygen xml output for project “udho” from directory: dox/xml
Warning
doxygenfunction: Cannot find function “udho::context::target” in doxygen xml output for project “udho” from directory: dox/xml
Warning
doxygenfunction: Cannot find function “udho::context::path” in doxygen xml output for project “udho” from directory: dox/xml
Warning
doxygenfunction: Cannot find function “udho::context::query” in doxygen xml output for project “udho” from directory: dox/xml
Logging¶
The context passes a logging message to the logger attached with the server.
Warning
doxygenfunction: Cannot find function “udho::context::log” in doxygen xml output for project “udho” from directory: dox/xml
API¶
Stateful Context Template¶
-
template<typename
AuxT
, typenameRequestT
, typenameShadowT
>
structudho
::
context
: public udho::detail::context_common<AuxT, RequestT> A Stateful context passed to all callables along with the arguments. The context is always the first argument to the callable. Even if the callable takes no arguments, it must take the context as the first argument. A stateful context should be used in callables that need to use session states.
- Note
instead of instantiating this template directly use udho::contexts::stateful
- Template Parameters
AuxT
: bridge between the server and the callableRequestT
: HTTP request typeShadowT
: the session data structure
Public Functions
-
session_type &
session
() access the HTTP Session
Stateless Context Template¶
-
template<typename
AuxT
, typenameRequestT
>
structcontext
<AuxT, RequestT, void> : public udho::detail::context_common<AuxT, RequestT> A Stateless context passed to all callables along with the arguments. he context is always the first argument to the callable. Even if the callable takes no arguments, it must take the context as the first argument. A stateless context should be used in callables that need not to use session states.
- Note
instead of instantiating this template directly use udho::contexts::stateless
- Template Parameters
AuxT
: bridge between the server and the callableRequestT
: HTTP request type
HTTP Server¶
udho provides varying types of servers depending on the logging and session facilities. A server is called stateful if it provides HTTP session, otherwise it is called stateless. If the server provides APIs that do noy require any session then use stateless server, otherwise use a stateful server. If no logging is required then use a quiet
server that uses a void logger, otherwise use a logging server. The servers udho::servers::ostreamed::stateless
and udho::servers::ostreamed::stateful<>
used in the examples are stateless and stateful servers respectively that uses ostreamed logger present inside udho. All servers inside udho::servers
namespace are typedef’ed udho::server
.
Logged Stateless Server¶
udho::servers::stateless::logged<LoggerT>
udho::servers::logged<LoggerT>::stateless
Quiet Stateless Server¶
udho::servers::stateless::quiet
udho::servers::quiet::stateless
Logged Stateful Server¶
udho::servers::stateful<States...>::logged<LoggerT>
udho::servers::logged<LoggerT>::stateful<States...>
Quiet Stateful Server¶
udho::servers::stateful<States...>::quiet
udho::servers::quiet::stateful<States...>
udho comes with a logger udho::loggers::ostream
that prints logginf messages to std::ostream
. This logger is used in all examples. So there is a typedef servers::stateful<States...>::ostreamed
that actually is servers::stateful<States...>::logged<loggers::ostream>
A Logging server takes reference to a logger in constructor. So the Logger has to be instantiated by the caller, as shown in the following example.
udho::loggers::ostream logger(std::cout);
udho::servers::stateful<StateA, StateB>::ostreamed server(logger);
For ease of access there is an ostreamed
server is provided which owns the ostream logger inside. To use this server, no logger has to be instantiated. Only the stream (std::cout) has to be provided. through the constructor.
udho::servers::ostreamed::stateless
udho::servers::ostreamed::stateful<StateA, StateB>
States¶
The stateful server uses session cookie for remembering a returning user. The session cookie is named UDHOSESSID
. For each session some information can be stored at server side. This type of features are useful for login, captcha, CSRF token etc.. udho takes advantage of stateful nation of C++ and provides session functionality around a set of states defined at compile time. A state can be any copiable C++ type. Once a stateful server is instantiated with N
number of states, callables that takes stateful contexts with M <= N
states can be used.
struct student{
std::string first_name;
std::string last_name;
unsigned int registration_id;
};
struct appearence{
std::string theme;
};
Using these two states a server can be defined as following.
udho::servers::ostreamed::stateful<student, appearence> server(std::cout);
A function taking a stateful context around zero or more of these two states can be used in the router when the above server is used. So all four (func1
, func2
, func3
, and func4
) are valid functions that can be mapped with the router when the above mentioned server is used.
std::string func1(udho::contexts::stateful<student, appearence> ctx){
// ...
}
std::string func2(udho::contexts::stateful<student> ctx){
// ...
}
std::string func3(udho::contexts::stateful<appearence> ctx){
// ...
}
std::string func4(udho::contexts::stateless ctx){
// ...
}
In these functions the corresponding values of the current session of the requested type can be accessed like the following.
std::string func1(udho::contexts::stateful<student, appearence> ctx){
bool student_data_exists = ctx.session().exists<student>();
if(!student_data_exists){
student data;
data.first_name = "Jane";
data.last_name = "Doe";
data.registration_id = 1;
ctx.session() << data;
}else{
student data;
ctx.session() >> data;
std::cout << data.first_name << std::endl;
}
}
Form¶
Forms are accessed through the context using ctx.form()
method.
Forms submitted in POST request can be url encoded
or multipart
. Different form parsing techniques are used by udho::urlencoded_form and udho::multipart_form.
API¶
udho::form¶
-
template<typename
RequestT
>
structudho
::
form_
unified form accessor that can extract field from both urlencoded as well as multipart forms.
Public Functions
-
void
parse_urlencoded
() parse the beast request body as urlencoded form data
-
void
parse_multipart
() parse the beast request body as multipart form data
-
bool
is_urlencoded
() const check whether the submitted form is urlencoded
-
bool
is_multipart
() const check whether the submitted form is multipart
-
const urlencoded_form<std::string::const_iterator> &
urlencoded
() const return the urlencoded specific form accessor
-
const multipart_form<std::string::const_iterator> &
multipart
() const return the multipart specific form accessor
-
bool
parsed
() const returns true once the form is parsed
-
bool
has
(const std::string &name) const checks whether the form contains any field with matching name
- Parameters
name
: name of the form field
-
template<typename
V
>
Vfield
(const std::string &name) const returns a form field object for a given field
-
fields_map_type::size_type
count
() const returns number of fields in the form
-
void
udho::urlencoded_form¶
-
template<typename
Iterator
>
structudho
::
urlencoded_form
Form accessor for urlencoded forms
Public Functions
-
std::size_t
count
() const number of fields in the form
-
bool
has
(const std::string name) const checks whether there exists any field with the name provided
-
template<typename
T
>
const Tfield
(const std::string &name) const returns the value of the field with the name provided lexically casted to type T
-
std::size_t
udho::multipart_form¶
-
template<typename
Iterator
>
structudho
::
multipart_form
Form accessor for multipart forms
Public Functions
-
std::size_t
count
() const number of fields in the form
-
bool
has
(const std::string name) const checks whether the form has any field with the given name
-
const form_part &
part
(const std::string &name) const returns the part associated with the given name
-
template<typename
T
>
const Tfield
(const std::string &name) const returns the value of the field lexically casted with the desired type
form.field<int>("age");
-
struct
form_part
A part in the multipart form data
Public Functions
-
const bounded_string_type &
header
(const std::string &key) const returns the value associated with the key in the header of the part
header("Content-Disposition").copied<std::string>();
-
bounded_string_type
header
(const std::string &key, const std::string &sub) const returns the value associated with the key and sub key in the header of the part
header("Content-Disposition", "name").copied<std::string>();
-
bounded_string_type
name
() const name of the part
name().copied<std::string>();
-
bounded_string_type
filename
() const filename of the part
name().copied<std::string>();
-
const bounded_string_type &
body
() const body of the part returned as a pair of string iterators
body().copied<std::string>();
-
std::string
str
() const returns the body of the part as string
-
template<typename
T
>
Tvalue
() const lexically convert the contents of the body to the requested type
-
const bounded_string_type &
-
std::size_t
HTTP Session¶
udho server takes a LoggerT
and a CacheT
as template parameters. The LoggerT
provides logging facilities and the CacheT
serves as the HTTP session. the first parameter udho::bridge
bridges a server with the contexts. It provides utilities like document root, that are configured at the server to the callable’s context. The reference to the bridge can be accessed through aux()
method in the context.
typedef server<udho::bridge, LoggerT, CacheT> server_type;
The cache is implemented by the template udho::cache::store<KeyT, States...>
. The cache::store
serves as a key-value store where the set of possible values are limited by the variadic parameter States...
.
struct X{};
struct Y{};
struct Z{};
udho::cache::store<int, X, X, Z> store;
In the example above an integer indexed store
is created that can store only three types of values (X
, Y
, Z
) for each key. Any read or write opration using any type other than these three will be restricted at compile time. The operations that can be performed on the store are
checks for existance of any value of type
V
against thekey
gets the value of type
V
associated with thekey
. If no such value is inserted returns thedefault_value
returns the value of type
V
associated withkey
and throws exception if that doesn’t exist.associates a value of type
V
withkey
udho uses boost::uuids::uuid
as KeyT
to provide session id. So each session id is 128 bit uuid generated by boost uuid library.
Logging¶
Async Task Graph¶
Execution of Asynchronous Tasks may be required for executing SQL or any other data queries including HTTP queries to fetch external data. udho does not including a database library with itself.
However any asynchronous database library using boost asio may benifit from an async activity framework. udho::activities
provides an way to describe a task graph that gather data into an heterogenous collector.
A task may be associated with its dependencies of other tasks and task related data.
Collector¶
Different activities using different success and failure data will be involved in the subtask graph. A subtask or even an activity may need to use the data fetched by its dependencies in order to execute its action. Hence a heterogenous collector collects the data submited by the success
or failure
methods, which can be accessed through an accessor. In the following example data
is a collector that collects success or failure data of three activities A1
, A2
, and A3
respectively. Usually all activities involved in the subtask graph should be passed as a template parameter of collect
auto data = udho::activities::collect<A1, A2, A3>(ctx, "Any string name for the collector");
However under many circumstances the entire collector is not required to be accessed. Instead a subset of what has been collected are accessed. So an accessor<...>
is created from that collector.
udho::activities::accessor<A1, A2> access(data);
if(!access.failed<A1>()){
A1SData pre = access.success<A1>();
}
The collector has to be passed to the constructor of all activities.
Activity¶
An activity
is the definition of the job that has to be performed. A subtask
is an instantiation of an activity
. Definition of an activity consists of two types SuccessDataT
, FailureDataT
and a no argument function call operarator operator()()
overload. A subtask
on the other hand instantiates an activity
by specifying its data and execution dependencies thus establishing an order of invocation. The philosophy is that the activity is reusable while the subtask reuses that to model different use cases. The activity is invoked through its operator()()
overload after all its prior activities have completed (dependencies are specified by the subtask). The operator()()
must call either success()
or failure()
methods either synchronously or asynchronously with SuccessDataT
or FailureDataT
in order to signal its completion. An activity A
subclasses from udho::activity<A, SuccessA, FailureA>
which defines the success()
and failure()
methods.
In the following example the success and failure data for activity A1 are A1SData
and A1FData
respectively. A1
starts a timer for 5 seconds. Once the timer finishes the value 42 is set as the success value and the activity finishes.
struct A1SData{
int value;
};
struct A1FData{
int reason;
};
struct A1: udho::activities::activity<A1, A1SData, A1FData>{
typedef udho::activities::activity<A1, A1SData, A1FData> base;
boost::asio::deadline_timer _timer;
template <typename CollectorT>
A1(CollectorT c, boost::asio::io_context& io): base(c), _timer(io){}
void operator()(){
_timer.expires_from_now(boost::posix_time::seconds(5));
_timer.async_wait(boost::bind(&A1::finished, self(), boost::asio::placeholders::error));
}
void finished(const boost::system::error_code& e){
A1SData data;
data.value = 42; // Fetched 42 from somewhere
success(data); // successful
}
};
Subtask¶
Activities serves the purpose of defining an action. however to action is supposed to fit in some use case depending on the application needs. The application needs may require a specific order of invocation of these activities. So that sufficient data is collected before some activity is invoked.

In the above mentioned task graph, Both A2 and A3 depends on A1. Hence A2 and A3 may start as soon as A1 completes. A4 depends on both A2 and A3 and cannot start until both A2 and A3 completes. In this situation A2 and A3 can access the data fetched by A1 activity because that has already been completed (succeded or failed) before A2 or A3 is invoked. Similarly A4 can access the data collected by A1, A2, A3 that has completed before A4 has been invoked.
usho::activities::perform
describes the above subtask graph as shown in the following code block.
auto data = udho::activities::collect<A1, A2i, A3i>(ctx, "A");
auto t1 = udho::activities::perform<A1>::with(data, io);
auto t2 = udho::activities::perform<A2>::require<A1>::with(data, io).after(t1);
auto t3 = udho::activities::perform<A3>::require<A1>::with(data, io).after(t1);
auto t4 = udho::activities::perform<A4>::require<A2, A3>::with(data, io).after(t2).after(t3);
The above statements using perform
are equivalent to the following.
auto data = udho::activities::collect<A1, A2i, A3i>(ctx, "A");
auto t1 = udho::activities::subtask<A1>::with(data, io);
auto t2 = udho::activities::subtask<A2, A1>::with(data, io).after(t1);
auto t3 = udho::activities::subtask<A3, A1>::with(data, io).after(t1);
auto t4 = udho::activities::subtask<A4, A2, A3>::with(data, io).after(t2).after(t3);
With this arrangement Success/Failure data of A1 is available to A2 and A3 before it starts execution. To access that data the constructors on A2 and A3 may create an accessor as shown below.
struct A2: udho::activities::activity<A2, A2SData, A2FData>{
typedef udho::activities::activity<A2, A2SData, A2FData> base;
boost::asio::deadline_timer _timer;
udho::activities::accessor<A1> _accessor; // An accessor to access success/failure data of A1
template <typename CollectorT>
A2(CollectorT c, boost::asio::io_context& io): base(c), _timer(io), _accessor(c){}
void operator()(){
_timer.expires_from_now(boost::posix_time::seconds(10));
_timer.async_wait(boost::bind(&A2::finished, self(), boost::asio::placeholders::error));
}
void finished(const boost::system::error_code& err){
if(!err && !_accessor.failed<A1>()){ // check whether A1 has failed or not
A1SData pre = _accessor.success<A1>(); // access the success data collected from A1
A2SData data;
data.value = pre.value + 2; // creates its own success data
success(data); // signal completion with success
}
}
};
However in the above mentioned implementation A2 always depends on A1. In an use case where A2 depends on some other activity or even executed independently won’t be feasible because A2 will still have an accessor to A1 and it will try to extract the success data of A1 irrespective of the graph. On the other hand, A2 may still need some data that has to be set in order to perform the activity. that data may be derived from A1 or from some other activity or through some constructor argument.
struct A2i: udho::activities::activity<A2i, A2SData, A2FData>{
typedef udho::activities::activity<A2i, A2SData, A2FData> base;
int prevalue;
boost::asio::deadline_timer _timer;
template <typename CollectorT>
A2i(CollectorT c, boost::asio::io_context& io, int p): base(c), prevalue(p), _timer(io){}
template <typename CollectorT>
A2i(CollectorT c, boost::asio::io_context& io): base(c), _timer(io){}
void operator()(){
_timer.expires_from_now(boost::posix_time::seconds(10));
_timer.async_wait(boost::bind(&A2i::finished, self(), boost::asio::placeholders::error));
}
void finished(const boost::system::error_code& err){
if(!err){
A2SData data;
data.value = prevalue + 2;
success(data);
}
}
};
In the above example prevalue
is that piece of information that is required by A2i
in order to perform its activity. It doesn’t care who provides that information, whether its A1, or some other activity. A2i
has a constructor that takes that prevalue
as an argument which can be used when prevalue
is known at the time of construction, or when A2i
is the starting activity in the graph.
auto t2 = udho::activities::perform<A2i>::require<A1>::with(data, io).after(t1).prepare([data](A2i& a2i){
udho::activities::accessor<A1> a1_access(data);
A1SData pre = a1_access.success<A1>();
a2i.prevalue = pre.value;
});
In the above code block that activity A2
is prepared through its reference passed as the argument right after all its dependencies (only A1 in this case) completes by the callback provided in the prepare
function. The collected data
is captured inside the lambda function from which the A1
success data is accessed.
Final¶
Finally we would like do something once the entire subtask graph has completed in a similar fasion. In the following example we do not perform A4
. Instead we execute the following piece of code once both A2i
and A3i
completes.
udho::activities::require<A2i, A3i>::with(data).exec([ctx, name](const udho::activities::accessor<A1, A2i, A3i>& d) mutable{
std::cout << "Final begin" << std::endl;
int sum = 0;
if(!d.failed<A2i>()){
A2SData pre = d.success<A2i>();
sum += pre.value;
std::cout << "A2i " << pre.value << std::endl;
}
if(!d.failed<A3i>()){
A3SData pre = d.success<A3i>();
sum += pre.value;
std::cout << "A3i " << pre.value << std::endl;
}
ctx.respond(boost::lexical_cast<std::string>(sum), "text/plain");
std::cout << "Final end" << std::endl;
}).after(t2).after(t3);
Once everything is set up we start the initial task t1()
t1();
Note
By default if one subtask fails then all subtasks that depend on it will be cancelled and the final callback will be called immediately.
However the sibling subtasks of the failing subtask will continue executing. To change this behavior use required(false)
on the subtask.
auto t1 = udho::activities::perform<A1>::with(data, io).required(false);
In the above example all other subtasks will execute even if t1
fails.
Note
The following shorthands may be used for conveniance. udho::collect
udho::accessor
udho::activity
udho::perform
udho::require
Example¶
API¶
Data¶
-
template<typename
ContextT
, typenameDatasetT
>
structcollector
-
template<typename ...
T
>
structudho::activities
::
accessor
: public udho::activities::fixed_key_accessor<udho::cache::shadow<std::string, T::result_type...>> Access a subset of data from the collector
Public Functions
-
template<typename
V
>
boolexists
() const Whether there exists any data for activity V
- Template Parameters
V
: Activity Type
-
template<typename
V
>
const V::result_type &get
() const get data associated with activity V
- Template Parameters
V
: activity type
-
template<typename
V
>
boolcompleted
() const Check whether activity V has completed.
- Template Parameters
V
: activity type
-
template<typename
V
>
boolcanceled
() const Check whether activity V has been canceled.
- Template Parameters
V
: activity type
-
template<typename
V
>
boolfailed
() const Check whether activity V has failed (only the failure data of V is valid).
- Template Parameters
V
: activity type
-
template<typename
V
>
boolokay
() const Check whether activity V is okay.
- Template Parameters
V
: activity type
-
template<typename
V
>
V::result_type::success_typesuccess
() const get success data for activity V
- Template Parameters
V
: activity type
-
template<typename
V
>
V::result_type::failure_typefailure
() const get failure data for activity V
- Template Parameters
V
: activity type
-
template<typename
V
, typenameF
>
voidapply
(F f) const Apply a callback on result of V
- Template Parameters
V
: activity type
- Parameters
f
: callback
-
template<typename
Activity¶
-
template<typename
DerivedT
, typenameSuccessDataT
= void, typenameFailureDataT
= void>
structudho::activities
::
activity
: public std::enable_shared_from_this<DerivedT>, public udho::activities::result<SuccessDataT, FailureDataT> An activity
A
must subclass fromactivity<A, SuccessA, FailureA>
assumingSuccessA
andFailureA
are the types that contains the relevant information regarding its success or failure. The activityA
must overload a no argumentoperator()()
which initiates the activity. After the activity is initiated eithersuccess()
orfailure()
methods must be called in order to signal its completion. The activityA
must take the collector as the first argument to its constructor, which is passed to the base classactivity<A, SuccessA, FailureA>
. Hence its prefered to take the first parameter to the constructor as template parameter.- Template Parameters
DerivedT
: Activity ClassSuccessDataT
: data associated to the activity if the activity succeedsFailureDataT
: data associated to the activity if the activity fails
Public Functions
-
derived_ptr_type
self
() shared_ptr to this
-
template<typename
SuccessT
, typenameFailureT
>
structudho::activities
::
result
: public udho::activities::result_data<SuccessT, FailureT> Completion handler for an activity.
- Template Parameters
SuccessT
: success data associated with the activityFailureT
: failure data associated with the activity
Public Functions
-
template<typename
StoreT
>result
(StoreT &store) - Parameters
store
: collector
-
template<typename
CombinatorT
>
voiddone
(CombinatorT cmb) attach another subtask as done callback which will be executed once this subtask finishes
- Parameters
cmb
: next subtask
-
void
required
(bool flag) mark the activity as required or optional
- Parameters
flag
:
-
void
cancel_if
(cancel_if_ftor f) Force cancelation of the activity even after it is successful to stop propagating to the next activities
- Parameters
f
: callback which should return true to signal cancelation
-
template<typename
SuccessT
, typenameFailureT
>
structudho::activities
::
result_data
Contains Copiable Success or Failure data for an activity.
- Template Parameters
SuccessT
: success data typeFailureT
: failure data type
Subclassed by udho::activities::result< SuccessT, FailureT >
Public Functions
-
bool
completed
() const either success or failure data set
-
bool
failed
() const whether the activity has failed
-
bool
canceled
() const check whether the activity has been canceled
-
const success_type &
success_data
() const Success data
-
const failure_type &
failure_data
() const Failure data
-
template<typename
CallableT
>
voidapply
(CallableT callback) Apply a callable to the result data which will be invoked exactly once with appropriate arguments. The invocation of the callback depends on the state as shown below.
Incomplete: callback()
Canceled: callback(const SuccessT&, const FailureT&)
Failed: callback(const FailureT&)
Successful: callback(const SuccessT&)
The callback may not have all the overloads.
- Parameters
callback
:
Subtask¶
-
template<typename
ActivityT
, typename ...DependenciesT
>
structudho::activities
::
subtask
A
subtask
is an instantiation of anactivity
. The subtask reuses an activity to model different use cases by attaching dependencies. A subtask contains two shared pointers, one to the activity and another one to the combinator. The subtask cannot be instantiated directly by calling the subtask constructor. Instead call the staticwith
method to instantiate.- Template Parameters
ActivityT
: The activityDependenciesT
: The activities that has to be performed before performing ActivityT
Public Functions
-
std::shared_ptr<activity_type>
activity
() shared pointer to the activity
-
template<typename
V
, typename ...DependenciesV
>
self_type &done
(subtask<V, DependenciesV...> &next) execute task next after the current one
- Parameters
next
: the next subtask
-
template<typename
V
, typename ...DependenciesV
>
self_type &after
(subtask<V, DependenciesV...> &previous) t2.after(t1) is equivalent to t1.done(t2)
- Parameters
previous
: the previous subtask
-
template<typename
PreparatorT
>
self_type &prepare
(PreparatorT prep) attach a callback which will be called with a reference to the activity after it has been instantiated and all its dependencies have completed.
-
self_type &
required
(bool flag) Set required flag on or off. If a required subtask fails then all intermediate subtask that depend on it fails and the final callback is called immediately. By default all subtasks are required
-
self_type &
cancel_if
(typename activity_type::cancel_if_ftor cancelor) Force cancelation of the activity even after it is successful to stop propagating to the next activities
- Parameters
f
: callback which should return true to signal cancelation
-
std::shared_ptr<activity_type>
operator->
() returns the shared pointer to the actiivity
Public Static Functions
-
template<typename
CollectorT
, typename ...U
>
self_typewith
(CollectorT collector, U&&... u) Arguments for the constructor of the Activity
-
template<typename
ActivityT
>
structudho::activities
::
perform
create a subtask to perform activity ActivityT
- Template Parameters
ActivityT
: the activity to perform
Public Static Functions
-
template<typename ...
DependenciesT
>
structrequire
mention the activities that has to be performed before executing this subtask.
- Template Parameters
DependenciesT
: dependencies
Public Static Functions
-
template<typename ...
U
>
subtask<ActivityT, DependenciesT...>with
(U&&... u) arguments for the activity constructor
Udho (উধো)¶
udho is a minimalistic featureful HTTP framework based on Boost.Beast.
std::string world(udho::contexts::stateless ctx){
return "{'planet': 'Earth'}";
}
std::string planet(udho::contexts::stateless ctx, std::string name){
return "Hello "+name;
}
int main(){
boost::asio::io_service io;
udho::servers::ostreamed::stateless server(io, std::cout);
auto urls = udho::router() | "/world" >> udho::get(&world).json()
| "/planet/(\\w+)" >> udho::get(&planet).plain();
server.serve(urls, 9198);
io.run();
return 0;
}
Philosophy¶
udho::router
comprises of mapping between url patterns (as regex) and the corresponding callables (function pointers, function objects). Multiple such mappings are combined at compile time using pipe (|
) operator. The url mappings are passed to the server along with the listening port and document root. The request methods (udho::get
, udho::post
, udho::head
, udho::put
, etc..) and the response content type (json()
, plain()
etc…) are attached with the callable on compile time. Whenever an HTTP request appears to the server its path is matched against the url patterns and the matching callable is called. The values captured from the url patterns are lexically converted (using ``boost::lexical_cast` <https://theboostcpplibraries.com/boost.lexical_cast>`_) and passed as arguments to the callables. The server can be logging or quiet. The example above uses an ostreamed logger that logs on std::cout
.
States¶
HTTP is stateless in general. But Session makes it stateful using a session cookie (e.g. PHPSESSID for PHP). A server can be stateless
or stateful
depending on the choice of session
. If the server uses HTTP session then it has to be stateful, and the states comprising the session has to be declared at the compile time. The example above uses a stateless server (no HTTP session cookie). Hence all the callables take a statless context. The example shown below uses stateful session, where user
is the only state. There can be multiple states passed as template parameters of stateful<StateA, StateB, StateC>
while constructing the server. Callables should have a matching context, that takes all contexts::stateful<StateA, StateB, StateC>
or lesser number of states contexts::stateful<StateB, StateC>
. Callables in a stateful server can have a contexts::stateless
context too.
Context¶
All the callables must take a compatiable context as the first parameter. The context includes the HTTP request object, logger reference, cookies, session information and additional accessories that might be required for serving the request.
Dependencies:¶
udho depend on boost. As boost-beast is only available on boost >= 1.66, udho requires a boost version at least 1.66. udho may optionally use ICU library for unicode regex functionality. In that case ICU library may be required.
boost > 1.66
pugixml
icu [optional]
Features:¶
[x] regular expression based url routing to callables (functions / function objects)
[x] compile time binding of routing rule with callables
[x] compile time travarsable url router
[x] response mime type specification in routing rule
[x] any default constructible can be used as callable argument type that can be parsed from std::string
[x] any ostreamable can be used as return type of callables
[x] automatic type coersion for url based method calling
[x] throwable http error messages
[x] throwable HTTP redirection
[x] serving static content from disk document root if no rule matched
[x] urlencoded/multipart form parsing
[x] form field validation
[x] on memory / on disk session for stateful web applications (no globals) and no session for stateless applications
[x] strictly typed on memory / on disk session storage
[x] compile time pluggable & customizable logging
[ ] server-sent events
[x] deferred response and long polling
[x] aync task graph
[x] xml based template parsing (working but need refactoring)
[x] arithmatic and logical expression evaluation in xml template (working but need refactoring)
Stateful Example ¶
struct user{
std::string name;
user(){}
user(const std::string& nm): name(nm){}
};
std::string login(udho::contexts::stateful<user> ctx){ /// < strictly typed stateful context
const static username = "derp";
const static password = "derp123";
if(ctx.session().exists<user>()){
user data;
ctx.session() >> data; /// < extract session data
return "already logged in";
}else{
if(ctx.form().has("user") && ctx.form().has("pass")){
std::string usr = ctx.form().field<std::string>("user"); /// < form field value from post request
std::string psw = ctx.form().field<std::string>("pass"); /// < form field value from post request
if(usr == username && psw == password){
ctx.session() << user(usr); /// < put data in session
return "successful";
}
}
}
return "failed";
}
std::string echo(udho::contexts::stateful<user> ctx, int num){
if(ctx.session().exists<user>()){
user data;
ctx.session() >> data;
return boost::format("{'name': '%1%', 'num': %2%}") % data.name % num;
}
return "{}";
}
int main(){
std::string doc_root("/path/to/static/document/root");
boost::asio::io_service io;
udho::servers::ostreamed::stateful<user> server(io, std::cout);
auto router = udho::router()
| (udho::post(&login).plain() = "^/login$")
| (udho::get(&echo).json() = "^/echo/(\\d+)$");
server.serve(router, 9198, doc_root);
io.run();
return 0;
}