MySQL 9.3.0
Source Code Documentation
mysqlrouter::MySQLSession Class Reference

#include <mysql_session.h>

Inheritance diagram for mysqlrouter::MySQLSession:
[legend]

Classes

class  Error
 
class  MYSQL_RES_Deleter
 
class  ResultRow
 
class  Transaction
 

Public Types

typedef std::vector< const char * > Row
 
typedef std::function< bool(const Row &)> RowProcessor
 
typedef std::function< bool(const ResultRow &)> ResultRowProcessor
 
typedef std::function< void(unsigned, MYSQL_FIELD *)> FieldValidator
 
typedef std::function< void()> OnResultSetEnd
 
template<mysql_option Opt>
using BooleanOption = impl::Option< Opt, bool >
 
template<mysql_option Opt>
using IntegerOption = impl::Option< Opt, unsigned int >
 
template<mysql_option Opt>
using LongOption = impl::Option< Opt, unsigned long >
 
template<mysql_option Opt>
using ConstCharOption = impl::Option< Opt, const char * >
 
using DefaultAuthentication = ConstCharOption< MYSQL_DEFAULT_AUTH >
 
using EnableCleartextPlugin = BooleanOption< MYSQL_ENABLE_CLEARTEXT_PLUGIN >
 
using InitCommand = ConstCharOption< MYSQL_INIT_COMMAND >
 
using BindAddress = ConstCharOption< MYSQL_OPT_BIND >
 
using CanHandleExpiredPasswords = BooleanOption< MYSQL_OPT_CAN_HANDLE_EXPIRED_PASSWORDS >
 
using Compress = BooleanOption< MYSQL_OPT_COMPRESS >
 
using CompressionAlgorithms = ConstCharOption< MYSQL_OPT_COMPRESSION_ALGORITHMS >
 
using ConnectAttributeReset = BooleanOption< MYSQL_OPT_CONNECT_ATTR_RESET >
 
using ConnectAttributeDelete = BooleanOption< MYSQL_OPT_CONNECT_ATTR_DELETE >
 
using ConnectTimeout = IntegerOption< MYSQL_OPT_CONNECT_TIMEOUT >
 
using GetServerPublicKey = BooleanOption< MYSQL_OPT_GET_SERVER_PUBLIC_KEY >
 
using LoadDataLocalDir = ConstCharOption< MYSQL_OPT_LOAD_DATA_LOCAL_DIR >
 
using LocalInfile = IntegerOption< MYSQL_OPT_LOCAL_INFILE >
 
using MaxAllowedPacket = LongOption< MYSQL_OPT_MAX_ALLOWED_PACKET >
 
using NamedPipe = BooleanOption< MYSQL_OPT_NAMED_PIPE >
 
using NetBufferLength = LongOption< MYSQL_OPT_NET_BUFFER_LENGTH >
 
using OptionalResultsetMetadata = BooleanOption< MYSQL_OPT_OPTIONAL_RESULTSET_METADATA >
 
using Protocol = IntegerOption< MYSQL_OPT_PROTOCOL >
 
using ReadTimeout = IntegerOption< MYSQL_OPT_READ_TIMEOUT >
 
using RetryCount = IntegerOption< MYSQL_OPT_RETRY_COUNT >
 
using SslCa = ConstCharOption< MYSQL_OPT_SSL_CA >
 
using SslCaPath = ConstCharOption< MYSQL_OPT_SSL_CAPATH >
 
using SslCert = ConstCharOption< MYSQL_OPT_SSL_CERT >
 
using SslCipher = ConstCharOption< MYSQL_OPT_SSL_CIPHER >
 
using SslCrl = ConstCharOption< MYSQL_OPT_SSL_CRL >
 
using SslCrlPath = ConstCharOption< MYSQL_OPT_SSL_CRLPATH >
 
using SslFipsMode = IntegerOption< MYSQL_OPT_SSL_FIPS_MODE >
 
using SslKey = ConstCharOption< MYSQL_OPT_SSL_KEY >
 
using SslMode = IntegerOption< MYSQL_OPT_SSL_MODE >
 
using TlsCipherSuites = ConstCharOption< MYSQL_OPT_TLS_CIPHERSUITES >
 
using TlsVersion = ConstCharOption< MYSQL_OPT_TLS_VERSION >
 
using WriteTimeout = IntegerOption< MYSQL_OPT_WRITE_TIMEOUT >
 
using ZstdCompressionLevel = IntegerOption< MYSQL_OPT_ZSTD_COMPRESSION_LEVEL >
 
using PluginDir = ConstCharOption< MYSQL_PLUGIN_DIR >
 
using ReportDataTruncation = BooleanOption< MYSQL_REPORT_DATA_TRUNCATION >
 
using ServerPluginKey = ConstCharOption< MYSQL_SERVER_PUBLIC_KEY >
 
using ReadDefaultFile = ConstCharOption< MYSQL_READ_DEFAULT_FILE >
 
using ReadDefaultGroup = ConstCharOption< MYSQL_READ_DEFAULT_GROUP >
 
using CharsetDir = ConstCharOption< MYSQL_SET_CHARSET_DIR >
 
using CharsetName = ConstCharOption< MYSQL_SET_CHARSET_NAME >
 
using SharedMemoryBasename = ConstCharOption< MYSQL_SHARED_MEMORY_BASE_NAME >
 

Public Member Functions

 MySQLSession ()
 
virtual ~MySQLSession ()
 
virtual void set_ssl_options (mysql_ssl_mode ssl_mode, const std::string &tls_version, const std::string &ssl_cipher, const std::string &ca, const std::string &capath, const std::string &crl, const std::string &crlpath)
 
uint64_t connection_id ()
 
mysql_ssl_mode ssl_mode () const
 
std::string tls_version () const
 
std::string ssl_cipher () const
 
std::string ssl_ca () const
 
std::string ssl_capath () const
 
std::string ssl_crl () const
 
std::string ssl_crlpath () const
 
std::string ssl_cert () const
 
std::string ssl_key () const
 
int connect_timeout () const
 
int read_timeout () const
 
virtual void set_ssl_cert (const std::string &cert, const std::string &key)
 
template<class SettableMysqlOption >
stdx::expected< void, MysqlErrorset_option (const SettableMysqlOption &opt)
 set a mysql option. More...
 
template<class GettableMysqlOption >
bool get_option (GettableMysqlOption &opt) const
 get a mysql option. More...
 
void connect (const std::string &host, unsigned int port, const std::string &username, const std::string &password, const std::string &unix_socket, const std::string &default_schema, int connect_timeout=kDefaultConnectTimeout, int read_timeout=kDefaultReadTimeout, unsigned long extra_client_flags=0)
 
void connect (const MySQLSession &other, const std::string &username, const std::string &password)
 
void change_user (const std::string &user, const std::string &password, const std::string &db)
 
virtual void connect (const std::string &host, unsigned int port, const std::string &username, const mysql_harness::SecureString &password, const std::string &unix_socket, const std::string &default_schema, int connect_timeout=kDefaultConnectTimeout, int read_timeout=kDefaultReadTimeout, unsigned long extra_client_flags=0)
 
virtual void connect (const MySQLSession &other, const std::string &username, const mysql_harness::SecureString &password)
 Connect using the same settings and parameters that were used for the last other.connect() using provided credentials. More...
 
virtual void change_user (const std::string &user, const mysql_harness::SecureString &password, const std::string &db)
 
virtual void disconnect ()
 
virtual void reset ()
 
virtual uint64_t prepare (const std::string &query)
 
virtual void prepare_execute_with_bind_parameters (uint64_t ps_id, std::vector< MYSQL_BIND > bind_parameters, const ResultRowProcessor &processor, const FieldValidator &validator, const OnResultSetEnd &on_resultset_end)
 
virtual void prepare_remove (uint64_t ps_id)
 
virtual void execute (const std::string &query)
 
virtual void query (const std::string &query, const ResultRowProcessor &processor, const FieldValidator &validator)
 
virtual std::unique_ptr< MySQLSession::ResultRowquery_one (const std::string &query, const FieldValidator &validator)
 
void query (const std::string &query, const RowProcessor &processor, const FieldValidator &validator)
 
void query (const std::string &stmt, const RowProcessor &processor)
 
virtual std::unique_ptr< MySQLSession::ResultRowquery_one (const std::string &stmt)
 
virtual int ping ()
 
virtual bool execute_nb (const std::string &query)
 
virtual uint64_t last_insert_id () noexcept
 
virtual uint64_t affected_rows () noexcept
 
virtual unsigned warning_count () noexcept
 
virtual std::string quote (const std::string &s, char qchar='\'') const
 
virtual bool is_connected () noexcept
 
const std::string & get_address () noexcept
 
virtual const char * last_sqlstate ()
 
virtual const char * last_error ()
 
virtual unsigned int last_errno ()
 
virtual const char * ssl_cipher ()
 
virtual bool has_data_on_socket ()
 
virtual std::vector< std::string > get_session_tracker_data (enum enum_session_state_type type)
 
virtual bool is_ssl_session_reused ()
 
virtual unsigned long server_version ()
 
MYSQLget_handle ()
 

Static Public Member Functions

static mysql_ssl_mode parse_ssl_mode (std::string ssl_mode)
 
static const char * ssl_mode_to_string (mysql_ssl_mode ssl_mode) noexcept
 

Static Public Attributes

static constexpr int kDefaultConnectTimeout = 5
 
static constexpr int kDefaultReadTimeout = 30
 
static const char kSslModeDisabled [] = "DISABLED"
 
static const char kSslModePreferred [] = "PREFERRED"
 
static const char kSslModeRequired [] = "REQUIRED"
 
static const char kSslModeVerifyCa [] = "VERIFY_CA"
 
static const char kSslModeVerifyIdentity []
 

Private Types

enum class  AsyncQueryState { kNone , kQuery , kStoreResult }
 
using mysql_result_type = std::unique_ptr< MYSQL_RES, MYSQL_RES_Deleter >
 

Private Member Functions

stdx::expected< mysql_result_type, MysqlErrorreal_query (const std::string &q)
 run query. More...
 
stdx::expected< mysql_result_type, MysqlErrorreal_query_nb (const std::string &q)
 
stdx::expected< mysql_result_type, MysqlErrorlogged_real_query (const std::string &q)
 log query after running it. More...
 
stdx::expected< mysql_result_type, MysqlErrorlogged_real_query_nb (const std::string &q)
 
void throw_mysqlerror (MYSQL_STMT *stmt, uint64_t ps_id)
 

Private Attributes

struct {
   std::string   host
 
   unsigned int   port {}
 
   std::string   unix_socket
 
   std::string   default_schema
 
connect_params_
 
uint64_t last_stmt_id {0}
 
std::map< uint64_t, MYSQL_STMT * > stmts_
 
MYSQLconnection_
 
bool connected_
 
std::string connection_address_
 
SQLLogFilter log_filter_
 
unsigned long extra_client_flags_ {0}
 
uint64_t connection_id_ {0}
 
AsyncQueryState async_state_ = AsyncQueryState::kNone
 
bool async_query_logged_ = false
 
mysql_harness::logging::DomainLogger logger_ {"sql"}
 

Member Typedef Documentation

◆ BindAddress

◆ BooleanOption

◆ CanHandleExpiredPasswords

◆ CharsetDir

◆ CharsetName

◆ Compress

◆ CompressionAlgorithms

◆ ConnectAttributeDelete

◆ ConnectAttributeReset

◆ ConnectTimeout

◆ ConstCharOption

template<mysql_option Opt>
using mysqlrouter::MySQLSession::ConstCharOption = impl::Option<Opt, const char *>

◆ DefaultAuthentication

◆ EnableCleartextPlugin

◆ FieldValidator

typedef std::function<void(unsigned, MYSQL_FIELD *)> mysqlrouter::MySQLSession::FieldValidator

◆ GetServerPublicKey

◆ InitCommand

◆ IntegerOption

template<mysql_option Opt>
using mysqlrouter::MySQLSession::IntegerOption = impl::Option<Opt, unsigned int>

◆ LoadDataLocalDir

◆ LocalInfile

◆ LongOption

template<mysql_option Opt>
using mysqlrouter::MySQLSession::LongOption = impl::Option<Opt, unsigned long>

◆ MaxAllowedPacket

◆ mysql_result_type

◆ NamedPipe

◆ NetBufferLength

◆ OnResultSetEnd

typedef std::function<void()> mysqlrouter::MySQLSession::OnResultSetEnd

◆ OptionalResultsetMetadata

◆ PluginDir

◆ Protocol

◆ ReadDefaultFile

◆ ReadDefaultGroup

◆ ReadTimeout

◆ ReportDataTruncation

◆ ResultRowProcessor

typedef std::function<bool(const ResultRow &)> mysqlrouter::MySQLSession::ResultRowProcessor

◆ RetryCount

◆ Row

typedef std::vector<const char *> mysqlrouter::MySQLSession::Row

◆ RowProcessor

typedef std::function<bool(const Row &)> mysqlrouter::MySQLSession::RowProcessor

◆ ServerPluginKey

◆ SharedMemoryBasename

◆ SslCa

◆ SslCaPath

◆ SslCert

◆ SslCipher

◆ SslCrl

◆ SslCrlPath

◆ SslFipsMode

◆ SslKey

◆ SslMode

◆ TlsCipherSuites

◆ TlsVersion

◆ WriteTimeout

◆ ZstdCompressionLevel

Member Enumeration Documentation

◆ AsyncQueryState

Enumerator
kNone 
kQuery 
kStoreResult 

Constructor & Destructor Documentation

◆ MySQLSession()

MySQLSession::MySQLSession ( )

◆ ~MySQLSession()

MySQLSession::~MySQLSession ( )
virtual

Member Function Documentation

◆ affected_rows()

uint64_t MySQLSession::affected_rows ( )
virtualnoexcept

◆ change_user() [1/2]

void MySQLSession::change_user ( const std::string &  user,
const mysql_harness::SecureString password,
const std::string &  db 
)
virtual

Reimplemented in collector::CountedMySQLSession.

◆ change_user() [2/2]

void MySQLSession::change_user ( const std::string &  user,
const std::string &  password,
const std::string &  db 
)

◆ connect() [1/4]

void MySQLSession::connect ( const MySQLSession other,
const std::string &  username,
const mysql_harness::SecureString password 
)
virtual

Connect using the same settings and parameters that were used for the last other.connect() using provided credentials.

◆ connect() [2/4]

void MySQLSession::connect ( const MySQLSession other,
const std::string &  username,
const std::string &  password 
)

◆ connect() [3/4]

void MySQLSession::connect ( const std::string &  host,
unsigned int  port,
const std::string &  username,
const mysql_harness::SecureString password,
const std::string &  unix_socket,
const std::string &  default_schema,
int  connect_timeout = kDefaultConnectTimeout,
int  read_timeout = kDefaultReadTimeout,
unsigned long  extra_client_flags = 0 
)
virtual

Reimplemented in collector::CountedMySQLSession.

◆ connect() [4/4]

void MySQLSession::connect ( const std::string &  host,
unsigned int  port,
const std::string &  username,
const std::string &  password,
const std::string &  unix_socket,
const std::string &  default_schema,
int  connect_timeout = kDefaultConnectTimeout,
int  read_timeout = kDefaultReadTimeout,
unsigned long  extra_client_flags = 0 
)

◆ connect_timeout()

int MySQLSession::connect_timeout ( ) const

◆ connection_id()

uint64_t MySQLSession::connection_id ( )

◆ disconnect()

void MySQLSession::disconnect ( )
virtual

◆ execute()

void MySQLSession::execute ( const std::string &  query)
virtual

Reimplemented in collector::CountedMySQLSession.

◆ execute_nb()

bool MySQLSession::execute_nb ( const std::string &  query)
virtual

◆ get_address()

const std::string & mysqlrouter::MySQLSession::get_address ( )
inlinenoexcept

◆ get_handle()

MYSQL * mysqlrouter::MySQLSession::get_handle ( )
inline

◆ get_option()

template<class GettableMysqlOption >
bool mysqlrouter::MySQLSession::get_option ( GettableMysqlOption &  opt) const
inline

get a mysql option.

if (res) {
std::cerr << opt_connect_timeout.value() << std::endl;
}
bool get_option(GettableMysqlOption &opt) const
get a mysql option.
Definition: mysql_session.h:416
IntegerOption< MYSQL_OPT_CONNECT_TIMEOUT > ConnectTimeout
Definition: mysql_session.h:207
static ulong opt_connect_timeout
Definition: mysql.cc:218
Parameters
[in,out]optoption to query.
Return values
trueon success.
falseif option is not known.

◆ get_session_tracker_data()

std::vector< std::string > MySQLSession::get_session_tracker_data ( enum enum_session_state_type  type)
virtual

◆ has_data_on_socket()

bool MySQLSession::has_data_on_socket ( )
virtual

◆ is_connected()

virtual bool mysqlrouter::MySQLSession::is_connected ( )
inlinevirtualnoexcept

◆ is_ssl_session_reused()

bool MySQLSession::is_ssl_session_reused ( )
virtual

◆ last_errno()

unsigned int MySQLSession::last_errno ( )
virtual

◆ last_error()

const char * MySQLSession::last_error ( )
virtual

◆ last_insert_id()

uint64_t MySQLSession::last_insert_id ( )
virtualnoexcept

◆ last_sqlstate()

const char * MySQLSession::last_sqlstate ( )
virtual

◆ logged_real_query()

stdx::expected< MySQLSession::mysql_result_type, MysqlError > MySQLSession::logged_real_query ( const std::string &  q)
private

log query after running it.

◆ logged_real_query_nb()

stdx::expected< MySQLSession::mysql_result_type, MysqlError > MySQLSession::logged_real_query_nb ( const std::string &  q)
private

◆ parse_ssl_mode()

mysql_ssl_mode MySQLSession::parse_ssl_mode ( std::string  ssl_mode)
static

◆ ping()

int MySQLSession::ping ( )
virtual

◆ prepare()

uint64_t MySQLSession::prepare ( const std::string &  query)
virtual

Reimplemented in collector::CountedMySQLSession.

◆ prepare_execute_with_bind_parameters()

void MySQLSession::prepare_execute_with_bind_parameters ( uint64_t  ps_id,
std::vector< MYSQL_BIND bind_parameters,
const ResultRowProcessor processor,
const FieldValidator validator,
const OnResultSetEnd on_resultset_end 
)
virtual

Reimplemented in collector::CountedMySQLSession.

◆ prepare_remove()

void MySQLSession::prepare_remove ( uint64_t  ps_id)
virtual

Reimplemented in collector::CountedMySQLSession.

◆ query() [1/3]

void MySQLSession::query ( const std::string &  query,
const ResultRowProcessor processor,
const FieldValidator validator 
)
virtual

Reimplemented in collector::CountedMySQLSession.

◆ query() [2/3]

void MySQLSession::query ( const std::string &  query,
const RowProcessor processor,
const FieldValidator validator 
)

◆ query() [3/3]

void mysqlrouter::MySQLSession::query ( const std::string &  stmt,
const RowProcessor processor 
)
inline

◆ query_one() [1/2]

std::unique_ptr< MySQLSession::ResultRow > MySQLSession::query_one ( const std::string &  query,
const FieldValidator validator 
)
virtual

Reimplemented in collector::CountedMySQLSession.

◆ query_one() [2/2]

virtual std::unique_ptr< MySQLSession::ResultRow > mysqlrouter::MySQLSession::query_one ( const std::string &  stmt)
inlinevirtual

Reimplemented in collector::CountedMySQLSession.

◆ quote()

std::string MySQLSession::quote ( const std::string &  s,
char  qchar = '\'' 
) const
virtual

◆ read_timeout()

int MySQLSession::read_timeout ( ) const

◆ real_query()

stdx::expected< MySQLSession::mysql_result_type, MysqlError > MySQLSession::real_query ( const std::string &  q)
private

run query.

There are 3 cases:

  1. query returns a resultset
  2. query returns no resultset
  1. query fails with an error
Parameters
qstmt to execute
Returns
resultset on success, MysqlError on error

◆ real_query_nb()

stdx::expected< MySQLSession::mysql_result_type, MysqlError > MySQLSession::real_query_nb ( const std::string &  q)
private

◆ reset()

void MySQLSession::reset ( )
virtual

Reimplemented in collector::CountedMySQLSession.

◆ server_version()

unsigned long MySQLSession::server_version ( )
virtual

◆ set_option()

template<class SettableMysqlOption >
stdx::expected< void, MysqlError > mysqlrouter::MySQLSession::set_option ( const SettableMysqlOption &  opt)
inline

set a mysql option.

auto res = set_option(ConnectTimeout(10));
stdx::expected< void, MysqlError > set_option(const SettableMysqlOption &opt)
set a mysql option.
Definition: mysql_session.h:390
Note
on error the MysqlError may not always contain the right error-code.
Parameters
[in]optoption to set.
Returns
a MysqlError on error
Return values
trueon success

◆ set_ssl_cert()

void MySQLSession::set_ssl_cert ( const std::string &  cert,
const std::string &  key 
)
virtual

◆ set_ssl_options()

void MySQLSession::set_ssl_options ( mysql_ssl_mode  ssl_mode,
const std::string &  tls_version,
const std::string &  ssl_cipher,
const std::string &  ca,
const std::string &  capath,
const std::string &  crl,
const std::string &  crlpath 
)
virtual

◆ ssl_ca()

std::string MySQLSession::ssl_ca ( ) const

◆ ssl_capath()

std::string MySQLSession::ssl_capath ( ) const

◆ ssl_cert()

std::string MySQLSession::ssl_cert ( ) const

◆ ssl_cipher() [1/2]

const char * MySQLSession::ssl_cipher ( )
virtual

◆ ssl_cipher() [2/2]

std::string MySQLSession::ssl_cipher ( ) const

◆ ssl_crl()

std::string MySQLSession::ssl_crl ( ) const

◆ ssl_crlpath()

std::string MySQLSession::ssl_crlpath ( ) const

◆ ssl_key()

std::string MySQLSession::ssl_key ( ) const

◆ ssl_mode()

mysql_ssl_mode MySQLSession::ssl_mode ( ) const

◆ ssl_mode_to_string()

const char * MySQLSession::ssl_mode_to_string ( mysql_ssl_mode  ssl_mode)
staticnoexcept

◆ throw_mysqlerror()

void MySQLSession::throw_mysqlerror ( MYSQL_STMT stmt,
uint64_t  ps_id 
)
private

◆ tls_version()

std::string MySQLSession::tls_version ( ) const

◆ warning_count()

unsigned MySQLSession::warning_count ( )
virtualnoexcept

Member Data Documentation

◆ async_query_logged_

bool mysqlrouter::MySQLSession::async_query_logged_ = false
private

◆ async_state_

AsyncQueryState mysqlrouter::MySQLSession::async_state_ = AsyncQueryState::kNone
private

◆ 

struct { ... } mysqlrouter::MySQLSession::connect_params_

◆ connected_

bool mysqlrouter::MySQLSession::connected_
private

◆ connection_

MYSQL* mysqlrouter::MySQLSession::connection_
private

◆ connection_address_

std::string mysqlrouter::MySQLSession::connection_address_
private

◆ connection_id_

uint64_t mysqlrouter::MySQLSession::connection_id_ {0}
private

◆ default_schema

std::string mysqlrouter::MySQLSession::default_schema

◆ extra_client_flags_

unsigned long mysqlrouter::MySQLSession::extra_client_flags_ {0}
private

◆ host

std::string mysqlrouter::MySQLSession::host

◆ kDefaultConnectTimeout

constexpr int mysqlrouter::MySQLSession::kDefaultConnectTimeout = 5
staticconstexpr

◆ kDefaultReadTimeout

constexpr int mysqlrouter::MySQLSession::kDefaultReadTimeout = 30
staticconstexpr

◆ kSslModeDisabled

const char MySQLSession::kSslModeDisabled = "DISABLED"
static

◆ kSslModePreferred

const char MySQLSession::kSslModePreferred = "PREFERRED"
static

◆ kSslModeRequired

const char MySQLSession::kSslModeRequired = "REQUIRED"
static

◆ kSslModeVerifyCa

const char MySQLSession::kSslModeVerifyCa = "VERIFY_CA"
static

◆ kSslModeVerifyIdentity

const char MySQLSession::kSslModeVerifyIdentity
static
Initial value:
=
"VERIFY_IDENTITY"

◆ last_stmt_id

uint64_t mysqlrouter::MySQLSession::last_stmt_id {0}
private

◆ log_filter_

SQLLogFilter mysqlrouter::MySQLSession::log_filter_
private

◆ logger_

mysql_harness::logging::DomainLogger mysqlrouter::MySQLSession::logger_ {"sql"}
private

◆ port

unsigned int mysqlrouter::MySQLSession::port {}

◆ stmts_

std::map<uint64_t, MYSQL_STMT *> mysqlrouter::MySQLSession::stmts_
private

◆ unix_socket

std::string mysqlrouter::MySQLSession::unix_socket

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