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_USER_H |
17 | #define CURSOR_BY_USER_H |
18 | |
19 | /** |
20 | @file storage/perfschema/cursor_by_user.h |
21 | Cursor CURSOR_BY_USER (declarations). |
22 | */ |
23 | |
24 | #include "pfs_engine_table.h" |
25 | #include "pfs_user.h" |
26 | #include "table_helper.h" |
27 | |
28 | /** |
29 | @addtogroup Performance_schema_tables |
30 | @{ |
31 | */ |
32 | |
33 | /** Cursor CURSOR_BY_USER. */ |
34 | class cursor_by_user : public PFS_engine_table |
35 | { |
36 | public: |
37 | virtual int rnd_next(); |
38 | virtual int rnd_pos(const void *pos); |
39 | virtual void reset_position(void); |
40 | |
41 | protected: |
42 | cursor_by_user(const PFS_engine_table_share *share); |
43 | |
44 | public: |
45 | ~cursor_by_user() |
46 | {} |
47 | |
48 | protected: |
49 | virtual void make_row(PFS_user *user)= 0; |
50 | |
51 | private: |
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 | |