1/* Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
2
3 This program is free software; you can redistribute it and/or modify
4 it under the terms of the GNU General Public License as published by
5 the Free Software Foundation; version 2 of the License.
6
7 This program is distributed in the hope that it will be useful,
8 but WITHOUT ANY WARRANTY; without even the implied warranty of
9 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 GNU General Public License for more details.
11
12 You should have received a copy of the GNU General Public License
13 along with this program; if not, write to the Free Software
14 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */
15
16#ifndef CURSOR_BY_THREAD_H
17#define CURSOR_BY_THREAD_H
18
19/**
20 @file storage/perfschema/cursor_by_thread.h
21 Cursor CURSOR_BY_THREAD (declarations).
22*/
23
24#include "pfs_engine_table.h"
25#include "pfs_instr.h"
26#include "table_helper.h"
27
28/**
29 @addtogroup Performance_schema_tables
30 @{
31*/
32
33/** Cursor CURSOR_BY_THREAD. */
34class cursor_by_thread : public PFS_engine_table
35{
36public:
37 virtual int rnd_next();
38 virtual int rnd_pos(const void *pos);
39 virtual void reset_position(void);
40
41protected:
42 cursor_by_thread(const PFS_engine_table_share *share);
43
44public:
45 ~cursor_by_thread()
46 {}
47
48protected:
49 virtual void make_row(PFS_thread *thread)= 0;
50
51private:
52 /** Current position. */
53 PFS_simple_index m_pos;
54 /** Next position. */
55 PFS_simple_index m_next_pos;
56};
57
58/** @} */
59#endif
60