The Battle for Wesnoth  1.15.6+dev
worker.hpp
Go to the documentation of this file.
1 //
2 // M A R I A D B + +
3 //
4 // Copyright Sylvain Rochette Langlois 2013,
5 // Frantisek Boranek 2015,
6 // The ViaDuck Project 2016 - 2018.
7 // Distributed under the Boost Software License, Version 1.0.
8 // (See accompanying file LICENSE or copy at
9 // http://www.boost.org/LICENSE_1_0.txt)
10 
11 #ifndef _MARIADB_WORKER_HPP_
12 #define _MARIADB_WORKER_HPP_
13 
14 #include <mariadb++/connection.hpp>
16 
17 namespace mariadb {
18 using namespace concurrency;
19 
20 namespace command {
21 enum type { execute, insert, query };
22 }
23 
24 //
25 // Worker entity used by concurrency namespace
26 //
27 class worker {
28  public:
29  //
30  // Constructor
31  //
32  worker();
33  worker(account_ref& account, handle hnd, bool keep_handle, command::type command,
34  const std::string& query);
35  worker(account_ref& account, handle hnd, bool keep_handle, command::type command,
37 
38  //
39  // Get informations
40  //
41  status::type status() const;
42  handle get_handle() const;
43  bool keep_handle() const;
44 
45  //
46  // Get result / result_set
47  //
48  u64 result() const;
49  result_set_ref result_set() const;
50 
51  //
52  // Do the actual job
53  //
54  void execute();
55 
56  private:
66 };
67 }
68 
69 #endif
std::shared_ptr< result_set > result_set_ref
Definition: result_set.hpp:219
bool m_keep_handle
Definition: worker.hpp:57
std::shared_ptr< account > account_ref
Definition: account.hpp:19
handle query(const std::string &query, bool keep_handle)
command::type m_command
Definition: worker.hpp:60
handle m_handle
Definition: worker.hpp:58
account_ref m_account
Definition: worker.hpp:63
Class used to store account and connection information used by mariadb::connection when connecting...
Definition: account.hpp:46
handle execute(const std::string &query, bool keep_handle)
u64 handle
Definition: types.hpp:38
Class representing a prepared statement with binding functionality.
Definition: statement.hpp:39
handle insert(const std::string &query, bool keep_handle)
statement_ref m_statement
Definition: worker.hpp:65
unsigned long long u64
Definition: types.hpp:34
Class used to store query and statement results.
Definition: result_set.hpp:69
std::shared_ptr< statement > statement_ref
Definition: statement.hpp:109
result_set_ref m_result_set
Definition: worker.hpp:64
std::string m_query
Definition: worker.hpp:62
status::type m_status
Definition: worker.hpp:59