Represents a timeout.
More...
#include <timeout.h>
|
Timeout & | operator= (const double &t) |
| Overload of the assignment operator from a double value. More...
|
|
uint32_t | sec () const |
| Return the number of seconds.
|
|
void | setValue (const double &t) |
| Set value from a double. More...
|
|
void | setValue (uint32_t s, uint32_t us) |
| Set the value from the integer part and the decimal part. More...
|
|
| Timeout (uint32_t s=1, uint32_t us=0) |
| Default constructor. More...
|
|
| Timeout (const double &t) |
| Constructor from a double. More...
|
|
uint32_t | usec () const |
| Return the number of microseconds. More...
|
|
double | value () const |
| Return the timeout in seconds.
|
|
Represents a timeout.
- Author
- Pascal JEAN, aka epsilonrt
- Copyright
- GNU Lesser General Public License
◆ Timeout() [1/2]
Modbus::Timeout::Timeout |
( |
uint32_t |
s = 1 , |
|
|
uint32_t |
us = 0 |
|
) |
| |
Default constructor.
- Parameters
-
◆ Timeout() [2/2]
Modbus::Timeout::Timeout |
( |
const double & |
t | ) |
|
Constructor from a double.
- Parameters
-
◆ operator=()
Timeout& Modbus::Timeout::operator= |
( |
const double & |
t | ) |
|
|
inline |
Overload of the assignment operator from a double value.
- Parameters
-
References setValue().
◆ setValue() [1/2]
void Modbus::Timeout::setValue |
( |
const double & |
t | ) |
|
Set value from a double.
- Parameters
-
Referenced by operator=().
◆ setValue() [2/2]
void Modbus::Timeout::setValue |
( |
uint32_t |
s, |
|
|
uint32_t |
us |
|
) |
| |
Set the value from the integer part and the decimal part.
- Parameters
-
s | seconds |
us | microseconds, if this value is greater than 999999, it is adjusted as well as s. |
◆ usec()
uint32_t Modbus::Timeout::usec |
( |
| ) |
const |
|
inline |
Return the number of microseconds.
in the range 0 to 999999.