template<typename OidMap, typename Statistics>
class ozo::connection< OidMap, Statistics >
Default model for Connection
concept.
Connection
concept model which is used by the library as default model. The class object is non-copyable.
- Template Parameters
-
OidMap | — oid map of types are used with connection |
Statistics | — statistics of the connection (not supported yet) |
- Thread safety
- Distinct objects:
Safe
Shared objects: Unsafe
- Models
Connection
template<typename OidMap , typename Statistics >
Assign an existing native connection handle to the object.
Typically this function is used by the library within the connection establishing process. Users should not use it directly other than for a special purpose (e.g., special connection pool implementation and so on).
- Warning
- Don't call this function during any active operation executed on the object.
- Parameters
-
handle | — rvalue reference on a new handle. |
- Returns
- error_code — error code of the function call.
References ozo::error::pq_socket_failed.
template<typename OidMap , typename Statistics >
template<typename WaitHandler >
void ozo::connection< OidMap, Statistics >::async_wait_read |
( |
WaitHandler && |
handler | ) |
|
Asynchronously wait for the connection socket to become ready to read or to have pending error conditions.
Typically this function is used by the library within the connection establishing process and operation execution. Users should not use it directly other than for custom libpq
-based opeartions.
- Warning
- The function is designated to the library operations use only. Don't call this function directly.
- Parameters
-
handler | — wait handler with void(ozo::error_code, int=0) signature. |
template<typename OidMap , typename Statistics >
template<typename WaitHandler >
void ozo::connection< OidMap, Statistics >::async_wait_write |
( |
WaitHandler && |
handler | ) |
|
Asynchronously wait for the connection socket to become ready to write or to have pending error conditions.
Typically this function is used by the library within the connection establishing process and operation execution. Users should not use it directly other than for custom libpq
-based opeartions.
- Warning
- The function is designated to the library operations use only. Don't call this function directly.
- Parameters
-
handler | — wait handler with void(ozo::error_code, int=0) signature. |
template<typename OidMap , typename Statistics >
Cancel all asynchronous operations associated with the connection.
This function causes all outstanding asynchronous operations to finish immediately, and the handlers for cancelled operations will be passed the boost::asio::error::operation_aborted
error.
template<typename OidMap , typename Statistics >
Release ownership of the native connection handle object.
This function may be used to obtain the underlying representation of the descriptor. After calling this function, is_open() returns false. The caller is the owner for the connection descriptor. All outstanding asynchronous read or write operations will finish immediately, and the handlers for cancelled operations will be passed the boost::asio::error::operation_aborted
error.
- Returns
- ozo::pg::conn — native connection handle object