~ubuntu-branches/ubuntu/trusty/mysql-5.6/trusty

« back to all changes in this revision

Viewing changes to storage/perfschema/table_all_instr.h

  • Committer: Package Import Robot
  • Author(s): James Page
  • Date: 2014-02-12 11:54:27 UTC
  • Revision ID: package-import@ubuntu.com-20140212115427-oq6tfsqxl1wuwehi
Tags: upstream-5.6.15
ImportĀ upstreamĀ versionĀ 5.6.15

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* Copyright (c) 2008, 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 Foundation,
 
14
  51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA */
 
15
 
 
16
#ifndef TABLE_ALL_INSTR_H
 
17
#define TABLE_ALL_INSTR_H
 
18
 
 
19
/**
 
20
  @file storage/perfschema/table_all_instr.h
 
21
  Abstract tables for all instruments (declarations).
 
22
*/
 
23
 
 
24
#include "pfs_instr_class.h"
 
25
#include "pfs_instr.h"
 
26
#include "pfs_engine_table.h"
 
27
#include "table_helper.h"
 
28
 
 
29
/**
 
30
  @addtogroup Performance_schema_tables
 
31
  @{
 
32
*/
 
33
 
 
34
/** Position of a cursor on table_all_instr. */
 
35
struct pos_all_instr : public PFS_double_index,
 
36
                       public PFS_instrument_view_constants
 
37
{
 
38
  pos_all_instr()
 
39
    : PFS_double_index(FIRST_VIEW, 0)
 
40
  {}
 
41
 
 
42
  inline void reset(void)
 
43
  {
 
44
    m_index_1= FIRST_VIEW;
 
45
    m_index_2= 0;
 
46
  }
 
47
 
 
48
  inline bool has_more_view(void)
 
49
  { return (m_index_1 <= LAST_VIEW); }
 
50
 
 
51
  inline void next_view(void)
 
52
  {
 
53
    m_index_1++;
 
54
    m_index_2= 0;
 
55
  }
 
56
};
 
57
 
 
58
/**
 
59
  Abstract table, a union of all instrumentations instances.
 
60
  This table is a union of:
 
61
  - a view on all mutex instances,
 
62
  - a view on all rwlock instances,
 
63
  - a view on all cond instances,
 
64
  - a view on all file instances,
 
65
  - a view on all socket instances
 
66
*/
 
67
class table_all_instr : public PFS_engine_table
 
68
{
 
69
public:
 
70
  virtual int rnd_next();
 
71
  virtual int rnd_pos(const void *pos);
 
72
  virtual void reset_position(void);
 
73
 
 
74
protected:
 
75
  table_all_instr(const PFS_engine_table_share *share);
 
76
 
 
77
public:
 
78
  ~table_all_instr()
 
79
  {}
 
80
 
 
81
protected:
 
82
  /**
 
83
    Build a row in the mutex instance view.
 
84
    @param pfs                        the mutex instance
 
85
  */
 
86
  virtual void make_mutex_row(PFS_mutex *pfs)= 0;
 
87
  /**
 
88
    Build a row in the rwlock instance view.
 
89
    @param pfs                        the rwlock instance
 
90
  */
 
91
  virtual void make_rwlock_row(PFS_rwlock *pfs)= 0;
 
92
  /**
 
93
    Build a row in the condition instance view.
 
94
    @param pfs                        the condition instance
 
95
  */
 
96
  virtual void make_cond_row(PFS_cond *pfs)= 0;
 
97
  /**
 
98
    Build a row in the file instance view.
 
99
    @param pfs                        the file instance
 
100
  */
 
101
  virtual void make_file_row(PFS_file *pfs)= 0;
 
102
  /**
 
103
    Build a row in the socket instance view.
 
104
    @param pfs                        the socket instance
 
105
  */
 
106
  virtual void make_socket_row(PFS_socket *pfs)= 0;
 
107
 
 
108
  /** Current position. */
 
109
  pos_all_instr m_pos;
 
110
  /** Next position. */
 
111
  pos_all_instr m_next_pos;
 
112
};
 
113
 
 
114
/** @} */
 
115
#endif