#include <ozo/connection.h>
Connection source concept
ConnectionSource
concept represents a type that creates a connection object with an established connection to a database. The connection source is the IO execution context agnostic entity. ConnectionSource
is used by the ozo::connection_provider
or other ConnectionSource
models like ozo::connection_pool
. Typically there is no need to use it directly.
ozo::connection_info
, ozo::connection_pool
, ozo::failover::role_based_connection_source
.
Connection source s
is an object of type S
for which these next requirements are valid:
Expression | Type | Description |
---|---|---|
s(io, t, h) | Should invoke a continuation object h within time-limited by t (if not ozo::none specified) with a connection object associated with an executor object of the io execution context or/and error_code in case of failure. If there is no error_code code set, the connection object should be in a valid state. | |
ozo::connection_type<S> | deduced type | Should return the Connection object type that is produced by the source. |
ozo::Connection<ozo::connection_type<S>> | std::true_type | Should provide a connection type that models the Connection concept. |
Where:
io
execution context object with type ozo::io_context
,t
is the TimeConstraint
model object,h
is callable with void(ozo::error_code, ozo::connection_type<S>)
signature.