aboutsummaryrefslogtreecommitdiffstats
path: root/staging_vespalib/src/vespa/vespalib/objects/fieldbase.h
blob: cdb9ae95c72e73d32c4d0e5631c1b3ba2406ce3e (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 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#pragma once

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

namespace vespalib {

class IFieldBase
{
public:
    virtual ~IFieldBase() { }
    virtual stringref getName() const = 0;
};

class FieldBase : public IFieldBase
{
public:
    FieldBase(stringref name) : _name(name) { }
    stringref getName() const final override { return _name; }
private:
    string _name;
};

class SerializerCommon
{
protected:
    static FieldBase _unspecifiedField;
    static FieldBase _sizeField;
};

}