Template Class Limited

Class Documentation

template<class T>
class Limited

Helper class that represents a numeric value with a lower and an upper boundary.

Template Parameters:

T – any type for which a comparison exists.

Public Types

using Datatype = T

Public Functions

Limited() = delete
~Limited() = default
inline Limited(const T lower, const T upper)

Create a new Limited object.

Parameters:
  • lower – Lower boundary used for this Limited object

  • upper – Upper boundary used for this Limited object

inline void setData(const T data)

Set the data field with a given value.

If the given value is out of the configured range, an exception is thrown.

Parameters:

data

inline T getData() const

Returns the data stored in this object.