MySQL 8.3.0
Source Code Documentation
item_processing_data.h
Go to the documentation of this file.
1/*
2 Copyright (c) 2015, 2023, Oracle and/or its affiliates.
3
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License, version 2.0,
6 as published by the Free Software Foundation.
7
8 This program is also distributed with certain software (including
9 but not limited to OpenSSL) that is licensed under separate terms,
10 as designated in a particular file or component or in included license
11 documentation. The authors of MySQL hereby grant you an additional
12 permission to link the program and your derivative works with the
13 separately licensed software that they have included with MySQL.
14
15 This program is distributed in the hope that it will be useful,
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 GNU General Public License, version 2.0, for more details.
19
20 You should have received a copy of the GNU General Public License
21 along with this program; if not, write to the Free Software
22 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
23*/
24
25#ifndef ITEM_PROCESSING_DATA_INCLUDED
26#define ITEM_PROCESSING_DATA_INCLUDED
27
28#include <atomic>
29#include <functional>
30
34
35namespace Mysql {
36namespace Tools {
37namespace Dump {
38
39/**
40 Data structure for objects that are processed in any chain.
41 */
43 public:
45 Chain_data *chain_data, I_dump_task *process_task_object,
46 I_chain_element *chain_element,
47 const std::function<void(Item_processing_data *)> *completion_callback,
48 Item_processing_data *parent_item_data);
49
51
52 /**
53 Returns chain data in which this item is being processed.
54 */
55 Chain_data *get_chain() const;
56
58
59 void start_processing();
60
61 bool end_processing();
62
64
66
68
69 bool had_chain_created() const;
70
72
73 void set_chain(Chain_data *);
74
76
77 private:
78 /**
79 Chain in which current processing item is processed.
80 */
82 /**
83 Instance of task object that is being processing.
84 */
86 /**
87 Instance of chain element that is processing specified element.
88 */
90 /**
91 Callback to call after element is fully processed to the output. Can be
92 NULL.
93 */
94 const std::function<void(Item_processing_data *)> *m_completion_callback;
95 /**
96 Link to item process information of parent module execution, if exists.
97 */
99 /**
100 Number of modules that have pending or are executing this task.
101 */
102 std::atomic<uint32_t> m_active_executions;
103 /**
104 Indicates if this item led to creation of at least one new chain.
105 */
107};
108
109} // namespace Dump
110} // namespace Tools
111} // namespace Mysql
112
113#endif
Definition: chain_data.h:34
Interface for all objects that can process data in any part of dump process.
Definition: i_chain_element.h:40
Interface for all individual dump process tasks.
Definition: i_dump_task.h:37
Data structure for objects that are processed in any chain.
Definition: item_processing_data.h:42
void set_had_chain_created()
Definition: item_processing_data.cc:81
const std::function< void(Item_processing_data *)> * m_completion_callback
Callback to call after element is fully processed to the output.
Definition: item_processing_data.h:94
bool have_completion_callback()
Definition: item_processing_data.cc:73
std::atomic< uint32_t > m_active_executions
Number of modules that have pending or are executing this task.
Definition: item_processing_data.h:102
I_chain_element * get_processing_chain_element() const
Definition: item_processing_data.cc:69
Chain_data * get_chain() const
Returns chain data in which this item is being processed.
Definition: item_processing_data.cc:50
bool had_chain_created() const
Definition: item_processing_data.cc:77
Item_processing_data * m_parent_item_data
Link to item process information of parent module execution, if exists.
Definition: item_processing_data.h:98
Item_processing_data(Chain_data *chain_data, I_dump_task *process_task_object, I_chain_element *chain_element, const std::function< void(Item_processing_data *)> *completion_callback, Item_processing_data *parent_item_data)
Definition: item_processing_data.cc:32
void set_chain(Chain_data *)
Definition: item_processing_data.cc:85
I_dump_task * m_process_task_object
Instance of task object that is being processing.
Definition: item_processing_data.h:85
bool m_had_chain_created
Indicates if this item led to creation of at least one new chain.
Definition: item_processing_data.h:106
void start_processing()
Definition: item_processing_data.cc:56
Item_processing_data * get_parent_item_data() const
Definition: item_processing_data.cc:52
I_chain_element * m_chain_element
Instance of chain element that is processing specified element.
Definition: item_processing_data.h:89
Chain_data * m_chain_data
Chain in which current processing item is processed.
Definition: item_processing_data.h:81
~Item_processing_data()
Definition: item_processing_data.cc:45
bool end_processing()
Definition: item_processing_data.cc:58
I_dump_task * get_process_task_object() const
Definition: item_processing_data.cc:65
bool call_completion_callback_at_end()
Definition: item_processing_data.cc:89
Definition: abstract_connection_program.h:39