MySQL 5.6.14 Source Code Document
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
FireTrigOrd.hpp
1 /*
2  Copyright (C) 2003, 2005-2008 MySQL AB
3  All rights reserved. Use is subject to license terms.
4 
5  This program is free software; you can redistribute it and/or modify
6  it under the terms of the GNU General Public License as published by
7  the Free Software Foundation; version 2 of the License.
8 
9  This program is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY; without even the implied warranty of
11  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  GNU General Public License for more details.
13 
14  You should have received a copy of the GNU General Public License
15  along with this program; if not, write to the Free Software
16  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
17 */
18 
19 #ifndef FIRE_TRIG_ORD_HPP
20 #define FIRE_TRIG_ORD_HPP
21 
22 #include "SignalData.hpp"
23 #include <NodeBitmask.hpp>
24 #include <trigger_definitions.h>
25 #include <string.h>
26 
33 class FireTrigOrd {
37  // API
38 
42  friend class Dbtup;
43 
47  friend class Dbtc;
48  friend class Backup;
49  friend class SumaParticipant;
50  friend class Suma;
51 
55  friend bool printFIRE_TRIG_ORD(FILE * output, const Uint32 * theData, Uint32 len, Uint16 receiverBlockNo);
56 
57 public:
58  STATIC_CONST( SignalLength = 11 );
59  STATIC_CONST( SignalWithGCILength = 9 );
60  STATIC_CONST( SignalLengthSuma = 14 );
61 
62 private:
63  Uint32 m_connectionPtr;
64  Uint32 m_userRef;
65  Uint32 m_triggerId;
66  Uint32 m_triggerEvent;
67  Uint32 m_noPrimKeyWords;
68  Uint32 m_noBeforeValueWords;
69  Uint32 m_noAfterValueWords;
70  Uint32 fragId;
71  union {
72  Uint32 m_gci_hi;
73  Uint32 m_triggerType;
74  };
75  Uint32 m_transId1;
76  Uint32 m_transId2;
77  Uint32 m_gci_lo;
78  Uint32 m_hashValue;
79  Uint32 m_any_value;
80  // Public methods
81 public:
82  Uint32 getConnectionPtr() const;
83  void setConnectionPtr(Uint32);
84  Uint32 getUserRef() const;
85  void setUserRef(Uint32);
86  Uint32 getTriggerId() const;
87  void setTriggerId(Uint32 anIndxId);
88  TriggerEvent::Value getTriggerEvent() const;
89  void setTriggerEvent(TriggerEvent::Value);
90  Uint32 getNoOfPrimaryKeyWords() const;
91  void setNoOfPrimaryKeyWords(Uint32);
92  Uint32 getNoOfBeforeValueWords() const;
93  void setNoOfBeforeValueWords(Uint32);
94  Uint32 getNoOfAfterValueWords() const;
95  void setNoOfAfterValueWords(Uint32);
96  Uint32 getGCI() const;
97  void setGCI(Uint32);
98  Uint32 getHashValue() const;
99  void setHashValue(Uint32);
100  Uint32 getAnyValue() const;
101  void setAnyValue(Uint32);
102 };
103 
104 inline
105 Uint32 FireTrigOrd::getConnectionPtr() const
106 {
107  return m_connectionPtr;
108 }
109 
110 inline
111 void FireTrigOrd::setConnectionPtr(Uint32 aConnectionPtr)
112 {
113  m_connectionPtr = aConnectionPtr;
114 }
115 
116 inline
117 Uint32 FireTrigOrd::getUserRef() const
118 {
119  return m_userRef;
120 }
121 
122 inline
123 void FireTrigOrd::setUserRef(Uint32 aUserRef)
124 {
125  m_userRef = aUserRef;
126 }
127 
128 inline
129 Uint32 FireTrigOrd::getTriggerId() const
130 {
131  return m_triggerId;
132 }
133 
134 inline
135 void FireTrigOrd::setTriggerId(Uint32 aTriggerId)
136 {
137  m_triggerId = aTriggerId;
138 }
139 
140 inline
141 TriggerEvent::Value FireTrigOrd::getTriggerEvent() const
142 {
143  return (TriggerEvent::Value)m_triggerEvent;
144 }
145 
146 inline
147 void FireTrigOrd::setTriggerEvent(TriggerEvent::Value aTriggerEvent)
148 {
149  m_triggerEvent = aTriggerEvent;
150 }
151 
152 inline
153 Uint32 FireTrigOrd::getNoOfPrimaryKeyWords() const
154 {
155  return m_noPrimKeyWords;
156 }
157 
158 inline
159 void FireTrigOrd::setNoOfPrimaryKeyWords(Uint32 noPrim)
160 {
161  m_noPrimKeyWords = noPrim;
162 }
163 
164 inline
165 Uint32 FireTrigOrd::getNoOfBeforeValueWords() const
166 {
167  return m_noBeforeValueWords;
168 }
169 
170 inline
171 void FireTrigOrd::setNoOfBeforeValueWords(Uint32 noBefore)
172 {
173  m_noBeforeValueWords = noBefore;
174 }
175 
176 inline
177 Uint32 FireTrigOrd::getNoOfAfterValueWords() const
178 {
179  return m_noAfterValueWords;
180 }
181 
182 inline
183 void FireTrigOrd::setNoOfAfterValueWords(Uint32 noAfter)
184 {
185  m_noAfterValueWords = noAfter;
186 }
187 
188 inline
189 Uint32 FireTrigOrd::getGCI() const
190 {
191  return m_gci_hi;
192 }
193 
194 inline
195 void FireTrigOrd::setGCI(Uint32 aGCI)
196 {
197  m_gci_hi = aGCI;
198 }
199 
200 inline
201 Uint32 FireTrigOrd::getHashValue() const
202 {
203  return m_hashValue;
204 }
205 
206 inline
207 void FireTrigOrd::setHashValue(Uint32 flag)
208 {
209  m_hashValue = flag;
210 }
211 
212 inline
213 Uint32 FireTrigOrd::getAnyValue() const
214 {
215  return m_any_value;
216 }
217 
218 inline
219 void FireTrigOrd::setAnyValue(Uint32 any_value)
220 {
221  m_any_value = any_value;
222 }
223 
225 {
226  STATIC_CONST( SignalLength = 4 );
227 
228  Uint32 tcOpRec;
229  Uint32 transId[2];
230  Uint32 pass;
231 };
232 
234 {
235  STATIC_CONST( SignalLength = 4 );
236 
237  Uint32 tcOpRec;
238  Uint32 transId[2];
239  Uint32 errCode;
240 
241  enum ErrorCode
242  {
243  FTR_UnknownOperation = 1235
244  ,FTR_IncorrectState = 1236
245  };
246 };
247 
249 {
250  STATIC_CONST( SignalLength = 4 );
251 
252  Uint32 tcOpRec;
253  Uint32 transId[2];
254  Uint32 noFiredTriggers; // bit 31 defered trigger
255 
256  static Uint32 getFiredCount(Uint32 v) {
257  return NoOfFiredTriggers::getFiredCount(v);
258  }
259  static Uint32 getDeferredBit(Uint32 v) {
260  return NoOfFiredTriggers::getDeferredBit(v);
261  }
262  static void setDeferredBit(Uint32 & v) {
263  NoOfFiredTriggers::setDeferredBit(v);
264  }
265 };
266 
267 #endif