OZO 「お象」
Boost.Asio and libpq based asynchronous PostgreSQL unofficial header-only C++17 client library.
Types

Description

Core utility types of the library.

Classes

struct  ozo::base_async_operation< Operation, Initiator >
 Base class for async operations. More...
 
struct  ozo::none_t
 None type None type modelling void as ordinary type. This type is callable with return type void. More...
 
struct  ozo::option< Key >
 Option class. More...
 
class  ozo::options_factory_base< RealType, Options >
 Base class for options factories. More...
 
class  ozo::options_factory< Options >
 Generic options factory. More...
 
struct  ozo::thread_safety< enabled >
 defines admissibility to use in multithreaded environment without additional synchronization More...
 
struct  ozo::unwrap_impl< T, When >
 Default implementation of ozo::unwrap() More...
 
struct  ozo::get_unwrapped_type< T >
 Unwraps nullable or reference wrapped type. More...
 
struct  ozo::time_traits
 Time traits of the library. More...
 

Macros

#define OZO_STRONG_TYPEDEF(base, type)
 Strong typedef. More...
 

Types

template<typename T >
using ozo::unwrap_type = typename get_unwrapped_type< T >::type
 Shortcut for ozo::get_unwrapped_type. More...
 

Variables

constexpr auto ozo::none = none_t{}
 None object. More...
 

Macro Definition Documentation

◆ OZO_STRONG_TYPEDEF

#define OZO_STRONG_TYPEDEF (   base,
  type 
)

Strong typedef.

C++ typedef creates only an alias to a base type, so the both types are the same. To get a really new type it is necessary to make some boilerplate code. This macro do such work. It is very similar to BOOST_STRONG_TYPEDEF Except the new type has base_type type and get() method which provides access to underlying base type object.

Note
This macro may be used inside a namespace.
Parameters
base— base type
type— new type

Example

namespace demo {
OZO_STRONG_TYPEDEF(std::vector<char>, bytes)
}
// Types are completely different
static_assert(!std::is_same_v<std::vector<char>, demo::bytes>);
// Type bytes::base_type is same as a first argument of the macro
static_assert(std::is_same_v<std::vector<char>, demo::bytes::base_type>);
demo::bytes b{};
std::vector<char>& base(b);
// Member function bytes::get() provides access to the underlying
// base type object
assert(std::addressof(base) == std::addressof(b.get()));

Types

◆ unwrap_type

template<typename T >
using ozo::unwrap_type = typedef typename get_unwrapped_type<T>::type

Shortcut for ozo::get_unwrapped_type.

Template Parameters
T– type to unwrap.

Variable Documentation

◆ none

OZO_STRONG_TYPEDEF
#define OZO_STRONG_TYPEDEF(base, type)
Strong typedef.
Definition: strong_typedef.h:98