MySQL 8.0.40
Source Code Documentation
item_processing_data.h
Go to the documentation of this file.
1/*
2 Copyright (c) 2015, 2024, 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 designed to work 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 either included with
14 the program or referenced in the documentation.
15
16 This program is distributed in the hope that it will be useful,
17 but WITHOUT ANY WARRANTY; without even the implied warranty of
18 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 GNU General Public License, version 2.0, for more details.
20
21 You should have received a copy of the GNU General Public License
22 along with this program; if not, write to the Free Software
23 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
24*/
25
26#ifndef ITEM_PROCESSING_DATA_INCLUDED
27#define ITEM_PROCESSING_DATA_INCLUDED
28
29#include <atomic>
30#include <functional>
31
35
36namespace Mysql {
37namespace Tools {
38namespace Dump {
39
40/**
41 Data structure for objects that are processed in any chain.
42 */
44 public:
46 Chain_data *chain_data, I_dump_task *process_task_object,
47 I_chain_element *chain_element,
48 const std::function<void(Item_processing_data *)> *completion_callback,
49 Item_processing_data *parent_item_data);
50
52
53 /**
54 Returns chain data in which this item is being processed.
55 */
56 Chain_data *get_chain() const;
57
59
60 void start_processing();
61
62 bool end_processing();
63
65
67
69
70 bool had_chain_created() const;
71
73
74 void set_chain(Chain_data *);
75
77
78 private:
79 /**
80 Chain in which current processing item is processed.
81 */
83 /**
84 Instance of task object that is being processing.
85 */
87 /**
88 Instance of chain element that is processing specified element.
89 */
91 /**
92 Callback to call after element is fully processed to the output. Can be
93 NULL.
94 */
95 const std::function<void(Item_processing_data *)> *m_completion_callback;
96 /**
97 Link to item process information of parent module execution, if exists.
98 */
100 /**
101 Number of modules that have pending or are executing this task.
102 */
103 std::atomic<uint32_t> m_active_executions;
104 /**
105 Indicates if this item led to creation of at least one new chain.
106 */
108};
109
110} // namespace Dump
111} // namespace Tools
112} // namespace Mysql
113
114#endif
Definition: chain_data.h:35
Interface for all objects that can process data in any part of dump process.
Definition: i_chain_element.h:41
Interface for all individual dump process tasks.
Definition: i_dump_task.h:38
Data structure for objects that are processed in any chain.
Definition: item_processing_data.h:43
void set_had_chain_created()
Definition: item_processing_data.cc:82
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:95
bool have_completion_callback()
Definition: item_processing_data.cc:74
std::atomic< uint32_t > m_active_executions
Number of modules that have pending or are executing this task.
Definition: item_processing_data.h:103
I_chain_element * get_processing_chain_element() const
Definition: item_processing_data.cc:70
Chain_data * get_chain() const
Returns chain data in which this item is being processed.
Definition: item_processing_data.cc:51
bool had_chain_created() const
Definition: item_processing_data.cc:78
Item_processing_data * m_parent_item_data
Link to item process information of parent module execution, if exists.
Definition: item_processing_data.h:99
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:33
void set_chain(Chain_data *)
Definition: item_processing_data.cc:86
I_dump_task * m_process_task_object
Instance of task object that is being processing.
Definition: item_processing_data.h:86
bool m_had_chain_created
Indicates if this item led to creation of at least one new chain.
Definition: item_processing_data.h:107
void start_processing()
Definition: item_processing_data.cc:57
Item_processing_data * get_parent_item_data() const
Definition: item_processing_data.cc:53
I_chain_element * m_chain_element
Instance of chain element that is processing specified element.
Definition: item_processing_data.h:90
Chain_data * m_chain_data
Chain in which current processing item is processed.
Definition: item_processing_data.h:82
~Item_processing_data()
Definition: item_processing_data.cc:46
bool end_processing()
Definition: item_processing_data.cc:59
I_dump_task * get_process_task_object() const
Definition: item_processing_data.cc:66
bool call_completion_callback_at_end()
Definition: item_processing_data.cc:90
Definition: abstract_connection_program.h:38