OpenTwin 0.1
OpenTwin
 
Loading...
Searching...
No Matches
ot::Size2D Class Reference

2D Size with integer values More...

#include "Size2D.h"

Inheritance diagram for ot::Size2D:
ot::Serializable

Public Member Functions

 Size2D ()
 
 Size2D (int _w, int _h)
 
 Size2D (const Size2D &_other)
 
virtual ~Size2D ()
 
Size2Doperator= (const Size2D &_other)
 
bool operator== (const Size2D &_other) const
 
bool operator!= (const Size2D &_other) const
 
virtual void addToJsonObject (JsonValue &_object, JsonAllocator &_allocator) const override
 Add the object contents to the provided JSON object.
 
virtual void setFromJsonObject (const ConstJsonObject &_object) override
 Will set the object contents from the provided JSON object.
 
bool isValid (void) const
 Returns true if the width and height are greater or equal 0.
 
void setWidth (int _w)
 Set width.
 
int width (void) const
 Return the width.
 
void setHeight (int _h)
 Set height.
 
int height (void) const
 Return the height.
 
- Public Member Functions inherited from ot::Serializable
 Serializable ()
 
virtual ~Serializable ()
 
virtual void addToJsonObject (ot::JsonValue &_object, ot::JsonAllocator &_allocator) const =0
 Add the object contents to the provided JSON object.
 

Detailed Description

2D Size with integer values

Constructor & Destructor Documentation

◆ Size2D() [1/3]

ot::Size2D::Size2D ( )
inline

◆ Size2D() [2/3]

ot::Size2D::Size2D ( int _w,
int _h )
inline

◆ Size2D() [3/3]

ot::Size2D::Size2D ( const Size2D & _other)
inline

◆ ~Size2D()

virtual ot::Size2D::~Size2D ( )
inlinevirtual

Member Function Documentation

◆ addToJsonObject()

void ot::Size2D::addToJsonObject ( JsonValue & _object,
JsonAllocator & _allocator ) const
overridevirtual

Add the object contents to the provided JSON object.

Parameters
_documentThe JSON document (used to get the allocator)
_objectThe JSON object to add the contents to

◆ height()

int ot::Size2D::height ( void ) const
inline

Return the height.

◆ isValid()

bool ot::Size2D::isValid ( void ) const
inline

Returns true if the width and height are greater or equal 0.

◆ operator!=()

bool ot::Size2D::operator!= ( const Size2D & _other) const
inline

◆ operator=()

Size2D & ot::Size2D::operator= ( const Size2D & _other)
inline

◆ operator==()

bool ot::Size2D::operator== ( const Size2D & _other) const
inline

◆ setFromJsonObject()

void ot::Size2D::setFromJsonObject ( const ConstJsonObject & _object)
overridevirtual

Will set the object contents from the provided JSON object.

Parameters
_objectThe JSON object containing the information
Exceptions
Willthrow an exception if the provided object is not valid (members missing or invalid types)

Implements ot::Serializable.

◆ setHeight()

void ot::Size2D::setHeight ( int _h)
inline

Set height.

Parameters
_hHeight to set

◆ setWidth()

void ot::Size2D::setWidth ( int _w)
inline

Set width.

Parameters
_wWidth to set

◆ width()

int ot::Size2D::width ( void ) const
inline

Return the width.


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