Rename ItOnNonConstValidFrames -> ValidFramesInvalidator
This commit is contained in:
parent
11119e5406
commit
7c37ed2313
@ -80,7 +80,7 @@ void MultiFrame::DefragmentValidFrames() noexcept {
|
|||||||
|
|
||||||
ValidFramesReader MultiFrame::GetValidFramesReader() { return ValidFramesReader(*this); }
|
ValidFramesReader MultiFrame::GetValidFramesReader() { return ValidFramesReader(*this); }
|
||||||
|
|
||||||
ItOnNonConstValidFrames MultiFrame::GetItOnNonConstValidFrames() { return ItOnNonConstValidFrames(*this); }
|
ValidFramesInvalidator MultiFrame::GetValidFramesInvalidator() { return ValidFramesInvalidator(*this); }
|
||||||
|
|
||||||
ItOnNonConstInvalidFrames MultiFrame::GetItOnNonConstInvalidFrames() { return ItOnNonConstInvalidFrames(*this); }
|
ItOnNonConstInvalidFrames MultiFrame::GetItOnNonConstInvalidFrames() { return ItOnNonConstInvalidFrames(*this); }
|
||||||
|
|
||||||
@ -93,17 +93,17 @@ ValidFramesReader::Iterator ValidFramesReader::end() {
|
|||||||
return Iterator(&multiframe_.frames_[multiframe_.frames_.size()], *this);
|
return Iterator(&multiframe_.frames_[multiframe_.frames_.size()], *this);
|
||||||
}
|
}
|
||||||
|
|
||||||
ItOnNonConstValidFrames::ItOnNonConstValidFrames(MultiFrame &multiframe) : multiframe_(multiframe) {}
|
ValidFramesInvalidator::ValidFramesInvalidator(MultiFrame &multiframe) : multiframe_(multiframe) {}
|
||||||
|
|
||||||
ItOnNonConstValidFrames::~ItOnNonConstValidFrames() {
|
ValidFramesInvalidator::~ValidFramesInvalidator() {
|
||||||
// #NoCommit possible optimisation: only DefragmentValidFrames if one frame has been invalidated? Only if does not
|
// #NoCommit possible optimisation: only DefragmentValidFrames if one frame has been invalidated? Only if does not
|
||||||
// cost too much to store it
|
// cost too much to store it
|
||||||
multiframe_.DefragmentValidFrames();
|
multiframe_.DefragmentValidFrames();
|
||||||
}
|
}
|
||||||
|
|
||||||
ItOnNonConstValidFrames::Iterator ItOnNonConstValidFrames::begin() { return Iterator(&multiframe_.frames_[0], *this); }
|
ValidFramesInvalidator::Iterator ValidFramesInvalidator::begin() { return Iterator(&multiframe_.frames_[0], *this); }
|
||||||
|
|
||||||
ItOnNonConstValidFrames::Iterator ItOnNonConstValidFrames::end() {
|
ValidFramesInvalidator::Iterator ValidFramesInvalidator::end() {
|
||||||
return Iterator(&multiframe_.frames_[multiframe_.frames_.size()], *this);
|
return Iterator(&multiframe_.frames_[multiframe_.frames_.size()], *this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -19,13 +19,13 @@ namespace memgraph::query::v2 {
|
|||||||
constexpr unsigned long kNumberOfFramesInMultiframe = 1000; // #NoCommit have it configurable
|
constexpr unsigned long kNumberOfFramesInMultiframe = 1000; // #NoCommit have it configurable
|
||||||
|
|
||||||
class ValidFramesReader;
|
class ValidFramesReader;
|
||||||
class ItOnNonConstValidFrames;
|
class ValidFramesInvalidator;
|
||||||
class ItOnNonConstInvalidFrames;
|
class ItOnNonConstInvalidFrames;
|
||||||
|
|
||||||
class MultiFrame {
|
class MultiFrame {
|
||||||
public:
|
public:
|
||||||
friend class ValidFramesReader;
|
friend class ValidFramesReader;
|
||||||
friend class ItOnNonConstValidFrames;
|
friend class ValidFramesInvalidator;
|
||||||
friend class ItOnNonConstInvalidFrames;
|
friend class ItOnNonConstInvalidFrames;
|
||||||
|
|
||||||
MultiFrame(FrameWithValidity default_frame, size_t number_of_frames, utils::MemoryResource *execution_memory);
|
MultiFrame(FrameWithValidity default_frame, size_t number_of_frames, utils::MemoryResource *execution_memory);
|
||||||
@ -49,9 +49,9 @@ class MultiFrame {
|
|||||||
state in the multiframe.
|
state in the multiframe.
|
||||||
Iteration goes in a deterministic order.
|
Iteration goes in a deterministic order.
|
||||||
One can modify the validity of the frame with this implementation.
|
One can modify the validity of the frame with this implementation.
|
||||||
If you do not plan to modify the validity of the frames, use GetReader instead as this is faster.
|
If you do not plan to modify the validity of the frames, use GetValidFramesReader instead as this is faster.
|
||||||
*/
|
*/
|
||||||
ItOnNonConstValidFrames GetItOnNonConstValidFrames();
|
ValidFramesInvalidator GetValidFramesInvalidator();
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
Returns a object on which one can iterate in a for-loop. By doing so, you will only get frames that are in an invalid
|
Returns a object on which one can iterate in a for-loop. By doing so, you will only get frames that are in an invalid
|
||||||
@ -122,15 +122,15 @@ class ValidFramesReader {
|
|||||||
MultiFrame &multiframe_;
|
MultiFrame &multiframe_;
|
||||||
};
|
};
|
||||||
|
|
||||||
class ItOnNonConstValidFrames {
|
class ValidFramesInvalidator {
|
||||||
public:
|
public:
|
||||||
ItOnNonConstValidFrames(MultiFrame &multiframe);
|
ValidFramesInvalidator(MultiFrame &multiframe);
|
||||||
|
|
||||||
~ItOnNonConstValidFrames();
|
~ValidFramesInvalidator();
|
||||||
ItOnNonConstValidFrames(const ItOnNonConstValidFrames &other) = delete; // copy constructor
|
ValidFramesInvalidator(const ValidFramesInvalidator &other) = delete; // copy constructor
|
||||||
ItOnNonConstValidFrames(ItOnNonConstValidFrames &&other) noexcept = delete; // move constructor
|
ValidFramesInvalidator(ValidFramesInvalidator &&other) noexcept = delete; // move constructor
|
||||||
ItOnNonConstValidFrames &operator=(const ItOnNonConstValidFrames &other) = delete; // copy assignment
|
ValidFramesInvalidator &operator=(const ValidFramesInvalidator &other) = delete; // copy assignment
|
||||||
ItOnNonConstValidFrames &operator=(ItOnNonConstValidFrames &&other) noexcept = delete; // move assignment
|
ValidFramesInvalidator &operator=(ValidFramesInvalidator &&other) noexcept = delete; // move assignment
|
||||||
|
|
||||||
struct Iterator {
|
struct Iterator {
|
||||||
using iterator_category = std::forward_iterator_tag;
|
using iterator_category = std::forward_iterator_tag;
|
||||||
@ -140,7 +140,7 @@ class ItOnNonConstValidFrames {
|
|||||||
using reference = FrameWithValidity &;
|
using reference = FrameWithValidity &;
|
||||||
using internal_ptr = FrameWithValidity *;
|
using internal_ptr = FrameWithValidity *;
|
||||||
|
|
||||||
Iterator(internal_ptr ptr, ItOnNonConstValidFrames &iterator_wrapper)
|
Iterator(internal_ptr ptr, ValidFramesInvalidator &iterator_wrapper)
|
||||||
: ptr_(ptr), iterator_wrapper_(iterator_wrapper) {}
|
: ptr_(ptr), iterator_wrapper_(iterator_wrapper) {}
|
||||||
|
|
||||||
reference operator*() const { return *ptr_; }
|
reference operator*() const { return *ptr_; }
|
||||||
@ -160,7 +160,7 @@ class ItOnNonConstValidFrames {
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
internal_ptr ptr_;
|
internal_ptr ptr_;
|
||||||
ItOnNonConstValidFrames &iterator_wrapper_;
|
ValidFramesInvalidator &iterator_wrapper_;
|
||||||
};
|
};
|
||||||
|
|
||||||
Iterator begin();
|
Iterator begin();
|
||||||
|
Loading…
Reference in New Issue
Block a user