libfoedus-core
FOEDUS Core Library
foedus::storage::array::ArrayRange Struct Reference

Represents an offset range in an array storage. More...

Detailed Description

Represents an offset range in an array storage.

Begin is inclusive, end is exclusive.

Definition at line 62 of file array_id.hpp.

#include <array_id.hpp>

Public Member Functions

 ArrayRange ()
 
 ArrayRange (ArrayOffset begin, ArrayOffset end)
 
 ArrayRange (ArrayOffset begin, ArrayOffset end, ArrayOffset array_size)
 this one adjusts the case where end might be larger than the whole array size (right-most) More...
 
bool overlaps (const ArrayRange &other) const
 Returns if there is any overlap with the other range. More...
 
bool contains (ArrayOffset offset) const
 
bool operator== (const ArrayRange &other) const
 
bool operator!= (const ArrayRange &other) const
 

Public Attributes

ArrayOffset begin_
 Inclusive beginning of the offset range. More...
 
ArrayOffset end_
 Exclusive end of the offset range. More...
 

Constructor & Destructor Documentation

foedus::storage::array::ArrayRange::ArrayRange ( )
inline

Definition at line 63 of file array_id.hpp.

63 : begin_(0), end_(0) {}
ArrayOffset begin_
Inclusive beginning of the offset range.
Definition: array_id.hpp:86
ArrayOffset end_
Exclusive end of the offset range.
Definition: array_id.hpp:88
foedus::storage::array::ArrayRange::ArrayRange ( ArrayOffset  begin,
ArrayOffset  end 
)
inline

Definition at line 64 of file array_id.hpp.

64 : begin_(begin), end_(end) {}
ArrayOffset begin_
Inclusive beginning of the offset range.
Definition: array_id.hpp:86
ArrayOffset end_
Exclusive end of the offset range.
Definition: array_id.hpp:88
foedus::storage::array::ArrayRange::ArrayRange ( ArrayOffset  begin,
ArrayOffset  end,
ArrayOffset  array_size 
)
inline

this one adjusts the case where end might be larger than the whole array size (right-most)

Definition at line 66 of file array_id.hpp.

References end_.

67  : begin_(begin), end_(end) {
68  if (end > array_size) {
69  end_ = array_size;
70  }
71  }
ArrayOffset begin_
Inclusive beginning of the offset range.
Definition: array_id.hpp:86
ArrayOffset end_
Exclusive end of the offset range.
Definition: array_id.hpp:88

Member Function Documentation

bool foedus::storage::array::ArrayRange::contains ( ArrayOffset  offset) const
inline
bool foedus::storage::array::ArrayRange::operator!= ( const ArrayRange other) const
inline

Definition at line 83 of file array_id.hpp.

References operator==().

83 { return !(this->operator==(other)); }
bool operator==(const ArrayRange &other) const
Definition: array_id.hpp:80

Here is the call graph for this function:

bool foedus::storage::array::ArrayRange::operator== ( const ArrayRange other) const
inline

Definition at line 80 of file array_id.hpp.

References begin_, and end_.

Referenced by operator!=().

80  {
81  return begin_ == other.begin_ && end_ == other.end_;
82  }
ArrayOffset begin_
Inclusive beginning of the offset range.
Definition: array_id.hpp:86
ArrayOffset end_
Exclusive end of the offset range.
Definition: array_id.hpp:88

Here is the caller graph for this function:

bool foedus::storage::array::ArrayRange::overlaps ( const ArrayRange other) const
inline

Returns if there is any overlap with the other range.

Definition at line 74 of file array_id.hpp.

References begin_, contains(), and end_.

Referenced by foedus::storage::array::ArrayStoragePimpl::prefetch_pages_recurse().

74  {
75  // Case 1: contains(other.begin) or contains(other.end)
76  // Case 2: not case 1, but other.contains(begin)
77  return contains(other.begin_) || contains(other.end_) || other.contains(begin_);
78  }
ArrayOffset begin_
Inclusive beginning of the offset range.
Definition: array_id.hpp:86
bool contains(ArrayOffset offset) const
Definition: array_id.hpp:79

Here is the call graph for this function:

Here is the caller graph for this function:

Member Data Documentation


The documentation for this struct was generated from the following file: