summaryrefslogtreecommitdiffstats
path: root/searchlib
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2017-03-09 00:21:14 +0100
committerHenning Baldersheim <balder@yahoo-inc.com>2017-03-09 00:21:14 +0100
commit94eea5f229b0a4034676002a423b226185a10820 (patch)
treefddc26a218c233f7b3b509525370d0f6d7ef17c8 /searchlib
parent68c336f802bba1974186c085ee7725a12980e244 (diff)
deiniline destructors
Diffstat (limited to 'searchlib')
-rw-r--r--searchlib/src/apps/fileheaderinspect/fileheaderinspect.cpp7
-rw-r--r--searchlib/src/apps/tests/biglogtest.cpp22
-rw-r--r--searchlib/src/apps/vespa-ranking-expression-analyzer/vespa-ranking-expression-analyzer.cpp30
-rw-r--r--searchlib/src/tests/attribute/attributeupdater.h35
-rw-r--r--searchlib/src/tests/attribute/bitvector/bitvector_test.cpp16
-rw-r--r--searchlib/src/tests/attribute/document_weight_iterator/document_weight_iterator_test.cpp25
-rw-r--r--searchlib/src/tests/attribute/enumeratedsave/enumeratedsave_test.cpp17
-rw-r--r--searchlib/src/tests/attribute/enumstore/enumstore_test.cpp9
8 files changed, 103 insertions, 58 deletions
diff --git a/searchlib/src/apps/fileheaderinspect/fileheaderinspect.cpp b/searchlib/src/apps/fileheaderinspect/fileheaderinspect.cpp
index 0d6f8c6baf9..3f0801a3a3f 100644
--- a/searchlib/src/apps/fileheaderinspect/fileheaderinspect.cpp
+++ b/searchlib/src/apps/fileheaderinspect/fileheaderinspect.cpp
@@ -27,6 +27,7 @@ private:
public:
Application();
+ ~Application();
int Main();
};
@@ -34,9 +35,9 @@ Application::Application() :
_fileName(""),
_delimiter(';'),
_quiet(false)
-{
- // empty
-}
+{ }
+
+Application::~Application() {}
void
diff --git a/searchlib/src/apps/tests/biglogtest.cpp b/searchlib/src/apps/tests/biglogtest.cpp
index 5e81b02493e..3b943d9fd17 100644
--- a/searchlib/src/apps/tests/biglogtest.cpp
+++ b/searchlib/src/apps/tests/biglogtest.cpp
@@ -124,19 +124,23 @@ struct factory<LogDataStore> : DioTune
vespalib::ThreadStackExecutor _executor;
transactionlog::NoSyncProxy _noTlSyncer;
LogDataStore _datastore;
- factory(std::string dir)
- : DioTune(),
- _fileHeaderContext(),
- _config(),
- _executor(_config.getNumThreads(), 128*1024),
- _noTlSyncer(),
- _datastore(_executor, dir, _config, GrowStrategy(), tuning,
- _fileHeaderContext, _noTlSyncer, NULL)
- {}
+ factory(std::string dir);
+ ~factory();
IDataStore & operator() () { return _datastore; }
};
+factory<LogDataStore>::factory(std::string dir)
+ : DioTune(),
+ _fileHeaderContext(),
+ _config(),
+ _executor(_config.getNumThreads(), 128*1024),
+ _noTlSyncer(),
+ _datastore(_executor, dir, _config, GrowStrategy(), tuning, _fileHeaderContext, _noTlSyncer, NULL)
+{}
+
+factory<LogDataStore>::~factory() {}
+
template <typename DS>
void
Test::testDIO()
diff --git a/searchlib/src/apps/vespa-ranking-expression-analyzer/vespa-ranking-expression-analyzer.cpp b/searchlib/src/apps/vespa-ranking-expression-analyzer/vespa-ranking-expression-analyzer.cpp
index 872664b9f9f..7409ad4abbd 100644
--- a/searchlib/src/apps/vespa-ranking-expression-analyzer/vespa-ranking-expression-analyzer.cpp
+++ b/searchlib/src/apps/vespa-ranking-expression-analyzer/vespa-ranking-expression-analyzer.cpp
@@ -263,19 +263,8 @@ struct State {
std::vector<vespalib::string> options;
std::vector<double> options_us;
- explicit State(const vespalib::string &file_name,
- vespalib::string expression_in)
- : name(strip_name(file_name)),
- expression(std::move(expression_in)),
- function(Function::parse(expression, FeatureNameExtractor())),
- fun_info(function),
- compiled_function(),
- llvm_compile_s(0.0),
- llvm_execute_us(0.0),
- options(),
- options_us()
- {
- }
+ State(const vespalib::string &file_name, vespalib::string expression_in);
+ ~State();
void benchmark_llvm_compile() {
BenchmarkTimer timer(1.0);
@@ -323,6 +312,21 @@ struct State {
}
};
+State::State(const vespalib::string &file_name, vespalib::string expression_in)
+ : name(strip_name(file_name)),
+ expression(std::move(expression_in)),
+ function(Function::parse(expression, FeatureNameExtractor())),
+ fun_info(function),
+ compiled_function(),
+ llvm_compile_s(0.0),
+ llvm_execute_us(0.0),
+ options(),
+ options_us()
+{
+}
+
+State::~State() {}
+
//-----------------------------------------------------------------------------
struct MyApp : public FastOS_Application {
diff --git a/searchlib/src/tests/attribute/attributeupdater.h b/searchlib/src/tests/attribute/attributeupdater.h
index 5193ca0f873..2e5b1cc2622 100644
--- a/searchlib/src/tests/attribute/attributeupdater.h
+++ b/searchlib/src/tests/attribute/attributeupdater.h
@@ -122,12 +122,8 @@ protected:
public:
AttributeUpdater(const AttributePtr & attrPtr, const std::vector<T> & values,
RandomGenerator & rndGen, bool validate, uint32_t commitFreq,
- uint32_t minValueCount, uint32_t maxValueCount) :
- _attrPtr(attrPtr), _attrVec(*(static_cast<Vector *>(attrPtr.get()))),
- _values(values), _buffer(), _getBuffer(), _rndGen(rndGen), _expected(), _timer(), _status(), _validator(),
- _validate(validate), _commitFreq(commitFreq), _minValueCount(minValueCount), _maxValueCount(maxValueCount)
- {
- }
+ uint32_t minValueCount, uint32_t maxValueCount);
+ ~AttributeUpdater();
void resetStatus() {
_status.reset();
}
@@ -142,6 +138,18 @@ public:
};
template <typename Vector, typename T, typename BT>
+AttributeUpdater<Vector, T, BT>::AttributeUpdater(const AttributePtr & attrPtr, const std::vector<T> & values,
+ RandomGenerator & rndGen, bool validate, uint32_t commitFreq,
+ uint32_t minValueCount, uint32_t maxValueCount)
+ :_attrPtr(attrPtr), _attrVec(*(static_cast<Vector *>(attrPtr.get()))), _values(values), _buffer(),
+ _getBuffer(), _rndGen(rndGen), _expected(), _timer(), _status(), _validator(), _validate(validate),
+ _commitFreq(commitFreq), _minValueCount(minValueCount), _maxValueCount(maxValueCount)
+{}
+
+template <typename Vector, typename T, typename BT>
+AttributeUpdater<Vector, T, BT>::~AttributeUpdater() {}
+
+template <typename Vector, typename T, typename BT>
class AttributeUpdaterThread : public AttributeUpdater<Vector, T, BT>, public Runnable
{
private:
@@ -150,13 +158,22 @@ private:
public:
AttributeUpdaterThread(const AttributePtr & attrPtr, const std::vector<T> & values,
RandomGenerator & rndGen, bool validate, uint32_t commitFreq,
- uint32_t minValueCount, uint32_t maxValueCount) :
- AttributeUpdater<Vector, T, BT>(attrPtr, values, rndGen, validate, commitFreq, minValueCount, maxValueCount),
- Runnable(0) {}
+ uint32_t minValueCount, uint32_t maxValueCount);
+ ~AttributeUpdaterThread();
virtual void doRun();
};
+template <typename Vector, typename T, typename BT>
+AttributeUpdaterThread<Vector, T, BT>::AttributeUpdaterThread(const AttributePtr & attrPtr, const std::vector<T> & values,
+ RandomGenerator & rndGen, bool validate, uint32_t commitFreq,
+ uint32_t minValueCount, uint32_t maxValueCount)
+ : AttributeUpdater<Vector, T, BT>(attrPtr, values, rndGen, validate, commitFreq, minValueCount, maxValueCount),
+ Runnable(0)
+{}
+template <typename Vector, typename T, typename BT>
+AttributeUpdaterThread<Vector, T, BT>::~AttributeUpdaterThread() { }
+
template <typename Vector, typename T, typename BT>
void
diff --git a/searchlib/src/tests/attribute/bitvector/bitvector_test.cpp b/searchlib/src/tests/attribute/bitvector/bitvector_test.cpp
index f3983a4900f..1c2ca360bd8 100644
--- a/searchlib/src/tests/attribute/bitvector/bitvector_test.cpp
+++ b/searchlib/src/tests/attribute/bitvector/bitvector_test.cpp
@@ -611,11 +611,8 @@ TEST_F("Test bitvectors with weighted set value string", BitVectorTest)
class Verifier : public search::test::SearchIteratorVerifier {
public:
- Verifier() : _bv(BitVector::create(getDocIdLimit())) {
- for (uint32_t docId: getExpectedDocIds()) {
- _bv->setBit(docId);
- }
- }
+ Verifier();
+ ~Verifier();
SearchIterator::UP create(bool strict) const override {
return BitVectorIterator::create(_bv.get(), getDocIdLimit(), _tfmd, strict);
@@ -626,6 +623,15 @@ private:
BitVector::UP _bv;
};
+Verifier::Verifier()
+ : _bv(BitVector::create(getDocIdLimit()))
+{
+ for (uint32_t docId: getExpectedDocIds()) {
+ _bv->setBit(docId);
+ }
+}
+Verifier::~Verifier() {}
+
TEST("Test that bitvector iterators adheres to SearchIterator requirements") {
Verifier searchIteratorVerifier;
searchIteratorVerifier.verify();
diff --git a/searchlib/src/tests/attribute/document_weight_iterator/document_weight_iterator_test.cpp b/searchlib/src/tests/attribute/document_weight_iterator/document_weight_iterator_test.cpp
index 62bdbd9bf51..120c471de48 100644
--- a/searchlib/src/tests/attribute/document_weight_iterator/document_weight_iterator_test.cpp
+++ b/searchlib/src/tests/attribute/document_weight_iterator/document_weight_iterator_test.cpp
@@ -169,16 +169,8 @@ TEST_F("require that string iterators are created correctly", StringFixture) {
class Verifier : public search::test::SearchIteratorVerifier {
public:
- Verifier() :
- _attr(make_attribute(BasicType::INT64, CollectionType::WSET, true))
- {
- add_docs(_attr, getDocIdLimit());
- auto docids = getExpectedDocIds();
- IntegerAttribute *int_attr = static_cast<IntegerAttribute *>(_attr.get());
- for (auto docid: docids) {
- set_doc(int_attr, docid, int64_t(123), 1);
- }
- }
+ Verifier();
+ ~Verifier();
SearchIterator::UP create(bool strict) const override {
(void) strict;
const IDocumentWeightAttribute *api(_attr->asDocumentWeightAttribute());
@@ -191,6 +183,19 @@ private:
mutable fef::TermFieldMatchData _tfmd;
AttributeVector::SP _attr;
};
+
+Verifier::Verifier()
+ : _attr(make_attribute(BasicType::INT64, CollectionType::WSET, true))
+{
+ add_docs(_attr, getDocIdLimit());
+ auto docids = getExpectedDocIds();
+ IntegerAttribute *int_attr = static_cast<IntegerAttribute *>(_attr.get());
+ for (auto docid: docids) {
+ set_doc(int_attr, docid, int64_t(123), 1);
+ }
+}
+Verifier::~Verifier() {}
+
TEST("verify document weight search iterator") {
Verifier verifier;
verifier.verify();
diff --git a/searchlib/src/tests/attribute/enumeratedsave/enumeratedsave_test.cpp b/searchlib/src/tests/attribute/enumeratedsave/enumeratedsave_test.cpp
index df0a406aebb..c57bf0ba87c 100644
--- a/searchlib/src/tests/attribute/enumeratedsave/enumeratedsave_test.cpp
+++ b/searchlib/src/tests/attribute/enumeratedsave/enumeratedsave_test.cpp
@@ -102,13 +102,8 @@ private:
public:
typedef std::shared_ptr<MemAttr> SP;
- MemAttr(void)
- : _datWriter(),
- _idxWriter(),
- _weightWriter(),
- _udatWriter()
- {
- }
+ MemAttr();
+ ~MemAttr();
// Implements IAttributeSaveTarget
virtual bool setup() { return true; }
@@ -127,6 +122,14 @@ public:
operator==(const MemAttr &rhs) const;
};
+MemAttr::MemAttr()
+ : _datWriter(),
+ _idxWriter(),
+ _weightWriter(),
+ _udatWriter()
+{ }
+MemAttr::~MemAttr() {}
+
class EnumeratedSaveTest
{
private:
diff --git a/searchlib/src/tests/attribute/enumstore/enumstore_test.cpp b/searchlib/src/tests/attribute/enumstore/enumstore_test.cpp
index b9c2279995e..63d12aaf242 100644
--- a/searchlib/src/tests/attribute/enumstore/enumstore_test.cpp
+++ b/searchlib/src/tests/attribute/enumstore/enumstore_test.cpp
@@ -89,8 +89,8 @@ private:
IndexVector _indices;
ExpectedVector _expected;
Reader(uint32_t generation, const IndexVector & indices,
- const ExpectedVector & expected) :
- _generation(generation), _indices(indices), _expected(expected) {}
+ const ExpectedVector & expected);
+ ~Reader();
};
void
@@ -103,6 +103,11 @@ public:
int Main();
};
+EnumStoreTest::Reader::Reader(uint32_t generation, const IndexVector & indices, const ExpectedVector & expected)
+ : _generation(generation), _indices(indices), _expected(expected)
+{}
+EnumStoreTest::Reader::~Reader() { }
+
void
EnumStoreTest::testIndex()
{