15 MADARA_GUARD_TYPE guard (
mutex_);
53 MADARA_GUARD_TYPE guard (
mutex_);
88 MADARA_GUARD_TYPE guard (
mutex_);
107 MADARA_GUARD_TYPE guard (
mutex_);
This class encapsulates an entry in a KnowledgeBase.
int set(const std::string &key, T &&value, const KnowledgeUpdateSettings &settings=KnowledgeUpdateSettings())
Atomically sets the value of a variable to the specific record.
void set_name(const std::string &var_name, KnowledgeBase &knowledge)
Sets the variable name that this refers to.
madara::knowledge::KnowledgeRecord get(const std::string &key, const KnowledgeReferenceSettings &settings=KnowledgeReferenceSettings()) const
Atomically returns the value of a variable.
void set_name(const std::string &var_name, KnowledgeBase &knowledge)
Sets the variable name that this refers to.
bool signal_changes
Toggle whether to signal changes have happened.
Integer tail_
Tail of the queue.
size_t count(void)
Returns the number of records in the queue.
size_t size(void) const
Returns the size of the local vector.
void signal(bool lock=true) const
Signals that this thread is done with the context.
std::vector< VariableReference > vector_
Values of the array.
Integer count_
Count of elements in queue.
knowledge::KnowledgeRecord::Integer increment(knowledge::KnowledgeRecord::Integer base, knowledge::KnowledgeRecord::Integer value)
Increments the base by the value, using size as a boundary.
std::string name_
Prefix of variable.
A thread-safe guard for a context or knowledge base.
ThreadSafeContext * context_
Variable context that we are modifying.
bool enqueue(const knowledge::KnowledgeRecord &record)
Enqueues a record to the end of the queue.
Vector queue_
Underlying array of records.
This class provides a distributed knowledge base to users.
Integer head_
Head of the queue.
knowledge::KnowledgeRecord dequeue(bool wait=true)
Dequeues a record from the front of the queue.
void wait_for_change(bool extra_release=false)
Wait for a change to happen to the context.
KnowledgeUpdateSettings settings_
Settings for modifications.
ThreadSafeContext & get_context(void)
Returns the ThreadSafeContext associated with this Knowledge Base.
Provides functions and classes for the distributed knowledge base.
void set_name(const std::string &var_name, KnowledgeBase &knowledge, int size=-1)
Sets the variable name that this refers to.
Settings for applying knowledge updates.
MADARA_LOCK_TYPE mutex_
guard for access and changes
Provides an interface for external functions into the MADARA KaRL variable settings.
ThreadSafeContext * get_context(void)
Returns the ThreadSafeContext associated with this Variables facade.