OZO 「お象」
Boost.Asio and libpq based asynchronous PostgreSQL unofficial header-only C++17 client library.
|
|
3 #include <ozo/core/concept.h>
4 #include <ozo/type_traits.h>
5 #include <ozo/io/size_of.h>
6 #include <ozo/io/ostream.h>
7 #include <ozo/io/type_traits.h>
36 template <
typename In,
typename = std::
void_t<>>
42 "In object type can't be sent. Probably it is not an arithmetic or doens't have data and size methods"
43 " or it is a struct with field which can't be sent."
54 template <
typename O
idMap>
55 static ostream&
apply(ostream& out,
const OidMap&,
const In& in) {
56 return write(out, in);
62 template <
typename T,
typename = std::
void_t<>>
63 struct send_impl_dispatcher {
using type = send_impl<std::decay_t<T>>; };
65 template <
typename T,
typename Tag>
66 struct send_impl_dispatcher<strong_typedef_wrapper<T, Tag>> {
using type = send_impl<std::decay_t<T>>; };
69 using get_send_impl =
typename send_impl_dispatcher<unwrap_type<T>>::type;
92 template <
class O
idMap,
class In>
93 inline ostream&
send(ostream& out,
const OidMap& oid_map,
const In& in) {
110 template <
class O
idMap,
class In>
113 return send(out, oid_map, in);
130 template <
class O
idMap,
class In>
constexpr decltype(auto) unwrap(T &&v) noexcept(noexcept(unwrap_impl< std::decay_t< T >>::apply(std::forward< T >(v))))
Unwraps argument underlying value or forwards the argument.
Definition: unwrap.h:57
Condition indicates if type has corresponding type traits for PostgreSQL.
constexpr size_type size_of(const T &v)
Returns size of object binary representation in bytes.
Definition: size_of.h:105
ostream & send(ostream &out, const OidMap &oid_map, const In &in)
Send object to an output stream.
Definition: send.h:93
static ostream & apply(ostream &out, const OidMap &, const In &in)
Implementation of serialization object into stream.
Definition: send.h:55
ostream & send_data_frame(ostream &out, const OidMap &oid_map, const In &in)
Send data frame of an object to an output stream.
Definition: send.h:111
constexpr auto OidMap
Map of C++ types to corresponding PostgreSQL types OIDs.
Definition: type_traits.h:534
oid_t type_oid(const OidMap &map) noexcept
Function returns oid for a type from #OidMap.
Defines how to send an object to an output stream.
Definition: send.h:37
constexpr decltype(auto) is_null(const T &v) noexcept(noexcept(is_null_impl< T >::apply(v)))
Indicates if value is in null state.
Definition: nullable.h:85
ostream & send_frame(ostream &out, const OidMap &oid_map, const In &in)
Send full frame of an object to an output stream.
Definition: send.h:131