diff --git a/include/linkahead/entity.h b/include/linkahead/entity.h index 1c75813c3ab4af95f4deb30cd6c4c60eaf135cb7..2f19bcf53713c53816f90c7d28c7421e6dc27067 100644 --- a/include/linkahead/entity.h +++ b/include/linkahead/entity.h @@ -157,7 +157,7 @@ public: friend class Entity; - virtual ~RepeatedPtrFieldWrapper(){}; + virtual ~RepeatedPtrFieldWrapper() {}; inline auto ToString() const noexcept -> const std::string override { if (this->size() == 0) { @@ -202,7 +202,7 @@ public: } protected: - RepeatedPtrFieldWrapper() : ProtoMessageWrapper<RepeatedPtrField<P>>(){}; + RepeatedPtrFieldWrapper() : ProtoMessageWrapper<RepeatedPtrField<P>>() {}; explicit inline RepeatedPtrFieldWrapper(RepeatedPtrField<P> *wrapped) : ProtoMessageWrapper<RepeatedPtrField<P>>(wrapped) {} @@ -242,8 +242,14 @@ protected: mutable std::map<int, T> cache; private: - class iterator : public std::iterator<std::output_iterator_tag, T> { + class iterator { public: + using iterator_category = std::output_iterator_tag; + using value_type = T; + using difference_type = std::ptrdiff_t; + using pointer = T *; + using reference = T &; + explicit iterator(const RepeatedPtrFieldWrapper<T, P> *instance, int index = 0); // TODO(henrik) add unit tests auto operator*() const -> T &; @@ -343,7 +349,7 @@ public: private: explicit inline Message(ProtoMessage *wrapped) - : ScalarProtoMessageWrapper<ProtoMessage>(wrapped){}; + : ScalarProtoMessageWrapper<ProtoMessage>(wrapped) {}; }; /** @@ -357,7 +363,7 @@ public: // friend class Property; private: - inline Messages() : RepeatedPtrFieldWrapper<Message, ProtoMessage>(){}; + inline Messages() : RepeatedPtrFieldWrapper<Message, ProtoMessage>() {}; }; /////////////////////////////////////////////////////////////////////////////// @@ -372,8 +378,8 @@ private: */ class Parent : public ScalarProtoMessageWrapper<ProtoParent> { public: - explicit inline Parent(ProtoParent *wrapped) : ScalarProtoMessageWrapper<ProtoParent>(wrapped){}; - Parent() : ScalarProtoMessageWrapper<ProtoParent>(){}; + explicit inline Parent(ProtoParent *wrapped) : ScalarProtoMessageWrapper<ProtoParent>(wrapped) {}; + Parent() : ScalarProtoMessageWrapper<ProtoParent>() {}; ~Parent() = default; /** @@ -475,9 +481,9 @@ public: friend class Entity; private: - inline Parents() : RepeatedPtrFieldWrapper<Parent, ProtoParent>(){}; + inline Parents() : RepeatedPtrFieldWrapper<Parent, ProtoParent>() {}; explicit inline Parents(::google::protobuf::RepeatedPtrField<caosdb::entity::v1::Parent> *wrapped) - : RepeatedPtrFieldWrapper<Parent, ProtoParent>(wrapped){}; + : RepeatedPtrFieldWrapper<Parent, ProtoParent>(wrapped) {}; }; /////////////////////////////////////////////////////////////////////////////// @@ -516,10 +522,10 @@ public: value(this->wrapped->has_value() ? this->wrapped->mutable_value() : static_cast<ProtoValue *>(nullptr)), data_type(this->wrapped->has_data_type() ? this->wrapped->mutable_data_type() - : static_cast<ProtoDataType *>(nullptr)){}; + : static_cast<ProtoDataType *>(nullptr)) {}; inline Property() : ScalarProtoMessageWrapper<ProtoProperty>(), value(static_cast<ProtoValue *>(nullptr)), - data_type(static_cast<ProtoDataType *>(nullptr)){}; + data_type(static_cast<ProtoDataType *>(nullptr)) {}; ~Property() = default; @@ -660,9 +666,9 @@ public: friend class Entity; private: - inline Properties(){}; + inline Properties() {}; explicit inline Properties(RepeatedPtrField<ProtoProperty> *wrapped) - : RepeatedPtrFieldWrapper<Property, ProtoProperty>(wrapped){}; + : RepeatedPtrFieldWrapper<Property, ProtoProperty>(wrapped) {}; }; /////////////////////////////////////////////////////////////////////////////// diff --git a/include/linkahead/result_set.h b/include/linkahead/result_set.h index d12d417635f38478d2262cf8dceb2dcedfeb820e..78155f5e01b41ebbeb82ce17b54d3a22806f2f99 100644 --- a/include/linkahead/result_set.h +++ b/include/linkahead/result_set.h @@ -56,8 +56,15 @@ public: auto end() const -> iterator; private: - class iterator : public std::iterator<std::output_iterator_tag, Entity> { + class iterator { public: + + using iterator_category = std::output_iterator_tag; + using value_type = Entity; + using difference_type = std::ptrdiff_t; + using pointer = Entity *; + using reference = Entity &; + explicit iterator(const ResultSet *result_set, int index = 0); auto operator*() const -> const Entity &; auto operator++() -> iterator &; diff --git a/include/linkahead/result_table.h b/include/linkahead/result_table.h index bbdbf363e0932b9fcea5df2c1db18390f99fd5c6..b20457f778444094d311115bf607c2378f055df6 100644 --- a/include/linkahead/result_table.h +++ b/include/linkahead/result_table.h @@ -82,8 +82,14 @@ public: friend class ResultTableImpl; private: - class HeaderIterator : std::iterator<std::output_iterator_tag, ResultTableColumn> { + class HeaderIterator { public: + using iterator_category = std::output_iterator_tag; + using value_type = ResultTableColumn; + using difference_type = std::ptrdiff_t; + using pointer = ResultTableColumn *; + using reference = ResultTableColumn &; + explicit HeaderIterator(const ResultTable *result_table, int index = 0); HeaderIterator(const HeaderIterator &other); auto operator*() const -> const ResultTableColumn &; @@ -99,8 +105,14 @@ private: const ResultTable *result_table; }; - class RowIterator : std::iterator<std::output_iterator_tag, ResultTableRow> { + class RowIterator { public: + using iterator_category = std::output_iterator_tag; + using value_type = linkahead::transaction::ResultTableRow; + using difference_type = std::ptrdiff_t; + using pointer = value_type *; + using reference = value_type &; + explicit RowIterator(const ResultTable *result_table, int index = 0); RowIterator(const RowIterator &other); auto operator*() const -> const ResultTableRow &;