aboutsummaryrefslogtreecommitdiffstats
path: root/document
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2016-12-16 19:40:52 +0100
committerGitHub <noreply@github.com>2016-12-16 19:40:52 +0100
commit20ef70b44f896843945b21721520a170c6d1624d (patch)
tree7b17323d99eebedca1156cb9c357692b4f8a2280 /document
parent7eec9171277f9e153cc2e0dc9be3e79ac8ab0512 (diff)
parentba2761d0d2f00e5617afb14ac546484c3f1521c1 (diff)
Merge pull request #1343 from yahoo/balder/ensure-progress-with-empty-terms
Balder/ensure progress with empty terms
Diffstat (limited to 'document')
-rw-r--r--document/src/vespa/document/select/context.cpp31
-rw-r--r--document/src/vespa/document/select/context.h52
-rw-r--r--document/src/vespa/document/select/resultlist.cpp4
-rw-r--r--document/src/vespa/document/select/resultlist.h5
4 files changed, 47 insertions, 45 deletions
diff --git a/document/src/vespa/document/select/context.cpp b/document/src/vespa/document/select/context.cpp
index 847de82e50c..44d005e9db2 100644
--- a/document/src/vespa/document/select/context.cpp
+++ b/document/src/vespa/document/select/context.cpp
@@ -1,11 +1,38 @@
// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-#include <vespa/fastos/fastos.h>
+
#include "context.h"
-#include "value.h"
namespace document {
namespace select {
+Context::Context(void)
+ : _doc(NULL),
+ _docId(NULL),
+ _docUpdate(NULL),
+ _variables()
+{ }
+
+Context::Context(const Document& doc)
+ : _doc(&doc),
+ _docId(NULL),
+ _docUpdate(NULL),
+ _variables()
+{ }
+
+Context::Context(const DocumentId& docId)
+ : _doc(NULL),
+ _docId(&docId),
+ _docUpdate(NULL),
+ _variables()
+{ }
+
+Context::Context(const DocumentUpdate& docUpdate)
+ : _doc(NULL),
+ _docId(NULL),
+ _docUpdate(&docUpdate),
+ _variables()
+{ }
+
Context::~Context() { }
} // select
diff --git a/document/src/vespa/document/select/context.h b/document/src/vespa/document/select/context.h
index 00152f54aaf..11a3a2be51c 100644
--- a/document/src/vespa/document/select/context.h
+++ b/document/src/vespa/document/select/context.h
@@ -4,61 +4,29 @@
#include <vespa/vespalib/stllike/string.h>
#include <vespa/vespalib/stllike/hash_map.h>
-namespace document
-{
+namespace document{
class Document;
class DocumentId;
class DocumentUpdate;
-namespace select
-{
-
-class Value;
+namespace select {
class Context
{
public:
typedef vespalib::hash_map<vespalib::string, double> VariableMap;
- Context(void)
- : _doc(NULL),
- _docId(NULL),
- _docUpdate(NULL),
- _variables()
- {
- }
-
- Context(const Document& doc)
- : _doc(&doc),
- _docId(NULL),
- _docUpdate(NULL),
- _variables()
- {
- }
-
- Context(const DocumentId& docId)
- : _doc(NULL),
- _docId(&docId),
- _docUpdate(NULL),
- _variables()
- {
- }
-
- Context(const DocumentUpdate& docUpdate)
- : _doc(NULL),
- _docId(NULL),
- _docUpdate(&docUpdate),
- _variables()
- {
- }
-
+ Context();
+ Context(const Document& doc);
+ Context(const DocumentId& docId);
+ Context(const DocumentUpdate& docUpdate);
virtual ~Context();
- const Document* _doc;
- const DocumentId* _docId;
- const DocumentUpdate* _docUpdate;
- VariableMap _variables;
+ const Document * _doc;
+ const DocumentId * _docId;
+ const DocumentUpdate * _docUpdate;
+ VariableMap _variables;
};
} // select
diff --git a/document/src/vespa/document/select/resultlist.cpp b/document/src/vespa/document/select/resultlist.cpp
index e0c8de26eb3..f8224b7a158 100644
--- a/document/src/vespa/document/select/resultlist.cpp
+++ b/document/src/vespa/document/select/resultlist.cpp
@@ -6,6 +6,10 @@
namespace document {
namespace select {
+ResultList::ResultList() : _results() { }
+
+ResultList::~ResultList() { }
+
ResultList::ResultList(const Result& result) {
add(VariableMap(), result);
}
diff --git a/document/src/vespa/document/select/resultlist.h b/document/src/vespa/document/select/resultlist.h
index cd10f1ec2d8..c33151ca496 100644
--- a/document/src/vespa/document/select/resultlist.h
+++ b/document/src/vespa/document/select/resultlist.h
@@ -16,7 +16,10 @@ public:
typedef Results::iterator iterator;
typedef Results::const_iterator const_iterator;
- ResultList() {};
+ ResultList();
+ ResultList(ResultList &&) = default;
+ ResultList & operator = (ResultList &&) = default;
+ ~ResultList();
/**
Creates a result list with one element with the given result type and no parameters.