2 #ifndef _MADARA_CONTAINERS_BARRIER_H_
3 #define _MADARA_CONTAINERS_BARRIER_H_
7 #include "madara/LockType.h"
99 void operator=(
const Barrier& rhs);
105 size_t get_id(
void)
const;
111 size_t get_participants(
void)
const;
126 void set(
type value);
156 int id,
int participants);
193 double to_double(
void)
const;
227 void set_quality(uint32_t quality,
236 void resize(
size_t id = 0,
size_t participants = 1);
260 bool is_true(
void)
const;
266 bool is_false(
void)
const;
273 virtual bool is_true_(
void)
const;
279 virtual bool is_false_(
void)
const;
289 virtual void modify_(
void);
305 void build_aggregate_barrier(
void);
316 for ( ; last_failed_check_ < participants_ ; ++last_failed_check_)
319 if (barrier_[last_failed_check_] < *barrier_[id_])
322 barrier_[last_failed_check_].read();
325 if (barrier_[last_failed_check_] < *barrier_[id_])
This class provides a distributed knowledge base to users.
This class encapsulates an entry in a KnowledgeBase.
Settings for applying knowledge updates.
Settings for applying knowledge updates.
This class stores variables and their values for use by any entity needing state information in a thr...
Provides an interface for external functions into the MADARA KaRL variable settings.
This class stores an integer within a variable context.
size_t last_failed_check_
id of this barrier in the barrier ring
bool operator==(const Barrier &value) const
Checks for equality.
knowledge::KnowledgeRecord::Integer type
trait that describes the value type
type get_round(void) const
Returns the current barrier round.
type barrier_result(void) const
Checks if current barrier is successful.
size_t participants_
the number of participants in the barrier ring
std::vector< IntegerStaged > barrier_
size_t id_
id of this barrier in the barrier ring
bool operator!=(const Barrier &value) const
Checks for inequality.
ThreadSafeContext * context_
Variable context that we are modifying.
This class is an abstract base class for all containers.
Provides container classes for fast knowledge base access and mutation.
Provides functions and classes for the distributed knowledge base.
Copyright(c) 2020 Galois.