Rose
Public Member Functions | Public Attributes | Static Public Attributes | List of all members
rose::Size Class Reference

A size in integer dimensions. More...

#include <Types.h>

Inheritance diagram for rose::Size:
Inheritance graph
[legend]
Collaboration diagram for rose::Size:
Collaboration graph
[legend]

Public Member Functions

constexpr Size (int W, int H) noexcept
 
constexpr Size (const Size &p)=default
 
constexpr Size (Size &&p)=default
 
constexpr Sizeoperator= (const Size &p)=default
 
constexpr Sizeoperator= (Size &&p)=default
 
constexpr Size (int size) noexcept
 
constexpr Size (const std::tuple< int, int > &size) noexcept
 
constexpr Sizeoperator= (std::tuple< int, int > &size) noexcept
 
 operator bool () const
 
bool operator!= (const Size &other) const noexcept
 
bool operator== (const Size &other) const noexcept
 
bool operator< (const Size &other) const noexcept
 
bool operator<= (const Size &other) const noexcept
 
bool operator>= (const Size &other) const noexcept
 
Size operator+ (const Size &other) const noexcept
 
Size operator- (const Size &other) const noexcept
 
Size operator/ (const int divisor) const
 
int & primary (Orientation o) noexcept
 
int & secondary (Orientation o) noexcept
 
constexpr int primary (Orientation o) const noexcept
 
constexpr int secondary (Orientation o) const noexcept
 
constexpr Size (std::array< int, 2 > value) noexcept
 Constructor sets value to contents of an array.
 
constexpr Size (int value=0) noexcept
 Default constructor initializes width and height to 0 or to a specified value.
 
constexpr Size (int width, int height) noexcept
 Constructor sets value to descrete values.
 
constexpr Size (const Size &)=default
 Copy constructor.
 
constexpr Size (Size &&)=default
 Move constructor.
 
constexpr Sizeoperator= (const Size &)=default
 Copy assignment.
 
constexpr Sizeoperator= (Size &&)=default
 Move assignment.
 
constexpr Size (const std::tuple< int, int > &t) noexcept
 
constexpr Sizeoperator= (const std::tuple< int, int > t) noexcept
 Copy assign tuple.
 
constexpr int & width ()
 Reference accessor for width.
 
constexpr int width () const noexcept
 Value accessor for width.
 
constexpr int & height ()
 Reference accessor for height.
 
constexpr int height () const noexcept
 Value accessor for height.
 
int & primary (Orientation orientation)
 Reference for primary axis value. More...
 
constexpr int primary (Orientation orientation) const noexcept
 Value for primary axis value. More...
 
int & secondary (Orientation orientation)
 Reference for secondary axis value. More...
 
constexpr int secondary (Orientation orientation) const noexcept
 Value for secondary axis value. More...
 
constexpr Size operator+ (const Size &size) const noexcept
 Addition operator.
 
constexpr Size operator- (const Size &size) const noexcept
 Subtraction operator.
 

Public Attributes

int w {0}
 
int h {0}
 

Static Public Attributes

static Size Zero {}
 
static const Size Zero
 A zero size.
 

Detailed Description

A size in integer dimensions.

The size of an object on the screen.

The width (w) is in the direction of the x axis, the height (h) is in the direction of the y axis.

Member Function Documentation

◆ primary() [1/2]

int& rose::Size::primary ( Orientation  orientation)
inline

Reference for primary axis value.

The primary access differs depending on the orientation

◆ primary() [2/2]

constexpr int rose::Size::primary ( Orientation  orientation) const
inlinenoexcept

Value for primary axis value.

The primary access differs depending on the orientation

◆ secondary() [1/2]

int& rose::Size::secondary ( Orientation  orientation)
inline

Reference for secondary axis value.

The secondary access differs depending on the orientation

◆ secondary() [2/2]

constexpr int rose::Size::secondary ( Orientation  orientation) const
inlinenoexcept

Value for secondary axis value.

The secondary access differs depending on the orientation


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