MySQL 9.3.0
Source Code Documentation
helper::MySQLRow Class Reference

#include <mysql_row.h>

Public Types

enum  Verification { kCheckAtDestructor , kEndCallRequired }
 
using ResultRow = mysqlrouter::MySQLSession::ResultRow
 

Public Member Functions

 MySQLRow (const ResultRow &row, MYSQL_FIELD *fields, unsigned number, Verification must_call_end=kCheckAtDestructor)
 
 ~MySQLRow ()
 
void end ()
 
void skip (uint32_t to_skip=1)
 
template<typename FieldType >
void unserialize (FieldType *out_field)
 
template<typename FieldType >
void unserialize (FieldType *out_field, FieldType value_default)
 
template<typename FieldType , typename Converter >
void unserialize_with_converter (FieldType *out_field, const Converter &converter)
 
template<typename FieldType , typename Converter >
void unserialize_with_converter (std::optional< FieldType > *out_field, const Converter &converter)
 
template<typename FieldType , typename Converter >
void unserialize_with_converter (helper::Optional< FieldType > *out_field, const Converter &converter)
 
template<typename FieldType >
void unserialize (std::optional< FieldType > *out_field)
 
template<typename FieldType >
void unserialize (helper::Optional< FieldType > *out_field)
 

Static Public Member Functions

static void set_from_string (std::set< std::string > *out, const char *in)
 

Public Attributes

uint32_t field_index_ {0}
 
const ResultRowrow_
 
MYSQL_FIELDfields_
 
unsigned no_of_fields_
 
bool unserialize_ended_ {true}
 

Private Member Functions

template<typename T >
std::enable_if< std::is_enum< T >::value >::type convert (unsigned field_index, T *out_value, const char *in_value)
 
void convert (unsigned field_index, bool *out_value, const char *in_value)
 
void convert (unsigned field_index, std::string *out_value, const char *in_value)
 
void convert (unsigned field_index, uint32_t *out_value, const char *in_value)
 
void convert (unsigned field_index, int32_t *out_value, const char *in_value)
 
void convert (unsigned field_index, uint64_t *out_value, const char *in_value)
 
void convert (unsigned field_index, std::vector< uint64_t > *out_value, const char *v)
 
void convert (unsigned field_index, helper::DateTime *out_value, const char *in_value)
 

Member Typedef Documentation

◆ ResultRow

Member Enumeration Documentation

◆ Verification

Enumerator
kCheckAtDestructor 
kEndCallRequired 

Constructor & Destructor Documentation

◆ MySQLRow()

helper::MySQLRow::MySQLRow ( const ResultRow row,
MYSQL_FIELD fields,
unsigned  number,
Verification  must_call_end = kCheckAtDestructor 
)
inline

◆ ~MySQLRow()

helper::MySQLRow::~MySQLRow ( )
inline

Member Function Documentation

◆ convert() [1/8]

void helper::MySQLRow::convert ( unsigned  field_index,
bool *  out_value,
const char *  in_value 
)
inlineprivate

◆ convert() [2/8]

void helper::MySQLRow::convert ( unsigned  field_index,
helper::DateTime out_value,
const char *  in_value 
)
inlineprivate

◆ convert() [3/8]

void helper::MySQLRow::convert ( unsigned  field_index,
int32_t *  out_value,
const char *  in_value 
)
inlineprivate

◆ convert() [4/8]

void helper::MySQLRow::convert ( unsigned  field_index,
std::string *  out_value,
const char *  in_value 
)
inlineprivate

◆ convert() [5/8]

void helper::MySQLRow::convert ( unsigned  field_index,
std::vector< uint64_t > *  out_value,
const char *  v 
)
inlineprivate

◆ convert() [6/8]

template<typename T >
std::enable_if< std::is_enum< T >::value >::type helper::MySQLRow::convert ( unsigned  field_index,
T out_value,
const char *  in_value 
)
inlineprivate

◆ convert() [7/8]

void helper::MySQLRow::convert ( unsigned  field_index,
uint32_t *  out_value,
const char *  in_value 
)
inlineprivate

◆ convert() [8/8]

void helper::MySQLRow::convert ( unsigned  field_index,
uint64_t *  out_value,
const char *  in_value 
)
inlineprivate

◆ end()

void helper::MySQLRow::end ( )
inline

◆ set_from_string()

static void helper::MySQLRow::set_from_string ( std::set< std::string > *  out,
const char *  in 
)
inlinestatic

◆ skip()

void helper::MySQLRow::skip ( uint32_t  to_skip = 1)
inline

◆ unserialize() [1/4]

template<typename FieldType >
void helper::MySQLRow::unserialize ( FieldType *  out_field)
inline

◆ unserialize() [2/4]

template<typename FieldType >
void helper::MySQLRow::unserialize ( FieldType *  out_field,
FieldType  value_default 
)
inline

◆ unserialize() [3/4]

template<typename FieldType >
void helper::MySQLRow::unserialize ( helper::Optional< FieldType > *  out_field)
inline

◆ unserialize() [4/4]

template<typename FieldType >
void helper::MySQLRow::unserialize ( std::optional< FieldType > *  out_field)
inline

◆ unserialize_with_converter() [1/3]

template<typename FieldType , typename Converter >
void helper::MySQLRow::unserialize_with_converter ( FieldType *  out_field,
const Converter &  converter 
)
inline

◆ unserialize_with_converter() [2/3]

template<typename FieldType , typename Converter >
void helper::MySQLRow::unserialize_with_converter ( helper::Optional< FieldType > *  out_field,
const Converter &  converter 
)
inline

◆ unserialize_with_converter() [3/3]

template<typename FieldType , typename Converter >
void helper::MySQLRow::unserialize_with_converter ( std::optional< FieldType > *  out_field,
const Converter &  converter 
)
inline

Member Data Documentation

◆ field_index_

uint32_t helper::MySQLRow::field_index_ {0}

◆ fields_

MYSQL_FIELD* helper::MySQLRow::fields_

◆ no_of_fields_

unsigned helper::MySQLRow::no_of_fields_

◆ row_

const ResultRow& helper::MySQLRow::row_

◆ unserialize_ended_

bool helper::MySQLRow::unserialize_ended_ {true}

The documentation for this class was generated from the following file: