DUDS
Distributed Update of Data from Something
duds::ui::graphics::GridLocation Struct Reference

The location of a panel in a PriorityGridLayout. More...

#include <GridLayoutConfig.hpp>

Public Member Functions

 GridLocation ()=default
 Construct uninitialized. More...
 
template<typename Int0 , typename Int1 , std::enable_if_t< std::is_integral< Int0 >::value, bool > = true, std::enable_if_t< std::is_integral< Int1 >::value, bool > = true>
constexpr GridLocation (Int0 col, Int1 row)
 Construct with the given location. More...
 
constexpr bool operator!= (const GridLocation &gl) const
 Obvious inequality operator. More...
 
constexpr bool operator== (const GridLocation &gl) const
 Obvious equality operator. More...
 

Public Attributes

std::uint16_t c
 The column position. More...
 
std::uint16_t r
 The row position. More...
 

Detailed Description

The location of a panel in a PriorityGridLayout.

Author
Jeff Jackowski

Definition at line 239 of file GridLayoutConfig.hpp.

Constructor & Destructor Documentation

◆ GridLocation() [1/2]

duds::ui::graphics::GridLocation::GridLocation ( )
default

Construct uninitialized.

◆ GridLocation() [2/2]

template<typename Int0 , typename Int1 , std::enable_if_t< std::is_integral< Int0 >::value, bool > = true, std::enable_if_t< std::is_integral< Int1 >::value, bool > = true>
constexpr duds::ui::graphics::GridLocation::GridLocation ( Int0  col,
Int1  row 
)
inline

Construct with the given location.

The template avoids warnings when the integer type is not std::int16_t. If a value is the result of a computation, it will likely be an int unless explicitly made otherwise, which is annoying when it comes with a warning.

Parameters
colThe column.
rowThe row.

Definition at line 268 of file GridLayoutConfig.hpp.

Member Function Documentation

◆ operator!=()

constexpr bool duds::ui::graphics::GridLocation::operator!= ( const GridLocation gl) const
inline

Obvious inequality operator.

Definition at line 279 of file GridLayoutConfig.hpp.

◆ operator==()

constexpr bool duds::ui::graphics::GridLocation::operator== ( const GridLocation gl) const
inline

Obvious equality operator.

Definition at line 273 of file GridLayoutConfig.hpp.

Member Data Documentation

◆ c

std::uint16_t duds::ui::graphics::GridLocation::c

The column position.

Because each row is independent, columns may not line up between rows.

Definition at line 244 of file GridLayoutConfig.hpp.

Referenced by duds::ui::graphics::PriorityGridLayout::layout(), operator!=(), and operator==().

◆ r

std::uint16_t duds::ui::graphics::GridLocation::r

The row position.

Each row is independent of every other row.

Definition at line 248 of file GridLayoutConfig.hpp.

Referenced by duds::ui::graphics::PriorityGridLayout::layout(), operator!=(), and operator==().


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