Flutter Engine
The Flutter Engine
Public Member Functions | Static Public Member Functions | List of all members
dart::compiler::ffi::Range Class Reference

#include <range.h>

Public Member Functions

intptr_t start () const
 
intptr_t end_exclusive () const
 
intptr_t end_inclusive () const
 
intptr_t Length () const
 
bool Contains (intptr_t number) const
 
bool Contains (const Range &other) const
 
bool After (const Range &other) const
 
bool Overlaps (const Range &other) const
 
const Range Intersect (const Range &other) const
 
const Range Translate (intptr_t delta) const
 

Static Public Member Functions

static Range StartAndLength (intptr_t start_inclusive, intptr_t length)
 
static Range StartAndEnd (intptr_t start_inclusive, intptr_t end_exclusive)
 

Detailed Description

Definition at line 23 of file range.h.

Member Function Documentation

◆ After()

bool dart::compiler::ffi::Range::After ( const Range other) const
inline

Definition at line 56 of file range.h.

56 {
57 return other.end_exclusive_ <= start_;
58 }

◆ Contains() [1/2]

bool dart::compiler::ffi::Range::Contains ( const Range other) const
inline

Definition at line 51 of file range.h.

51 {
52 return Contains(other.start_) && Contains(other.end_inclusive());
53 }
bool Contains(intptr_t number) const
Definition: range.h:46

◆ Contains() [2/2]

bool dart::compiler::ffi::Range::Contains ( intptr_t  number) const
inline

Definition at line 46 of file range.h.

46 {
47 return start_ <= number && number < end_exclusive_;
48 }

◆ end_exclusive()

intptr_t dart::compiler::ffi::Range::end_exclusive ( ) const
inline

Definition at line 40 of file range.h.

40{ return end_exclusive_; }

◆ end_inclusive()

intptr_t dart::compiler::ffi::Range::end_inclusive ( ) const
inline

Definition at line 41 of file range.h.

41{ return end_exclusive_ - 1; }

◆ Intersect()

const Range dart::compiler::ffi::Range::Intersect ( const Range other) const
inline

Definition at line 68 of file range.h.

68 {
69 ASSERT(Overlaps(other));
70 return Range(Utils::Maximum(start_, other.start_),
71 Utils::Minimum(end_exclusive_, other.end_exclusive_));
72 }
static constexpr T Maximum(T x, T y)
Definition: utils.h:41
static T Minimum(T x, T y)
Definition: utils.h:36
bool Overlaps(const Range &other) const
Definition: range.h:61
#define ASSERT(E)

◆ Length()

intptr_t dart::compiler::ffi::Range::Length ( ) const
inline

Definition at line 43 of file range.h.

43{ return end_exclusive_ - start_; }

◆ Overlaps()

bool dart::compiler::ffi::Range::Overlaps ( const Range other) const
inline

Definition at line 61 of file range.h.

61 {
62 return !this->After(other) && !other.After(*this);
63 }
bool After(const Range &other) const
Definition: range.h:56

◆ start()

intptr_t dart::compiler::ffi::Range::start ( ) const
inline

Definition at line 39 of file range.h.

39{ return start_; }

◆ StartAndEnd()

static Range dart::compiler::ffi::Range::StartAndEnd ( intptr_t  start_inclusive,
intptr_t  end_exclusive 
)
inlinestatic

Definition at line 35 of file range.h.

35 {
36 return Range(start_inclusive, end_exclusive);
37 }
intptr_t end_exclusive() const
Definition: range.h:40

◆ StartAndLength()

static Range dart::compiler::ffi::Range::StartAndLength ( intptr_t  start_inclusive,
intptr_t  length 
)
inlinestatic

Definition at line 28 of file range.h.

28 {
29 return Range(start_inclusive, start_inclusive + length);
30 }
size_t length

◆ Translate()

const Range dart::compiler::ffi::Range::Translate ( intptr_t  delta) const
inline

Definition at line 77 of file range.h.

77 {
78 return Range(start_ + delta, end_exclusive_ + delta);
79 }

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