MySQL 5.6.14 Source Code Document
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
table_ews_by_account_by_event_name.h
Go to the documentation of this file.
1 /* Copyright (c) 2010, 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 TABLE_EWS_BY_ACCOUNT_BY_EVENT_NAME_H
17 #define TABLE_EWS_BY_ACCOUNT_BY_EVENT_NAME_H
18 
24 #include "pfs_column_types.h"
25 #include "pfs_engine_table.h"
26 #include "pfs_instr_class.h"
27 #include "pfs_instr.h"
28 #include "pfs_account.h"
29 #include "table_helper.h"
30 
41 {
48 };
49 
59 {
61  : PFS_triple_index(0, FIRST_VIEW, 1)
62  {}
63 
64  inline void reset(void)
65  {
66  m_index_1= 0;
67  m_index_2= VIEW_MUTEX;
68  m_index_3= 1;
69  }
70 
71  inline bool has_more_account(void)
72  { return (m_index_1 < account_max); }
73 
74  inline void next_account(void)
75  {
76  m_index_1++;
77  m_index_2= FIRST_VIEW;
78  m_index_3= 1;
79  }
80 
81  inline bool has_more_view(void)
82  { return (m_index_2 <= LAST_VIEW); }
83 
84  inline void next_view(void)
85  {
86  m_index_2++;
87  m_index_3= 1;
88  }
89 };
90 
93 {
94 public:
97  static PFS_engine_table* create();
98  static int delete_all_rows();
99 
100  virtual int rnd_next();
101  virtual int rnd_pos(const void *pos);
102  virtual void reset_position(void);
103 
104 protected:
105  virtual int read_row_values(TABLE *table,
106  unsigned char *buf,
107  Field **fields,
108  bool read_all);
109 
111 
112 public:
114  {}
115 
116 protected:
117  void make_row(PFS_account *account, PFS_instr_class *klass);
118 
119 private:
121  static THR_LOCK m_table_lock;
123  static TABLE_FIELD_DEF m_field_def;
124 
128  bool m_row_exists;
133 };
134 
136 #endif