tbx  0.7.6
Public Member Functions | Public Attributes | List of all members
tbx::Size Class Reference

Class to represent a two-dimensional size. More...

#include <size.h>

Public Member Functions

 Size ()
 Construct an uninitialised size object. More...
 
 Size (int w, int h)
 Construct a size object with the given dimensions. More...
 
 Size (const Size &other)
 Copy constructor. More...
 
Sizeoperator= (const Size &other)
 Assign size to be equal to another. More...
 
bool operator== (const Size &other) const
 Check if two size have the same values. More...
 
bool operator!= (const Size &other) const
 Check if two size have a different width or height. More...
 

Public Attributes

int width
 Width of size object.
 
int height
 Height of size object.
 

Detailed Description

Class to represent a two-dimensional size.

Constructor & Destructor Documentation

◆ Size() [1/3]

tbx::Size::Size ( )
inline

Construct an uninitialised size object.

The width and height have undefined values

◆ Size() [2/3]

tbx::Size::Size ( int  w,
int  h 
)
inline

Construct a size object with the given dimensions.

Parameters
wwidth for size object
hheight for size object

◆ Size() [3/3]

tbx::Size::Size ( const Size other)
inline

Copy constructor.

Parameters
othersize object to copy

Member Function Documentation

◆ operator!=()

bool tbx::Size::operator!= ( const Size other) const
inline

Check if two size have a different width or height.

Parameters
otherSize to compare with
Returns
true if sizes do not match

◆ operator=()

Size& tbx::Size::operator= ( const Size other)
inline

Assign size to be equal to another.

Parameters
otherSize to copy
Returns
*this

◆ operator==()

bool tbx::Size::operator== ( const Size other) const
inline

Check if two size have the same values.

Parameters
otherSize to compare with
Returns
true if sizes match

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