8 : context_ (0), settings_ (settings)
17 count_ (name +
".count", knowledge, 0),
18 head_ (name +
".head", knowledge, 0),
19 tail_ (name +
".tail", knowledge, 0),
31 count_ (name +
".count", knowledge),
32 head_ (name +
".head", knowledge),
33 tail_ (name +
".tail", knowledge),
46 count_ (name +
".count", knowledge, 0),
47 head_ (name +
".head", knowledge, 0),
48 tail_ (name +
".tail", knowledge, 0),
49 queue_ (name, knowledge, size, false, settings),
60 count_ (name +
".count", knowledge, 0),
61 head_ (name +
".head", knowledge, 0),
62 tail_ (name +
".tail", knowledge, 0),
63 queue_ (name, knowledge, size, false, settings),
101 const Queue & value)
const 108 const Queue & value)
const 113 template<
typename... Args>
126 MADARA_GUARD_TYPE guard (
mutex_);
141 MADARA_GUARD_TYPE guard (
mutex_);
154 MADARA_GUARD_TYPE guard (
mutex_);
167 return (
size_t)(*count_);
176 MADARA_GUARD_TYPE guard (
mutex_);
191 MADARA_GUARD_TYPE guard (
mutex_);
208 MADARA_GUARD_TYPE guard (
mutex_);
This class encapsulates an entry in a KnowledgeBase.
bool operator==(const Queue &value) const
Checks for equality.
Queue(const KnowledgeUpdateSettings &settings=KnowledgeUpdateSettings())
Default constructor.
void resize(int size=-1)
Resizes the queue.
bool emplace(Args &&...args)
Enqueues a new record to the end of the queue.
madara::knowledge::KnowledgeRecord get(const std::string &key, const KnowledgeReferenceSettings &settings=KnowledgeReferenceSettings()) const
Atomically returns the value of a variable.
bool operator!=(const Queue &value) const
Checks for inequality.
void clear(void)
Clears the queue.
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.
std::vector< VariableReference > vector_
Values of the array.
size_t size(void)
Returns the maximum size of the queue.
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.
void set_quality(uint32_t quality, const KnowledgeReferenceSettings &settings=KnowledgeReferenceSettings(false))
Sets the quality of writing to the counter variables.
std::string name_
Prefix of variable.
std::string get_name(void) const
Returns the name of the variable.
A thread-safe guard for a context or knowledge base.
void resize(int size=-1, bool delete_vars=true)
Resizes the vector.
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.
knowledge::KnowledgeRecord inspect(size_t position)
Retrieves a record at a position in the queue.
This class provides a distributed knowledge base to users.
Integer head_
Head of the queue.
KnowledgeUpdateSettings settings_
Settings for modifications.
This class stores thread-safe queue within the knowledge base.
Provides functions and classes for the distributed knowledge base.
void operator=(const Queue &rhs)
Assignment operator.
Settings for applying knowledge updates.
uint32_t set_quality(const std::string &key, uint32_t quality, bool force_update, const KnowledgeReferenceSettings &settings)
Atomically sets quality of this process for a variable.
KnowledgeUpdateSettings set_settings(const KnowledgeUpdateSettings &settings)
Sets the update settings for the variable.
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.