summaryrefslogtreecommitdiffstats
path: root/slobrok/src/vespa/slobrok/server/service_mapping.h
blob: 61729a37d8fba4ce2fced6ed1d1fdb0c086052d8 (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
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.

#pragma once

#include <vespa/vespalib/stllike/string.h>
#include <vector>

namespace slobrok {

struct ServiceMapping {
    vespalib::string name;
    vespalib::string spec;
    ServiceMapping(const vespalib::string & name_, const vespalib::string & spec_) noexcept : name(name_), spec(spec_) { }
    ServiceMapping(const ServiceMapping& rhs) noexcept;
    ~ServiceMapping();
    ServiceMapping& operator=(const ServiceMapping& rhs);

    bool operator== (const ServiceMapping &other) const noexcept {
        return name == other.name && spec == other.spec;
    }

    bool operator< (const ServiceMapping &other) const noexcept {
        if (name < other.name) return true;
        if (other.name < name) return false;
        return spec < other.spec;
    }
};

using ServiceMappingList = std::vector<ServiceMapping>;

}