21 #ifndef _MADARA_NO_KARL_
53 "KnowledgeBase::wait:"
55 expression.
logic.c_str());
60 "KnowledgeBase::wait:"
61 " completed first eval to get %s\n",
72 "KnowledgeBase::wait:"
73 " last value didn't result in success\n");
91 "KnowledgeBase::wait:"
93 expression.
logic.c_str());
98 "KnowledgeBase::wait:"
99 " completed eval to get %s\n",
111 "KnowledgeBase::wait:"
112 " Evaluate did not succeed. Timeout occurred\n");
121 else if (
impl_.get())
123 result =
impl_->wait(expression, settings);
utility::EpochEnforcer< std::chrono::steady_clock > EpochEnforcer
#define madara_logger_log(loggering, level,...)
Fast version of the madara::logger::log method.
madara::knowledge::KnowledgeRecord evaluate(const madara::knowledge::KnowledgeUpdateSettings &settings=knowledge::KnowledgeUpdateSettings())
Evaluates the expression tree.
Compiled, optimized KaRL logic.
std::string logic
the logic that was compiled
madara::expression::ExpressionTree expression
the expression tree
A thread-safe guard for a context or knowledge base.
int send_modifieds(const std::string &prefix="KnowledgeBase::send_modifieds", const EvalSettings &settings=EvalSettings::SEND)
Sends all modified variables through the attached transports.
madara::knowledge::KnowledgeRecord wait(const std::string &expression, const WaitSettings &settings=WaitSettings())
Waits for an expression to be non-zero.
ThreadSafeContext * context_
A knowledge base can also be a facade for another knowledge base.
std::shared_ptr< KnowledgeBaseImpl > impl_
Pointer to actual implementation, i.e., the "bridge", which is reference counted to automate memory m...
This class encapsulates an entry in a KnowledgeBase.
std::string to_string(const std::string &delimiter=", ") const
converts the value to a string.
Integer to_integer(void) const
converts the value to an integer.
logger::Logger & get_logger(void) const
Gets the logger used for information printing.
void signal(bool lock=true) const
Signals that this thread is done with the context.
void print(unsigned int level) const
Atomically prints all variables and values in the context.
void wait_for_change(bool extra_release=false)
Wait for a change to happen to the context.
Enforces a periodic epoch.
bool is_done(void) const
Checks to see if max duration is finished.
void sleep_until_next(void)
Sleeps until the next epoch.
Provides functions and classes for the distributed knowledge base.
Provides utility functions and classes for common tasks and needs.
Copyright(c) 2020 Galois.
std::string post_print_statement
Statement to print after evaluations.
std::string pre_print_statement
Statement to print before evaluations.
Encapsulates settings for a wait statement.
double max_wait_time
Maximum time to wait for an expression to become true (in seconds)
double poll_frequency
Frequency to poll an expression for truth (in seconds)