summaryrefslogtreecommitdiffstats
path: root/searchsummary
diff options
context:
space:
mode:
authorGeir Storli <geirst@yahooinc.com>2022-12-21 12:50:50 +0000
committerGeir Storli <geirst@yahooinc.com>2022-12-21 15:49:52 +0000
commit3160d5918d2b8eb18eb4f6c5a6a3cf6d28b868a5 (patch)
treef3f7d7d69984e99c176fc6e1571cc1d7ab393976 /searchsummary
parenta3d5e2ce14352ab181e940574f6e1a99d40cd520 (diff)
Change from typedef to using in searchsummary C++ code.
Diffstat (limited to 'searchsummary')
-rw-r--r--searchsummary/src/tests/juniper/auxTest.cpp4
-rw-r--r--searchsummary/src/tests/juniper/auxTest.h2
-rw-r--r--searchsummary/src/tests/juniper/latintokenizertest.h4
-rw-r--r--searchsummary/src/tests/juniper/matchobjectTest.h2
-rw-r--r--searchsummary/src/tests/juniper/mcandTest.h2
-rw-r--r--searchsummary/src/tests/juniper/queryparserTest.h2
-rw-r--r--searchsummary/src/tests/juniper/testenv.h2
-rw-r--r--searchsummary/src/vespa/juniper/Matcher.cpp2
-rw-r--r--searchsummary/src/vespa/juniper/Matcher.h2
-rw-r--r--searchsummary/src/vespa/juniper/hashbase.h8
-rw-r--r--searchsummary/src/vespa/juniper/latintokenizer.h2
-rw-r--r--searchsummary/src/vespa/juniper/matchelem.h2
-rw-r--r--searchsummary/src/vespa/juniper/matchobject.h6
-rw-r--r--searchsummary/src/vespa/juniper/mcand.h2
-rw-r--r--searchsummary/src/vespa/juniper/queryhandle.h4
-rw-r--r--searchsummary/src/vespa/juniper/querynode.h2
-rw-r--r--searchsummary/src/vespa/juniper/queryparser.h4
-rw-r--r--searchsummary/src/vespa/juniper/queryvisitor.h6
-rw-r--r--searchsummary/src/vespa/juniper/reducematcher.h2
-rw-r--r--searchsummary/src/vespa/juniper/rpinterface.h4
-rw-r--r--searchsummary/src/vespa/juniper/sumdesc.h4
21 files changed, 34 insertions, 34 deletions
diff --git a/searchsummary/src/tests/juniper/auxTest.cpp b/searchsummary/src/tests/juniper/auxTest.cpp
index ef22b0542af..8eda6a2132a 100644
--- a/searchsummary/src/tests/juniper/auxTest.cpp
+++ b/searchsummary/src/tests/juniper/auxTest.cpp
@@ -664,7 +664,7 @@ AuxTest::assertChar(ucs4_t act, char exp)
return _test((char) act == exp);
}
-typedef std::unique_ptr<QueryNode> QueryNodeUP;
+using QueryNodeUP = std::unique_ptr<QueryNode>;
struct QB {
QueryNodeUP q;
QB(size_t numTerms) : q(new QueryNode(numTerms, 0, 0)) {}
@@ -694,7 +694,7 @@ void
AuxTest::TestSpecialTokenRegistry()
{
{
- typedef SpecialTokenRegistry::CharStream CharStream;
+ using CharStream = SpecialTokenRegistry::CharStream;
ucs4_t buf[16];
{
std::string text = " c+-";
diff --git a/searchsummary/src/tests/juniper/auxTest.h b/searchsummary/src/tests/juniper/auxTest.h
index 9ff391911b3..70d7c8e6d23 100644
--- a/searchsummary/src/tests/juniper/auxTest.h
+++ b/searchsummary/src/tests/juniper/auxTest.h
@@ -17,7 +17,7 @@ public:
virtual ~AuxTest();
typedef void(AuxTest::* tst_method_ptr) ();
- typedef std::map<std::string, tst_method_ptr> MethodContainer;
+ using MethodContainer = std::map<std::string, tst_method_ptr>;
MethodContainer test_methods_;
void init();
diff --git a/searchsummary/src/tests/juniper/latintokenizertest.h b/searchsummary/src/tests/juniper/latintokenizertest.h
index b4d113918ee..d06a3ae9289 100644
--- a/searchsummary/src/tests/juniper/latintokenizertest.h
+++ b/searchsummary/src/tests/juniper/latintokenizertest.h
@@ -371,7 +371,7 @@ private:
void LatinTokenizerTest::TestTypeparamObservers()
{
- typedef Fast_LatinTokenizer<TPS,TPS> MyTokenizer;
+ using MyTokenizer = Fast_LatinTokenizer<TPS,TPS>;
PushDesc("TypeparamObservers\n");
std::string text("4Some6text");
@@ -390,7 +390,7 @@ void LatinTokenizerTest::TestTypeparamObservers()
void LatinTokenizerTest::TestMapelURL()
{
- typedef Fast_LatinTokenizer<Maple_Space, Mapel_Pucntuation> MyTokenizer;
+ using MyTokenizer = Fast_LatinTokenizer<Maple_Space, Mapel_Pucntuation>;
PushDesc("MapelURL\n");
std::string text("http://search.msn.co.uk/results.asp?q= cfg=SMCBROWSE rn=1825822 dp=1873075 v=166:");
diff --git a/searchsummary/src/tests/juniper/matchobjectTest.h b/searchsummary/src/tests/juniper/matchobjectTest.h
index 9fdd3e4719f..f85973e7dd6 100644
--- a/searchsummary/src/tests/juniper/matchobjectTest.h
+++ b/searchsummary/src/tests/juniper/matchobjectTest.h
@@ -74,7 +74,7 @@ class MatchObjectTest : public Test {
void tearDown();
typedef void(MatchObjectTest::* tst_method_ptr) ();
- typedef std::map<std::string, tst_method_ptr> MethodContainer;
+ using MethodContainer = std::map<std::string, tst_method_ptr>;
MethodContainer test_methods_;
void init();
diff --git a/searchsummary/src/tests/juniper/mcandTest.h b/searchsummary/src/tests/juniper/mcandTest.h
index 6eb8b4d66e5..37613c6b9ab 100644
--- a/searchsummary/src/tests/juniper/mcandTest.h
+++ b/searchsummary/src/tests/juniper/mcandTest.h
@@ -172,7 +172,7 @@ class MatchCandidateTest : public Test {
void tearDown();
typedef void(MatchCandidateTest::* tst_method_ptr) ();
- typedef std::map<std::string, tst_method_ptr> MethodContainer;
+ using MethodContainer = std::map<std::string, tst_method_ptr>;
MethodContainer test_methods_;
void init();
protected:
diff --git a/searchsummary/src/tests/juniper/queryparserTest.h b/searchsummary/src/tests/juniper/queryparserTest.h
index 803fbd4c999..45d2e966e99 100644
--- a/searchsummary/src/tests/juniper/queryparserTest.h
+++ b/searchsummary/src/tests/juniper/queryparserTest.h
@@ -73,7 +73,7 @@ class QueryParserTest : public Test {
void tearDown();
typedef void(QueryParserTest::* tst_method_ptr) ();
- typedef std::map<std::string, tst_method_ptr> MethodContainer;
+ using MethodContainer = std::map<std::string, tst_method_ptr>;
MethodContainer test_methods_;
void init();
diff --git a/searchsummary/src/tests/juniper/testenv.h b/searchsummary/src/tests/juniper/testenv.h
index f723fb96602..11b975d0888 100644
--- a/searchsummary/src/tests/juniper/testenv.h
+++ b/searchsummary/src/tests/juniper/testenv.h
@@ -66,5 +66,5 @@ extern Juniper * _Juniper;
} // end namespace juniper
-typedef juniper::TestQuery TestQuery;
+using TestQuery = juniper::TestQuery;
diff --git a/searchsummary/src/vespa/juniper/Matcher.cpp b/searchsummary/src/vespa/juniper/Matcher.cpp
index 76f4a17ad1c..9f7db56823a 100644
--- a/searchsummary/src/vespa/juniper/Matcher.cpp
+++ b/searchsummary/src/vespa/juniper/Matcher.cpp
@@ -60,7 +60,7 @@ Matcher::~Matcher()
MatchCandidate* Matcher::NewCandidate(QueryExpr* query)
{
- typedef MatchElement * MatchElementP;
+ using MatchElementP = MatchElement *;
return new MatchCandidate(query, new MatchElementP[query->_arity], _ctxt_start);
}
diff --git a/searchsummary/src/vespa/juniper/Matcher.h b/searchsummary/src/vespa/juniper/Matcher.h
index 5564537ae4a..a23fd225cf3 100644
--- a/searchsummary/src/vespa/juniper/Matcher.h
+++ b/searchsummary/src/vespa/juniper/Matcher.h
@@ -47,7 +47,7 @@ class SummaryDesc;
class SummaryConfig;
class QueryTerm;
-typedef std::list<MatchCandidate*> match_sequence;
+using match_sequence = std::list<MatchCandidate*>;
class Matcher : public ITokenProcessor
{
diff --git a/searchsummary/src/vespa/juniper/hashbase.h b/searchsummary/src/vespa/juniper/hashbase.h
index 2cdfc02800f..6231aa97114 100644
--- a/searchsummary/src/vespa/juniper/hashbase.h
+++ b/searchsummary/src/vespa/juniper/hashbase.h
@@ -120,9 +120,9 @@ private:
Fast_HashTable &operator=(Fast_HashTable &);
public:
- typedef Fast_HashTableElement<Key, T> element;
- typedef Fast_HashTableIterator<Key, T, _tableSize> iterator;
- typedef Key keytype;
+ using element = Fast_HashTableElement<Key, T>;
+ using iterator = Fast_HashTableIterator<Key, T, _tableSize>;
+ using keytype = Key;
friend class Fast_HashTableIterator<Key, T, _tableSize>;
@@ -144,7 +144,7 @@ protected:
public:
Fast_HashTable() : _numElements(0), _lookupTable(NULL), _compare()
{
- typedef element dummyDef;
+ using dummyDef = element;
_lookupTable = new dummyDef* [_tableSize];
memset(_lookupTable, 0, _tableSize * sizeof(element *));
}
diff --git a/searchsummary/src/vespa/juniper/latintokenizer.h b/searchsummary/src/vespa/juniper/latintokenizer.h
index 7a98d780c56..1b0b49d7329 100644
--- a/searchsummary/src/vespa/juniper/latintokenizer.h
+++ b/searchsummary/src/vespa/juniper/latintokenizer.h
@@ -374,4 +374,4 @@ struct Fast_IsPunctuation {
* @date Creation date: 2001-12-07
*****************************************************************************/
-typedef Fast_LatinTokenizer<Fast_IsSpace, Fast_IsPunctuation> Fast_SimpleLatinTokenizer;
+using Fast_SimpleLatinTokenizer = Fast_LatinTokenizer<Fast_IsSpace, Fast_IsPunctuation>;
diff --git a/searchsummary/src/vespa/juniper/matchelem.h b/searchsummary/src/vespa/juniper/matchelem.h
index 7948eabb8ed..b8061c9213f 100644
--- a/searchsummary/src/vespa/juniper/matchelem.h
+++ b/searchsummary/src/vespa/juniper/matchelem.h
@@ -20,7 +20,7 @@ struct sequential_elem
return m1->starttoken() < m2->starttoken();
}
};
-typedef std::set<key_occ*, sequential_elem<key_occ*> > keylist;
+using keylist = std::set<key_occ*, sequential_elem<key_occ*> >;
class MatchElement
{
diff --git a/searchsummary/src/vespa/juniper/matchobject.h b/searchsummary/src/vespa/juniper/matchobject.h
index 3278448e0f7..5ab90c1a61e 100644
--- a/searchsummary/src/vespa/juniper/matchobject.h
+++ b/searchsummary/src/vespa/juniper/matchobject.h
@@ -8,8 +8,8 @@
#include "reducematcher.h"
#include "ITokenProcessor.h"
-typedef juniper::Result Result;
-typedef ITokenProcessor::Token Token;
+using Result = juniper::Result;
+using Token = ITokenProcessor::Token;
// Reverse length order, longest match first - needed to allow matcher to
// match on the most explicit matches before the more implicit ones
@@ -72,7 +72,7 @@ public:
~MatchObject();
- typedef match_iterator iterator;
+ using iterator = match_iterator;
/** Check if the given string matches any query term in the MatchObject
* @param an iterator that will be updated to iterate over all matching query terms
diff --git a/searchsummary/src/vespa/juniper/mcand.h b/searchsummary/src/vespa/juniper/mcand.h
index a09a18267c1..46e095fd5cb 100644
--- a/searchsummary/src/vespa/juniper/mcand.h
+++ b/searchsummary/src/vespa/juniper/mcand.h
@@ -18,7 +18,7 @@ struct gtematch_cand {
bool operator()(const MatchCandidate* m1, const MatchCandidate* m2) const;
bool gtDistance(const MatchCandidate* m1, const MatchCandidate* m2) const;
};
-typedef std::multiset<MatchCandidate*, gtematch_cand> match_candidate_set;
+using match_candidate_set = std::multiset<MatchCandidate*, gtematch_cand>;
class MatchCandidate : public MatchElement
{
diff --git a/searchsummary/src/vespa/juniper/queryhandle.h b/searchsummary/src/vespa/juniper/queryhandle.h
index d0b266e99ce..a829af7f147 100644
--- a/searchsummary/src/vespa/juniper/queryhandle.h
+++ b/searchsummary/src/vespa/juniper/queryhandle.h
@@ -12,8 +12,8 @@ class MatchObject;
#include "queryvisitor.h"
#include "expcache.h"
-typedef std::vector<QueryTerm*> queryterm_vector;
-typedef std::vector<QueryNode*> querynode_vector;
+using queryterm_vector = std::vector<QueryTerm*>;
+using querynode_vector = std::vector<QueryNode*>;
namespace juniper
{
diff --git a/searchsummary/src/vespa/juniper/querynode.h b/searchsummary/src/vespa/juniper/querynode.h
index c6fecaf1b9f..1c269097940 100644
--- a/searchsummary/src/vespa/juniper/querynode.h
+++ b/searchsummary/src/vespa/juniper/querynode.h
@@ -33,7 +33,7 @@
class QueryNode;
class QueryTerm;
-typedef std::vector<QueryNode*> querynode_vector;
+using querynode_vector = std::vector<QueryNode*>;
// Support slightly extended visitor pattern for QueryExpr nodes..
diff --git a/searchsummary/src/vespa/juniper/queryparser.h b/searchsummary/src/vespa/juniper/queryparser.h
index 99d31f4e5ff..a69971f5c8a 100644
--- a/searchsummary/src/vespa/juniper/queryparser.h
+++ b/searchsummary/src/vespa/juniper/queryparser.h
@@ -21,7 +21,7 @@ struct IsPunctuation {
}
};
-typedef Fast_LatinTokenizer<Fast_IsSpace, IsPunctuation> WildcardTokenizer;
+using WildcardTokenizer = Fast_LatinTokenizer<Fast_IsSpace, IsPunctuation>;
class QueryParserQueryItem;
@@ -48,7 +48,7 @@ private:
inline void setvisitor(IQueryVisitor* v) { _v = v; }
bool match(const char* s, bool required = false);
- typedef WildcardTokenizer Tokenizer;
+ using Tokenizer = WildcardTokenizer;
Tokenizer _tokenizer;
std::map<std::string, int> _op_to_type;
const char* _query_string;
diff --git a/searchsummary/src/vespa/juniper/queryvisitor.h b/searchsummary/src/vespa/juniper/queryvisitor.h
index 7c82d3fa50a..8566e4ff73e 100644
--- a/searchsummary/src/vespa/juniper/queryvisitor.h
+++ b/searchsummary/src/vespa/juniper/queryvisitor.h
@@ -7,9 +7,9 @@
// Juniper internal implementation of the IQueryVisitor interface as used by
// query providers (this is the initial 1.0.x structure implementation)
-typedef juniper::QueryItem QueryItem;
-typedef juniper::IQuery IQuery;
-typedef juniper::QueryHandle QueryHandle;
+using QueryItem = juniper::QueryItem;
+using IQuery = juniper::IQuery;
+using QueryHandle = juniper::QueryHandle;
class Matcher;
diff --git a/searchsummary/src/vespa/juniper/reducematcher.h b/searchsummary/src/vespa/juniper/reducematcher.h
index cfdc252b17e..6be27fcd7ea 100644
--- a/searchsummary/src/vespa/juniper/reducematcher.h
+++ b/searchsummary/src/vespa/juniper/reducematcher.h
@@ -8,7 +8,7 @@
namespace juniper
{
-typedef std::map<std::string, std::vector<QueryTerm*> > string_match_table;
+using string_match_table = std::map<std::string, std::vector<QueryTerm*> >;
class string_matcher
{
diff --git a/searchsummary/src/vespa/juniper/rpinterface.h b/searchsummary/src/vespa/juniper/rpinterface.h
index 41a40e2c98d..5bfee1e2691 100644
--- a/searchsummary/src/vespa/juniper/rpinterface.h
+++ b/searchsummary/src/vespa/juniper/rpinterface.h
@@ -73,8 +73,8 @@ public:
/**
* Convenience typedefs.
*/
- typedef std::unique_ptr<Juniper> UP;
- typedef std::shared_ptr<Juniper> SP;
+ using UP = std::unique_ptr<Juniper>;
+ using SP = std::shared_ptr<Juniper>;
/** Initialize the Juniper subsystem.
* @param props A pointer to the object containing all available configuration
diff --git a/searchsummary/src/vespa/juniper/sumdesc.h b/searchsummary/src/vespa/juniper/sumdesc.h
index a0440a60fba..c1e230f1bf4 100644
--- a/searchsummary/src/vespa/juniper/sumdesc.h
+++ b/searchsummary/src/vespa/juniper/sumdesc.h
@@ -61,8 +61,8 @@ protected:
void add_desc(off_t pos, ssize_t len, bool highlight);
- typedef std::set<MatchCandidate*,sequential_elem<MatchCandidate*> > cand_list;
- typedef std::list<highlight_desc> print_list;
+ using cand_list = std::set<MatchCandidate*,sequential_elem<MatchCandidate*> >;
+ using print_list = std::list<highlight_desc>;
/** Helper function to build a simple query highlight of the complete document */
void build_fulldoc_desc();