当前位置: 首页>>代码示例>>C++>>正文


C++ Book::getEditorial方法代码示例

本文整理汇总了C++中Book::getEditorial方法的典型用法代码示例。如果您正苦于以下问题:C++ Book::getEditorial方法的具体用法?C++ Book::getEditorial怎么用?C++ Book::getEditorial使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Book的用法示例。


在下文中一共展示了Book::getEditorial方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: indexingListOnIndex

bool Mediator::indexingListOnIndex(IndexWrapper::indexItem item)
{
	bool done = false;
	List<int>* flagsLs = this->dataBookManager->getListToFileFlag(item);
	if(!flagsLs->isEmpty())
	{
		cout << "Process Started: " << Utility::getDate() << endl;
		ListIterator<int> it = flagsLs->getIterator();
		int ID;
		while(it.hasNext())
		{
			ID = it.next();
			ByteString bs = this->dataBookManager->getBook(ID);
			Book book;
			book.Hidratate(bs);

			string clave;
			Record* record;
			ByteString bsIdBook;
			ByteString* bsId;
			bsIdBook.insertLast(&ID,sizeof(int));
			Key* key;
			switch(item){
			case IndexWrapper::AUTOR :
										clave = book.getAuthor();
										cout << "Book begin process: " << book.getTitle() << " - Author:" << clave << " - Start:" << Utility::getDate();

										key = new Key(clave);
										bsId = new ByteString(bsIdBook);
										record = new Record(key,bsId);
										done = this->indexWrapper->add(record,item);
										break;
			case IndexWrapper::EDITORIAL :
										clave = book.getEditorial();
										cout << "Book begin process: " << book.getTitle() << " - Editorial:" << clave << " - Start:" << Utility::getDate();

										key = new Key(clave);
										bsId = new ByteString(bsIdBook);
										record = new Record(key,bsId);
										done = this->indexWrapper->add(record,item);
										break;
			case IndexWrapper::TITULO :
										clave = book.getTitle();
										cout << "Book begin process: " << book.getTitle() << " - Start:" << Utility::getDate();

										key = new Key(clave);
										bsId = new ByteString(bsIdBook);
										record = new Record(key,bsId);
										done = this->indexWrapper->add(record,item);
										break;
			case IndexWrapper::PALABRAS :
										this->fileParser->setWords(book.getText());

										// ----------------------------------------------------------------------------------------------- //
										// Se incorpora la norma infinito del documento
										// ----------------------------------------------------------------------------------------------- //
										Key* keyIdBook = new Key(bsIdBook.toString());

										ByteString* bsInfinityNorm = new ByteString();
										unsigned int infinityNorm = this->fileParser->getInfinityNorm();
										bsInfinityNorm->insertLast(&infinityNorm, sizeof(unsigned int));

										Record* recInfinityNorm = new Record(keyIdBook, bsInfinityNorm);
										this->infinityNormIndex->add(recInfinityNorm);
										delete recInfinityNorm;
										// ----------------------------------------------------------------------------------------------- //

										map<string,Term*> terms = this->fileParser->getTerms();
										cout << "Book begin process: " << book.getTitle() << " - Words Count:" << Utility::intToString(terms.size()) << " - Start:" << Utility::getDate();
										int i = 0;
										for(map<string,Term*>::iterator it = terms.begin(); it != terms.end(); ++it)
										{
											i++;
											// ------------------------ //
											key = new Key(it->first);
											string word = it->first;
											list<int>* listDocuments = this->indexWrapper->searchAllIds(key, IndexWrapper::PALABRAS);
											int idTerm;

											// Si no tiene datos --> la palabra no existe en el hash
											if (listDocuments->size() == 0)
											{
												//delete poddo
												delete listDocuments;

												// Se agrega la palabra al vocabulario y se obtiene su id
												int possibleID = this->autoIncInteger + 1;

												// La clave es el id de termino y el dato la palabra
												ByteString bsIdTerm;
												bsIdTerm.insertLast(&possibleID, sizeof(int));
												Key* keyIdTerm = new Key(bsIdTerm.toString());

												ByteString* bsTerm = new ByteString();
												bsTerm->insertLast(word);

												Record* recVocabulary = new Record(keyIdTerm, bsTerm);
												this->vocabularyIndex->add(recVocabulary);
												delete recVocabulary;

//.........这里部分代码省略.........
开发者ID:busiris2014,项目名称:7506Condor1C2014,代码行数:101,代码来源:Mediator.cpp


注:本文中的Book::getEditorial方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。