Clang tidy

This commit is contained in:
jeremy 2022-11-29 15:43:24 +01:00
parent 9faa206f95
commit cc3bcf1dc2
2 changed files with 14 additions and 18 deletions

View File

@ -24,8 +24,6 @@ MultiFrame::MultiFrame(FrameWithValidity default_frame, size_t number_of_frames,
MG_ASSERT(!default_frame.IsValid());
}
MultiFrame::~MultiFrame() = default;
MultiFrame::MultiFrame(const MultiFrame &other) : default_frame_(other.default_frame_) {
/*
TODO
@ -42,7 +40,7 @@ MultiFrame::MultiFrame(const MultiFrame &other) : default_frame_(other.default_f
});
}
MultiFrame::MultiFrame(MultiFrame &&other) : default_frame_(std::move(other.default_frame_)) {
MultiFrame::MultiFrame(MultiFrame &&other) noexcept : default_frame_(std::move(other.default_frame_)) {
/*
TODO
Do we just copy all frames or do we make distinctions between valid and not valid frames? Does it make any
@ -89,14 +87,14 @@ ValidFramesReader::ValidFramesReader(MultiFrame &multiframe) : multiframe_(multi
ValidFramesReader::Iterator ValidFramesReader::begin() { return Iterator{&multiframe_.frames_[0], *this}; }
ValidFramesReader::Iterator ValidFramesReader::end() {
return Iterator(&multiframe_.frames_[multiframe_.frames_.size()], *this);
return Iterator{&multiframe_.frames_[multiframe_.frames_.size()], *this};
}
ValidFramesModifier::ValidFramesModifier(MultiFrame &multiframe) : multiframe_(multiframe) {}
ValidFramesModifier::Iterator ValidFramesModifier::begin() { return Iterator{&multiframe_.frames_[0], *this}; }
ValidFramesModifier::Iterator ValidFramesModifier::end() {
return Iterator(&multiframe_.frames_[multiframe_.frames_.size()], *this);
return Iterator{&multiframe_.frames_[multiframe_.frames_.size()], *this};
}
ValidFramesConsumer::ValidFramesConsumer(MultiFrame &multiframe) : multiframe_(multiframe) {}
@ -110,17 +108,15 @@ ValidFramesConsumer::~ValidFramesConsumer() {
ValidFramesConsumer::Iterator ValidFramesConsumer::begin() { return Iterator{&multiframe_.frames_[0], *this}; }
ValidFramesConsumer::Iterator ValidFramesConsumer::end() {
return Iterator(&multiframe_.frames_[multiframe_.frames_.size()], *this);
return Iterator{&multiframe_.frames_[multiframe_.frames_.size()], *this};
}
InvalidFramesPopulator::InvalidFramesPopulator(MultiFrame &multiframe) : multiframe_(multiframe) {}
InvalidFramesPopulator::~InvalidFramesPopulator() = default;
InvalidFramesPopulator::Iterator InvalidFramesPopulator::begin() {
for (auto idx = 0UL; idx < multiframe_.frames_.size(); ++idx) {
if (!multiframe_.frames_[idx].IsValid()) {
return Iterator(&multiframe_.frames_[idx]);
return Iterator{&multiframe_.frames_[idx]};
}
}

View File

@ -31,10 +31,10 @@ class MultiFrame {
friend class InvalidFramesPopulator;
MultiFrame(FrameWithValidity default_frame, size_t number_of_frames, utils::MemoryResource *execution_memory);
~MultiFrame();
~MultiFrame() = default;
MultiFrame(const MultiFrame &other); // copy constructor
MultiFrame(MultiFrame &&other); // move constructor
MultiFrame(const MultiFrame &other); // copy constructor
MultiFrame(MultiFrame &&other) noexcept; // move constructor
MultiFrame &operator=(const MultiFrame &other) = delete;
MultiFrame &operator=(MultiFrame &&other) noexcept = delete;
@ -88,7 +88,7 @@ class MultiFrame {
class ValidFramesReader {
public:
ValidFramesReader(MultiFrame &multiframe);
explicit ValidFramesReader(MultiFrame &multiframe);
~ValidFramesReader() = default;
ValidFramesReader(const ValidFramesReader &other) = delete; // copy constructor
@ -135,7 +135,7 @@ class ValidFramesReader {
class ValidFramesModifier {
public:
ValidFramesModifier(MultiFrame &multiframe);
explicit ValidFramesModifier(MultiFrame &multiframe);
~ValidFramesModifier() = default;
ValidFramesModifier(const ValidFramesModifier &other) = delete; // copy constructor
@ -183,7 +183,7 @@ class ValidFramesModifier {
class ValidFramesConsumer {
public:
ValidFramesConsumer(MultiFrame &multiframe);
explicit ValidFramesConsumer(MultiFrame &multiframe);
~ValidFramesConsumer();
ValidFramesConsumer(const ValidFramesConsumer &other) = delete; // copy constructor
@ -231,8 +231,8 @@ class ValidFramesConsumer {
class InvalidFramesPopulator {
public:
InvalidFramesPopulator(MultiFrame &multiframe);
~InvalidFramesPopulator();
explicit InvalidFramesPopulator(MultiFrame &multiframe);
~InvalidFramesPopulator() = default;
InvalidFramesPopulator(const InvalidFramesPopulator &other) = delete; // copy constructor
InvalidFramesPopulator(InvalidFramesPopulator &&other) noexcept = delete; // move constructor
@ -247,7 +247,7 @@ class InvalidFramesPopulator {
using reference = FrameWithValidity &;
using internal_ptr = FrameWithValidity *;
Iterator(internal_ptr ptr) : ptr_(ptr) {}
explicit Iterator(internal_ptr ptr) : ptr_(ptr) {}
reference operator*() const { return *ptr_; }
pointer operator->() { return ptr_; }