summaryrefslogtreecommitdiffstats
path: root/document
diff options
context:
space:
mode:
authorGeir Storli <geirst@yahooinc.com>2022-12-21 13:56:41 +0000
committerGeir Storli <geirst@yahooinc.com>2022-12-21 15:49:53 +0000
commitc52f85fc197ac72b8011de1d6021a0ce5588b9dc (patch)
tree315480bd79af5ebcb4c2f96f8c603ddc582fed98 /document
parent3160d5918d2b8eb18eb4f6c5a6a3cf6d28b868a5 (diff)
Change from typedef to using in document C++ code.
Diffstat (limited to 'document')
-rw-r--r--document/src/tests/globalidtest.cpp4
-rw-r--r--document/src/tests/predicate/predicate_printer_test.cpp2
-rw-r--r--document/src/tests/predicate/predicate_test.cpp2
-rw-r--r--document/src/tests/primitivefieldvaluetest.cpp2
-rw-r--r--document/src/vespa/document/annotation/alternatespanlist.h4
-rw-r--r--document/src/vespa/document/annotation/span.h2
-rw-r--r--document/src/vespa/document/annotation/spanlist.h10
-rw-r--r--document/src/vespa/document/annotation/spannode.h2
-rw-r--r--document/src/vespa/document/annotation/spantree.h4
-rw-r--r--document/src/vespa/document/base/documentid.h2
-rw-r--r--document/src/vespa/document/base/fieldpath.h17
-rw-r--r--document/src/vespa/document/base/idstring.h2
-rw-r--r--document/src/vespa/document/bucket/bucketid.cpp4
-rw-r--r--document/src/vespa/document/bucket/bucketselector.h2
-rw-r--r--document/src/vespa/document/datatype/annotationreferencedatatype.h2
-rw-r--r--document/src/vespa/document/datatype/annotationtype.h4
-rw-r--r--document/src/vespa/document/fieldset/fieldsets.h2
-rw-r--r--document/src/vespa/document/fieldvalue/bytefieldvalue.h2
-rw-r--r--document/src/vespa/document/fieldvalue/document.h4
-rw-r--r--document/src/vespa/document/fieldvalue/doublefieldvalue.h2
-rw-r--r--document/src/vespa/document/fieldvalue/floatfieldvalue.h2
-rw-r--r--document/src/vespa/document/fieldvalue/intfieldvalue.h2
-rw-r--r--document/src/vespa/document/fieldvalue/literalfieldvalue.h8
-rw-r--r--document/src/vespa/document/fieldvalue/longfieldvalue.h2
-rw-r--r--document/src/vespa/document/fieldvalue/mapfieldvalue.h6
-rw-r--r--document/src/vespa/document/fieldvalue/numericfieldvalue.h2
-rw-r--r--document/src/vespa/document/fieldvalue/rawfieldvalue.h2
-rw-r--r--document/src/vespa/document/fieldvalue/shortfieldvalue.h4
-rw-r--r--document/src/vespa/document/fieldvalue/stringfieldvalue.h8
-rw-r--r--document/src/vespa/document/fieldvalue/structuredfieldvalue.h4
-rw-r--r--document/src/vespa/document/fieldvalue/weightedsetfieldvalue.h8
-rw-r--r--document/src/vespa/document/predicate/predicate.h2
-rw-r--r--document/src/vespa/document/predicate/predicate_slime_builder.h4
-rw-r--r--document/src/vespa/document/repo/documenttyperepo.cpp4
-rw-r--r--document/src/vespa/document/select/node.h4
-rw-r--r--document/src/vespa/document/select/operator.h2
-rw-r--r--document/src/vespa/document/select/resultlist.h8
-rw-r--r--document/src/vespa/document/select/value.h10
-rw-r--r--document/src/vespa/document/serialization/vespadocumentdeserializer.cpp2
-rw-r--r--document/src/vespa/document/update/arithmeticvalueupdate.h2
-rw-r--r--document/src/vespa/document/util/bytebuffer.h2
41 files changed, 81 insertions, 82 deletions
diff --git a/document/src/tests/globalidtest.cpp b/document/src/tests/globalidtest.cpp
index 58767c751e1..fb11671433e 100644
--- a/document/src/tests/globalidtest.cpp
+++ b/document/src/tests/globalidtest.cpp
@@ -184,7 +184,7 @@ TEST_F(GlobalIdTest, testGidRangeConversion)
TEST_F(GlobalIdTest, testBucketOrderCmp)
{
- typedef GlobalId::BucketOrderCmp C;
+ using C = GlobalId::BucketOrderCmp;
EXPECT_TRUE(C::compareRaw(0, 0) == 0);
EXPECT_TRUE(C::compareRaw(0, 1) == -1);
EXPECT_TRUE(C::compareRaw(1, 0) == 1);
@@ -217,7 +217,7 @@ TEST_F(GlobalIdTest, testBucketOrderCmp)
GlobalId bar = GlobalId::parse("gid(0x000000100030003000700000)");
GlobalId baz = GlobalId::parse("gid(0x000000103330333000700000)");
- typedef std::map<GlobalId, uint32_t, GlobalId::BucketOrderCmp> GidMap;
+ using GidMap = std::map<GlobalId, uint32_t, GlobalId::BucketOrderCmp>;
GidMap gidMap;
gidMap[foo] = 666;
gidMap[bar] = 777;
diff --git a/document/src/tests/predicate/predicate_printer_test.cpp b/document/src/tests/predicate/predicate_printer_test.cpp
index ba0ffe40a27..43826d7ab92 100644
--- a/document/src/tests/predicate/predicate_printer_test.cpp
+++ b/document/src/tests/predicate/predicate_printer_test.cpp
@@ -15,7 +15,7 @@ using namespace document;
namespace {
-typedef std::unique_ptr<Slime> SlimeUP;
+using SlimeUP = std::unique_ptr<Slime>;
using namespace document::predicate_slime_builder;
TEST("require that PredicatePrinter prints FeatureSets") {
diff --git a/document/src/tests/predicate/predicate_test.cpp b/document/src/tests/predicate/predicate_test.cpp
index cee19e8b7ab..5efb871f31d 100644
--- a/document/src/tests/predicate/predicate_test.cpp
+++ b/document/src/tests/predicate/predicate_test.cpp
@@ -20,7 +20,7 @@ using namespace document;
namespace {
-typedef std::unique_ptr<Slime> SlimeUP;
+using SlimeUP = std::unique_ptr<Slime>;
TEST("require that predicate feature set slimes can be compared") {
PredicateSlimeBuilder builder;
diff --git a/document/src/tests/primitivefieldvaluetest.cpp b/document/src/tests/primitivefieldvaluetest.cpp
index ea78baa4ee6..9ebe069e0da 100644
--- a/document/src/tests/primitivefieldvaluetest.cpp
+++ b/document/src/tests/primitivefieldvaluetest.cpp
@@ -208,7 +208,7 @@ namespace {
void
testNumeric(const std::string& maxVal, bool floatingPoint)
{
- typedef typename Numeric::Number Number;
+ using Number = typename Numeric::Number;
Number maxValue(std::numeric_limits<Number>::max());
// Test common fieldvalue stuff
testCommon(Numeric(),
diff --git a/document/src/vespa/document/annotation/alternatespanlist.h b/document/src/vespa/document/annotation/alternatespanlist.h
index f21cafedb41..b4306ce8b24 100644
--- a/document/src/vespa/document/annotation/alternatespanlist.h
+++ b/document/src/vespa/document/annotation/alternatespanlist.h
@@ -19,8 +19,8 @@ class AlternateSpanList : public SpanNode {
void addInternal(size_t index, std::unique_ptr<SpanNode> node);
public:
- typedef std::unique_ptr<AlternateSpanList> UP;
- typedef std::vector<Subtree>::const_iterator const_iterator;
+ using UP = std::unique_ptr<AlternateSpanList>;
+ using const_iterator = std::vector<Subtree>::const_iterator;
~AlternateSpanList();
diff --git a/document/src/vespa/document/annotation/span.h b/document/src/vespa/document/annotation/span.h
index 5f3a78bf98c..68079c194e4 100644
--- a/document/src/vespa/document/annotation/span.h
+++ b/document/src/vespa/document/annotation/span.h
@@ -12,7 +12,7 @@ class Span : public SpanNode {
int32_t _length;
public:
- typedef std::unique_ptr<Span> UP;
+ using UP = std::unique_ptr<Span>;
Span(int32_t from_pos=0, int32_t len=0) noexcept : _from(from_pos), _length(len) {}
diff --git a/document/src/vespa/document/annotation/spanlist.h b/document/src/vespa/document/annotation/spanlist.h
index c4e71b2f29a..a579eb0df11 100644
--- a/document/src/vespa/document/annotation/spanlist.h
+++ b/document/src/vespa/document/annotation/spanlist.h
@@ -12,8 +12,8 @@ class SpanList : public SpanNode {
std::vector<SpanNode *> _span_vector;
public:
- typedef std::unique_ptr<SpanList> UP;
- typedef std::vector<SpanNode *>::const_iterator const_iterator;
+ using UP = std::unique_ptr<SpanList>;
+ using const_iterator = std::vector<SpanNode *>::const_iterator;
~SpanList();
@@ -34,12 +34,12 @@ public:
};
class SimpleSpanList : public SpanNode {
- typedef std::vector<Span> SpanVector;
+ using SpanVector = std::vector<Span>;
SpanVector _span_vector;
public:
- typedef std::unique_ptr<SimpleSpanList> UP;
- typedef SpanVector::const_iterator const_iterator;
+ using UP = std::unique_ptr<SimpleSpanList>;
+ using const_iterator = SpanVector::const_iterator;
SimpleSpanList(size_t sz);
~SimpleSpanList();
diff --git a/document/src/vespa/document/annotation/spannode.h b/document/src/vespa/document/annotation/spannode.h
index 90b49b31ba0..b80ace9ec87 100644
--- a/document/src/vespa/document/annotation/spannode.h
+++ b/document/src/vespa/document/annotation/spannode.h
@@ -9,7 +9,7 @@ namespace document {
struct SpanTreeVisitor;
struct SpanNode {
- typedef std::unique_ptr<SpanNode> UP;
+ using UP = std::unique_ptr<SpanNode>;
virtual ~SpanNode() = default;
diff --git a/document/src/vespa/document/annotation/spantree.h b/document/src/vespa/document/annotation/spantree.h
index 03ee820466c..a0010fafa74 100644
--- a/document/src/vespa/document/annotation/spantree.h
+++ b/document/src/vespa/document/annotation/spantree.h
@@ -17,8 +17,8 @@ class SpanTree {
std::vector<Annotation> _annotations;
public:
- typedef std::unique_ptr<SpanTree> UP;
- typedef AnnotationVector::const_iterator const_iterator;
+ using UP = std::unique_ptr<SpanTree>;
+ using const_iterator = AnnotationVector::const_iterator;
template <typename T>
SpanTree(vespalib::stringref name, std::unique_ptr<T> root)
diff --git a/document/src/vespa/document/base/documentid.h b/document/src/vespa/document/base/documentid.h
index 06f6a7f4342..ebf91808b49 100644
--- a/document/src/vespa/document/base/documentid.h
+++ b/document/src/vespa/document/base/documentid.h
@@ -31,7 +31,7 @@ class DocumentType;
class DocumentId
{
public:
- typedef std::unique_ptr<DocumentId> UP;
+ using UP = std::unique_ptr<DocumentId>;
DocumentId();
DocumentId(vespalib::nbostream & os);
diff --git a/document/src/vespa/document/base/fieldpath.h b/document/src/vespa/document/base/fieldpath.h
index 95f916af118..46b757fc7dd 100644
--- a/document/src/vespa/document/base/fieldpath.h
+++ b/document/src/vespa/document/base/fieldpath.h
@@ -91,18 +91,17 @@ private:
mutable std::unique_ptr<FieldValue> _fillInVal;
};
-//typedef std::deque<FieldPathEntry> FieldPath;
// Facade over FieldPathEntry container that exposes cloneability
class FieldPath {
- typedef std::vector<std::unique_ptr<FieldPathEntry>> Container;
+ using Container = std::vector<std::unique_ptr<FieldPathEntry>>;
public:
- typedef Container::reference reference;
- typedef Container::const_reference const_reference;
- typedef Container::iterator iterator;
- typedef Container::const_iterator const_iterator;
- typedef Container::reverse_iterator reverse_iterator;
- typedef Container::const_reverse_iterator const_reverse_iterator;
- typedef std::unique_ptr<FieldPath> UP;
+ using reference = Container::reference;
+ using const_reference = Container::const_reference;
+ using iterator = Container::iterator;
+ using const_iterator = Container::const_iterator;
+ using reverse_iterator = Container::reverse_iterator;
+ using const_reverse_iterator = Container::const_reverse_iterator;
+ using UP = std::unique_ptr<FieldPath>;
FieldPath();
FieldPath(const FieldPath &);
diff --git a/document/src/vespa/document/base/idstring.h b/document/src/vespa/document/base/idstring.h
index 30538a5d2d4..bb752bd456e 100644
--- a/document/src/vespa/document/base/idstring.h
+++ b/document/src/vespa/document/base/idstring.h
@@ -19,7 +19,7 @@ namespace document {
*/
class IdString {
public:
- typedef uint64_t LocationType;
+ using LocationType = uint64_t;
static LocationType makeLocation(vespalib::stringref s);
explicit IdString(vespalib::stringref ns);
diff --git a/document/src/vespa/document/bucket/bucketid.cpp b/document/src/vespa/document/bucket/bucketid.cpp
index 9ca4db1e51c..06ddfa60d67 100644
--- a/document/src/vespa/document/bucket/bucketid.cpp
+++ b/document/src/vespa/document/bucket/bucketid.cpp
@@ -43,7 +43,7 @@ namespace {
void fillUsedMasks(BucketId::Type * masks, uint8_t maxBits)
{
- typedef BucketId::Type Type;
+ using Type = BucketId::Type;
for (uint32_t usedBits = 0; usedBits <= maxBits; ++usedBits) {
uint8_t notused = 8 * sizeof(Type) - usedBits;
masks[usedBits] = (usedBits > 0) ? ((std::numeric_limits<Type>::max() << notused) >> notused) : std::numeric_limits<Type>::max();
@@ -52,7 +52,7 @@ void fillUsedMasks(BucketId::Type * masks, uint8_t maxBits)
void fillStripMasks(BucketId::Type * masks, uint8_t maxBits)
{
- typedef BucketId::Type Type;
+ using Type = BucketId::Type;
for (uint32_t usedBits = 0; usedBits <= maxBits; ++usedBits) {
uint8_t notused = 8 * sizeof(Type) - usedBits;
Type usedMask = (usedBits > 0) ? ((std::numeric_limits<Type>::max() << notused) >> notused) : std::numeric_limits<Type>::max();
diff --git a/document/src/vespa/document/bucket/bucketselector.h b/document/src/vespa/document/bucket/bucketselector.h
index 6bd37c9a7c5..36fe4c1c156 100644
--- a/document/src/vespa/document/bucket/bucketselector.h
+++ b/document/src/vespa/document/bucket/bucketselector.h
@@ -35,7 +35,7 @@ class BucketSelector {
public:
explicit BucketSelector(const BucketIdFactory& factory);
- typedef std::vector<BucketId> BucketVector;
+ using BucketVector = std::vector<BucketId>;
/**
* Get a list of bucket ids that needs to be visited to be sure to find
* all data matching given expression. Note that we can only detect
diff --git a/document/src/vespa/document/datatype/annotationreferencedatatype.h b/document/src/vespa/document/datatype/annotationreferencedatatype.h
index 32017442ce3..bf926253e4c 100644
--- a/document/src/vespa/document/datatype/annotationreferencedatatype.h
+++ b/document/src/vespa/document/datatype/annotationreferencedatatype.h
@@ -11,7 +11,7 @@ class AnnotationReferenceDataType final : public DataType {
const AnnotationType *_type;
public:
- typedef std::shared_ptr<AnnotationReferenceDataType> SP;
+ using SP = std::shared_ptr<AnnotationReferenceDataType>;
AnnotationReferenceDataType(const AnnotationType &type, int id);
AnnotationReferenceDataType(const AnnotationReferenceDataType &) = delete;
diff --git a/document/src/vespa/document/datatype/annotationtype.h b/document/src/vespa/document/datatype/annotationtype.h
index 6a2301ca06b..80ad6ba5edc 100644
--- a/document/src/vespa/document/datatype/annotationtype.h
+++ b/document/src/vespa/document/datatype/annotationtype.h
@@ -16,8 +16,8 @@ class AnnotationType {
const DataType *_type;
public:
- typedef std::unique_ptr<AnnotationType> UP;
- typedef std::shared_ptr<AnnotationType> SP;
+ using UP = std::unique_ptr<AnnotationType>;
+ using SP = std::shared_ptr<AnnotationType>;
AnnotationType(int id, vespalib::stringref name)
: _id(id), _name(name), _type(0) {}
diff --git a/document/src/vespa/document/fieldset/fieldsets.h b/document/src/vespa/document/fieldset/fieldsets.h
index 4e33d658540..b2490f01232 100644
--- a/document/src/vespa/document/fieldset/fieldsets.h
+++ b/document/src/vespa/document/fieldset/fieldsets.h
@@ -48,7 +48,7 @@ public:
class FieldCollection : public FieldSet
{
public:
- typedef std::unique_ptr<FieldCollection> UP;
+ using UP = std::unique_ptr<FieldCollection>;
FieldCollection(const DocumentType& docType, Field::Set set);
FieldCollection(const FieldCollection &);
diff --git a/document/src/vespa/document/fieldvalue/bytefieldvalue.h b/document/src/vespa/document/fieldvalue/bytefieldvalue.h
index 1b810828c53..9e5bbb20987 100644
--- a/document/src/vespa/document/fieldvalue/bytefieldvalue.h
+++ b/document/src/vespa/document/fieldvalue/bytefieldvalue.h
@@ -14,7 +14,7 @@ namespace document {
class ByteFieldValue final : public NumericFieldValue<int8_t> {
public:
- typedef int8_t Number;
+ using Number = int8_t;
ByteFieldValue(Number value = 0)
: NumericFieldValue<Number>(Type::BYTE, value) {}
diff --git a/document/src/vespa/document/fieldvalue/document.h b/document/src/vespa/document/fieldvalue/document.h
index 610b2fcbd1b..efdc61c93b0 100644
--- a/document/src/vespa/document/fieldvalue/document.h
+++ b/document/src/vespa/document/fieldvalue/document.h
@@ -38,8 +38,8 @@ private:
int64_t _lastModified;
public:
- typedef std::unique_ptr<Document> UP;
- typedef std::shared_ptr<Document> SP;
+ using UP = std::unique_ptr<Document>;
+ using SP = std::shared_ptr<Document>;
static constexpr uint16_t getNewestSerializationVersion() { return 8; }
static const DataType & verifyDocumentType(const DataType *type);
diff --git a/document/src/vespa/document/fieldvalue/doublefieldvalue.h b/document/src/vespa/document/fieldvalue/doublefieldvalue.h
index 56ba6e334e9..95169a7ef1b 100644
--- a/document/src/vespa/document/fieldvalue/doublefieldvalue.h
+++ b/document/src/vespa/document/fieldvalue/doublefieldvalue.h
@@ -14,7 +14,7 @@ namespace document {
class DoubleFieldValue final : public NumericFieldValue<double> {
public:
- typedef double Number;
+ using Number = double;
DoubleFieldValue(Number value = 0) : NumericFieldValue<Number>(Type::DOUBLE, value) {}
diff --git a/document/src/vespa/document/fieldvalue/floatfieldvalue.h b/document/src/vespa/document/fieldvalue/floatfieldvalue.h
index 783459dec64..d11f2f1f800 100644
--- a/document/src/vespa/document/fieldvalue/floatfieldvalue.h
+++ b/document/src/vespa/document/fieldvalue/floatfieldvalue.h
@@ -14,7 +14,7 @@ namespace document {
class FloatFieldValue final : public NumericFieldValue<float> {
public:
- typedef float Number;
+ using Number = float;
FloatFieldValue(Number value = 0) : NumericFieldValue<Number>(Type::FLOAT, value) {}
diff --git a/document/src/vespa/document/fieldvalue/intfieldvalue.h b/document/src/vespa/document/fieldvalue/intfieldvalue.h
index 521aced292c..bfe02038711 100644
--- a/document/src/vespa/document/fieldvalue/intfieldvalue.h
+++ b/document/src/vespa/document/fieldvalue/intfieldvalue.h
@@ -14,7 +14,7 @@ namespace document {
class IntFieldValue final : public NumericFieldValue<int32_t> {
public:
- typedef int32_t Number;
+ using Number = int32_t;
IntFieldValue(Number value = 0) : NumericFieldValue<Number>(Type::INT, value) {}
diff --git a/document/src/vespa/document/fieldvalue/literalfieldvalue.h b/document/src/vespa/document/fieldvalue/literalfieldvalue.h
index 89f2f6afd74..24c4988865e 100644
--- a/document/src/vespa/document/fieldvalue/literalfieldvalue.h
+++ b/document/src/vespa/document/fieldvalue/literalfieldvalue.h
@@ -22,10 +22,10 @@ namespace document {
class LiteralFieldValueB : public FieldValue {
public:
- typedef vespalib::string string;
- typedef vespalib::stringref stringref;
- typedef std::unique_ptr<LiteralFieldValueB> UP;
- typedef string value_type;
+ using string = vespalib::string;
+ using stringref = vespalib::stringref;
+ using UP = std::unique_ptr<LiteralFieldValueB>;
+ using value_type = string;
explicit LiteralFieldValueB(Type type);
~LiteralFieldValueB();
diff --git a/document/src/vespa/document/fieldvalue/longfieldvalue.h b/document/src/vespa/document/fieldvalue/longfieldvalue.h
index 4b73ef0c2ea..6df082af6c3 100644
--- a/document/src/vespa/document/fieldvalue/longfieldvalue.h
+++ b/document/src/vespa/document/fieldvalue/longfieldvalue.h
@@ -14,7 +14,7 @@ namespace document {
class LongFieldValue final : public NumericFieldValue<int64_t> {
public:
- typedef int64_t Number;
+ using Number = int64_t;
LongFieldValue(Number value = 0) : NumericFieldValue<Number>(Type::LONG, value) {}
diff --git a/document/src/vespa/document/fieldvalue/mapfieldvalue.h b/document/src/vespa/document/fieldvalue/mapfieldvalue.h
index b34e6aebe9b..f66438d26e0 100644
--- a/document/src/vespa/document/fieldvalue/mapfieldvalue.h
+++ b/document/src/vespa/document/fieldvalue/mapfieldvalue.h
@@ -50,9 +50,9 @@ private:
VESPA_DLL_LOCAL void ensureLookupMap() const;
VESPA_DLL_LOCAL ssize_t findIndex(const FieldValue& fv) const;
public:
- typedef std::unique_ptr<MapFieldValue> UP;
+ using UP = std::unique_ptr<MapFieldValue>;
class iterator {
- typedef std::pair<FieldValue *, FieldValue *> pair;
+ using pair = std::pair<FieldValue *, FieldValue *>;
public:
iterator(MapFieldValue & map, size_t index) : _map(&map), _index(index) { }
bool operator == (const iterator & rhs) const { return _map == rhs._map && _index == rhs._index; }
@@ -72,7 +72,7 @@ public:
};
class const_iterator {
public:
- typedef std::pair<const FieldValue *, const FieldValue *> pair;
+ using pair = std::pair<const FieldValue *, const FieldValue *>;
const_iterator(const MapFieldValue & map, size_t index) : _map(&map), _index(index) { }
bool operator == (const const_iterator & rhs) const { return _map == rhs._map && _index == rhs._index; }
bool operator != (const const_iterator & rhs) const { return _map != rhs._map || _index != rhs._index; }
diff --git a/document/src/vespa/document/fieldvalue/numericfieldvalue.h b/document/src/vespa/document/fieldvalue/numericfieldvalue.h
index a19456f0e4a..b65475e6bb5 100644
--- a/document/src/vespa/document/fieldvalue/numericfieldvalue.h
+++ b/document/src/vespa/document/fieldvalue/numericfieldvalue.h
@@ -29,7 +29,7 @@ protected:
explicit NumericFieldValue(Type type, Number value=0) : NumericFieldValueBase(type), _value(value) { }
Number _value;
public:
- typedef Number value_type;
+ using value_type = Number;
value_type getValue() const { return _value; }
void setValue(Number newValue) { _value = newValue; }
diff --git a/document/src/vespa/document/fieldvalue/rawfieldvalue.h b/document/src/vespa/document/fieldvalue/rawfieldvalue.h
index b946ecd0038..b63402a8a0a 100644
--- a/document/src/vespa/document/fieldvalue/rawfieldvalue.h
+++ b/document/src/vespa/document/fieldvalue/rawfieldvalue.h
@@ -15,7 +15,7 @@ namespace document {
class RawFieldValue final : public LiteralFieldValue<RawFieldValue, DataType::T_RAW>
{
public:
- typedef LiteralFieldValue<RawFieldValue, DataType::T_RAW> Parent;
+ using Parent = LiteralFieldValue<RawFieldValue, DataType::T_RAW>;
RawFieldValue()
: Parent(Type::RAW) { }
diff --git a/document/src/vespa/document/fieldvalue/shortfieldvalue.h b/document/src/vespa/document/fieldvalue/shortfieldvalue.h
index e135f2a4f54..232db1eff59 100644
--- a/document/src/vespa/document/fieldvalue/shortfieldvalue.h
+++ b/document/src/vespa/document/fieldvalue/shortfieldvalue.h
@@ -14,8 +14,8 @@ namespace document {
class ShortFieldValue final : public NumericFieldValue<int16_t> {
public:
- typedef std::unique_ptr<ShortFieldValue> UP;
- typedef int16_t Number;
+ using UP = std::unique_ptr<ShortFieldValue>;
+ using Number = int16_t;
ShortFieldValue(Number value = 0)
: NumericFieldValue<Number>(Type::SHORT, value) {}
diff --git a/document/src/vespa/document/fieldvalue/stringfieldvalue.h b/document/src/vespa/document/fieldvalue/stringfieldvalue.h
index 95cd9c6190c..a9d1267d21c 100644
--- a/document/src/vespa/document/fieldvalue/stringfieldvalue.h
+++ b/document/src/vespa/document/fieldvalue/stringfieldvalue.h
@@ -19,8 +19,8 @@ class DocumentTypeRepo;
class StringFieldValue final : public LiteralFieldValue<StringFieldValue, DataType::T_STRING> {
public:
- typedef LiteralFieldValue<StringFieldValue, DataType::T_STRING> Parent;
- typedef std::vector<SpanTree::UP> SpanTrees;
+ using Parent = LiteralFieldValue<StringFieldValue, DataType::T_STRING>;
+ using SpanTrees = std::vector<SpanTree::UP>;
StringFieldValue() : Parent(Type::STRING), _annotationData() { }
StringFieldValue(const vespalib::stringref &value)
@@ -62,8 +62,8 @@ private:
class AnnotationData {
public:
- typedef std::vector<char> BackingBlob;
- typedef std::unique_ptr<AnnotationData> UP;
+ using BackingBlob = std::vector<char>;
+ using UP = std::unique_ptr<AnnotationData>;
VESPA_DLL_LOCAL AnnotationData(const AnnotationData & rhs);
AnnotationData & operator = (const AnnotationData &) = delete;
VESPA_DLL_LOCAL AnnotationData(vespalib::ConstBufferRef serialized, const FixedTypeRepo &repo,
diff --git a/document/src/vespa/document/fieldvalue/structuredfieldvalue.h b/document/src/vespa/document/fieldvalue/structuredfieldvalue.h
index fdc4ecf7765..b55af4d8e62 100644
--- a/document/src/vespa/document/fieldvalue/structuredfieldvalue.h
+++ b/document/src/vespa/document/fieldvalue/structuredfieldvalue.h
@@ -51,7 +51,7 @@ protected:
const DataType &getType() const { return *_type; }
struct StructuredIterator {
- typedef std::unique_ptr<StructuredIterator> UP;
+ using UP = std::unique_ptr<StructuredIterator>;
virtual ~StructuredIterator() {}
virtual const Field* getNextField() = 0;
@@ -178,7 +178,7 @@ public:
}
virtual bool empty() const = 0;
- typedef Iterator const_iterator;
+ using const_iterator = Iterator;
const_iterator begin() const { return const_iterator(*this, nullptr); }
const_iterator end() const { return const_iterator(); }
diff --git a/document/src/vespa/document/fieldvalue/weightedsetfieldvalue.h b/document/src/vespa/document/fieldvalue/weightedsetfieldvalue.h
index b2183efef42..74a51da616f 100644
--- a/document/src/vespa/document/fieldvalue/weightedsetfieldvalue.h
+++ b/document/src/vespa/document/fieldvalue/weightedsetfieldvalue.h
@@ -21,7 +21,7 @@ public:
template<typename T> bool operator()(const T& s1, const T& s2) const
{ return *s1 < *s2; }
};
- typedef MapFieldValue WeightedFieldValueMap;
+ using WeightedFieldValueMap = MapFieldValue;
private:
std::shared_ptr<const MapDataType> _map_type;
@@ -33,7 +33,7 @@ private:
bool removeValue(const FieldValue& val) override;
fieldvalue::ModificationStatus onIterateNested(PathRange nested, fieldvalue::IteratorHandler& handler) const override;
public:
- typedef std::unique_ptr<WeightedSetFieldValue> UP;
+ using UP = std::unique_ptr<WeightedSetFieldValue>;
/**
* @param wsetType Type of the weighted set. Must be a WeightedSetDataType,
@@ -79,8 +79,8 @@ public:
void print(std::ostream& out, bool verbose, const std::string& indent) const override;
// Implements iterating through internal content.
- typedef WeightedFieldValueMap::const_iterator const_iterator;
- typedef WeightedFieldValueMap::iterator iterator;
+ using const_iterator = WeightedFieldValueMap::const_iterator;
+ using iterator = WeightedFieldValueMap::iterator;
const_iterator begin() const { return _map.begin(); }
iterator begin() { return _map.begin(); }
diff --git a/document/src/vespa/document/predicate/predicate.h b/document/src/vespa/document/predicate/predicate.h
index 6972ecdc898..ec09d920ac6 100644
--- a/document/src/vespa/document/predicate/predicate.h
+++ b/document/src/vespa/document/predicate/predicate.h
@@ -39,7 +39,7 @@ struct Predicate {
};
struct PredicateNode {
- typedef std::unique_ptr<PredicateNode> UP;
+ using UP = std::unique_ptr<PredicateNode>;
virtual ~PredicateNode() {}
};
diff --git a/document/src/vespa/document/predicate/predicate_slime_builder.h b/document/src/vespa/document/predicate/predicate_slime_builder.h
index 4a03a85f90d..942a81cb54b 100644
--- a/document/src/vespa/document/predicate/predicate_slime_builder.h
+++ b/document/src/vespa/document/predicate/predicate_slime_builder.h
@@ -11,7 +11,7 @@ class PredicateSlimeBuilder {
std::unique_ptr<vespalib::Slime> _slime;
vespalib::slime::Cursor *_cursor;
- typedef std::unique_ptr<vespalib::Slime> SlimeUP;
+ using SlimeUP = std::unique_ptr<vespalib::Slime>;
public:
PredicateSlimeBuilder();
@@ -37,7 +37,7 @@ public:
namespace predicate_slime_builder {
-typedef std::unique_ptr<vespalib::Slime> SlimeUP;
+using SlimeUP = std::unique_ptr<vespalib::Slime>;
SlimeUP featureSet(const std::string &key,
const std::initializer_list<std::string> &values);
diff --git a/document/src/vespa/document/repo/documenttyperepo.cpp b/document/src/vespa/document/repo/documenttyperepo.cpp
index e0db118be11..d7435c979a0 100644
--- a/document/src/vespa/document/repo/documenttyperepo.cpp
+++ b/document/src/vespa/document/repo/documenttyperepo.cpp
@@ -212,7 +212,7 @@ const AnnotationType *AnnotationTypeRepo::lookup(int32_t id) const {
// Combination of a DocumentType and a collection of DataTypes
// associated with it.
struct DataTypeRepo {
- typedef unique_ptr<DataTypeRepo> UP;
+ using UP = unique_ptr<DataTypeRepo>;
std::unique_ptr<DocumentType> doc_type;
Repo repo;
@@ -252,7 +252,7 @@ void setAnnotationDataTypes(const vector<DocumenttypesConfig::Documenttype::Anno
}
}
-typedef DocumenttypesConfig::Documenttype::Datatype Datatype;
+using Datatype = DocumenttypesConfig::Documenttype::Datatype;
void addField(const Datatype::Sstruct::Field &field, Repo &repo, StructDataType &struct_type)
{
diff --git a/document/src/vespa/document/select/node.h b/document/src/vespa/document/select/node.h
index 6221d027af0..3618860ca96 100644
--- a/document/src/vespa/document/select/node.h
+++ b/document/src/vespa/document/select/node.h
@@ -26,8 +26,8 @@ protected:
bool _parentheses; // Set to true if parentheses was used around this part
// Set such that we can recreate original query in print.
public:
- typedef std::unique_ptr<Node> UP;
- typedef std::shared_ptr<Node> SP;
+ using UP = std::unique_ptr<Node>;
+ using SP = std::shared_ptr<Node>;
Node(vespalib::stringref name, uint32_t max_depth)
: _name(name), _max_depth(max_depth), _parentheses(false)
diff --git a/document/src/vespa/document/select/operator.h b/document/src/vespa/document/select/operator.h
index 433ce5a3325..bdaed3004f9 100644
--- a/document/src/vespa/document/select/operator.h
+++ b/document/src/vespa/document/select/operator.h
@@ -19,7 +19,7 @@ namespace document::select {
class Operator : public Printable {
private:
- typedef vespalib::hash_map<vespalib::string, const Operator*> OperatorMap;
+ using OperatorMap = vespalib::hash_map<vespalib::string, const Operator*>;
static OperatorMap _operators;
vespalib::string _name;
diff --git a/document/src/vespa/document/select/resultlist.h b/document/src/vespa/document/select/resultlist.h
index 36907be72a3..0bc27cd5b43 100644
--- a/document/src/vespa/document/select/resultlist.h
+++ b/document/src/vespa/document/select/resultlist.h
@@ -10,10 +10,10 @@ namespace document::select {
class ResultList : public Printable {
public:
using VariableMap = fieldvalue::VariableMap;
- typedef std::pair<VariableMap, const Result*> ResultPair;
- typedef std::vector<ResultPair> Results;
- typedef Results::iterator iterator;
- typedef Results::const_iterator const_iterator;
+ using ResultPair = std::pair<VariableMap, const Result*>;
+ using Results = std::vector<ResultPair>;
+ using iterator = Results::iterator;
+ using const_iterator = Results::const_iterator;
using reverse_iterator = Results::reverse_iterator;
ResultList();
diff --git a/document/src/vespa/document/select/value.h b/document/src/vespa/document/select/value.h
index aeb814262f2..5d94af12833 100644
--- a/document/src/vespa/document/select/value.h
+++ b/document/src/vespa/document/select/value.h
@@ -28,8 +28,8 @@ namespace document::select {
class Value : public document::Printable
{
public:
- typedef std::shared_ptr<Value> SP;
- typedef std::unique_ptr<Value> UP;
+ using SP = std::shared_ptr<Value>;
+ using UP = std::unique_ptr<Value>;
enum Type { Invalid, Null, String, Integer, Float, Array, Struct, Bucket };
Value(Type t) : _type(t) {}
@@ -103,7 +103,7 @@ class FloatValue;
class NumberValue : public Value
{
public:
- typedef double CommonValueType;
+ using CommonValueType = double;
NumberValue(Type t) : Value(t) {}
@@ -120,7 +120,7 @@ public:
class IntegerValue : public NumberValue
{
public:
- typedef int64_t ValueType;
+ using ValueType = int64_t;
IntegerValue(ValueType value, bool isBucketValue);
@@ -142,7 +142,7 @@ private:
class FloatValue : public NumberValue
{
public:
- typedef double ValueType;
+ using ValueType = double;
FloatValue(ValueType val);
diff --git a/document/src/vespa/document/serialization/vespadocumentdeserializer.cpp b/document/src/vespa/document/serialization/vespadocumentdeserializer.cpp
index 55ea4988fc4..c8074b27549 100644
--- a/document/src/vespa/document/serialization/vespadocumentdeserializer.cpp
+++ b/document/src/vespa/document/serialization/vespadocumentdeserializer.cpp
@@ -292,7 +292,7 @@ VespaDocumentDeserializer::read(StringFieldValue &value) {
namespace {
-typedef SerializableArray::EntryMap FieldInfo;
+using FieldInfo = SerializableArray::EntryMap;
void readFieldInfo(nbostream& input, SerializableArray::EntryMap & field_info) __attribute__((noinline));
diff --git a/document/src/vespa/document/update/arithmeticvalueupdate.h b/document/src/vespa/document/update/arithmeticvalueupdate.h
index 7651c838458..51fb975398e 100644
--- a/document/src/vespa/document/update/arithmeticvalueupdate.h
+++ b/document/src/vespa/document/update/arithmeticvalueupdate.h
@@ -37,7 +37,7 @@ private:
ACCEPT_UPDATE_VISITOR;
public:
- typedef std::unique_ptr<ArithmeticValueUpdate> UP;
+ using UP = std::unique_ptr<ArithmeticValueUpdate>;
/**
* The default constructor requires initial values for all member variables.
diff --git a/document/src/vespa/document/util/bytebuffer.h b/document/src/vespa/document/util/bytebuffer.h
index 302d43f8742..58a26d7313a 100644
--- a/document/src/vespa/document/util/bytebuffer.h
+++ b/document/src/vespa/document/util/bytebuffer.h
@@ -21,7 +21,7 @@ namespace document {
class ByteBuffer
{
public:
- typedef std::unique_ptr<ByteBuffer> UP;
+ using UP = std::unique_ptr<ByteBuffer>;
ByteBuffer(const ByteBuffer &);
ByteBuffer& operator=(const ByteBuffer &) = delete;