Google OR-Tools v9.14
a fast and portable software suite for combinatorial optimization
Loading...
Searching...
No Matches
operations_research::math_opt::ElementId< element_type > Class Template Referencefinal

A strongly typed element id. Value type. More...

#include <elements.h>

Public Types

using ValueType = int64_t

Public Member Functions

constexpr ElementId ()
 Constructs an invalid element id.
constexpr ElementId (int64_t id)
 Constructs a valid element id. DCHECKs that id is non-negative.
constexpr bool IsValid () const
int64_t value () const
 Returns the raw id value.
ElementId Next () const
ElementId operator++ ()

Static Public Member Functions

static constexpr ElementType type ()

Friends

bool operator== (const ElementId &lhs, const ElementId &rhs)
bool operator!= (const ElementId &lhs, const ElementId &rhs)
bool operator< (const ElementId &lhs, const ElementId &rhs)
bool operator<= (const ElementId &lhs, const ElementId &rhs)
bool operator> (const ElementId &lhs, const ElementId &rhs)
bool operator>= (const ElementId &lhs, const ElementId &rhs)
template<typename H>
AbslHashValue (H h, const ElementId &a)

Detailed Description

template<ElementType element_type>
class operations_research::math_opt::ElementId< element_type >

A strongly typed element id. Value type.

Definition at line 64 of file elements.h.

Member Typedef Documentation

◆ ValueType

template<ElementType element_type>
using operations_research::math_opt::ElementId< element_type >::ValueType = int64_t

Definition at line 125 of file elements.h.

Constructor & Destructor Documentation

◆ ElementId() [1/2]

template<ElementType element_type>
operations_research::math_opt::ElementId< element_type >::ElementId ( )
inlineconstexpr

Constructs an invalid element id.

Definition at line 67 of file elements.h.

◆ ElementId() [2/2]

template<ElementType element_type>
operations_research::math_opt::ElementId< element_type >::ElementId ( int64_t id)
inlineexplicitconstexpr

Constructs a valid element id. DCHECKs that id is non-negative.

Definition at line 70 of file elements.h.

Member Function Documentation

◆ IsValid()

template<ElementType element_type>
bool operations_research::math_opt::ElementId< element_type >::IsValid ( ) const
inlineconstexpr

Definition at line 74 of file elements.h.

◆ Next()

template<ElementType element_type>
ElementId operations_research::math_opt::ElementId< element_type >::Next ( ) const
inline

We don't support addition between ElementIds: what does it mean to add indices ? We do support getting the next element id though.

Definition at line 107 of file elements.h.

◆ operator++()

template<ElementType element_type>
ElementId operations_research::math_opt::ElementId< element_type >::operator++ ( )
inline

MakeStrongIntRange() relies on operator++ being present. Prefer the more explicit Next() in general.

Definition at line 114 of file elements.h.

◆ type()

template<ElementType element_type>
constexpr ElementType operations_research::math_opt::ElementId< element_type >::type ( )
inlinestaticconstexpr

Definition at line 79 of file elements.h.

◆ value()

template<ElementType element_type>
int64_t operations_research::math_opt::ElementId< element_type >::value ( ) const
inline

Returns the raw id value.

Definition at line 77 of file elements.h.

◆ AbslHashValue

template<ElementType element_type>
template<typename H>
H AbslHashValue ( H h,
const ElementId< element_type > & a )
friend

Definition at line 121 of file elements.h.

◆ operator!=

template<ElementType element_type>
bool operator!= ( const ElementId< element_type > & lhs,
const ElementId< element_type > & rhs )
friend

Definition at line 85 of file elements.h.

◆ operator<

template<ElementType element_type>
bool operator< ( const ElementId< element_type > & lhs,
const ElementId< element_type > & rhs )
friend

Definition at line 89 of file elements.h.

◆ operator<=

template<ElementType element_type>
bool operator<= ( const ElementId< element_type > & lhs,
const ElementId< element_type > & rhs )
friend

Definition at line 93 of file elements.h.

◆ operator==

template<ElementType element_type>
bool operator== ( const ElementId< element_type > & lhs,
const ElementId< element_type > & rhs )
friend

Definition at line 81 of file elements.h.

◆ operator>

template<ElementType element_type>
bool operator> ( const ElementId< element_type > & lhs,
const ElementId< element_type > & rhs )
friend

Definition at line 97 of file elements.h.

◆ operator>=

template<ElementType element_type>
bool operator>= ( const ElementId< element_type > & lhs,
const ElementId< element_type > & rhs )
friend

Definition at line 101 of file elements.h.


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