78 std::stringstream result;
85 MADARA_GUARD_TYPE guard (
mutex_);
87 result << this->
name_;
109 return new Double (*
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_);
226 MADARA_GUARD_TYPE guard (
mutex_);
241 MADARA_GUARD_TYPE guard (
mutex_);
254 MADARA_GUARD_TYPE guard (
mutex_);
267 MADARA_GUARD_TYPE guard (
mutex_);
280 MADARA_GUARD_TYPE guard (
mutex_);
289 const Double & value)
const 294 MADARA_GUARD_TYPE guard (
mutex_);
305 const Double & value)
const 310 MADARA_GUARD_TYPE guard (
mutex_);
325 MADARA_GUARD_TYPE guard (
mutex_);
338 MADARA_GUARD_TYPE guard (
mutex_);
351 MADARA_GUARD_TYPE guard (
mutex_);
364 MADARA_GUARD_TYPE guard (
mutex_);
385 MADARA_GUARD_TYPE guard (
mutex_);
400 MADARA_GUARD_TYPE guard (
mutex_);
413 MADARA_GUARD_TYPE guard (
mutex_);
426 MADARA_GUARD_TYPE guard (
mutex_);
439 MADARA_GUARD_TYPE guard (
mutex_);
454 MADARA_GUARD_TYPE guard (
mutex_);
465 "Double::is_true: checking for non-zero value\n", (int)result);
470 MADARA_GUARD_TYPE guard (
mutex_);
475 "Double::is_true: final result is %d\n", (int)result);
This class encapsulates an entry in a KnowledgeBase.
This class stores a double within a variable context.
madara::knowledge::KnowledgeRecord dec(const std::string &key, const KnowledgeUpdateSettings &settings=KnowledgeUpdateSettings())
Atomically decrements the value of the variable.
int set(const std::string &key, T &&value, const KnowledgeUpdateSettings &settings=KnowledgeUpdateSettings())
Atomically sets the value of a variable to the specific record.
knowledge::KnowledgeRecord::Integer to_integer(void) const
Returns the value as an integer.
bool is_true(void) const
Checks to see if the record is true.
bool exists(void) const
Checks to see if the variable has ever been assigned a value.
bool operator==(type value) const
Checks for equality.
VariableReference get_ref(const std::string &key, const KnowledgeReferenceSettings &settings=knowledge::KnowledgeReferenceSettings(false))
Retrieves the value of a variable.
virtual void modify_(void)
Polymorphic modify method used by collection containers.
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.
bool operator<(type value) const
Checks for less than relationship.
type operator++(void)
Increments the value of the variable and returns the result.
This class stores variables and their values for use by any entity needing state information in a thr...
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 ...
knowledge::KnowledgeRecord to_record(void) const
Returns the value as a knowledge::KnowledgeRecord.
MADARA_LOCK_TYPE mutex_
guard for access and changes
#define madara_logger_log(logger, level,...)
Fast version of the madara::logger::log method.
bool exists(const std::string &key, const KnowledgeReferenceSettings &settings=KnowledgeReferenceSettings()) const
Atomically checks to see if a variable already exists.
void exchange(containers::Double &other)
Exchanges the integer at this location with the integer at another location.
bool operator>(type value) const
Checks for greater than relationship.
ThreadSafeContext * context_
Variable context that we are modifying.
virtual ~Double()
Destructor.
bool is_false(void) const
Determines if the value is zero.
A thread-safe guard for a context or knowledge base.
double type
trait that describes the value type
std::string get_debug_info(void)
Returns the type of the container along with name and any other useful information.
type operator+=(type value)
Increments by a value.
type operator-=(type value)
Decrements by a value.
This class provides a distributed knowledge base to users.
madara::knowledge::KnowledgeRecord inc(const std::string &key, const KnowledgeUpdateSettings &settings=KnowledgeUpdateSettings())
Atomically increments the value of the variable.
bool operator!=(type value) const
Checks for inequality.
type operator*(void) const
Returns the value of the variable.
VariableReference variable_
Variable reference.
Double(const KnowledgeUpdateSettings &settings=KnowledgeUpdateSettings())
Default constructor.
std::string to_string(void) const
Returns the value as a string.
void set_quality(uint32_t quality, const KnowledgeReferenceSettings &settings=KnowledgeReferenceSettings(false))
Sets the quality of writing to the variable.
bool operator<=(type value) const
Checks for less than or equal to relationship.
bool operator>=(type value) const
Checks for greater than or equal to relationship.
Integer to_integer(void) const
converts the value to an integer
virtual std::string get_debug_info_(void)
Returns the type of the container along with name and any other useful information.
ThreadSafeContext & get_context(void)
Returns the ThreadSafeContext associated with this Knowledge Base.
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.
bool is_true(void) const
Determines if the value is true.
type operator--(void)
Decrements the value of the variable and returns the result.
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.
logger::Logger & get_logger(void) const
Gets the logger used for information printing.
virtual bool is_true_(void) const
Polymorphic is true method which can be used to determine if all values in the container are true...
Settings for applying knowledge updates.
std::string to_string(const std::string &delimiter=", ") const
converts the value to a string.
Provides an interface for external functions into the MADARA KaRL variable settings.
virtual BaseContainer * clone(void) const
Clones this container.
This class is an abstract base class for all containers.
void operator=(const Double &rhs)
Assignment operator.
void modify(void)
Mark the value as modified.
double to_double(void) const
Returns the value as a double (alias of *)
void set_name(const std::string &var_name, KnowledgeBase &knowledge)
Sets the variable name that this refers to.
VariableReference get_ref(const std::string &key, const KnowledgeReferenceSettings &settings=KnowledgeReferenceSettings(false))
Atomically returns a reference to the variable.
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...
ThreadSafeContext * get_context(void)
Returns the ThreadSafeContext associated with this Variables facade.