Database-related type system functions.
|
| template<typename T > |
| constexpr auto | ozo::type_name () noexcept |
| | Function returns type name in Postgre SQL. More...
|
| |
| template<typename T > |
| constexpr auto | ozo::type_name (const T &) noexcept |
| | Function returns type name in Postgre SQL. More...
|
| |
| template<typename ... Ts> |
| constexpr oid_map_t< Ts... > | ozo::register_types () noexcept |
| | Provides #OidMap implementation for user-defined types. More...
|
| |
| template<typename T , typename ... Ts> |
| void | ozo::set_type_oid (oid_map_t< Ts... > &map, oid_t oid) noexcept |
| |
| template<typename T , typename OidMap > |
| oid_t | ozo::type_oid (const OidMap &map) noexcept |
| | Function returns oid for a type from #OidMap. More...
|
| |
| template<typename T , typename OidMap > |
| oid_t | ozo::type_oid (const OidMap &map, const T &v) noexcept template< typename T |
| | Function returns oid for type from #OidMap. More...
|
| |
| template<typename T , typename OidMap > |
| bool | ozo::accepts_oid (const OidMap &map, const T &, oid_t oid) noexcept |
| |
| template<typename ... Ts> |
| constexpr bool | ozo::empty (const oid_map_t< Ts... > &map) noexcept |
| |
◆ accepts_oid()
template<typename T , typename OidMap >
| bool ozo::accepts_oid |
( |
const OidMap & |
map, |
|
|
const T & |
, |
|
|
oid_t |
oid |
|
) |
| |
|
noexcept |
Function returns true if type can be obtained from DB response with specified OID.
- Parameters
-
| map | — #OidMap to get type OID from |
| const | T& — type to examine |
| oid | — OID to check for compatibility |
◆ empty()
template<typename ... Ts>
| constexpr bool ozo::empty |
( |
const oid_map_t< Ts... > & |
map | ) |
|
|
constexprnoexcept |
Checks if #OidMap contains no items.
Example
- Parameters
-
- Returns
true — if map contains no items
-
false — if contains items.
◆ register_types()
template<typename ... Ts>
| constexpr oid_map_t<Ts...> ozo::register_types |
( |
| ) |
|
|
constexprnoexcept |
Provides #OidMap implementation for user-defined types.
This function have to be used to provide information about custom types are being used within requests for a ConnectionSource.
Example
struct custom_type;
const ozo::connection_info conn_source("...",
register_types<custom_type>());
- Returns
oid_map_t object.
◆ set_type_oid()
template<typename T , typename ... Ts>
Function sets oid for a type in #OidMap.
- Template Parameters
-
- Parameters
-
| map | — #OidMap to modify. |
| oid | — OID to set. |
◆ type_name() [1/2]
template<typename T >
| constexpr auto ozo::type_name |
( |
| ) |
|
|
constexprnoexcept |
Function returns type name in Postgre SQL.
- Template Parameters
-
- Returns
const char* — name of the type
◆ type_name() [2/2]
template<typename T >
| constexpr auto ozo::type_name |
( |
const T & |
| ) |
|
|
constexprnoexcept |
Function returns type name in Postgre SQL.
- Parameters
-
- Returns
const char* — name of the type
◆ type_oid() [1/2]
template<typename T , typename OidMap >
| oid_t ozo::type_oid |
( |
const OidMap & |
map | ) |
|
|
noexcept |
Function returns oid for a type from #OidMap.
- Template Parameters
-
- Parameters
-
| map | — #OidMap to get OID from. |
- Returns
- oid_t — OID of the type
Referenced by ozo::send_frame().
◆ type_oid() [2/2]
template<typename T , typename OidMap >
| oid_t ozo::type_oid |
( |
const OidMap & |
map, |
|
|
const T & |
v |
|
) |
| |
|
noexcept |
Function returns oid for type from #OidMap.
- Parameters
-
| map | — #OidMap to get OID from. |
| v | — object for which type's OID will return. |
- Returns
- oid_t — OID of the type Function returns true if type can be obtained from DB response with specified OID.
- Template Parameters
-
- Parameters
-
| map | — #OidMap to get type OID from |
| oid | — OID to check for compatibility |