aboutsummaryrefslogtreecommitdiffstats
path: root/searchsummary/src/vespa/searchsummary/docsummary/getdocsumargs.cpp
blob: dd9b77816a926cd86070b7d866d33d19270388e1 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.

#include "getdocsumargs.h"

namespace search::docsummary {

GetDocsumArgs::GetDocsumArgs()
    : _ranking(),
      _resultClassName(),
      _dumpFeatures(false),
      _no_locations(false),
      _stackItems(0),
      _stackDump(),
      _location(),
      _timeout(30s),
      _propertiesMap()
{ }


GetDocsumArgs::~GetDocsumArgs() = default;

void
GetDocsumArgs::initFromDocsumRequest(const search::engine::DocsumRequest &req)
{
    _ranking           = req.ranking;
    _dumpFeatures      = req.dumpFeatures;
    _resultClassName   = req.resultClassName;
    _stackItems        = req.stackItems;
    _stackDump         = req.stackDump;
    _location          = req.location;
    _timeout           = req.getTimeLeft();
    _propertiesMap     = req.propertiesMap;
}

void
GetDocsumArgs::SetStackDump(uint32_t stackItems, uint32_t stackDumpLen, const char *stackDump)
{
    _stackItems = stackItems;
    _stackDump.resize(stackDumpLen);
    memcpy(&_stackDump[0], stackDump, _stackDump.size());
}

}