got rid of the STD_SHARED_XX std/tr1 defines

This commit is contained in:
Jean-Francois Dockes
2016-07-13 15:12:25 +02:00
parent 0e0b660ebc
commit 0b0385e459
65 changed files with 219 additions and 257 deletions
+3 -3
View File
@@ -18,7 +18,7 @@
#include "autoconfig.h"
#include MEMORY_INCLUDE
#include <memory>
#include "log.h"
#include "utf8iter.h"
@@ -57,9 +57,9 @@ bool createExpansionDbs(Xapian::WritableDatabase& wdb,
vector<XapWritableComputableSynFamMember> stemdbs;
// Note: tried to make this to work with stack-allocated objects, couldn't.
// Looks like a bug in copy constructors somewhere, can't guess where
vector<STD_SHARED_PTR<SynTermTransStem> > stemmers;
vector<std::shared_ptr<SynTermTransStem> > stemmers;
for (unsigned int i = 0; i < langs.size(); i++) {
stemmers.push_back(STD_SHARED_PTR<SynTermTransStem>
stemmers.push_back(std::shared_ptr<SynTermTransStem>
(new SynTermTransStem(langs[i])));
stemdbs.push_back(
XapWritableComputableSynFamMember(wdb, synFamStem, langs[i],
+1 -1
View File
@@ -357,7 +357,7 @@ int Query::Native::makeAbstract(Xapian::docid docid,
map<unsigned int, string> sparseDoc;
// Also remember apart the search term positions so that we can list
// them with their snippets.
STD_UNORDERED_SET<unsigned int> searchTermPositions;
std::unordered_set<unsigned int> searchTermPositions;
// Remember max position. Used to stop walking positions lists while
// populating the adjacent slots.
+1 -1
View File
@@ -572,7 +572,7 @@ bool Db::Native::addOrUpdateWrite(const string& udi, const string& uniterm,
Chrono chron;
std::unique_lock<std::mutex> lock(m_mutex);
#endif
STD_SHARED_PTR<Xapian::Document> doc_cleaner(newdocument_ptr);
std::shared_ptr<Xapian::Document> doc_cleaner(newdocument_ptr);
// Check file system full every mbyte of indexed text. It's a bit wasteful
// to do this after having prepared the document, but it needs to be in
+1 -1
View File
@@ -21,7 +21,7 @@
#include <string>
#include <vector>
#include MEMORY_INCLUDE
#include <memory>
#include "cstr.h"
#include "rcldoc.h"
+1 -1
View File
@@ -70,7 +70,7 @@ bool Db::docDups(const Doc& idoc, vector<Doc>& odocs)
MD5HexPrint(digest, md5);
SearchData *sdp = new SearchData();
STD_SHARED_PTR<SearchData> sd(sdp);
std::shared_ptr<SearchData> sd(sdp);
SearchDataClauseSimple *sdc =
new SearchDataClauseSimple(SCLT_AND, md5, "rclmd5");
sdc->addModifier(SearchDataClause::SDCM_CASESENS);
+1 -1
View File
@@ -173,7 +173,7 @@ void Query::setSortBy(const string& fld, bool ascending) {
#define ISNULL(X) !(X)
// Prepare query out of user search data
bool Query::setQuery(STD_SHARED_PTR<SearchData> sdata)
bool Query::setQuery(std::shared_ptr<SearchData> sdata)
{
LOGDEB("Query::setQuery:\n" );
+4 -4
View File
@@ -19,7 +19,7 @@
#include <string>
#include <vector>
#include MEMORY_INCLUDE
#include <memory>
#include "searchdata.h"
#ifndef NO_NAMESPACES
@@ -92,7 +92,7 @@ class Query {
* be called repeatedly on the same object which gets reinitialized each
* time.
*/
bool setQuery(STD_SHARED_PTR<SearchData> q);
bool setQuery(std::shared_ptr<SearchData> q);
/** Get results count for current query */
int getResCnt();
@@ -117,7 +117,7 @@ class Query {
int getFirstMatchPage(const Doc &doc, std::string& term);
/** Retrieve a reference to the searchData we are using */
STD_SHARED_PTR<SearchData> getSD()
std::shared_ptr<SearchData> getSD()
{
return m_sd;
}
@@ -143,7 +143,7 @@ private:
bool m_sortAscending;
bool m_collapseDuplicates;
int m_resCnt;
STD_SHARED_PTR<SearchData> m_sd;
std::shared_ptr<SearchData> m_sd;
int m_snipMaxPosWalk;
/* Copyconst and assignement private and forbidden */
+6 -6
View File
@@ -185,11 +185,11 @@ bool Db::termMatch(int typ_sens, const string &lang, const string &_term,
XapComputableSynFamMember synac(xrdb, synFamDiCa, "all", &unacfoldtrans);
if (matchtyp == ET_WILD || matchtyp == ET_REGEXP) {
STD_SHARED_PTR<StrMatcher> matcher;
std::shared_ptr<StrMatcher> matcher;
if (matchtyp == ET_WILD) {
matcher = STD_SHARED_PTR<StrMatcher>(new StrWildMatcher(term));
matcher = std::shared_ptr<StrMatcher>(new StrWildMatcher(term));
} else {
matcher = STD_SHARED_PTR<StrMatcher>(new StrRegexpMatcher(term));
matcher = std::shared_ptr<StrMatcher>(new StrRegexpMatcher(term));
}
if (!diac_sensitive || !case_sensitive) {
// Perform case/diac expansion on the exp as appropriate and
@@ -355,15 +355,15 @@ bool Db::idxTermMatch(int typ_sens, const string &lang, const string &root,
}
res.prefix = prefix;
STD_SHARED_PTR<StrMatcher> matcher;
std::shared_ptr<StrMatcher> matcher;
if (typ == ET_REGEXP) {
matcher = STD_SHARED_PTR<StrMatcher>(new StrRegexpMatcher(root));
matcher = std::shared_ptr<StrMatcher>(new StrRegexpMatcher(root));
if (!matcher->ok()) {
LOGERR("termMatch: regcomp failed: " << (matcher->getreason()));
return false;
}
} else if (typ == ET_WILD) {
matcher = STD_SHARED_PTR<StrMatcher>(new StrWildMatcher(root));
matcher = std::shared_ptr<StrMatcher>(new StrWildMatcher(root));
}
// Find the initial section before any special char
+1 -1
View File
@@ -162,7 +162,7 @@ bool SearchData::maybeAddAutoPhrase(Rcl::Db& db, double freqThreshold)
// an actual user-entered phrase
slack += 1 + nwords / 3;
m_autophrase = STD_SHARED_PTR<SearchDataClauseDist>(
m_autophrase = std::shared_ptr<SearchDataClauseDist>(
new SearchDataClauseDist(SCLT_PHRASE, swords, slack, field));
return true;
}
+5 -5
View File
@@ -29,7 +29,7 @@
#include <ostream>
#include "rcldb.h"
#include MEMORY_INCLUDE
#include <memory>
#include "smallut.h"
#include "cstr.h"
#include "hldata.h"
@@ -178,7 +178,7 @@ private:
std::vector<std::string> m_nfiletypes;
// Autophrase if set. Can't be part of the normal chain because
// it uses OP_AND_MAYBE
STD_SHARED_PTR<SearchDataClauseDist> m_autophrase;
std::shared_ptr<SearchDataClauseDist> m_autophrase;
// Special stuff produced by input which looks like a clause but means
// something else (date and size specs)
@@ -493,7 +493,7 @@ private:
/** Subquery */
class SearchDataClauseSub : public SearchDataClause {
public:
SearchDataClauseSub(STD_SHARED_PTR<SearchData> sub)
SearchDataClauseSub(std::shared_ptr<SearchData> sub)
: SearchDataClause(SCLT_SUB), m_sub(sub)
{
}
@@ -509,13 +509,13 @@ public:
{
m_sub.get()->getTerms(hldata);
}
virtual STD_SHARED_PTR<SearchData> getSub() {
virtual std::shared_ptr<SearchData> getSub() {
return m_sub;
}
virtual void dump(ostream& o) const;
protected:
STD_SHARED_PTR<SearchData> m_sub;
std::shared_ptr<SearchData> m_sub;
};
} // Namespace Rcl
+3 -3
View File
@@ -20,7 +20,7 @@
#include <iostream>
#include <algorithm>
#include MEMORY_INCLUDE
#include <memory>
#include "log.h"
#include "cstr.h"
@@ -183,9 +183,9 @@ bool XapComputableSynFamMember::synKeyExpand(StrMatcher* inexp,
LOGDEB("XapCompSynFam::synKeyExpand: [" << (inexp->exp()) << "]\n" );
// If set, compute filtering term (e.g.: only case-folded)
STD_SHARED_PTR<StrMatcher> filter_exp;
std::shared_ptr<StrMatcher> filter_exp;
if (filtertrans) {
filter_exp = STD_SHARED_PTR<StrMatcher>(inexp->clone());
filter_exp = std::shared_ptr<StrMatcher>(inexp->clone());
filter_exp->setExp((*filtertrans)(inexp->exp()));
}