aboutsummaryrefslogtreecommitdiffstats
path: root/searchcore/src/vespa/searchcorespi/index/isearchableindexcollection.cpp
blob: 85e87965cb70494e6116538fcc9cf3d1b6a92336 (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
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.

#include "isearchableindexcollection.h"
#include <vespa/searchlib/queryeval/isourceselector.h>

namespace searchcorespi {

using search::queryeval::ISourceSelector;

void
ISearchableIndexCollection::setCurrentIndex(uint32_t id)
{
    assert( id < ISourceSelector::SOURCE_LIMIT);

    _currentIndex = id;
}

uint32_t
ISearchableIndexCollection::getCurrentIndex() const
{
    assert( valid() );

    return _currentIndex;
}

bool
ISearchableIndexCollection::valid() const
{
    return (_currentIndex > 0) && (_currentIndex < ISourceSelector::SOURCE_LIMIT);
}

}