1 #ifndef _MADARA_KNOWLEDGE_BASE_H
2 #define _MADARA_KNOWLEDGE_BASE_H
20 #include "madara/MadaraExport.h"
31 #ifdef _MADARA_PYTHON_CALLBACKS_
32 #include "madara/Boost.h"
33 #include "boost/python/object.hpp"
138 void activate_transport(
void);
143 void close_transport(
void);
149 size_t get_num_transports(
void);
205 return impl_->share_string(key, settings);
209 return context_->share_string(key, settings);
225 return impl_->share_string(key, settings);
229 return context_->share_string(key, settings);
245 return impl_->share_integers(key, settings);
249 return context_->share_integers(key, settings);
265 return impl_->share_integers(key, settings);
269 return context_->share_integers(key, settings);
285 return impl_->share_doubles(key, settings);
289 return context_->share_doubles(key, settings);
305 return impl_->share_doubles(key, settings);
309 return context_->share_doubles(key, settings);
325 return impl_->share_binary(key, settings);
329 return context_->share_binary(key, settings);
345 return impl_->share_binary(key, settings);
349 return context_->share_binary(key, settings);
391 true,
false,
true,
false,
false));
402 true,
false,
true,
false,
false));
413 true,
false,
true,
false,
false));
424 true,
false,
true,
false,
false));
435 true,
false,
true,
false,
false));
446 true,
false,
true,
false,
false));
457 true,
false,
true,
false,
false));
468 true,
false,
true,
false,
false));
478 true,
false,
true,
false,
false))
480 return set(variable, 1, settings);
492 true,
false,
true,
false,
false));
503 true,
false,
true,
false,
false));
515 true,
false,
true,
false,
false));
528 true,
false,
true,
false,
false));
537 template<typename T, typename std::enable_if<std::is_floating_point<T>::value,
541 true,
false,
true,
false,
false));
551 const std::vector<KnowledgeRecord::Integer>& value,
553 true,
false,
true,
false,
false));
563 std::vector<KnowledgeRecord::Integer>&& value,
565 true,
false,
true,
false,
false));
578 true,
false,
true,
false,
false));
587 template<typename T, typename std::enable_if<std::is_integral<T>::value,
591 true,
false,
true,
false,
false));
604 true,
false,
true,
false,
false));
614 int set_file(
const std::string& key,
const unsigned char* value,
size_t size,
616 true,
false,
true,
false,
false));
626 int set_jpeg(
const std::string& key,
const unsigned char* value,
size_t size,
628 true,
false,
true,
false,
false));
641 true,
false,
true,
false,
false));
654 true,
false,
true,
false,
false));
666 true,
false,
true,
false,
false));
678 true,
false,
true,
false,
false));
705 #ifndef _MADARA_NO_KARL_
789 void define_function(
799 void define_function(
const std::string& name, jobject callable);
802 #ifdef _MADARA_PYTHON_CALLBACKS_
808 void define_function(
const std::string& name, boost::python::object callable);
823 void define_function(
837 template<typename T, typename std::enable_if<std::is_integral<T>::value,
841 true,
false,
true,
false,
false));
854 int set_index(
const std::string& key,
size_t index, T&& value,
856 true,
false,
true,
false,
false));
871 true,
false,
true,
false,
false));
883 const std::vector<KnowledgeRecord::Integer>& value,
885 true,
false,
true,
false,
false));
896 int set(
const std::string& key, std::vector<KnowledgeRecord::Integer>&& value,
898 true,
false,
true,
false,
false));
907 true,
false,
true,
false,
false))
909 return set(key, 1, settings);
921 template<typename T, typename std::enable_if<std::is_floating_point<T>::value,
925 true,
false,
true,
false,
false));
937 int set(
const std::string& key,
const double* value, uint32_t size,
939 true,
false,
true,
false,
false));
950 int set(
const std::string& key,
const std::vector<double>& value,
952 true,
false,
true,
false,
false));
963 int set(
const std::string& key, std::vector<double>&& value,
965 true,
false,
true,
false,
false));
978 true,
false,
true,
false,
false));
991 true,
false,
true,
false,
false));
1000 void set_quality(
const std::string& key, uint32_t quality,
1062 void print(
unsigned int level = 0)
const;
1069 void print_knowledge(
unsigned int level = 0)
const;
1079 void print(
const std::string& statement,
unsigned int level = 0)
const;
1105 const std::string& key_val_delimiter =
"=")
const;
1125 void clear(
bool erase =
false);
1130 void reset_checkpoint(
void)
const;
1135 void clear_map(
void);
1167 size_t attach_transport(
1176 size_t remove_transport(
size_t index);
1198 int get_log_level(
void);
1216 void set_log_level(
int level);
1248 size_t to_vector(
const std::string& subject,
unsigned int start,
1249 unsigned int end, std::vector<KnowledgeRecord>& target);
1262 std::map<std::string, knowledge::KnowledgeRecord>& target);
1281 const std::string& suffix, std::vector<std::string>& next_keys,
1282 std::map<std::string, knowledge::KnowledgeRecord>& result,
1283 bool just_keys =
false);
1314 int64_t save_context(
const std::string& filename)
const;
1331 int64_t save_as_json(
const std::string& filename)
const;
1345 int64_t save_as_karl(
const std::string& filename)
const;
1362 int64_t save_checkpoint(
1363 const std::string& filename,
bool reset_modifieds =
true);
1386 std::unique_ptr<BaseStreamer> streamer)
1390 return impl_->attach_streamer(std::move(streamer));
1394 return context_->attach_streamer(std::move(streamer));
1396 throw_null_context();
1409 int64_t load_context(
const std::string& filename,
bool use_id =
true,
1411 true,
true,
true,
false));
1430 true,
true,
true,
false));
1443 true,
true,
true,
false));
1454 true,
true,
true,
false));
1487 const std::string& prefix =
"KnowledgeBase::send_modifieds",
1497 void clear_modifieds(
void);
1502 void wait_for_change(
void);
1516 "KnowledgeBase as no context or impl set");
1521 template<
typename Callable>
1525 std::forward<Callable>(callable), std::declval<KnowledgeRecord&>()))
1529 return impl_->invoke(key, std::forward<Callable>(callable), settings);
1533 return context_->invoke(key, std::forward<Callable>(callable), settings);
1535 throw_null_context();
1538 template<
typename Callable>
1542 std::forward<Callable>(callable), std::declval<KnowledgeRecord&>()))
1546 return impl_->invoke(key, std::forward<Callable>(callable), settings);
1550 return context_->invoke(key, std::forward<Callable>(callable), settings);
1552 throw_null_context();
1555 template<
typename Callable>
1563 return impl_->invoke(key, std::forward<Callable>(callable), settings);
1567 return context_->invoke(key, std::forward<Callable>(callable), settings);
1569 throw_null_context();
1572 template<
typename Callable>
1580 return impl_->invoke(key, std::forward<Callable>(callable), settings);
1584 return context_->invoke(key, std::forward<Callable>(callable), settings);
1586 throw_null_context();
1589 template<
typename Callable>
1597 return impl_->cinvoke(key, std::forward<Callable>(callable), settings);
1601 return context_->cinvoke(key, std::forward<Callable>(callable), settings);
1603 throw_null_context();
1606 template<
typename Callable>
1614 return impl_->cinvoke(key, std::forward<Callable>(callable), settings);
1618 return context_->cinvoke(key, std::forward<Callable>(callable), settings);
1620 throw_null_context();
1682 template<
typename OutputIterator>
1697 template<
typename OutputIterator,
typename ConstOutputIterator>
1699 ConstOutputIterator out_end,
1715 template<
typename OutputIterator>
1729 template<
typename OutputIterator>
1744 template<
typename OutputIterator,
typename ConstOutputIterator>
1746 ConstOutputIterator out_end,
1762 template<
typename OutputIterator>
1787 template<
typename T>
1812 template<
typename T>
1840 template<
typename T>
1868 template<
typename T>
1895 template<
typename T>
1910 template<
typename OutputIterator>
1927 template<
typename OutputIterator>
2027 template<
typename OutputIterator>
2043 template<
typename OutputIterator,
typename ConstOutputIterator>
2045 ConstOutputIterator out_end,
2061 template<
typename OutputIterator>
2075 template<
typename OutputIterator>
2091 template<
typename OutputIterator,
typename ConstOutputIterator>
2093 ConstOutputIterator out_end,
2109 template<
typename OutputIterator>
2134 template<
typename T>
2159 template<
typename T>
2188 template<
typename T>
2217 template<
typename T>
2244 template<
typename T>
2259 template<
typename OutputIterator>
2261 ssize_t index,
size_t count,
2276 template<
typename OutputIterator>
2292 size_t index,
size_t count,
2326 template<
typename Func>
2331 impl_->for_each(std::forward<Func>(func));
2335 context_->for_each(std::forward<Func>(func));
2342 std::shared_ptr<KnowledgeBaseImpl>
impl_;
const ThreadSafeContext * context_
An exception for attempting to access an invalid context1.
An abstract base class defines a simple abstract implementation of an expression tree node.
Holds settings for checkpoints to load or save.
Compiled, optimized KaRL logic.
This class provides a distributed knowledge base to users.
std::vector< T > get_oldest(const VariableReference &key, size_t count, const KnowledgeReferenceSettings &settings=KnowledgeReferenceSettings()) const
Return the count oldest stored history entries of this record in a vector of the given element type,...
auto get_history(const std::string &key, OutputIterator out, const KnowledgeReferenceSettings &settings=KnowledgeReferenceSettings()) const -> decltype(*out, size_t{})
Copy the stored history of this record to the given output iterator, in order from oldest to newest.
auto invoke(VariableReference key, Callable &&callable, const EvalSettings &settings=EvalSettings()) -> decltype(utility::invoke_(std::forward< Callable >(callable), std::declval< KnowledgeRecord & >()))
std::vector< KnowledgeRecord > get_oldest(const std::string &key, size_t count, const KnowledgeReferenceSettings &settings=KnowledgeReferenceSettings()) const
Return the count oldest stored history entries of this record in a vector.
T get_newest(const VariableReference &key, const KnowledgeReferenceSettings &settings=KnowledgeReferenceSettings()) const
Return the newest stored history entry of this record as the type given (which must support knowledge...
KnowledgeRecord get_history(const VariableReference &key, size_t index, const KnowledgeReferenceSettings &settings=KnowledgeReferenceSettings()) const
Return the given entry in this record's history.
size_t get_newest(const std::string &key, OutputIterator out, size_t count, const KnowledgeReferenceSettings &settings=KnowledgeReferenceSettings()) const
Copy the count newest stored history entries of this record to the given output iterator,...
auto get_newest(const std::string &key, OutputIterator out, ConstOutputIterator out_end, const KnowledgeReferenceSettings &settings=KnowledgeReferenceSettings()) const -> utility::enable_if_<!std::is_arithmetic< ConstOutputIterator >::value, size_t >
Copy the newest stored history entries of this record to the given output iterator,...
auto cinvoke(const VariableReference &key, Callable &&callable, const KnowledgeReferenceSettings &settings=KnowledgeReferenceSettings()) const -> decltype(utility::invoke_(std::forward< Callable >(callable), std::declval< KnowledgeRecord & >()))
auto get_oldest(const std::string &key, OutputIterator out, const KnowledgeReferenceSettings &settings=KnowledgeReferenceSettings()) const -> decltype(*out, size_t{})
Copy the oldest stored history entry of this record to the given output iterator.
void for_each(Func &&func) const
Call given Callable on each element in this KB.
std::shared_ptr< const std::string > share_string(const VariableReference &key, const KnowledgeReferenceSettings &settings=KnowledgeReferenceSettings()) const
size_t get_history_size(const VariableReference &key, const KnowledgeReferenceSettings &settings=KnowledgeReferenceSettings()) const
Return the amount of history this record holds.
auto invoke(const std::string &key, Callable &&callable, const KnowledgeReferenceSettings &settings=KnowledgeReferenceSettings()) const -> decltype(utility::invoke_(std::forward< Callable >(callable), std::declval< KnowledgeRecord & >()))
std::shared_ptr< const std::vector< unsigned char > > share_binary(const std::string &key, const KnowledgeReferenceSettings &settings=KnowledgeReferenceSettings()) const
KnowledgeRecord get_newest(const std::string &key, const KnowledgeReferenceSettings &settings=KnowledgeReferenceSettings()) const
Return the newest stored history entry of this record.
KnowledgeRecord get_oldest(const VariableReference &key, const KnowledgeReferenceSettings &settings=KnowledgeReferenceSettings()) const
Return the oldest stored history entry of this record.
KnowledgeRecord get_history(const std::string &key, size_t index, const KnowledgeReferenceSettings &settings=KnowledgeReferenceSettings()) const
Return the given entry in this record's history.
std::vector< KnowledgeRecord > get_history(const VariableReference &key, size_t index, size_t count, const KnowledgeReferenceSettings &settings=KnowledgeReferenceSettings()) const
Return a copy of the given range of history in a vector.
int set(const VariableReference &variable, T value, const EvalSettings &settings=EvalSettings(true, false, true, false, false))
Atomically sets the value of a variable to an integer.
ThreadSafeContext * context_
A knowledge base can also be a facade for another knowledge base.
std::vector< KnowledgeRecord > get_newest(const VariableReference &key, size_t count, const KnowledgeReferenceSettings &settings=KnowledgeReferenceSettings()) const
Return the count newest stored history entries of this record in a vector.
KnowledgeRecord get_oldest(const std::string &key, const KnowledgeReferenceSettings &settings=KnowledgeReferenceSettings()) const
Return the oldest stored history entry of this record.
std::vector< KnowledgeRecord > get_history(const std::string &key, size_t index, size_t count, const KnowledgeReferenceSettings &settings=KnowledgeReferenceSettings()) const
Return a copy of the given range of history in a vector.
auto get_newest(const VariableReference &key, OutputIterator out, ConstOutputIterator out_end, const KnowledgeReferenceSettings &settings=KnowledgeReferenceSettings()) const -> utility::enable_if_<!std::is_arithmetic< ConstOutputIterator >::value, size_t >
Copy the newest stored history entries of this record to the given output iterator,...
~KnowledgeBase()=default
Destructor.
int set(const std::string &key, const EvalSettings &settings=EvalSettings(true, false, true, false, false))
Atomically sets the value of a variable to an integer 1.
int set_xml(const VariableReference &variable, const char *value, size_t size, const EvalSettings &settings=EvalSettings(true, false, true, false, false))
Atomically sets the value of a variable to an XML string.
void set_history_capacity(const VariableReference &key, size_t size, const EvalSettings &settings=EvalSettings())
Set the capacity of this record's history circular buffer.
T get_newest(const std::string &key, const KnowledgeReferenceSettings &settings=KnowledgeReferenceSettings()) const
Return the newest stored history entry of this record as the type given (which must support knowledge...
auto get_history(const VariableReference &key, OutputIterator out, const KnowledgeReferenceSettings &settings=KnowledgeReferenceSettings()) const -> decltype(*out, size_t{})
Copy the stored history of this record to the given output iterator, in order from oldest to newest.
size_t get_history_capacity(const std::string &key, const KnowledgeReferenceSettings &settings=KnowledgeReferenceSettings()) const
Return the maximum amount of history this record can hold.
auto get_newest(const VariableReference &key, OutputIterator out, const KnowledgeReferenceSettings &settings=KnowledgeReferenceSettings()) const -> decltype(*out, size_t{})
Copy the newest stored history entry of this record to the given output iterator.
std::vector< T > get_newest(const std::string &key, size_t count, const KnowledgeReferenceSettings &settings=KnowledgeReferenceSettings()) const
Return the count newest stored history entries of this record in a vector of the given element type,...
std::vector< KnowledgeRecord > get_oldest(const VariableReference &key, size_t count, const KnowledgeReferenceSettings &settings=KnowledgeReferenceSettings()) const
Return the count oldest stored history entries of this record in a vector.
std::shared_ptr< const std::vector< KnowledgeRecord::Integer > > share_integers(const std::string &key, const KnowledgeReferenceSettings &settings=KnowledgeReferenceSettings()) const
auto get_oldest(const std::string &key, OutputIterator out, ConstOutputIterator out_end, const KnowledgeReferenceSettings &settings=KnowledgeReferenceSettings()) const -> utility::enable_if_<!std::is_arithmetic< ConstOutputIterator >::value, size_t >
Copy the oldest stored history entries of this record to the given output iterator,...
std::vector< KnowledgeRecord > get_history(const VariableReference &key, const KnowledgeReferenceSettings &settings=KnowledgeReferenceSettings()) const
Get a copy of the entire stored history of this record.
int set_text(const VariableReference &variable, const char *value, size_t size, const EvalSettings &settings=EvalSettings(true, false, true, false, false))
Atomically sets the value of a variable to a text file's contents.
T get_oldest(const VariableReference &key, const KnowledgeReferenceSettings &settings=KnowledgeReferenceSettings()) const
Return the oldest stored history entry of this record as the type given (which must support knowledge...
int set(const std::string &key, T value, const EvalSettings &settings=EvalSettings(true, false, true, false, false))
Sets a knowledge variable to a specified value.
std::shared_ptr< const std::vector< unsigned char > > share_binary(const VariableReference &key, const KnowledgeReferenceSettings &settings=KnowledgeReferenceSettings()) const
size_t get_history(const VariableReference &key, OutputIterator out, ssize_t index, size_t count, const KnowledgeReferenceSettings &settings=KnowledgeReferenceSettings()) const
Copy the given range of history to the output iterator given.
size_t get_history_size(const std::string &key, const KnowledgeReferenceSettings &settings=KnowledgeReferenceSettings()) const
Return the amount of history this record holds.
std::vector< KnowledgeRecord > get_newest(const std::string &key, size_t count, const KnowledgeReferenceSettings &settings=KnowledgeReferenceSettings()) const
Return the count newest stored history entries of this record in a vector.
KnowledgeRecord get_newest(const VariableReference &key, const KnowledgeReferenceSettings &settings=KnowledgeReferenceSettings()) const
Return the newest stored history entry of this record.
auto get_oldest(const VariableReference &key, OutputIterator out, const KnowledgeReferenceSettings &settings=KnowledgeReferenceSettings()) const -> decltype(*out, size_t{})
Copy the oldest stored history entry of this record to the given output iterator.
std::vector< T > get_history(const VariableReference &key, const KnowledgeReferenceSettings &settings=KnowledgeReferenceSettings()) const
Get a copy of the entire stored history of this record in a vector of the given element type,...
KnowledgeBase(const KnowledgeBase &original)=default
Copy constructor.
std::shared_ptr< const std::vector< double > > share_doubles(const VariableReference &key, const KnowledgeReferenceSettings &settings=KnowledgeReferenceSettings()) const
std::unique_ptr< BaseStreamer > attach_streamer(std::unique_ptr< BaseStreamer > streamer)
Attach a streaming provider object, inherited from BaseStreamer, such as CheckpointStreamer.
bool has_history(const std::string &key, const KnowledgeReferenceSettings &settings=KnowledgeReferenceSettings()) const
Return true if this record has a circular buffer history.
size_t get_oldest(const VariableReference &key, OutputIterator out, size_t count, const KnowledgeReferenceSettings &settings=KnowledgeReferenceSettings()) const
Copy the count oldest stored history entries of this record to the given output iterator,...
KnowledgeBase & operator=(const KnowledgeBase &original)=default
Assigns another instance's knowledge and settings to this instance.
std::vector< T > get_history(const std::string &key, const KnowledgeReferenceSettings &settings=KnowledgeReferenceSettings()) const
Get a copy of the entire stored history of this record in a vector of the given element type,...
size_t get_oldest(const std::string &key, OutputIterator out, size_t count, const KnowledgeReferenceSettings &settings=KnowledgeReferenceSettings()) const
Copy the count oldest stored history entries of this record to the given output iterator,...
std::shared_ptr< const std::vector< KnowledgeRecord::Integer > > share_integers(const VariableReference &key, const KnowledgeReferenceSettings &settings=KnowledgeReferenceSettings()) const
T get_oldest(const std::string &key, const KnowledgeReferenceSettings &settings=KnowledgeReferenceSettings()) const
Return the oldest stored history entry of this record as the type given (which must support knowledge...
auto cinvoke(const std::string &key, Callable &&callable, const KnowledgeReferenceSettings &settings=KnowledgeReferenceSettings()) const -> decltype(utility::invoke_(std::forward< Callable >(callable), std::declval< KnowledgeRecord & >()))
void clear_history(const std::string &key, const EvalSettings &settings=EvalSettings())
Clear all history for this record, keeping the current value.
size_t get_newest(const VariableReference &key, OutputIterator out, size_t count, const KnowledgeReferenceSettings &settings=KnowledgeReferenceSettings()) const
Copy the count newest stored history entries of this record to the given output iterator,...
std::vector< KnowledgeRecord > get_history(const std::string &key, const KnowledgeReferenceSettings &settings=KnowledgeReferenceSettings()) const
Get a copy of the entire stored history of this record.
void clear_history(const VariableReference &key, const EvalSettings &settings=EvalSettings())
Clear all history for this record, keeping the current value.
size_t get_history_capacity(const VariableReference &key, const KnowledgeReferenceSettings &settings=KnowledgeReferenceSettings()) const
Return the maximum amount of history this record can hold.
std::vector< T > get_newest(const VariableReference &key, size_t count, const KnowledgeReferenceSettings &settings=KnowledgeReferenceSettings()) const
Return the count newest stored history entries of this record in a vector of the given element type,...
bool has_history(const VariableReference &key, const KnowledgeReferenceSettings &settings=KnowledgeReferenceSettings()) const
Return true if this record has a circular buffer history.
std::shared_ptr< const std::string > share_string(const std::string &key, const KnowledgeReferenceSettings &settings=KnowledgeReferenceSettings()) const
std::vector< T > get_oldest(const std::string &key, size_t count, const KnowledgeReferenceSettings &settings=KnowledgeReferenceSettings()) const
Return the count oldest stored history entries of this record in a vector of the given element type,...
void throw_null_context() const
auto invoke(const VariableReference &key, Callable &&callable, const KnowledgeReferenceSettings &settings=KnowledgeReferenceSettings()) const -> decltype(utility::invoke_(std::forward< Callable >(callable), std::declval< KnowledgeRecord & >()))
auto get_newest(const std::string &key, OutputIterator out, const KnowledgeReferenceSettings &settings=KnowledgeReferenceSettings()) const -> decltype(*out, size_t{})
Copy the newest stored history entry of this record to the given output iterator.
auto get_oldest(const VariableReference &key, OutputIterator out, ConstOutputIterator out_end, const KnowledgeReferenceSettings &settings=KnowledgeReferenceSettings()) const -> utility::enable_if_<!std::is_arithmetic< ConstOutputIterator >::value, size_t >
Copy the oldest stored history entries of this record to the given output iterator,...
std::shared_ptr< const std::vector< double > > share_doubles(const std::string &key, const KnowledgeReferenceSettings &settings=KnowledgeReferenceSettings()) const
size_t get_history(const std::string &key, OutputIterator out, ssize_t index, size_t count, const KnowledgeReferenceSettings &settings=KnowledgeReferenceSettings()) const
Copy the given range of history to the output iterator given.
auto invoke(const std::string &key, Callable &&callable, const EvalSettings &settings=EvalSettings()) -> decltype(utility::invoke_(std::forward< Callable >(callable), std::declval< KnowledgeRecord & >()))
std::shared_ptr< KnowledgeBaseImpl > impl_
Pointer to actual implementation, i.e., the "bridge", which is reference counted to automate memory m...
int set(const VariableReference &variable, const EvalSettings &settings=EvalSettings(true, false, true, false, false))
Atomically sets the value of a variable to an integer 1.
void set_history_capacity(const std::string &key, size_t size, const EvalSettings &settings=EvalSettings())
Set the capacity of this record's history circular buffer.
This class encapsulates an entry in a KnowledgeBase.
bool has_history() const
Return true if this record has a circular buffer history.
size_t get_history_capacity() const
Return the maximum amount of history this record can hold.
size_t get_history_size() const
Return the amount of history this record holds.
size_t get_newest(OutputIterator out, size_t count) const
Copy the count newest stored history entries of this record to the given output iterator,...
size_t get_oldest(OutputIterator out, size_t count) const
Copy the count oldest stored history entries of this record to the given output iterator,...
void clear_history()
Clear all history for this record, keeping the current value.
std::vector< KnowledgeRecord > get_history() const
Get a copy of the entire stored history of this record.
void set_history_capacity(size_t size)
Set the capacity of this record's history circular buffer.
Settings for applying knowledge updates.
Settings for applying knowledge updates.
This class stores variables and their values for use by any entity needing state information in a thr...
Optimized reference to a variable within the knowledge base.
Provides an interface for external functions into the MADARA KaRL variable settings.
A multi-threaded logger for logging to one or more destinations.
Base class from which all transports must be derived.
Holds basic transport settings.
Provides functions and classes for the distributed knowledge base.
std::map< std::string, bool > CopySet
Typedef for set of copyable keys.
T get(const KnowledgeRecord &kr)
Get the value of a KnowlegeRecord.
std::vector< KnowledgeRecord > FunctionArguments
::std::map< std::string, KnowledgeRecord > KnowledgeMap
std::vector< VariableReference > VariableReferences
a vector of variable references
Provides knowledge logging services to files and terminals.
MADARA_EXPORT bool exists(const char *originator, uint64_t clock, uint32_t update_number, OriginatorFragmentMap &map)
Checks if a fragment already exists within a fragment map.
Provides utility functions and classes for common tasks and needs.
std::string file_to_string(const std::string &filename)
Reads a file into a string.
ssize_t write_file(const std::string &filename, void *buffer, size_t size)
Writes a file with provided contents.
typename std::enable_if< Pred, T >::type enable_if_
Less verbose synonym for std::enable_if.
constexpr bool is_arithmetic()
Less verbose equivalent for std::is_arithmetic.
auto invoke_(Func func, Arg0 &&arg0) -> decltype(std::forward< Arg0 >(arg0).*func)
int read_file(const std::string &filename, void *&buffer, size_t &size, bool add_zero_char)
Reads a file into a provided void pointer.
Copyright(c) 2020 Galois.
Encapsulates settings for an evaluation statement.
static const EvalSettings SEND
Settings to immediately send modifieds and expand variables.
Holds settings requirements for knowledge, usually in copying.
Encapsulates settings for a wait statement.