FrTFIDF::FrTFIDF(const FrTFIDF *orig) { if (orig) { if (orig->ht) { ht = orig->ht->deepcopy() ; ht->doHashEntries(copy_tfidf_record) ; } else { ht = new FrSymHashTable ; ht->expand(1000) ; } total_docs = orig->total_docs ; markClean() ; } else { total_docs = 0 ; ht = new FrSymHashTable ; ht->expand(1000) ; markClean() ; } return ; }
void CertIdentity::enableEditSsl(bool enable) { if (!enable || _certManager) return; _certManager = new ClientCertManager(id(), this); if (isValid()) { // this means we are not a newly created Identity but have a proper Id Client::signalProxy()->synchronize(_certManager); connect(_certManager, SIGNAL(updated()), this, SLOT(markClean())); connect(_certManager, SIGNAL(initDone()), this, SLOT(markClean())); } }
FrTFIDF::FrTFIDF() { total_docs = 0 ; ht = new FrSymHashTable ; ht->expand(1000) ; markClean() ; return ; }
void OpenWithManagerDialog::reset() { m_factories.clear(); m_origFactories.clear(); m_factoryModel->setFactories(NULL); m_patternModel->setRegExps(NULL); setFactoryGuiEnabled(false); setPatternGuiEnabled(false); markClean(); }
/* * locked_flush() * * Flushes the LSO assuming the lock is held. * * We want to override LSOBasic's flush() because it write-backs the * ObjtokenID field in an inconsistent way for symlinks */ void LSOBasicSymlink::locked_flush() { _ASSERT_HELD(lock); if (isDirty()) { markClean(); // then flush the object related state getRecordMap()->setRecord(&id, lsoBufData); } }
FrTFIDF::FrTFIDF(const char *filename) { total_docs = 0 ; ht = 0 ; load(filename) ; if (!ht) { // put in a small dummy hash table ht = new FrSymHashTable ; ht->expand(100) ; } markClean() ; return ; }
bool FrTFIDF::save(FILE *fp, bool verbosely) { if (dirty() && fp) { fprintf(fp,"!!! %ld\t%ld\t\tTF*IDF data file\n", (unsigned long)total_docs, (unsigned long)(ht ? ht->currentSize() : 0)) ; bool success = true ; if (ht) success = ht->doHashEntries(write_tfidf,fp,verbosely,total_docs) ; if (success) markClean() ; return success ; } else return false ; }
/* * deleteFile() * * Remove the file, freeing all used disk space. * * We want to override LSOBasic's deleteFile() because we need to correctly * release all records allocated for symlink content. Additionally, we have no * underlying PSO, so we don't need to free it. */ /* virtual */ SysStatus LSOBasicSymlink::deleteFile() { LSOBasicSymlinkStruct *symlinkStruct = (LSOBasicSymlinkStruct *)lsoBuf; uval linkSize = symlinkStruct->statGetSize(); lock.acquire(); // no more flushing out markClean(); // make sure there are no outstanding links if (getNumLinks() != 0) { tassertMsg(0, "look at this %p, stat.st_nlink %ld\n", this, (uval) getNumLinks()); lock.release(); return -1; } // free the data if (linkSize > FAST_SYMLINK_SIZE) { if (linkSize <= MED_SYMLINK_SIZE) { // Must free all the used records uval nrec = (linkSize + KFS_RECORD_SIZE) / KFS_RECORD_SIZE; for (uval i = 0; i < nrec; i++) { ObjTokenID tmp = symlinkStruct->getObjTokenID(i); getRecordMap()->freeRecord(&tmp); } } else if (linkSize <= OS_BLOCK_SIZE) { globals->super->freeBlock(symlinkStruct->getBlkno()); } } // free the record getRecordMap()->freeRecord(&id); lock.release(); return 0; }
bool AbstractTagFilterWithCache::rebuildCache() { markClean(); return p_rebuildCache(); }