1 /* Copyright (c) 2003, 2005 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 TRIG_ATTRINFO_HPP
17 #define TRIG_ATTRINFO_HPP
19 #include "SignalData.hpp"
20 #include <NodeBitmask.hpp>
21 #include <trigger_definitions.h>
27 * This signal is sent by TUP to signal
28 * that a trigger has fired
37 * Sender(s) / Reciver(s)
46 friend class SumaParticipant
;
51 friend bool printTRIG_ATTRINFO(FILE * output
, const Uint32
* theData
, Uint32 len
, Uint16 receiverBlockNo
);
60 STATIC_CONST( DataLength
= 22 );
61 STATIC_CONST( StaticLength
= 3 );
64 Uint32 m_connectionPtr
;
67 Uint32 m_data
[DataLength
];
71 Uint32
getConnectionPtr() const;
72 void setConnectionPtr(Uint32
);
73 AttrInfoType
getAttrInfoType() const;
74 void setAttrInfoType(AttrInfoType anAttrType
);
75 Uint32
getTriggerId() const;
76 void setTriggerId(Uint32 aTriggerId
);
77 Uint32
getTransactionId1() const;
78 void setTransactionId1(Uint32 aTransId
);
79 Uint32
getTransactionId2() const;
80 void setTransactionId2(Uint32 aTransId
);
81 Uint32
* getData() const;
82 int setData(Uint32
* aDataBuf
, Uint32 aDataLen
);
86 Uint32
TrigAttrInfo::getConnectionPtr() const
88 return m_connectionPtr
;
92 void TrigAttrInfo::setConnectionPtr(Uint32 aConnectionPtr
)
94 m_connectionPtr
= aConnectionPtr
;
98 TrigAttrInfo::AttrInfoType
TrigAttrInfo::getAttrInfoType() const
100 return (TrigAttrInfo::AttrInfoType
) m_type
;
104 void TrigAttrInfo::setAttrInfoType(TrigAttrInfo::AttrInfoType anAttrType
)
106 m_type
= (Uint32
) anAttrType
;
110 Uint32
TrigAttrInfo::getTriggerId() const
116 void TrigAttrInfo::setTriggerId(Uint32 aTriggerId
)
118 m_trigId
= aTriggerId
;
122 Uint32
* TrigAttrInfo::getData() const
124 return (Uint32
*)&m_data
[0];
128 int TrigAttrInfo::setData(Uint32
* aDataBuf
, Uint32 aDataLen
)
130 if (aDataLen
> DataLength
)
132 memcpy(m_data
, aDataBuf
, aDataLen
*sizeof(Uint32
));