MADARA  3.4.1
madara::knowledge::KnowledgeRequirements Class Reference

Holds settings requirements for knowledge, usually in copying. More...

#include <KnowledgeRequirements.h>

Classes

struct  MatchPredicate
 A helper class for matching prefixes and suffixes. More...
 

Public Member Functions

 KnowledgeRequirements ()
 Constructor. More...
 
 KnowledgeRequirements (bool t_clear_knowledge, uint64_t t_clock_threshold=0, std::vector< MatchPredicate > t_predicates={}, uint64_t t_quality_threshold=0, bool t_use_source_clock=false)
 Constructor. More...
 
 KnowledgeRequirements (const KnowledgeRequirements &rhs)
 Copy constructor. More...
 

Public Attributes

bool clear_knowledge
 If true, during loads, clear the KnowledgeBase first. More...
 
uint64_t clock_threshold
 Minimum acceptable clock to accept (0 by default) More...
 
std::vector< MatchPredicatepredicates
 A vector of acceptable predicates to match (prefix and suffix). More...
 
uint64_t quality_threshold
 Minimum acceptable knowledge qualilty to accept (0 by default) More...
 
bool use_source_clock
 Update to the Lamport Clock of the source. More...
 

Detailed Description

Holds settings requirements for knowledge, usually in copying.

Definition at line 25 of file KnowledgeRequirements.h.

Constructor & Destructor Documentation

◆ KnowledgeRequirements() [1/3]

madara::knowledge::KnowledgeRequirements::KnowledgeRequirements ( )
inline

Constructor.

Definition at line 42 of file KnowledgeRequirements.h.

◆ KnowledgeRequirements() [2/3]

madara::knowledge::KnowledgeRequirements::KnowledgeRequirements ( bool  t_clear_knowledge,
uint64_t  t_clock_threshold = 0,
std::vector< MatchPredicate t_predicates = {},
uint64_t  t_quality_threshold = 0,
bool  t_use_source_clock = false 
)
inline

Constructor.

Parameters
t_clear_knowledgeif true, target clears knowledge first
t_clock_thresholdthe minimum source knowledge clock value
t_predicatesa vector of predicates to match
t_quality_thresholdthe minimum source knowledge quality
t_use_source_clockif true, target uses source clock value

Definition at line 59 of file KnowledgeRequirements.h.

◆ KnowledgeRequirements() [3/3]

madara::knowledge::KnowledgeRequirements::KnowledgeRequirements ( const KnowledgeRequirements rhs)
inline

Copy constructor.

Parameters
rhssettings instance to copy

Definition at line 74 of file KnowledgeRequirements.h.

Member Data Documentation

◆ clear_knowledge

bool madara::knowledge::KnowledgeRequirements::clear_knowledge

If true, during loads, clear the KnowledgeBase first.

Definition at line 86 of file KnowledgeRequirements.h.

◆ clock_threshold

uint64_t madara::knowledge::KnowledgeRequirements::clock_threshold

Minimum acceptable clock to accept (0 by default)

Definition at line 91 of file KnowledgeRequirements.h.

◆ predicates

std::vector<MatchPredicate> madara::knowledge::KnowledgeRequirements::predicates

A vector of acceptable predicates to match (prefix and suffix).

Empty elements mean "match all". Consequently, if you have a a predicate with a prefix of "" and a suffix of "", this would simply mean match all records. If you have a prefix of "agent", and an empty suffix, then all variables that start with "agent" will be accepted in the operation. Matching suffixes is more computationally expensive, as it forces all variables to be evaluated. If at all possible, use prefixes. Only use suffixes to filter out prefix results.

Definition at line 104 of file KnowledgeRequirements.h.

◆ quality_threshold

uint64_t madara::knowledge::KnowledgeRequirements::quality_threshold

Minimum acceptable knowledge qualilty to accept (0 by default)

Definition at line 109 of file KnowledgeRequirements.h.

◆ use_source_clock

bool madara::knowledge::KnowledgeRequirements::use_source_clock

Update to the Lamport Clock of the source.

Definition at line 114 of file KnowledgeRequirements.h.


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