An extension of diagnostic_updater::FrequencyStatusParam that allows passing non-pointer min/max frequency values. If the internal pointers are used, they are correctly handled when copying this object (the new copy will have its own copy of the internal pointers).
More...
#include <topic_status_param.hpp>
|
| FrequencyStatusParam (const ::cras::FrequencyStatusParam &other) |
| Copy values from another object of this type. If it uses the internal pointers, their values are copied and a new set of internal pointers is created for this object, making it independent of the other one. If the other object uses explicit pointer, this object will use pointers to the same memory. More...
|
|
| FrequencyStatusParam (const ::cras::SimpleTopicStatusParamNoHeader ¶ms) |
| Initialize this object from SimpleTopicStatusParam . Internal pointers for min/max rate will be used, so the params object may cease to exist. More...
|
|
| FrequencyStatusParam (const ::diagnostic_updater::FrequencyStatusParam &other) |
| Copy values from the original diagnostic_updater::FrequencyStatusParam . This object will use pointers to the same memory for min/max rate as the other one. More...
|
|
| FrequencyStatusParam (double *min_freq, double *max_freq, double tolerance=0.1, int window_size=5) |
| The original constructor from diagnostic_updater::FrequencyStatusParam. More...
|
|
| FrequencyStatusParam (double min_freq=0.0, double max_freq=::std::numeric_limits< double >::infinity(), double tolerance=0.1, int window_size=5) |
| The added constructor not requiring pointers. More...
|
|
double | getExpectedRate () const |
| Get the expected/average rate. If min and max are the same, their value will be returned. If min rate is non-positive, the max rate is returned. Otherwise, if max rate is infinite, the min rate will be returned. If min is positive and max is finite, their arithmetic mean is returned. More...
|
|
::cras::FrequencyStatusParam & | operator= (const ::cras::FrequencyStatusParam &other) |
| Copy values from another object of this type. If it uses the internal pointers, their values are copied and a new set of internal pointers is created for this object, making it independent of the other one. If the other object uses explicit pointer, this object will use pointers to the same memory. More...
|
|
::cras::FrequencyStatusParam & | operator= (const ::diagnostic_updater::FrequencyStatusParam &other) |
| Copy values from the original diagnostic_updater::FrequencyStatusParam . This object will use pointers to the same memory for min/max rate as the other one. More...
|
|
| FrequencyStatusParam (double *min_freq, double *max_freq, double tolerance=0.1, int window_size=5) |
|
|
double | maxFreq {::std::numeric_limits<double>::infinity()} |
| Maximum frequency. This field is used by the internal pointers if they are used, otherwise it is ignored. More...
|
|
double | minFreq {0.0} |
| Minimum frequency. This field is used by the internal pointers if they are used, otherwise it is ignored. More...
|
|
bool | usesInternalPointers {false} |
| Whether internal pointers are used or not (depends on whether this object was constructed with explicit rate pointers or not). More...
|
|
An extension of diagnostic_updater::FrequencyStatusParam that allows passing non-pointer min/max frequency values. If the internal pointers are used, they are correctly handled when copying this object (the new copy will have its own copy of the internal pointers).
Definition at line 119 of file topic_status_param.hpp.
◆ FrequencyStatusParam() [1/5]
cras::FrequencyStatusParam::FrequencyStatusParam |
( |
double * |
min_freq, |
|
|
double * |
max_freq, |
|
|
double |
tolerance = 0.1 , |
|
|
int |
window_size = 5 |
|
) |
| |
The original constructor from diagnostic_updater::FrequencyStatusParam.
- Parameters
-
[in] | min_freq | Pointer to a double containing the minimum allowed frequency. Cannot be nullptr. |
[in] | max_freq | Pointer to a double containing the maximum allowed frequency. Cannot be nullptr. |
[in] | tolerance | Tolerance of the rate. |
[in] | window_size | Number of updates during which the frequency is computed. |
◆ FrequencyStatusParam() [2/5]
cras::FrequencyStatusParam::FrequencyStatusParam |
( |
double |
min_freq = 0.0 , |
|
|
double |
max_freq = ::std::numeric_limits< double >::infinity() , |
|
|
double |
tolerance = 0.1 , |
|
|
int |
window_size = 5 |
|
) |
| |
|
explicit |
The added constructor not requiring pointers.
- Parameters
-
[in] | min_freq | Minimum allowed frequency. |
[in] | max_freq | Maximum allowed frequency. |
[in] | tolerance | Tolerance of the rate. |
[in] | window_size | Number of updates during which the frequency is computed. |
- Note
- Internal pointers for min/max rate are used.
◆ FrequencyStatusParam() [3/5]
Copy values from another object of this type. If it uses the internal pointers, their values are copied and a new set of internal pointers is created for this object, making it independent of the other one. If the other object uses explicit pointer, this object will use pointers to the same memory.
- Parameters
-
[in] | other | The object to copy from. |
◆ FrequencyStatusParam() [4/5]
Copy values from the original diagnostic_updater::FrequencyStatusParam
. This object will use pointers to the same memory for min/max rate as the other one.
- Parameters
-
[in] | other | The object to copy from. |
◆ FrequencyStatusParam() [5/5]
Initialize this object from SimpleTopicStatusParam
. Internal pointers for min/max rate will be used, so the params
object may cease to exist.
- Parameters
-
[in] | params | The parameters to initialize with. |
◆ copyAdditionalData()
This method handles copying of the internal pointers if they are used.
- Parameters
-
◆ getExpectedRate()
double cras::FrequencyStatusParam::getExpectedRate |
( |
| ) |
const |
Get the expected/average rate. If min and max are the same, their value will be returned. If min rate is non-positive, the max rate is returned. Otherwise, if max rate is infinite, the min rate will be returned. If min is positive and max is finite, their arithmetic mean is returned.
- Returns
- The expected rate (in Hz).
◆ operator=() [1/2]
Copy values from another object of this type. If it uses the internal pointers, their values are copied and a new set of internal pointers is created for this object, making it independent of the other one. If the other object uses explicit pointer, this object will use pointers to the same memory.
- Parameters
-
[in] | other | The object to copy from. |
◆ operator=() [2/2]
Copy values from the original diagnostic_updater::FrequencyStatusParam
. This object will use pointers to the same memory for min/max rate as the other one.
- Parameters
-
[in] | other | The object to copy from. |
◆ maxFreq
double cras::FrequencyStatusParam::maxFreq {::std::numeric_limits<double>::infinity()} |
|
private |
Maximum frequency. This field is used by the internal pointers if they are used, otherwise it is ignored.
Definition at line 199 of file topic_status_param.hpp.
◆ minFreq
double cras::FrequencyStatusParam::minFreq {0.0} |
|
private |
Minimum frequency. This field is used by the internal pointers if they are used, otherwise it is ignored.
Definition at line 196 of file topic_status_param.hpp.
◆ usesInternalPointers
bool cras::FrequencyStatusParam::usesInternalPointers {false} |
|
private |
Whether internal pointers are used or not (depends on whether this object was constructed with explicit rate pointers or not).
Definition at line 203 of file topic_status_param.hpp.
The documentation for this class was generated from the following file: