⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 lqhtransconf.hpp

📁 mysql-5.0.22.tar.gz源码包
💻 HPP
字号:
/* Copyright (C) 2003 MySQL AB   This program is free software; you can redistribute it and/or modify   it under the terms of the GNU General Public License as published by   the Free Software Foundation; either version 2 of the License, or   (at your option) any later version.   This program is distributed in the hope that it will be useful,   but WITHOUT ANY WARRANTY; without even the implied warranty of   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the   GNU General Public License for more details.   You should have received a copy of the GNU General Public License   along with this program; if not, write to the Free Software   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */#ifndef LQH_TRANS_CONF_H#define LQH_TRANS_CONF_H#include "SignalData.hpp"/** * This signal is sent as response to a LQH_TRANSREQ * which is sent as by a take-over TC */class LqhTransConf {  /**   * Reciver(s)   */  friend class Dbtc;  /**   * Sender(s)   */  friend class Dblqh;        friend bool printLQH_TRANSCONF(FILE *, const Uint32 *, Uint32, Uint16);  public:  STATIC_CONST( SignalLength = 15 );private:  /**   * This type describes the state of the operation returned in this signal   */  enum OperationStatus {    InvalidStatus = 0, /**< This status should never be sent in a signal			  it is only used for initializing variables so that			  you can easily later check if they have changed */    LastTransConf = 4, /**< This status indicates that LQH has finished the scan			  of operations belonging to the died TC.			  Data 0 - 2 is valid */        Prepared  = 2,    Committed = 3,    Aborted   = 1,    Marker    = 5 /**< This means that the only thing left is a marker,		     Data 0 - 6 is valid */  };    /**   * DATA VARIABLES   */  Uint32 tcRef;           // 0  Uint32 lqhNodeId;       // 1     Uint32 operationStatus; // 2 See enum OperationStatus  Uint32 transId1;        // 3  Uint32 transId2;        // 4  Uint32 apiRef;          // 5  Uint32 apiOpRec;        // 6  Uint32 lqhConnectPtr;  Uint32 oldTcOpRec;  Uint32 requestInfo;  Uint32 gci;  Uint32 nextNodeId1;  Uint32 nextNodeId2;  Uint32 nextNodeId3;  Uint32 tableId;  /**   * Getters   */  static Uint32 getReplicaNo(Uint32 & requestInfo);  static Uint32 getReplicaType(Uint32 & requestInfo);  static Uint32 getLastReplicaNo(Uint32 & requestInfo);  static Uint32 getSimpleFlag(Uint32 & requestInfo);  static Uint32 getDirtyFlag(Uint32 & requestInfo);  static Uint32 getOperation(Uint32 & requestInfo);  static Uint32 getMarkerFlag(Uint32 & requestInfo);  static void setReplicaNo(UintR & requestInfo, UintR val);  static void setReplicaType(UintR & requestInfo, UintR val);  static void setLastReplicaNo(UintR & requestInfo, UintR val);  static void setSimpleFlag(UintR & requestInfo, UintR val);  static void setDirtyFlag(UintR & requestInfo, UintR val);  static void setOperation(UintR & requestInfo, UintR val);  static void setMarkerFlag(Uint32 & requestInfo, Uint32 val);};/** * Request Info * * t = replica type           - 2  Bits (0-1) * r = Replica No             - 2  Bits (2-3) * l = Last Replica No        - 2  Bits (4-5) * s = Simple                 - 1  Bits (6) * d = Dirty                  - 1  Bit  (7) * o = Operation              - 3  Bit  (8-9) * m = Marker present         - 1  Bit  (10) * *           1111111111222222222233 * 01234567890123456789012345678901 * ttrrllsdooom */#define LTC_REPLICA_TYPE_SHIFT    (0)#define LTC_REPLICA_TYPE_MASK     (3)#define LTC_REPLICA_NO_SHIFT      (2)#define LTC_REPLICA_NO_MASK       (3)#define LTC_LAST_REPLICA_SHIFT    (4)#define LTC_LAST_REPLICA_MASK     (3)#define LTC_SIMPLE_SHIFT          (6)#define LTC_DIRTY_SHIFT           (7)#define LTC_OPERATION_SHIFT       (8)#define LTC_OPERATION_MASK        (7)#define LTC_MARKER_SHIFT          (10)inlineUint32LqhTransConf::getReplicaType(Uint32 & requestInfo){  return (requestInfo >> LTC_REPLICA_TYPE_SHIFT) & LTC_REPLICA_TYPE_MASK;}inlineUint32LqhTransConf::getReplicaNo(Uint32 & requestInfo){  return (requestInfo >> LTC_REPLICA_NO_SHIFT) & LTC_REPLICA_NO_MASK;}inlineUint32LqhTransConf::getLastReplicaNo(Uint32 & requestInfo){  return (requestInfo >> LTC_LAST_REPLICA_SHIFT) & LTC_LAST_REPLICA_MASK;}inlineUint32LqhTransConf::getSimpleFlag(Uint32 & requestInfo){  return (requestInfo >> LTC_SIMPLE_SHIFT) & 1;}inlineUint32LqhTransConf::getDirtyFlag(Uint32 & requestInfo){  return (requestInfo >> LTC_DIRTY_SHIFT) & 1;}inlineUint32LqhTransConf::getOperation(Uint32 & requestInfo){  return (requestInfo >> LTC_OPERATION_SHIFT) & LTC_OPERATION_MASK;}inlineUint32LqhTransConf::getMarkerFlag(Uint32 & requestInfo){  return (requestInfo >> LTC_MARKER_SHIFT) & 1;}inlinevoidLqhTransConf::setReplicaNo(UintR & requestInfo, UintR val){  ASSERT_MAX(val, LTC_REPLICA_NO_MASK, "LqhTransConf::setReplicaNo");  requestInfo |= (val << LTC_REPLICA_NO_SHIFT);}inlinevoidLqhTransConf::setReplicaType(UintR & requestInfo, UintR val){  ASSERT_MAX(val, LTC_REPLICA_TYPE_MASK, "LqhTransConf::setReplicaType");  requestInfo |= (val << LTC_REPLICA_TYPE_SHIFT);}inlinevoidLqhTransConf::setLastReplicaNo(UintR & requestInfo, UintR val){  ASSERT_MAX(val, LTC_LAST_REPLICA_MASK, "LqhTransConf::setLastReplicaNo");  requestInfo |= (val << LTC_LAST_REPLICA_SHIFT);}inlinevoidLqhTransConf::setSimpleFlag(UintR & requestInfo, UintR val){  ASSERT_BOOL(val, "LqhTransConf::setSimpleFlag");  requestInfo |= (val << LTC_SIMPLE_SHIFT);}inlinevoidLqhTransConf::setDirtyFlag(UintR & requestInfo, UintR val){  ASSERT_BOOL(val, "LqhTransConf::setDirtyFlag");  requestInfo |= (val << LTC_DIRTY_SHIFT);}inlinevoidLqhTransConf::setOperation(UintR & requestInfo, UintR val){  ASSERT_MAX(val, LTC_OPERATION_MASK, "LqhTransConf::setOperation");  requestInfo |= (val << LTC_OPERATION_SHIFT);}inlinevoidLqhTransConf::setMarkerFlag(UintR & requestInfo, UintR val){  ASSERT_BOOL(val, "LqhTransConf::setMarkerFlag");  requestInfo |= (val << LTC_MARKER_SHIFT);}#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -