~ubuntu-branches/ubuntu/trusty/mariadb-5.5/trusty-proposed

« back to all changes in this revision

Viewing changes to storage/ndb/src/ndbapi/NdbUtil.hpp

  • Committer: Package Import Robot
  • Author(s): Otto Kekäläinen
  • Date: 2013-12-22 10:27:05 UTC
  • Revision ID: package-import@ubuntu.com-20131222102705-mndw7s12mz0szrcn
Tags: upstream-5.5.32
Import upstream version 5.5.32

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* Copyright (C) 2003 MySQL AB
 
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
/************************************************************************************************
 
17
Name:           NdbUtil.H
 
18
Include:        
 
19
Link:           
 
20
Author:         UABRONM Mikael Ronstr�m UAB/B/SD
 
21
Date:           991029
 
22
Version:        0.4
 
23
Description:    Utility classes for NDB API
 
24
Documentation:
 
25
Adjust:         991029  UABRONM   First version.
 
26
Comment:        
 
27
************************************************************************************************/
 
28
#ifndef NdbUtil_H
 
29
#define NdbUtil_H
 
30
 
 
31
#include <ndb_global.h>
 
32
 
 
33
class Ndb;
 
34
class NdbApiSignal;
 
35
class NdbOperation;
 
36
 
 
37
template<class T>
 
38
struct Free_list_element 
 
39
{
 
40
  Free_list_element() { theNext = 0;}
 
41
  void next(T* obj) { theNext = obj;}
 
42
  T* next() { return theNext;}
 
43
 
 
44
  T* theNext;
 
45
};
 
46
 
 
47
class NdbLabel : public Free_list_element<NdbLabel>
 
48
{
 
49
friend class NdbOperation;
 
50
friend class Ndb;
 
51
public:
 
52
  NdbLabel(Ndb*);
 
53
  ~NdbLabel();
 
54
 
 
55
private:
 
56
  Uint32   theSubroutine[16];
 
57
  Uint32   theLabelAddress[16];
 
58
  Uint32   theLabelNo[16];
 
59
};
 
60
 
 
61
class NdbSubroutine : public Free_list_element<NdbSubroutine>
 
62
{
 
63
friend class NdbOperation;
 
64
friend class Ndb;
 
65
 
 
66
public:
 
67
  NdbSubroutine(Ndb*);
 
68
  ~NdbSubroutine();
 
69
 
 
70
  Uint32   theSubroutineAddress[16];
 
71
};
 
72
 
 
73
class NdbBranch : public Free_list_element<NdbBranch>
 
74
{
 
75
friend class NdbOperation;
 
76
friend class Ndb;
 
77
 
 
78
public:
 
79
  NdbBranch(Ndb*);
 
80
  ~NdbBranch();
 
81
 
 
82
  NdbApiSignal* theSignal;
 
83
  Uint32       theSignalAddress;
 
84
  Uint32       theBranchAddress;
 
85
  Uint32        theBranchLabel;
 
86
  Uint32        theSubroutine;
 
87
};
 
88
 
 
89
class NdbCall : public Free_list_element<NdbCall>
 
90
{
 
91
friend class NdbOperation;
 
92
friend class Ndb;
 
93
 
 
94
public:
 
95
  NdbCall(Ndb*);
 
96
  ~NdbCall();
 
97
 
 
98
  NdbApiSignal* theSignal;
 
99
  Uint32       theSignalAddress;
 
100
  Uint32        theSubroutine;
 
101
};
 
102
 
 
103
#endif