DataValidatorGroup: add add_new_validator() to dynamically add new validators

This commit is contained in:
Beat Küng
2016-11-01 22:49:20 +01:00
committed by Lorenz Meier
parent ded3b1a690
commit 227938d263
2 changed files with 20 additions and 0 deletions
+7
View File
@@ -48,6 +48,12 @@ public:
DataValidatorGroup(unsigned siblings);
virtual ~DataValidatorGroup();
/**
* Create a new Validator (with index equal to the number of currently existing validators)
* @return the newly created DataValidator or nullptr on error
*/
DataValidator *add_new_validator();
/**
* Put an item into the validator group.
*
@@ -117,6 +123,7 @@ public:
private:
DataValidator *_first; /**< sibling in the group */
uint32_t _timeout_interval_us; /**< currently set timeout */
int _curr_best; /**< currently best index */
int _prev_best; /**< the previous best index */
uint64_t _first_failover_time; /**< timestamp where the first failover occured or zero if none occured */