HOPS
HOPS class reference
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
hops::MHO_Interval< XIntegerType > Class Template Reference

Class MHO_Interval. More...

#include <MHO_Interval.hh>

Public Member Functions

 MHO_Interval ()
 
 MHO_Interval (const MHO_Interval &copy)
 
 MHO_Interval (XIntegerType lower_bound, XIntegerType upper_bound)
 
virtual ~MHO_Interval ()
 
std::pair< XIntegerType, XIntegerType > GetInterval () const
 Getter for interval bounds. More...
 
XIntegerType GetLength () const
 Getter for length. More...
 
XIntegerType GetLowerBound () const
 Getter for lower bound. More...
 
XIntegerType GetUpperBound () const
 Getter for upper bound. More...
 
MHO_Interval Intersection (const MHO_Interval &other) const
 Checks if this interval intersects with another and returns true if it does. More...
 
bool Intersects (const MHO_Interval &other) const
 Checks if this interval intersects with another. More...
 
bool Intersects (const XIntegerType &idx) const
 Checks if closed interval intersects with another interval. More...
 
MHO_Intervaloperator= (const MHO_Interval &rhs)
 
void SetBounds (const std::pair< XIntegerType, XIntegerType > &lower_upper)
 Setter for bounds. More...
 
void SetBounds (XIntegerType lower_bound, XIntegerType upper_bound)
 Setter for bounds. More...
 
void SetLowerBound (XIntegerType low)
 Setter for lower bound. More...
 
void SetUpperBound (XIntegerType up)
 Setter for upper bound. More...
 
MHO_Interval Union (const MHO_Interval &other) const
 Calculates and returns the union interval of this interval and another. More...
 

Protected Member Functions

void SetIntervalImpl (XIntegerType low, XIntegerType up)
 Setter for interval impl. More...
 

Protected Attributes

XIntegerType fLowerBound
 
XIntegerType fUpperBound
 
bool fValid
 

Detailed Description

template<typename XIntegerType = std::size_t>
class hops::MHO_Interval< XIntegerType >

Class MHO_Interval.

Implements the open integer interval [a,b)

Author
J. Barrett - barre.nosp@m.ttj@.nosp@m.mit.e.nosp@m.du
Date
Thu Sep 17 10:45:44 2020 -0400

Constructor & Destructor Documentation

◆ MHO_Interval() [1/3]

template<typename XIntegerType = std::size_t>
hops::MHO_Interval< XIntegerType >::MHO_Interval ( )
inline

◆ MHO_Interval() [2/3]

template<typename XIntegerType = std::size_t>
hops::MHO_Interval< XIntegerType >::MHO_Interval ( XIntegerType  lower_bound,
XIntegerType  upper_bound 
)
inline

◆ MHO_Interval() [3/3]

template<typename XIntegerType = std::size_t>
hops::MHO_Interval< XIntegerType >::MHO_Interval ( const MHO_Interval< XIntegerType > &  copy)
inline

◆ ~MHO_Interval()

template<typename XIntegerType = std::size_t>
virtual hops::MHO_Interval< XIntegerType >::~MHO_Interval ( )
inlinevirtual

Member Function Documentation

◆ GetInterval()

template<typename XIntegerType = std::size_t>
std::pair< XIntegerType, XIntegerType > hops::MHO_Interval< XIntegerType >::GetInterval ( ) const
inline

Getter for interval bounds.

Returns
A pair of XIntegerType representing the current interval's lower and upper bounds.

◆ GetLength()

template<typename XIntegerType = std::size_t>
XIntegerType hops::MHO_Interval< XIntegerType >::GetLength ( ) const
inline

Getter for length.

Returns
Length calculated as fUpperBound - fLowerBound

◆ GetLowerBound()

template<typename XIntegerType = std::size_t>
XIntegerType hops::MHO_Interval< XIntegerType >::GetLowerBound ( ) const
inline

Getter for lower bound.

Returns
Lower bound value as XIntegerType

◆ GetUpperBound()

template<typename XIntegerType = std::size_t>
XIntegerType hops::MHO_Interval< XIntegerType >::GetUpperBound ( ) const
inline

Getter for upper bound.

Returns
Upper bound value as XIntegerType

◆ Intersection()

template<typename XIntegerType = std::size_t>
MHO_Interval hops::MHO_Interval< XIntegerType >::Intersection ( const MHO_Interval< XIntegerType > &  other) const
inline

Checks if this interval intersects with another and returns true if it does.

Parameters
otherThe other interval to check for intersection.
Returns
True if there is an intersection, false otherwise.

◆ Intersects() [1/2]

template<typename XIntegerType = std::size_t>
bool hops::MHO_Interval< XIntegerType >::Intersects ( const MHO_Interval< XIntegerType > &  other) const
inline

Checks if this interval intersects with another.

Parameters
otherThe other interval to check for intersection
Returns
True if there is an intersection, false otherwise

◆ Intersects() [2/2]

template<typename XIntegerType = std::size_t>
bool hops::MHO_Interval< XIntegerType >::Intersects ( const XIntegerType &  idx) const
inline

Checks if closed interval intersects with another interval.

Parameters
idx(const XIntegerType&)
Returns
True if intervals intersect, false otherwise

◆ operator=()

template<typename XIntegerType = std::size_t>
MHO_Interval& hops::MHO_Interval< XIntegerType >::operator= ( const MHO_Interval< XIntegerType > &  rhs)
inline

◆ SetBounds() [1/2]

template<typename XIntegerType = std::size_t>
void hops::MHO_Interval< XIntegerType >::SetBounds ( const std::pair< XIntegerType, XIntegerType > &  lower_upper)
inline

Setter for bounds.

Parameters
lower_boundLower bound of type XIntegerType
upper_boundUpper bound of type XIntegerType

◆ SetBounds() [2/2]

template<typename XIntegerType = std::size_t>
void hops::MHO_Interval< XIntegerType >::SetBounds ( XIntegerType  lower_bound,
XIntegerType  upper_bound 
)
inline

Setter for bounds.

Parameters
lower_boundLower bound value of type XIntegerType
upper_boundUpper bound value of type XIntegerType

◆ SetIntervalImpl()

template<typename XIntegerType = std::size_t>
void hops::MHO_Interval< XIntegerType >::SetIntervalImpl ( XIntegerType  low,
XIntegerType  up 
)
inlineprotected

Setter for interval impl.

Parameters
lowLower bound of new interval (copied)
upUpper bound of new interval (copied)

◆ SetLowerBound()

template<typename XIntegerType = std::size_t>
void hops::MHO_Interval< XIntegerType >::SetLowerBound ( XIntegerType  low)
inline

Setter for lower bound.

Parameters
lowNew lower bound value of type XIntegerType.

◆ SetUpperBound()

template<typename XIntegerType = std::size_t>
void hops::MHO_Interval< XIntegerType >::SetUpperBound ( XIntegerType  up)
inline

Setter for upper bound.

Parameters
upNew upper bound value of type XIntegerType

◆ Union()

template<typename XIntegerType = std::size_t>
MHO_Interval hops::MHO_Interval< XIntegerType >::Union ( const MHO_Interval< XIntegerType > &  other) const
inline

Calculates and returns the union interval of this interval and another.

Parameters
otherThe other interval to calculate the union with.
Returns
The union interval as an MHO_Interval object.

Member Data Documentation

◆ fLowerBound

template<typename XIntegerType = std::size_t>
XIntegerType hops::MHO_Interval< XIntegerType >::fLowerBound
protected

◆ fUpperBound

template<typename XIntegerType = std::size_t>
XIntegerType hops::MHO_Interval< XIntegerType >::fUpperBound
protected

◆ fValid

template<typename XIntegerType = std::size_t>
bool hops::MHO_Interval< XIntegerType >::fValid
protected

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