mySQL 5.0.11 sources for tomato
[tomato.git] / release / src / router / mysql / storage / ndb / include / kernel / signaldata / CreateEvnt.hpp
blob328c5146c6c6260919b8e7f1ed28680cc17ce01f
1 /* Copyright (c) 2003-2006 MySQL AB
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.
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.
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 */
16 #ifndef CREATE_EVNT_HPP
17 #define CREATE_EVNT_HPP
19 #include <ndberror.h>
20 #include "SignalData.hpp"
21 #include <NodeBitmask.hpp>
22 #include <signaldata/DictTabInfo.hpp>
24 /**
25 * DropEvntReq.
27 class DropEvntReq {
28 friend bool printDROP_EVNT_REQ(FILE*, const Uint32*, Uint32, Uint16);
30 public:
31 STATIC_CONST( SignalLength = 2 );
32 SECTION( EVENT_NAME_SECTION = 0 );
34 union { // user block reference
35 Uint32 senderRef;
36 Uint32 m_userRef;
38 union {
39 Uint32 senderData;
40 Uint32 m_userData; // user
43 Uint32 getUserRef() const {
44 return m_userRef;
46 void setUserRef(Uint32 val) {
47 m_userRef = val;
49 Uint32 getUserData() const {
50 return m_userData;
52 void setUserData(Uint32 val) {
53 m_userData = val;
57 /**
58 * DropEvntConf.
60 class DropEvntConf {
61 friend bool printDROP_EVNT_CONF(FILE*, const Uint32*, Uint32, Uint16);
63 public:
64 STATIC_CONST( SignalLength = 2 );
66 union { // user block reference
67 Uint32 senderRef;
68 Uint32 m_userRef;
70 union {
71 Uint32 senderData;
72 Uint32 m_userData; // user
75 Uint32 getUserRef() const {
76 return m_userRef;
78 void setUserRef(Uint32 val) {
79 m_userRef = val;
81 Uint32 getUserData() const {
82 return m_userData;
84 void setUserData(Uint32 val) {
85 m_userData = val;
89 /**
90 * DropEvntRef.
92 class DropEvntRef {
93 friend bool printDROP_EVNT_REF(FILE*, const Uint32*, Uint32, Uint16);
95 public:
96 enum ErrorCode {
97 NoError = 0,
98 Undefined = 1,
99 NF_FakeErrorREF = 11,
100 Busy = 701,
101 NotMaster = 702
103 STATIC_CONST( SignalLength = 7 );
104 STATIC_CONST( SignalLength2 = SignalLength+1 );
106 union { // user block reference
107 Uint32 senderRef;
108 Uint32 m_userRef;
110 union {
111 Uint32 senderData;
112 Uint32 m_userData; // user
114 union {
115 Uint32 errorCode;
116 Uint32 m_errorCode;
118 Uint32 m_errorLine;
119 Uint32 m_errorNode;
120 // with SignalLength2
121 Uint32 m_masterNodeId;
122 Uint32 getUserRef() const {
123 return m_userRef;
125 void setUserRef(Uint32 val) {
126 m_userRef = val;
128 Uint32 getUserData() const {
129 return m_userData;
131 void setUserData(Uint32 val) {
132 m_userData = val;
134 Uint32 getErrorCode() const {
135 return m_errorCode;
137 void setErrorCode(Uint32 val) {
138 m_errorCode = val;
140 Uint32 getErrorLine() const {
141 return m_errorLine;
143 void setErrorLine(Uint32 val) {
144 m_errorLine = val;
146 Uint32 getErrorNode() const {
147 return m_errorNode;
149 void setErrorNode(Uint32 val) {
150 m_errorNode = val;
152 Uint32 getMasterNode() const {
153 return m_masterNodeId;
155 void setMasterNode(Uint32 val) {
156 m_masterNodeId = val;
161 * CreateEvntReq.
163 struct CreateEvntReq {
164 friend bool printCREATE_EVNT_REQ(FILE*, const Uint32*, Uint32, Uint16);
166 enum RequestType {
167 RT_UNDEFINED = 0,
168 RT_USER_CREATE = 1,
169 RT_USER_GET = 2,
171 RT_DICT_AFTER_GET = 0x1 << 4
172 // RT_DICT_MASTER = 0x2 << 4,
174 // RT_DICT_COMMIT = 0xC << 4,
175 // RT_DICT_ABORT = 0xF << 4,
176 // RT_TC = 5 << 8
178 enum EventFlags {
179 EF_REPORT_ALL = 0x1 << 16,
180 EF_REPORT_SUBSCRIBE = 0x2 << 16,
181 EF_ALL = 0xFFFF << 16
183 STATIC_CONST( SignalLengthGet = 3 );
184 STATIC_CONST( SignalLengthCreate = 6+MAXNROFATTRIBUTESINWORDS );
185 STATIC_CONST( SignalLength = 8+MAXNROFATTRIBUTESINWORDS );
186 // SECTION( ATTRIBUTE_LIST_SECTION = 0 );
187 SECTION( EVENT_NAME_SECTION = 0 );
189 union {
190 Uint32 m_userRef; // user block reference
191 Uint32 senderRef; // user block reference
193 union {
194 Uint32 m_userData; // user
195 Uint32 senderData; // user
197 Uint32 m_requestInfo;
198 Uint32 m_tableId; // table to event
199 Uint32 m_tableVersion; // table version
200 AttributeMask::Data m_attrListBitmask;
201 Uint32 m_eventType; // EventFlags (16 bits) + from DictTabInfo::TableType (16 bits)
202 Uint32 m_eventId; // event table id set by DICT/SUMA
203 Uint32 m_eventKey; // event table key set by DICT/SUMA
204 Uint32 getUserRef() const {
205 return m_userRef;
207 void setUserRef(Uint32 val) {
208 m_userRef = val;
210 Uint32 getUserData() const {
211 return m_userData;
213 void setUserData(Uint32 val) {
214 m_userData = val;
216 CreateEvntReq::RequestType getRequestType() const {
217 const Uint32 val = BitmaskImpl::getField(1, &m_requestInfo, 0, 16);
218 return (CreateEvntReq::RequestType)val;
220 void setRequestType(CreateEvntReq::RequestType val) {
221 m_requestInfo = (Uint32)val;
223 Uint32 getRequestFlag() const {
224 return BitmaskImpl::getField(1, &m_requestInfo, 16, 16);
226 void addRequestFlag(Uint32 val) {
227 val |= BitmaskImpl::getField(1, &m_requestInfo, 16, 16);
228 BitmaskImpl::setField(1, &m_requestInfo, 16, 16, val);
230 Uint32 getTableId() const {
231 return m_tableId;
233 void setTableId(Uint32 val) {
234 m_tableId = val;
236 Uint32 getTableVersion() const {
237 return m_tableVersion;
239 void setTableVersion(Uint32 val) {
240 m_tableVersion = val;
242 AttributeMask getAttrListBitmask() const {
243 AttributeMask tmp;
244 tmp.assign(m_attrListBitmask);
245 return tmp;
247 void setAttrListBitmask(const AttributeMask & val) {
248 AttributeMask::assign(m_attrListBitmask.data, val);
250 Uint32 getEventType() const {
251 return m_eventType & ~EF_ALL;
253 void setEventType(Uint32 val) {
254 m_eventType = (m_eventType & EF_ALL) | (~EF_ALL & (Uint32)val);
256 Uint32 getEventId() const {
257 return m_eventId;
259 void setEventId(Uint32 val) {
260 m_eventId = val;
262 Uint32 getEventKey() const {
263 return m_eventKey;
265 void setEventKey(Uint32 val) {
266 m_eventKey = val;
268 void clearFlags() {
269 m_eventType&= ~EF_ALL;
271 Uint32 getReportFlags() const {
272 return m_eventType & EF_ALL;
274 void setReportFlags(Uint32 val) {
275 m_eventType = (val & EF_ALL) | (m_eventType & ~EF_ALL);
277 Uint32 getReportAll() const {
278 return m_eventType & EF_REPORT_ALL ;
280 void setReportAll() {
281 m_eventType|= EF_REPORT_ALL;
283 Uint32 getReportSubscribe() const {
284 return m_eventType & EF_REPORT_SUBSCRIBE ;
286 void setReportSubscribe() {
287 m_eventType|= EF_REPORT_SUBSCRIBE;
292 * CreateEvntConf.
294 class CreateEvntConf {
295 friend bool printCREATE_EVNT_CONF(FILE*, const Uint32*, Uint32, Uint16);
297 public:
298 // STATIC_CONST( InternalLength = 3 );
299 STATIC_CONST( SignalLength = 8+MAXNROFATTRIBUTESINWORDS );
301 union {
302 Uint32 m_userRef; // user block reference
303 Uint32 senderRef; // user block reference
305 union {
306 Uint32 m_userData; // user
307 Uint32 senderData; // user
309 Uint32 m_requestInfo;
310 Uint32 m_tableId;
311 Uint32 m_tableVersion; // table version
312 AttributeMask m_attrListBitmask;
313 Uint32 m_eventType;
314 Uint32 m_eventId;
315 Uint32 m_eventKey;
317 Uint32 getUserRef() const {
318 return m_userRef;
320 void setUserRef(Uint32 val) {
321 m_userRef = val;
323 Uint32 getUserData() const {
324 return m_userData;
326 void setUserData(Uint32 val) {
327 m_userData = val;
329 CreateEvntReq::RequestType getRequestType() const {
330 return (CreateEvntReq::RequestType)m_requestInfo;
332 void setRequestType(CreateEvntReq::RequestType val) {
333 m_requestInfo = (Uint32)val;
335 Uint32 getTableId() const {
336 return m_tableId;
338 void setTableId(Uint32 val) {
339 m_tableId = val;
341 Uint32 getTableVersion() const {
342 return m_tableVersion;
344 void setTableVersion(Uint32 val) {
345 m_tableVersion = val;
347 AttributeMask getAttrListBitmask() const {
348 return m_attrListBitmask;
350 void setAttrListBitmask(const AttributeMask & val) {
351 m_attrListBitmask = val;
353 Uint32 getEventType() const {
354 return m_eventType;
356 void setEventType(Uint32 val) {
357 m_eventType = (Uint32)val;
359 Uint32 getEventId() const {
360 return m_eventId;
362 void setEventId(Uint32 val) {
363 m_eventId = val;
365 Uint32 getEventKey() const {
366 return m_eventKey;
368 void setEventKey(Uint32 val) {
369 m_eventKey = val;
374 * CreateEvntRef.
376 struct CreateEvntRef {
377 friend class SafeCounter;
378 friend bool printCREATE_EVNT_REF(FILE*, const Uint32*, Uint32, Uint16);
380 STATIC_CONST( SignalLength = 11 );
381 STATIC_CONST( SignalLength2 = SignalLength + 1 );
382 enum ErrorCode {
383 NoError = 0,
384 Undefined = 1,
385 NF_FakeErrorREF = 11,
386 Busy = 701,
387 NotMaster = 702
389 union {
390 Uint32 m_userRef; // user block reference
391 Uint32 senderRef; // user block reference
393 union {
394 Uint32 m_userData; // user
395 Uint32 senderData; // user
398 Uint32 m_requestInfo;
399 Uint32 m_tableId;
400 Uint32 m_tableVersion; // table version
401 Uint32 m_eventType;
402 Uint32 m_eventId;
403 Uint32 m_eventKey;
404 Uint32 errorCode;
405 Uint32 m_errorLine;
406 Uint32 m_errorNode;
407 // with SignalLength2
408 Uint32 m_masterNodeId;
409 Uint32 getUserRef() const {
410 return m_userRef;
412 void setUserRef(Uint32 val) {
413 m_userRef = val;
415 Uint32 getUserData() const {
416 return m_userData;
418 void setUserData(Uint32 val) {
419 m_userData = val;
421 CreateEvntReq::RequestType getRequestType() const {
422 return (CreateEvntReq::RequestType)m_requestInfo;
424 void setRequestType(CreateEvntReq::RequestType val) {
425 m_requestInfo = (Uint32)val;
427 Uint32 getTableId() const {
428 return m_tableId;
430 void setTableId(Uint32 val) {
431 m_tableId = val;
433 Uint32 getTableVersion() const {
434 return m_tableVersion;
436 void setTableVersion(Uint32 val) {
437 m_tableVersion = val;
440 Uint32 getEventType() const {
441 return m_eventType;
443 void setEventType(Uint32 val) {
444 m_eventType = (Uint32)val;
446 Uint32 getEventId() const {
447 return m_eventId;
449 void setEventId(Uint32 val) {
450 m_eventId = val;
452 Uint32 getEventKey() const {
453 return m_eventKey;
455 void setEventKey(Uint32 val) {
456 m_eventKey = val;
459 Uint32 getErrorCode() const {
460 return errorCode;
462 void setErrorCode(Uint32 val) {
463 errorCode = val;
465 Uint32 getErrorLine() const {
466 return m_errorLine;
468 void setErrorLine(Uint32 val) {
469 m_errorLine = val;
471 Uint32 getErrorNode() const {
472 return m_errorNode;
474 void setErrorNode(Uint32 val) {
475 m_errorNode = val;
477 Uint32 getMasterNode() const {
478 return m_masterNodeId;
480 void setMasterNode(Uint32 val) {
481 m_masterNodeId = val;
484 #endif