本文整理汇总了C++中CMySQLQuery::Destroy方法的典型用法代码示例。如果您正苦于以下问题:C++ CMySQLQuery::Destroy方法的具体用法?C++ CMySQLQuery::Destroy怎么用?C++ CMySQLQuery::Destroy使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CMySQLQuery
的用法示例。
在下文中一共展示了CMySQLQuery::Destroy方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ProcessCallbacks
void CCallback::ProcessCallbacks() {
CMySQLQuery *Query = NULL;
while( (Query = GetNextQuery()) != NULL) {
CCallback *Callback = Query->Callback;
if(Callback != NULL && (Callback->Name.length() > 0 || Query->OrmObject != NULL) ) {
bool PassByReference = Query->Callback->IsInline;
if(Query->OrmObject != NULL) { //orm, update the variables with the given result
switch(Query->OrmQueryType) {
case ORM_QUERYTYPE_SELECT:
Query->OrmObject->ApplySelectResult(Query->Result);
break;
case ORM_QUERYTYPE_INSERT:
Query->OrmObject->ApplyInsertResult(Query->Result);
break;
}
}
for (list<AMX *>::iterator a = m_AmxList.begin(), end = m_AmxList.end(); a != end; ++a) {
AMX *amx = (*a);
cell amx_Ret;
int amx_Index;
cell amx_MemoryAddress = -1;
if (amx_FindPublic(amx, Callback->Name.c_str(), &amx_Index) == AMX_ERR_NONE) {
CLog::Get()->StartCallback(Callback->Name.c_str());
int StringIndex = Callback->ParamFormat.length()-1;
while(!Callback->Parameters.empty() && StringIndex >= 0) {
switch(Callback->ParamFormat.at(StringIndex)) {
case 'i':
case 'd': {
int val = 0;
ConvertStrToInt(Callback->Parameters.top().c_str(), val);
if(PassByReference == false)
amx_Push(amx, (cell)val);
else {
cell tmpAddress;
amx_PushArray(amx, &tmpAddress, NULL, (cell*)&val, 1);
if(amx_MemoryAddress < NULL)
amx_MemoryAddress = tmpAddress;
}
} break;
case 'f': {
float float_val = 0.0f;
ConvertStrToFloat(Callback->Parameters.top().c_str(), float_val);
cell FParam = amx_ftoc(float_val);
if(PassByReference == false)
amx_Push(amx, FParam);
else {
cell tmpAddress;
amx_PushArray(amx, &tmpAddress, NULL, (cell*)&FParam, 1);
if(amx_MemoryAddress < NULL)
amx_MemoryAddress = tmpAddress;
}
} break;
default: {
cell tmpAddress;
amx_PushString(amx, &tmpAddress, NULL, Callback->Parameters.top().c_str(), 0, 0);
if(amx_MemoryAddress < NULL)
amx_MemoryAddress = tmpAddress;
}
}
StringIndex--;
Callback->Parameters.pop();
}
Query->ConnHandle->SetActiveResult(Query->Result);
Query->Result = NULL;
amx_Exec(amx, &amx_Ret, amx_Index);
if (amx_MemoryAddress >= NULL)
amx_Release(amx, amx_MemoryAddress);
if(Query->ConnHandle->IsActiveResultSaved() == false)
delete Query->ConnHandle->GetActiveResult();
Query->ConnHandle->SetActiveResult((CMySQLResult *)NULL);
CLog::Get()->EndCallback();
break; //we have found our callback, exit loop
}
}
}
Query->Destroy();
}
}
示例2: ClearAll
void CCallback::ClearAll() {
CMySQLQuery *tmpQuery = NULL;
while(m_CallbackQueue.pop(tmpQuery))
tmpQuery->Destroy();
}