TeiaCareSDK  v0.1.0
TeiaCareSDK is a collection of reusable C++ components
Loading...
Searching...
No Matches
tc::sdk::size< T > Class Template Reference

2D size specified by a pair of width/height dimensions. More...

#include <size.hpp>

Public Member Functions

constexpr size ()=default
 Default Constructor. Creates a default tc::sdk::size instance.
 
constexpr size (const size &)=default
 Copy Constructor. Copy a tc::sdk::size instance into another one.
 
constexpr size (size &&)=default
 Move Constructor. Copy a tc::sdk::size instance into another one.
 
constexpr size (T w, T h) noexcept
 Constructor. Creates tc::sdk::size instance with given width and height dimensions.
 
sizeoperator= (const size &)=default
 Assignment operator. Assign a tc::sdk::size instance to another one.
 
sizeoperator= (size &&)=default
 Move assignment operator. Assign a tc::sdk::size instance to another one.
 
constexpr bool operator== (const size &other) const noexcept
 Equality operator.
 
constexpr bool operator!= (const size &other) const noexcept
 Inequality operator.
 
constexpr bool is_null () const noexcept
 Check if the size is the null.
 
constexprwidth () const noexcept
 Width dimension getter.
 
constexprheight () const noexcept
 Height dimension getter.
 
void set_width (T width) noexcept
 Width coordinate setter. Set the width dimension of the size.
 
void set_height (T height) noexcept
 Height coordinate setter. Set the height dimension of the size.
 
constexpr std::string to_string () const
 Get the size string representation.
 

Friends

std::ostream & operator<< (std::ostream &stream, const size &s)
 Output stream operator.
 

Detailed Description

template<typename T>
class tc::sdk::size< T >

2D size specified by a pair of width/height dimensions.

Template Parameters
TDimensions type

Definition at line 28 of file size.hpp.

Constructor & Destructor Documentation

◆ size()

template<typename T >
constexpr tc::sdk::size< T >::size ( w,
h 
)
inlineexplicitconstexprnoexcept

Constructor. Creates tc::sdk::size instance with given width and height dimensions.

Parameters
wthe width of the size.
hthe height of the size.

Definition at line 51 of file size.hpp.

Member Function Documentation

◆ operator==()

template<typename T >
constexpr bool tc::sdk::size< T >::operator== ( const size< T > &  other) const
inlineconstexprnoexcept

Equality operator.

Parameters
otherthe size to compare against.
Returns
true if the two sizes have the same dimensions.

Definition at line 72 of file size.hpp.

◆ operator!=()

template<typename T >
constexpr bool tc::sdk::size< T >::operator!= ( const size< T > &  other) const
inlineconstexprnoexcept

Inequality operator.

Parameters
otherthe size to compare against.
Returns
true if the two sizes have the different dimensions.

Definition at line 82 of file size.hpp.

◆ is_null()

template<typename T >
constexpr bool tc::sdk::size< T >::is_null ( ) const
inlineconstexprnoexcept

Check if the size is the null.

Returns
true if both width and height are zero.

Definition at line 91 of file size.hpp.

◆ width()

template<typename T >
constexpr T tc::sdk::size< T >::width ( ) const
inlineconstexprnoexcept

Width dimension getter.

Returns
Width dimension of the size.

Definition at line 100 of file size.hpp.

◆ height()

template<typename T >
constexpr T tc::sdk::size< T >::height ( ) const
inlineconstexprnoexcept

Height dimension getter.

Returns
Height dimension of the size.

Definition at line 109 of file size.hpp.

◆ set_width()

template<typename T >
void tc::sdk::size< T >::set_width ( width)
inlinenoexcept

Width coordinate setter. Set the width dimension of the size.

Definition at line 117 of file size.hpp.

◆ set_height()

template<typename T >
void tc::sdk::size< T >::set_height ( height)
inlinenoexcept

Height coordinate setter. Set the height dimension of the size.

Definition at line 125 of file size.hpp.

◆ to_string()

template<typename T >
constexpr std::string tc::sdk::size< T >::to_string ( ) const
inlineconstexpr

Get the size string representation.

Returns
String representation of the current size.

Definition at line 134 of file size.hpp.

Friends And Related Symbol Documentation

◆ operator<<

template<typename T >
std::ostream & operator<< ( std::ostream &  stream,
const size< T > &  s 
)
friend

Output stream operator.

Parameters
streamthe output stream to write into.
sthe size object to stream.
Returns
reference to the output stream operator, with the size string representation written into it.

Definition at line 145 of file size.hpp.


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