MySQL 9.6.0
Source Code Documentation
mysql::sets::Interval< Set_traits_tp > Class Template Reference

Holds the start boundary and endpoint boundary of an interval. More...

#include <interval.h>

Inheritance diagram for mysql::sets::Interval< Set_traits_tp >:
[legend]

Public Types

using Set_traits_t = Set_traits_tp
 
using Element_t = Set_traits_t::Element_t
 
using Return_status_t = mysql::utils::Return_status
 
- Public Types inherited from mysql::sets::detail::Interval_base< Set_traits_tp >
using Set_traits_t = Set_traits_tp
 
using Element_t = Set_traits_t::Element_t
 

Public Member Functions

 Interval ()
 
void throwing_assign (const Element_t &start_arg, const Element_t &exclusive_end_arg)
 Set the start and exclusive end to the given values. More...
 
void throwing_set_start (const Element_t &start_arg)
 Set the start to the given value. More...
 
void throwing_set_exclusive_end (const Element_t &exclusive_end_arg)
 Set the exclusive end to the given value. More...
 
Return_status_t assign (const Element_t &start_arg, const Element_t &exclusive_end_arg)
 Set the start and exclusive end to the given values. More...
 
Return_status_t set_start (const Element_t &start_arg)
 Set the start to the given value. More...
 
Return_status_t set_exclusive_end (const Element_t &exclusive_end_arg)
 Set the exclusive end to the given value. More...
 
- Public Member Functions inherited from mysql::sets::detail::Interval_base< Set_traits_tp >
constexpr const Element_tstart () const
 Return const reference to the starting point of the interval (inclusive). More...
 
constexpr const Element_texclusive_end () const
 Return const reference to the exclusive endpoint of the interval. More...
 

Static Public Member Functions

static Interval throwing_make (const Element_t &start_arg, const Element_t &exclusive_end_arg)
 Construct an interval with the given values for start and exclusive end. More...
 
static Interval throwing_make (const Element_t &singleton)
 Construct a singleton interval. More...
 

Protected Member Functions

 Interval (const Element_t &start_arg, const Element_t &exclusive_end_arg)
 Construct an interval with the given values for start and exclusive end. More...
 
 Interval (const Element_t &singleton)
 Construct a singleton interval. More...
 
- Protected Member Functions inherited from mysql::sets::detail::Interval_base< Set_traits_tp >
constexpr Interval_base ()
 This is enabled if Set_traits_t are discrete set traits. More...
 
constexpr Interval_base (const Element_t &start, const Element_t &exclusive_end)
 Construct an interval with the given inclusive start and exclusive end. More...
 
constexpr Interval_base (Element_t singleton)
 Construct a singleton interval. More...
 
void assign (const Element_t &start_arg, const Element_t &exclusive_end_arg)
 Set both boundaries to the given values, without validating the range. More...
 
void set_start (Element_t start_arg)
 Set the value for the start boundary, without validating the range. More...
 
void set_exclusive_end (Element_t exclusive_end_arg)
 Set the value for the exclusive_end boundary, without validating the range. More...
 

Private Types

enum class  Check_start { no , yes }
 Whether assert_consistent needs to check the start boundary. More...
 
enum class  Check_end { no , yes }
 Whether assert_consistent needs to check the end boundary. More...
 
using Base_t = detail::Interval_base< Set_traits_tp >
 

Private Member Functions

template<Check_start check_start = Check_start::yes, Check_end check_end = Check_end::yes>
void assert_consistent (Element_t start_arg, Element_t exclusive_end_arg)
 Check that the given values are in range and in order. More...
 

Detailed Description

template<Is_bounded_set_traits Set_traits_tp>
class mysql::sets::Interval< Set_traits_tp >

Holds the start boundary and endpoint boundary of an interval.

The endpoint is always exclusive. This class maintains that the boundaries are in range and in order, i.e.:

Set_traits_tp::min() <= start < max_exclusive <= Set_traits_tp::max_exclusive()

The setter functions come in two flavors: one whose name begins with throwing_, which throws an exception if the boundaries are out-of-range or out-of-order; one without the prefix that returns a success status. There are also two factory functions, throwing_make, which create an interval and throws an exception if the boundaries are out-of-range or out-of-order.

Template Parameters
Set_traits_tpBounded set traits describing properties of the element type.

Member Typedef Documentation

◆ Base_t

template<Is_bounded_set_traits Set_traits_tp>
using mysql::sets::Interval< Set_traits_tp >::Base_t = detail::Interval_base<Set_traits_tp>
private

◆ Element_t

template<Is_bounded_set_traits Set_traits_tp>
using mysql::sets::Interval< Set_traits_tp >::Element_t = Set_traits_t::Element_t

◆ Return_status_t

template<Is_bounded_set_traits Set_traits_tp>
using mysql::sets::Interval< Set_traits_tp >::Return_status_t = mysql::utils::Return_status

◆ Set_traits_t

template<Is_bounded_set_traits Set_traits_tp>
using mysql::sets::Interval< Set_traits_tp >::Set_traits_t = Set_traits_tp

Member Enumeration Documentation

◆ Check_end

template<Is_bounded_set_traits Set_traits_tp>
enum class mysql::sets::Interval::Check_end
strongprivate

Whether assert_consistent needs to check the end boundary.

Enumerator
no 
yes 

◆ Check_start

template<Is_bounded_set_traits Set_traits_tp>
enum class mysql::sets::Interval::Check_start
strongprivate

Whether assert_consistent needs to check the start boundary.

Enumerator
no 
yes 

Constructor & Destructor Documentation

◆ Interval() [1/3]

template<Is_bounded_set_traits Set_traits_tp>
mysql::sets::Interval< Set_traits_tp >::Interval ( const Element_t start_arg,
const Element_t exclusive_end_arg 
)
inlineexplicitprotected

Construct an interval with the given values for start and exclusive end.

Exceptions
std::domain_errorif the values are out of range or out of order.

◆ Interval() [2/3]

template<Is_bounded_set_traits Set_traits_tp>
mysql::sets::Interval< Set_traits_tp >::Interval ( const Element_t singleton)
inlineexplicitprotected

Construct a singleton interval.

Exceptions
std::domain_errorif the value is out of range.

◆ Interval() [3/3]

template<Is_bounded_set_traits Set_traits_tp>
mysql::sets::Interval< Set_traits_tp >::Interval ( )
inline

Member Function Documentation

◆ assert_consistent()

template<Is_bounded_set_traits Set_traits_tp>
template<Check_start check_start = Check_start::yes, Check_end check_end = Check_end::yes>
void mysql::sets::Interval< Set_traits_tp >::assert_consistent ( Element_t  start_arg,
Element_t  exclusive_end_arg 
)
inlineprivate

Check that the given values are in range and in order.

Template Parameters
check_startIf yes, check that the start value is in range.
check_endIf yes, check that the end value is in range.
Exceptions
std::domain_errorif the values are out of range or out of order.

◆ assign()

template<Is_bounded_set_traits Set_traits_tp>
Return_status_t mysql::sets::Interval< Set_traits_tp >::assign ( const Element_t start_arg,
const Element_t exclusive_end_arg 
)
inline

Set the start and exclusive end to the given values.

Returns
ok on success, error if the values are out of range or out of order.

◆ set_exclusive_end()

template<Is_bounded_set_traits Set_traits_tp>
Return_status_t mysql::sets::Interval< Set_traits_tp >::set_exclusive_end ( const Element_t exclusive_end_arg)
inline

Set the exclusive end to the given value.

Returns
ok on success, error if the value is out of range or out of order.

◆ set_start()

template<Is_bounded_set_traits Set_traits_tp>
Return_status_t mysql::sets::Interval< Set_traits_tp >::set_start ( const Element_t start_arg)
inline

Set the start to the given value.

Returns
ok on success, error if the value is out of range or out of order.

◆ throwing_assign()

template<Is_bounded_set_traits Set_traits_tp>
void mysql::sets::Interval< Set_traits_tp >::throwing_assign ( const Element_t start_arg,
const Element_t exclusive_end_arg 
)
inline

Set the start and exclusive end to the given values.

Exceptions
std::domain_errorif the values are out of range or out of order.

◆ throwing_make() [1/2]

template<Is_bounded_set_traits Set_traits_tp>
static Interval mysql::sets::Interval< Set_traits_tp >::throwing_make ( const Element_t singleton)
inlinestatic

Construct a singleton interval.

Exceptions
std::domain_errorif the value is out of range.

◆ throwing_make() [2/2]

template<Is_bounded_set_traits Set_traits_tp>
static Interval mysql::sets::Interval< Set_traits_tp >::throwing_make ( const Element_t start_arg,
const Element_t exclusive_end_arg 
)
inlinestatic

Construct an interval with the given values for start and exclusive end.

Exceptions
std::domain_errorif the values are out of range or out of order.

◆ throwing_set_exclusive_end()

template<Is_bounded_set_traits Set_traits_tp>
void mysql::sets::Interval< Set_traits_tp >::throwing_set_exclusive_end ( const Element_t exclusive_end_arg)
inline

Set the exclusive end to the given value.

Exceptions
std::domain_errorif the value is out of range or out of order.

◆ throwing_set_start()

template<Is_bounded_set_traits Set_traits_tp>
void mysql::sets::Interval< Set_traits_tp >::throwing_set_start ( const Element_t start_arg)
inline

Set the start to the given value.

Exceptions
std::domain_errorif the value is out of range or out of order.

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