void QuadTree::_Clear(Node* node) { if( node->pChild_NW == NULL )//if 1 is NULL then all are NULL { node->ElementsPts.clear(); return; } _Clear(node->pChild_NW); delete node->pChild_NW; node->pChild_NW = NULL; _Clear(node->pChild_NE); delete node->pChild_NE; node->pChild_NE = NULL; _Clear(node->pChild_SW); delete node->pChild_SW; node->pChild_SW = NULL; _Clear(node->pChild_SE); delete node->pChild_SE; node->pChild_SE = NULL; return; }
void Value:: SetIntegerValue (long long i) { _Clear(); valueType=INTEGER_VALUE; integerValue = i; }
void Value:: SetRealValue (double r) { _Clear(); valueType=REAL_VALUE; realValue = r; }
void Value:: SetListValue( classad_shared_ptr<ExprList> l) { _Clear(); valueType = SLIST_VALUE; slistValue = new classad_shared_ptr<ExprList>(l); }
void BrowsingHistory::Clear() { BAutolock _(this); _Clear(); _SaveSettings(); }
void Value:: SetClassAdValue( ClassAd *ad ) { _Clear(); valueType = CLASSAD_VALUE; classadValue = ad; }
void Value:: SetStringValue( const char *s ) { _Clear(); valueType = STRING_VALUE; strValue = new string( s ); }
void Value:: SetBooleanValue( bool b ) { _Clear(); valueType = BOOLEAN_VALUE; booleanValue = b; }
void Value:: SetRelativeTimeValue( double rsecs ) { _Clear(); valueType = RELATIVE_TIME_VALUE; relTimeValueSecs = rsecs; }
void GenerateNew() { if (RPC_S_OK != ::UuidCreate(&m_uuid)) { _Clear(); } }
void Value:: SetListValue( ExprList *l) { _Clear(); valueType = LIST_VALUE; listValue = l; }
void Value:: CopyFrom( const Value &val ) { // optimization, when copying string to string, we can skip the delete/new of the string buffer if (valueType == STRING_VALUE && val.valueType == valueType) { *strValue = *(val.strValue); return; } _Clear(); valueType = val.valueType; factor = val.factor; switch (val.valueType) { case STRING_VALUE: strValue = new string( *val.strValue); return; case BOOLEAN_VALUE: booleanValue = val.booleanValue; return; case INTEGER_VALUE: integerValue = val.integerValue; return; case REAL_VALUE: realValue = val.realValue; return; case UNDEFINED_VALUE: case ERROR_VALUE: return; case LIST_VALUE: listValue = val.listValue; return; case SLIST_VALUE: slistValue = new classad_shared_ptr<ExprList>(*val.slistValue); return; case CLASSAD_VALUE: classadValue = val.classadValue; return; case ABSOLUTE_TIME_VALUE: absTimeValueSecs = new abstime_t(); *absTimeValueSecs = *val.absTimeValueSecs; return; case RELATIVE_TIME_VALUE: relTimeValueSecs = val.relTimeValueSecs; return; default: SetUndefinedValue (); } }
void Value:: SetAbsoluteTimeValue( abstime_t asecs ) { _Clear(); valueType = ABSOLUTE_TIME_VALUE; absTimeValueSecs = new abstime_t(); *absTimeValueSecs = asecs; }
void My_TestGLDrawing::DrawTest() { _Clear(); DrawScene(); DrawMarquee(); }
ZLUuid& operator=(LPCTSTR lpUuid) { RPC_WSTR rpcUuid = (RPC_WSTR)lpUuid; if (RPC_S_OK != ::UuidFromString(rpcUuid, &m_uuid)) { _Clear(); } return *this; }
void Value:: SetStringValue( const char *s, size_t cch ) { // optimization, when copying string to string, we can skip the delete/new of the string buffer if (valueType == STRING_VALUE) { strValue->assign(s, cch); return; } _Clear(); valueType = STRING_VALUE; strValue = new string( s, cch ); }
void Value:: SetStringValue( const string &s ) { // optimization, when copying string to string, we can skip the delete/new of the string buffer if (valueType == STRING_VALUE) { *strValue = s; return; } _Clear(); valueType = STRING_VALUE; strValue = new string( s ); }
void Value:: CopyFrom( const Value &val ) { _Clear(); valueType = val.valueType; switch (val.valueType) { case STRING_VALUE: strValue = new string( *val.strValue); return; case BOOLEAN_VALUE: booleanValue = val.booleanValue; return; case INTEGER_VALUE: integerValue = val.integerValue; return; case REAL_VALUE: realValue = val.realValue; return; case UNDEFINED_VALUE: case ERROR_VALUE: return; case LIST_VALUE: listValue = val.listValue; return; case SLIST_VALUE: slistValue = new classad_shared_ptr<ExprList>(*val.slistValue); return; case CLASSAD_VALUE: classadValue = val.classadValue; return; case ABSOLUTE_TIME_VALUE: absTimeValueSecs = new abstime_t(); *absTimeValueSecs = *val.absTimeValueSecs; return; case RELATIVE_TIME_VALUE: relTimeValueSecs = val.relTimeValueSecs; return; default: SetUndefinedValue (); } }
void C_vector_any::_CopyVector(const C_vector_any &v){ if(this==&v) return; _Clear(); int i = v.used_size; _Reserve(i); used_size = i; while(i--){ int offs = i*elem_size; _Construct(array+offs); _Copy(array+offs, v.array + offs); } }
bool CUiSkin9GridImage::setImage(const QString& strImageFileName, QPoint ptTopLeft) { _Clear(); // if (false == m_imge.load(strImageFileName)) { return false; } // int nImageWidth = m_imge.width(); int nImageHeight = m_imge.height(); // //将图片分割成9块,边缘部分以后有用 return splitRect(QRect(0, 0, nImageWidth, nImageHeight), ptTopLeft, m_arrayRcImage9Grid, 9); }
void My_TestGLDrawing::DrawScene() { _Clear(); int width = GetWidth(), height = GetHeight(); GfMatrix4d viewMatrix = GetViewMatrix(); GfFrustum frustum = GetFrustum(); GfVec4d viewport(0, 0, width, height); GfMatrix4d projMatrix = frustum.ComputeProjectionMatrix(); _delegate->SetCamera(viewMatrix, projMatrix); glViewport(viewport[0], viewport[1], viewport[2], viewport[3]); SdfPath renderSetupTask("/renderSetupTask"); SdfPath renderTask("/renderTask"); SdfPath selectionTask("/selectionTask"); // viewport HdxRenderTaskParams param = _delegate->GetTaskParam( renderSetupTask, HdTokens->params).Get<HdxRenderTaskParams>(); param.viewport = viewport; _delegate->SetTaskParam(renderSetupTask, HdTokens->params, VtValue(param)); HdTaskSharedPtrVector tasks; tasks.push_back(_delegate->GetRenderIndex().GetTask(renderSetupTask)); tasks.push_back(_delegate->GetRenderIndex().GetTask(renderTask)); tasks.push_back(_delegate->GetRenderIndex().GetTask(selectionTask)); glEnable(GL_DEPTH_TEST); glBindVertexArray(vao); VtValue v(_picker.GetSelectionTracker()); _engine.SetTaskContextData(HdxTokens->selectionState, v); _engine.Execute(_delegate->GetRenderIndex(), tasks); glBindVertexArray(0); }
bool BWrepMap::DecodeMap(const unsigned char *buffer, int mapSize, int w, int h) { const unsigned char *current = buffer; int read=0; // map dimensions m_mapWidth=w; m_mapHeight=h; // clear previous infos _Clear(); // read block chain while(read<mapSize && m_sectionCount<MAXSECTION) { // extract block title char blockTitle[5]; memcpy(blockTitle,current,4); blockTitle[4]=0; current+=4; // extract block size unsigned long bsize = *((unsigned long*)current); current+=4; // init section block read+=8; m_sections[m_sectionCount].Init(blockTitle,bsize,current); // next block m_sectionCount++; current+=bsize; read+=bsize; } // keep pointer on buffer m_data = buffer; m_datasize = mapSize; return true; }
inline BOOL ZLSignInfo::Load( LPCTSTR lpFilePath ) { _Clear(); HCRYPTMSG hCryptMsg = NULL; HCERTSTORE hCertStore = NULL; PCCERT_CONTEXT pCertContext = NULL; PCMSG_SIGNER_INFO pMsgSignerInfoOfFile = NULL; PCMSG_SIGNER_INFO pMsgSignerInfoOfTimestamp = NULL; _GetFileSignerHandle(lpFilePath, hCryptMsg, hCertStore); if (NULL == hCryptMsg || NULL == hCertStore) return FALSE; if (hCryptMsg) { pMsgSignerInfoOfFile = _GetMsgSignerInfoOfFile(hCryptMsg); } if (pMsgSignerInfoOfFile) { pMsgSignerInfoOfTimestamp = _GetMsgSignerInfoOfTimestamp(pMsgSignerInfoOfFile); } if (pMsgSignerInfoOfTimestamp) { m_tSigningTime = _ReadSigningTime(pMsgSignerInfoOfTimestamp); } pCertContext = _ReadCertInfo(hCertStore, pMsgSignerInfoOfFile); m_sSignerName = _ReadSignerName(pCertContext); m_sIssuerName = _ReadIssuerName(pCertContext); m_sSerialNumber = _ReadSerialNumber(pCertContext); if (hCryptMsg) ::CryptMsgClose(hCryptMsg); if (hCertStore) ::CertCloseStore(hCertStore, 0); if (pCertContext) ::CertFreeCertificateContext(pCertContext); if (pMsgSignerInfoOfFile) ::LocalFree((HLOCAL)pMsgSignerInfoOfFile); if (pMsgSignerInfoOfTimestamp) ::LocalFree((HLOCAL)pMsgSignerInfoOfTimestamp); return TRUE; }
void PunishMgr::Load(void) { sLog.outString("Loading punish actions..."); _Clear(); std::string t; uint32 actionCount = 0, trigCount = 0; QueryResult *result = LoginDatabase.Query("SELECT what, action, arg FROM punish_action"); if(result) { barGoLink bar(result->GetRowCount()); do { Field *fields = result->Fetch(); t = fields[1].GetCppString(); if(!_Valid(t.c_str())) { sLog.outError("punish_action: Action '%s' unknown, skipped", t.c_str()); continue; } PunishAction *act = new PunishAction; act->what = fields[0].GetCppString(); act->action = t; act->arg = fields[2].GetCppString(); _actions[act->what].push_back(act); bar.step(); ++actionCount; } while(result->NextRow()); delete result; } else sLog.outError("Could not load punish actions!"); sLog.outString("Loading punish trigger values..."); result = LoginDatabase.Query("SELECT value, action, arg FROM punish_value"); if(result) { barGoLink bar(result->GetRowCount()); do { Field *fields = result->Fetch(); t = fields[1].GetCppString(); if(!_Valid(t.c_str())) { sLog.outError("punish_value: Action '%s' unknown, skipped", t.c_str()); continue; } PunishTrigger *trg = new PunishTrigger; trg->value = fields[0].GetUInt32(); trg->action = t; trg->arg = fields[2].GetCppString(); _triggers[trg->value].push_back(trg); _maxpoints = std::max(trg->value, _maxpoints); bar.step(); ++trigCount; } while(result->NextRow()); delete result; } else sLog.outError("Could not load punish triggers!"); sLog.outString(); sLog.outString(">> [FG] Punish system: Loaded %u actions, %u triggers. Max. %u points.", actionCount, trigCount, _maxpoints); }
BWrepMap::~BWrepMap() { _Clear(); }
CSymbolUseManager::CSymbolUseManager( void ) { _Clear(); }
void Value:: SetErrorValue (void) { _Clear(); valueType=ERROR_VALUE; }
void Value:: SetUndefinedValue (void) { _Clear(); valueType=UNDEFINED_VALUE; }
PunishMgr::~PunishMgr() { _Clear(); _maxpoints = 0; }
CReqAccount::~CReqAccount( void ) { _Clear(); }