MySQL 8.0.32
Source Code Documentation
iterators.h
Go to the documentation of this file.
1/*
2 Copyright (c) 2019, 2022, 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#ifndef BINLOG_TOOLS_ITERATORS_H
25#define BINLOG_TOOLS_ITERATORS_H
26
27#include <queue>
28#include "sql/binlog_reader.h"
29
30namespace binlog {
31namespace tools {
32
33class Iterator {
34 protected:
35 std::queue<Log_event *> m_events;
40 std::string m_error_message;
41
42 public:
44 virtual ~Iterator();
45
46 virtual void unset_copy_event_buffer();
47 virtual void set_copy_event_buffer();
48
49 virtual void unset_verify_checksum();
50 virtual void set_verify_checksum();
51
52 virtual bool has_error();
53 virtual int get_error_number();
54 virtual std::string get_error_message();
55
56 virtual Log_event *begin();
57 virtual Log_event *end();
58 virtual Log_event *next();
59
60 protected:
61 virtual Log_event *do_next();
62};
63
64} // namespace tools
65} // namespace binlog
66
67#endif
It owns an allocator, a byte stream, an event_data stream and an event object stream.
Definition: binlog_reader.h:246
This is the abstract base class for binary log events.
Definition: log_event.h:547
Definition: iterators.h:33
int m_error_number
Definition: iterators.h:39
Iterator(Binlog_file_reader *)
Definition: iterators.cc:33
virtual void set_verify_checksum()
Definition: iterators.cc:46
std::string m_error_message
Definition: iterators.h:40
virtual void set_copy_event_buffer()
Definition: iterators.cc:40
virtual Log_event * next()
Definition: iterators.cc:139
virtual int get_error_number()
Definition: iterators.cc:133
virtual Log_event * end()
Definition: iterators.cc:144
virtual bool has_error()
Definition: iterators.cc:131
virtual Log_event * do_next()
Definition: iterators.cc:54
bool m_copy_event_buffer
Definition: iterators.h:38
virtual void unset_copy_event_buffer()
Definition: iterators.cc:42
std::queue< Log_event * > m_events
Definition: iterators.h:35
virtual Log_event * begin()
Definition: iterators.cc:137
virtual std::string get_error_message()
Definition: iterators.cc:135
Binlog_file_reader * m_binlog_reader
Definition: iterators.h:36
virtual ~Iterator()
Definition: iterators.cc:123
bool m_verify_checksum
Definition: iterators.h:37
virtual void unset_verify_checksum()
Definition: iterators.cc:50
Definition: global.cc:26