aboutsummaryrefslogtreecommitdiffstats
path: root/vespalib/src/vespa/vespalib/objects/objectpredicate.h
blob: 024ed41ad2b6d2bf998c010ffd1d7eb59d395fb7 (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
// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#pragma once

namespace vespalib {

class Identifiable;

/**
 * A predicate that is able to say either true or false when presented
 * with a generic object.
 **/
class ObjectPredicate
{
public:
    /**
     * Apply this predicate to the given object.
     *
     * @return true or false
     * @param obj the object to check
     **/
    virtual bool check(const Identifiable &obj) const = 0;

    /**
     * empty
     **/
    virtual ~ObjectPredicate() { }
};

} // namespace vespalib