79 std::stringstream result;
86 MADARA_GUARD_TYPE guard (
mutex_);
88 result << this->
name_;
110 return new String (*
this);
134 MADARA_GUARD_TYPE guard (
mutex_), guard2 (other.
mutex_);
151 MADARA_GUARD_TYPE guard (
mutex_);
166 MADARA_GUARD_TYPE guard (
mutex_);
181 MADARA_GUARD_TYPE guard (
mutex_);
193 MADARA_GUARD_TYPE guard (
mutex_);
208 MADARA_GUARD_TYPE guard (
mutex_);
224 MADARA_GUARD_TYPE guard (
mutex_);
237 MADARA_GUARD_TYPE guard (
mutex_);
246 const String & value)
const 251 MADARA_GUARD_TYPE guard (
mutex_);
262 const String & value)
const 267 MADARA_GUARD_TYPE guard (
mutex_);
282 MADARA_GUARD_TYPE guard (
mutex_);
295 MADARA_GUARD_TYPE guard (
mutex_);
308 MADARA_GUARD_TYPE guard (
mutex_);
321 MADARA_GUARD_TYPE guard (
mutex_);
342 MADARA_GUARD_TYPE guard (
mutex_);
357 MADARA_GUARD_TYPE guard (
mutex_);
370 MADARA_GUARD_TYPE guard (
mutex_);
383 MADARA_GUARD_TYPE guard (
mutex_);
396 MADARA_GUARD_TYPE guard (
mutex_);
411 MADARA_GUARD_TYPE guard (
mutex_);
422 "String::is_true: checking for non-zero value\n");
427 MADARA_GUARD_TYPE guard (
mutex_);
432 "String::is_true: final result is %d\n", (int)result);
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.
bool is_true(void) const
Checks to see if the record is true.
VariableReference variable_
Variable reference.
virtual bool is_false_(void) const
Polymorphic is false method which can be used to determine if at least one value in the container is ...
VariableReference get_ref(const std::string &key, const KnowledgeReferenceSettings &settings=knowledge::KnowledgeReferenceSettings(false))
Retrieves the value of a variable.
knowledge::KnowledgeRecord to_record(void) const
Returns the value as a knowledge::KnowledgeRecord.
madara::knowledge::KnowledgeRecord get(const std::string &key, const KnowledgeReferenceSettings &settings=KnowledgeReferenceSettings()) const
Atomically returns the value of a variable.
double to_double(void) const
converts the value to a float/double
std::string name_
Prefix of variable.
This class stores a string within a variable context.
This class stores variables and their values for use by any entity needing state information in a thr...
type operator*(void) const
Returns the value of the variable.
bool operator<=(type value) const
Checks for less than or equal to relationship.
MADARA_LOCK_TYPE mutex_
guard for access and changes
virtual BaseContainer * clone(void) const
Clones this container.
#define madara_logger_log(logger, level,...)
Fast version of the madara::logger::log method.
void set_quality(uint32_t quality, const KnowledgeReferenceSettings &settings=KnowledgeReferenceSettings(false))
Sets the quality of writing to the variable.
void exchange(String &other)
Exchanges the string at this location with the string at another location.
bool exists(const std::string &key, const KnowledgeReferenceSettings &settings=KnowledgeReferenceSettings()) const
Atomically checks to see if a variable already exists.
std::string type
trait that describes the value type
virtual ~String()
Destructor.
bool operator==(type value) const
Checks for equality.
bool operator>(type value) const
Checks for greater than relationship.
bool is_false(void) const
Determines if the value is zero.
type operator+=(type value)
Increments by a value.
bool exists(void) const
Checks to see if the variable has ever been assigned a value.
A thread-safe guard for a context or knowledge base.
ThreadSafeContext * context_
Variable context that we are modifying.
virtual bool is_true_(void) const
Polymorphic is true method which can be used to determine if all values in the container are true...
String(const KnowledgeUpdateSettings &settings=KnowledgeUpdateSettings())
Default constructor.
This class provides a distributed knowledge base to users.
bool operator!=(type value) const
Checks for inequality.
Integer to_integer(void) const
converts the value to an integer
std::string get_debug_info(void)
Returns the type of the container along with name and any other useful information.
std::string to_string(void) const
Returns the value as a string (alias of *)
ThreadSafeContext & get_context(void)
Returns the ThreadSafeContext associated with this Knowledge Base.
int set(const VariableReference &variable, const std::string &value, const EvalSettings &settings=EvalSettings(false, false, true, false, false))
Atomically sets the value of a variable to a string.
int set(const std::string &key, madara::knowledge::KnowledgeRecord::Integer value, const KnowledgeUpdateSettings &settings=knowledge::KnowledgeUpdateSettings(false, true, false, false))
Sets the value of a variable.
Provides functions and classes for the distributed knowledge base.
KnowledgeUpdateSettings settings_
Settings for modifications.
VariableReference get_ref(const std::string &key, const KnowledgeReferenceSettings &settings=KnowledgeReferenceSettings())
Atomically returns a reference to the variable.
Settings for applying knowledge updates.
virtual std::string get_debug_info_(void)
Returns the type of the container along with name and any other useful information.
void operator=(const String &rhs)
Assignment operator.
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.
bool operator>=(type value) const
Checks for greater than or equal to relationship.
logger::Logger & get_logger(void) const
Gets the logger used for information printing.
Settings for applying knowledge updates.
std::string to_string(const std::string &delimiter=", ") const
converts the value to a string.
bool is_true(void) const
Determines if the value is true.
Provides an interface for external functions into the MADARA KaRL variable settings.
This class is an abstract base class for all containers.
double to_double(void) const
Returns the value as a double.
madara::knowledge::KnowledgeRecord::Integer to_integer(void) const
Returns the value as an integer.
VariableReference get_ref(const std::string &key, const KnowledgeReferenceSettings &settings=KnowledgeReferenceSettings(false))
Atomically returns a reference to the variable.
virtual void modify_(void)
Polymorphic modify method used by collection containers.
void mark_modified(const VariableReference &variable, const KnowledgeUpdateSettings &settings=KnowledgeUpdateSettings())
Marks the variable reference as updated for the purposes of sending or checkpointing knowledge (for g...
void modify(void)
Mark the value as modified.
void set_name(const std::string &var_name, KnowledgeBase &knowledge)
Sets the variable name that this refers to.
ThreadSafeContext * get_context(void)
Returns the ThreadSafeContext associated with this Variables facade.
bool operator<(type value) const
Checks for less than relationship.