2 #ifndef _MADARA_CONTAINERS_BARRIER_H_ 3 #define _MADARA_CONTAINERS_BARRIER_H_ 5 #ifndef _MADARA_NO_KARL_ 9 #include "madara/LockType.h" 111 void operator= (
const Barrier & rhs);
117 size_t get_id (
void)
const;
123 size_t get_participants (
void)
const;
131 return to_integer ();
138 void set (type value);
181 type operator= (type value);
211 double to_double (
void)
const;
245 void set_quality (uint32_t quality,
254 void resize (
size_t id = 0,
size_t participants = 1);
278 bool is_true (
void)
const;
284 bool is_false (
void)
const;
292 virtual bool is_true_ (
void)
const;
298 virtual bool is_false_ (
void)
const;
308 virtual void modify_ (
void);
324 void build_aggregate_barrier (
void);
332 return context_->evaluate (aggregate_barrier_, no_harm).to_integer ();
338 void build_var (
void);
343 void init_noharm (
void);
386 #endif // _MADARA_NO_KARL_ 389 #endif // _MADARA_CONTAINERS_BARRIER_H_ This class encapsulates an entry in a KnowledgeBase.
knowledge::KnowledgeRecord::Integer type
trait that describes the value type
This class stores variables and their values for use by any entity needing state information in a thr...
size_t id_
id of this barrier in the barrier ring
Optimized reference to a variable within the knowledge base.
Compiled, optimized KaRL logic.
Provides container classes for fast knowledge base access and mutation.
ThreadSafeContext * context_
Variable context that we are modifying.
CompiledExpression aggregate_barrier_
Expression for aggregating barrier in one atomic operation.
VariableReference variable_
Variable reference.
This class provides a distributed knowledge base to users.
type barrier_result(void) const
Checks if current barrier is successful.
auto operator==(const Tracked< T > &lhs, const Tracked< U > &rhs) -> decltype(lhs.get()==rhs.get())
auto operator!=(const Tracked< T > &lhs, const Tracked< U > &rhs) -> decltype(lhs.get()!=rhs.get())
type get_round(void) const
Returns the current barrier round.
Encapsulates settings for an evaluation statement.
size_t participants_
the number of participants in the barrier ring
std::string variable_name_
Holder for variable name to quickly refresh modified status.
Provides functions and classes for the distributed knowledge base.
EvalSettings no_harm
Settings we'll use for all evaluations.
Settings for applying knowledge updates.
Copyright (c) 2015 Carnegie Mellon University.
This class stores an integer within a variable context.
Settings for applying knowledge updates.
Provides an interface for external functions into the MADARA KaRL variable settings.
This class is an abstract base class for all containers.