本文整理汇总了C++中NdbOperation::checkMagicNumber方法的典型用法代码示例。如果您正苦于以下问题:C++ NdbOperation::checkMagicNumber方法的具体用法?C++ NdbOperation::checkMagicNumber怎么用?C++ NdbOperation::checkMagicNumber使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类NdbOperation
的用法示例。
在下文中一共展示了NdbOperation::checkMagicNumber方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: handleReceivedSignal
/****************************************************************************
void handleReceivedSignal(NdbApiSignal* aSignal);
Parameters: aSignal: The signal object.
Remark: Send all operations belonging to this connection.
*****************************************************************************/
void
Ndb::handleReceivedSignal(const NdbApiSignal* aSignal,
const LinearSectionPtr ptr[3])
{
NdbOperation* tOp;
NdbIndexOperation* tIndexOp;
NdbTransaction* tCon;
int tReturnCode = -1;
const Uint32* tDataPtr = aSignal->getDataPtr();
const Uint32 tWaitState = theImpl->theWaiter.get_state();
const Uint32 tSignalNumber = aSignal->readSignalNumber();
const Uint32 tFirstData = *tDataPtr;
const Uint32 tLen = aSignal->getLength();
Uint32 tNewState = tWaitState;
void * tFirstDataPtr;
NdbWaiter *t_waiter = &theImpl->theWaiter;
/* Update cached Min Db node version */
theCachedMinDbNodeVersion = theImpl->m_transporter_facade->getMinDbNodeVersion();
if (likely(NdbImpl::recordGSN(tSignalNumber)))
{
Uint32 secs = aSignal->m_noOfSections;
theImpl->incClientStat(BytesRecvdCount,
((aSignal->getLength() << 2) +
((secs > 2)? ptr[2].sz << 2: 0) +
((secs > 1)? ptr[1].sz << 2: 0) +
((secs > 0)? ptr[0].sz << 2: 0)));
}
/*
In order to support 64 bit processes in the application we need to use
id's rather than a direct pointer to the object used. It is also a good
idea that one cannot corrupt the application code by sending a corrupt
memory pointer.
All signals received by the API requires the first data word to be such
an id to the receiving object.
*/
switch (tSignalNumber){
case GSN_TCKEYCONF:
case GSN_TCINDXCONF:
{
const TcKeyConf * const keyConf = (TcKeyConf *)tDataPtr;
if (tFirstData != RNIL)
{
tFirstDataPtr = int2void(tFirstData);
if (tFirstDataPtr == 0) goto InvalidSignal;
tCon = void2con(tFirstDataPtr);
}
else
{
tCon = lookupTransactionFromOperation(keyConf);
if (tCon == NULL) goto InvalidSignal;
}
const BlockReference aTCRef = aSignal->theSendersBlockRef;
if ((tCon->checkMagicNumber() == 0) &&
(tCon->theSendStatus == NdbTransaction::sendTC_OP)) {
tReturnCode = tCon->receiveTCKEYCONF(keyConf, tLen);
if (tReturnCode != -1) {
completedTransaction(tCon);
}//if
if(TcKeyConf::getMarkerFlag(keyConf->confInfo)){
NdbTransaction::sendTC_COMMIT_ACK(theImpl,
theCommitAckSignal,
keyConf->transId1,
keyConf->transId2,
aTCRef);
}
return;
}//if
goto InvalidSignal;
return;
}
case GSN_TRANSID_AI:{
tFirstDataPtr = int2void(tFirstData);
if (tFirstDataPtr){
NdbReceiver* const tRec = void2rec(tFirstDataPtr);
if(!tRec->checkMagicNumber()){
return;
}
tCon = tRec->getTransaction();
if((tCon!=NULL) &&
tCon->checkState_TransId(((const TransIdAI*)tDataPtr)->transId)){
Uint32 com;
if(aSignal->m_noOfSections > 0){
if(tRec->getType()==NdbReceiver::NDB_QUERY_OPERATION){
com = ((NdbQueryOperationImpl*)(tRec->m_owner))
->execTRANSID_AI(ptr[0].p, ptr[0].sz);
//.........这里部分代码省略.........