MADARA  3.4.1
KnowledgeBaseImpl.h
Go to the documentation of this file.
1 #ifndef _MADARA_KNOWLEDGE_BASE_IMPL_H
2 #define _MADARA_KNOWLEDGE_BASE_IMPL_H
3 
11 #include <string>
12 #include <map>
13 
14 #include <ostream>
15 #include <vector>
16 #include <atomic>
17 
24 #include "madara/MadaraExport.h"
28 
29 namespace madara
30 {
31 namespace knowledge
32 {
38 {
39 public:
44 
50  KnowledgeBaseImpl(const std::string& host, int transport);
51 
59  const std::string& host, int transport, const std::string& domain);
60 
66  KnowledgeBaseImpl(const std::string& host,
68 
73 
77  void lock(void);
78 
83  void unlock(void);
84 
88  void activate_transport(void);
89 
94  size_t get_num_transports(void);
95 
99  void close_transport(void);
100 
111  void copy(const KnowledgeBaseImpl& source, const KnowledgeRequirements& reqs,
112  const EvalSettings& settings = EvalSettings());
113 
134  void copy(const KnowledgeBaseImpl& source,
135  const CopySet& copy_set = CopySet(), bool clean_copy = false,
136  const EvalSettings& settings = EvalSettings());
137 
145  const std::string& key, const KnowledgeReferenceSettings& settings =
147 
156  const KnowledgeReferenceSettings& settings =
158 
168  const std::string& key, const KnowledgeReferenceSettings& settings =
170 
175  template<typename K>
176  std::shared_ptr<const std::string> share_string(
177  K&& key, const KnowledgeReferenceSettings& settings =
179  {
180  return map_.share_string(std::forward<K>(key), settings);
181  }
182 
187  template<typename K>
188  std::shared_ptr<const std::vector<KnowledgeRecord::Integer>> share_integers(
189  K&& key, const KnowledgeReferenceSettings& settings =
191  {
192  return map_.share_integers(std::forward<K>(key), settings);
193  }
194 
199  template<typename K>
200  std::shared_ptr<const std::vector<double>> share_doubles(
201  K&& key, const KnowledgeReferenceSettings& settings =
203  {
204  return map_.share_doubles(std::forward<K>(key), settings);
205  }
206 
211  template<typename K>
212  std::shared_ptr<const std::vector<unsigned char>> share_binary(
213  K&& key, const KnowledgeReferenceSettings& settings =
215  {
216  return map_.share_binary(std::forward<K>(key), settings);
217  }
218 
224  void mark_modified(const VariableReference& variable,
226 
232  void mark_modified(const std::string& name,
234 
243  size_t index,
244  const KnowledgeReferenceSettings& settings =
246 
255  const VariableReference& variable, size_t index,
256  const KnowledgeReferenceSettings& settings =
258 
267  std::string expand_statement(const std::string& statement) const;
268 
274  std::string debug_modifieds(void) const;
275 
280  int get_log_level(void);
281 
286  void attach_logger(logger::Logger& logger) const;
287 
292  logger::Logger& get_logger(void) const;
293 
298  void set_log_level(int level);
299 
300 #ifndef _MADARA_NO_KARL_
301 
309  CompiledExpression compile(const std::string& expression);
310 
319 
329  const std::string& expression, const EvalSettings& settings);
330 
340  CompiledExpression& expression, const EvalSettings& settings);
341 
351  const EvalSettings& settings = EvalSettings());
352 
362 
374  const std::string& expression, const WaitSettings& settings);
375 
387  CompiledExpression& expression, const WaitSettings& settings);
388 
394  void define_function(const std::string& name,
396 
403  void define_function(
404  const std::string& name, knowledge::KnowledgeRecord (*func)(const char*,
406 
407 #ifdef _MADARA_JAVA_
413  void define_function(const std::string& name, jobject callable);
414 #endif
415 
416 #ifdef _MADARA_PYTHON_CALLBACKS_
422  void define_function(const std::string& name, boost::python::object callable);
423 #endif
424 
430  void define_function(const std::string& name, const std::string& expression);
431 
437  void define_function(
438  const std::string& name, const CompiledExpression& expression);
439 
440 #endif // _MADARA_NO_KARL_
441 
449  int read_file(const std::string& knowledge_key, const std::string& filename,
450  const EvalSettings& settings = EvalSettings());
451 
458  ssize_t write_file(
459  const std::string& knowledge_key, const std::string& filename);
460 
461  template<typename K, typename V>
462  int set(K&& key, V&& val, const EvalSettings& settings)
463  {
464  int result = map_.set(std::forward<K>(key), std::forward<V>(val), settings);
465 
466  send_modifieds("KnowledgeBaseImpl:set", settings);
467 
468  return result;
469  }
470 
471  template<typename K, typename V>
472  int set_index(K&& key, size_t i, V&& val, const EvalSettings& settings)
473  {
474  int result =
475  map_.set_index(std::forward<K>(key), i, std::forward<V>(val), settings);
476 
477  send_modifieds("KnowledgeBaseImpl:set_index", settings);
478 
479  return result;
480  }
481 
482  template<typename K, typename V>
483  int set(K&& key, const V* arr, size_t size, const EvalSettings& settings)
484  {
485  int result = map_.set(std::forward<K>(key), arr, (uint32_t)size, settings);
486 
487  send_modifieds("KnowledgeBaseImpl:set", settings);
488 
489  return result;
490  }
491 
499  int read_file(const VariableReference& variable, const std::string& filename,
500  const EvalSettings& settings = EvalSettings());
501 
510  int set_text(const VariableReference& variable, const char* value,
511  size_t size, const EvalSettings& settings = EvalSettings());
512 
521  int set_file(const VariableReference& variable, const unsigned char* value,
522  size_t size, const EvalSettings& settings = EvalSettings());
523 
532  int set_jpeg(const VariableReference& variable, const unsigned char* value,
533  size_t size, const EvalSettings& settings = EvalSettings());
534 
543  int set_xml(const VariableReference& variable, const char* value, size_t size,
544  const EvalSettings& settings = EvalSettings());
545 
551 
558  int apply_modified(const EvalSettings& settings = EvalSettings());
559 
567  bool exists(
568  const std::string& key, const KnowledgeReferenceSettings& settings =
570 
578  bool exists(const VariableReference& variable,
580  false)) const;
581 
589  void set_quality(const std::string& key, uint32_t quality,
590  const KnowledgeReferenceSettings& settings =
592 
597  void print(unsigned int level) const;
598 
607  void print(const std::string& statement, unsigned int level) const;
608 
631  void to_string(std::string& target, const std::string& array_delimiter = ",",
632  const std::string& record_delimiter = ";\n",
633  const std::string& key_val_delimiter = "=") const;
634 
644  bool clear(
645  const std::string& key, const KnowledgeReferenceSettings& settings =
647 
661  void clear(bool erase = false);
662 
666  void clear_map(void);
667 
671  void clear_rules(void);
672 
678  void acquire(void);
679 
685  void release(void);
686 
697  size_t attach_transport(madara::transport::Base* transport);
698 
706  size_t attach_transport(
707  const std::string& id, transport::TransportSettings& settings);
708 
715  size_t remove_transport(size_t index);
716 
724 
729  std::string get_id(void);
730 
745  size_t to_vector(const std::string& subject, unsigned int start,
746  unsigned int end, std::vector<KnowledgeRecord>& target);
747 
755  void get_matches(const std::string& prefix, const std::string& suffix,
756  VariableReferences& matches);
757 
768  size_t to_map(const std::string& subject,
769  std::map<std::string, knowledge::KnowledgeRecord>& target);
770 
787  size_t to_map(const std::string& prefix, const std::string& delimiter,
788  const std::string& suffix, std::vector<std::string>& next_keys,
789  std::map<std::string, knowledge::KnowledgeRecord>& result,
790  bool just_keys);
791 
800  knowledge::KnowledgeMap to_map(const std::string& prefix) const;
801 
814 
821  int64_t save_context(const std::string& filename) const;
822 
831  int64_t save_context(CheckpointSettings& settings) const;
832 
838  int64_t save_as_json(const std::string& filename) const;
839 
845  int64_t save_as_json(const CheckpointSettings& settings) const;
846 
852  int64_t save_as_karl(const std::string& filename) const;
853 
859  int64_t save_as_karl(const CheckpointSettings& settings) const;
860 
869  int64_t save_checkpoint(
870  const std::string& filename, bool reset_modifieds = true);
871 
881  int64_t save_checkpoint(CheckpointSettings& settings) const;
882 
892  std::unique_ptr<BaseStreamer> attach_streamer(
893  std::unique_ptr<BaseStreamer> streamer)
894  {
895  return map_.attach_streamer(std::move(streamer));
896  }
897 
908  int64_t load_context(const std::string& filename, bool use_id,
910  true, true, true, false));
911 
926  int64_t load_context(const std::string& filename, FileHeader& meta,
927  bool use_id = true,
929  true, true, true, false));
930 
940  int64_t load_context(CheckpointSettings& checkpoint_settings,
941  const KnowledgeUpdateSettings& update_settings = KnowledgeUpdateSettings(
942  true, true, true, false));
943 
951  KnowledgeRecord evaluate_file(CheckpointSettings& checkpoint_settings,
952  const KnowledgeUpdateSettings& update_settings = KnowledgeUpdateSettings(
953  true, true, true, false));
954 
960  std::string file_to_string(CheckpointSettings& checkpoint_settings);
961 
969  void clear_modifieds(void);
970 
974  void reset_checkpoint(void) const;
975 
980  void add_modifieds(const VariableReferences& modifieds) const;
981 
991 
999  MADARA_EXPORT int send_modifieds(const std::string& prefix,
1000  const EvalSettings& settings = EvalSettings::SEND);
1001 
1005  void wait_for_change(void);
1006 
1016 
1017 private:
1019  {
1021  const char* func;
1023 
1025  {
1026  self->send_modifieds(func, *settings);
1027  }
1028  };
1029 
1030 public:
1031 
1032  template<typename Callable>
1033  auto invoke(const std::string& key, Callable&& callable,
1034  const EvalSettings& settings = EvalSettings())
1035  -> decltype(utility::invoke_(
1036  std::forward<Callable>(callable), std::declval<KnowledgeRecord&>()))
1037  {
1038  ModifiedsSender sender = {this, "KnowledgeBase::invoke", &settings};
1039  return map_.invoke(key, std::forward<Callable>(callable), settings);
1040  }
1041 
1042  template<typename Callable>
1043  auto invoke(const VariableReference& key, Callable&& callable,
1044  const EvalSettings& settings = EvalSettings())
1045  -> decltype(utility::invoke_(
1046  std::forward<Callable>(callable), std::declval<KnowledgeRecord&>()))
1047  {
1048  ModifiedsSender sender = {this, "KnowledgeBase::invoke", &settings};
1049  return map_.invoke(key, std::forward<Callable>(callable), settings);
1050  }
1051 
1052  template<typename Callable>
1053  auto invoke(const std::string& key, Callable&& callable,
1055  const -> decltype(utility::invoke_(
1056  std::forward<Callable>(callable), std::declval<KnowledgeRecord&>()))
1057  {
1058  return map_.invoke(key, std::forward<Callable>(callable), settings);
1059  }
1060 
1061  template<typename Callable>
1062  auto invoke(const VariableReference& key, Callable&& callable,
1064  const -> decltype(utility::invoke_(
1065  std::forward<Callable>(callable), std::declval<KnowledgeRecord&>()))
1066  {
1067  return map_.invoke(key, std::forward<Callable>(callable), settings);
1068  }
1069 
1070  template<typename Callable>
1071  auto cinvoke(const std::string& key, Callable&& callable,
1073  const -> decltype(utility::invoke_(
1074  std::forward<Callable>(callable), std::declval<KnowledgeRecord&>()))
1075  {
1076  return map_.cinvoke(key, std::forward<Callable>(callable), settings);
1077  }
1078 
1079  template<typename Callable>
1080  auto cinvoke(const VariableReference& key, Callable&& callable,
1082  const -> decltype(utility::invoke_(
1083  std::forward<Callable>(callable), std::declval<KnowledgeRecord&>()))
1084  {
1085  return map_.cinvoke(key, std::forward<Callable>(callable), settings);
1086  }
1087 
1097  template<typename Func>
1098  void for_each(Func&& func) const
1099  {
1100  map_.for_each(std::forward<Func>(func));
1101  }
1102 
1103 private:
1107 
1108  mutable MADARA_LOCK_TYPE transport_mutex_;
1109  mutable MADARA_LOCK_TYPE send_mutex_;
1110  mutable MADARA_LOCK_TYPE done_sending_mutex_;
1111 
1112  std::vector<std::shared_ptr<transport::Base>> transports_;
1113 
1117  std::vector<std::shared_ptr<transport::Base>> get_transports()
1118  {
1119  MADARA_GUARD_TYPE transport_guard(transport_mutex_);
1120  return transports_;
1121  }
1122 
1123  bool done_sending_ = false;
1124 };
1125 }
1126 }
1127 
1128 // include the inline functions
1129 #include "KnowledgeBaseImpl.inl"
1130 
1131 #endif // _MADARA_KNOWLEDGE_BASE_IMPL_H
An abstract base class defines a simple abstract implementation of an expression tree node.
Definition: ComponentNode.h:37
Holds settings for checkpoints to load or save.
Compiled, optimized KaRL logic.
Defines a file header which is the default for KaRL checkpointing.
Definition: FileHeader.h:37
This class provides a distributed knowledge base implementation.
std::shared_ptr< const std::vector< double > > share_doubles(K &&key, const KnowledgeReferenceSettings &settings=KnowledgeReferenceSettings()) const
Returns a shared_ptr, sharing with the internal one.
madara::knowledge::KnowledgeRecord retrieve_index(const std::string &key, size_t index, const KnowledgeReferenceSettings &settings=KnowledgeReferenceSettings())
Retrieves a value at a specified index within a knowledge array.
std::string expand_statement(const std::string &statement) const
Expands a statement using variable expansion.
ThreadSafeContext & get_context(void)
Returns the ThreadSafeContext associated with this Knowledge Base.
madara::transport::TransportSettings & transport_settings(void)
Returns a non-const reference to the Transport Settings.
void clear_map(void)
Clears the knowledge base.
void set_log_level(int level)
Sets the log level.
int get_log_level(void)
Gets the log level.
logger::Logger & get_logger(void) const
Gets the logger used for information printing.
std::string debug_modifieds(void) const
Retrieves a stringified list of all modified variables that are ready to send over transport on next ...
void release(void)
Releases a recursive lock on the knowledge base.
int64_t save_as_json(const std::string &filename) const
Saves the context to a file as JSON.
auto invoke(const std::string &key, Callable &&callable, const EvalSettings &settings=EvalSettings()) -> decltype(utility::invoke_(std::forward< Callable >(callable), std::declval< KnowledgeRecord & >()))
std::string get_id(void)
Returns the unique host and ephemeral binding for this Knowlede Base.
madara::knowledge::KnowledgeRecord get(const std::string &key, const KnowledgeReferenceSettings &settings=KnowledgeReferenceSettings())
Retrieves a knowledge value.
void for_each(Func &&func) const
Call given Callable on each element in this KB.
ssize_t write_file(const std::string &knowledge_key, const std::string &filename)
Write a file from the knowledge base to a specified location.
std::shared_ptr< const std::vector< unsigned char > > share_binary(K &&key, const KnowledgeReferenceSettings &settings=KnowledgeReferenceSettings()) const
Returns a shared_ptr, sharing with the internal one.
void print(unsigned int level) const
Prints all knowledge variables and values in the context.
auto cinvoke(const VariableReference &key, Callable &&callable, const KnowledgeReferenceSettings &settings=KnowledgeReferenceSettings()) const -> decltype(utility::invoke_(std::forward< Callable >(callable), std::declval< KnowledgeRecord & >()))
int read_file(const std::string &knowledge_key, const std::string &filename, const EvalSettings &settings=EvalSettings())
Read a file into the knowledge base.
size_t to_vector(const std::string &subject, unsigned int start, unsigned int end, std::vector< KnowledgeRecord > &target)
Fills a vector with Knowledge Records that begin with a common subject and have a finite range of int...
void set_quality(const std::string &key, uint32_t quality, const KnowledgeReferenceSettings &settings=KnowledgeReferenceSettings())
Sets the quality of writing to a certain variable from this entity.
std::string setup_unique_hostport(std::string host="")
Creates a random UUID for unique tie breakers in global ordering.
KnowledgeRecord evaluate_file(CheckpointSettings &checkpoint_settings, const KnowledgeUpdateSettings &update_settings=KnowledgeUpdateSettings(true, true, true, false))
Loads and evaluates a karl script from a file.
size_t attach_transport(madara::transport::Base *transport)
Attaches a transport to the Knowledge Engine.
void activate_transport(void)
Starts the transport mechanism for dissemination if it is closed.
VariableReferences save_modifieds(void) const
Saves the list of modified records to use later for resending.
void clear_rules(void)
Clears the permanent knowledge rules (unimplemented)
auto invoke(const std::string &key, Callable &&callable, const KnowledgeReferenceSettings &settings=KnowledgeReferenceSettings()) const -> decltype(utility::invoke_(std::forward< Callable >(callable), std::declval< KnowledgeRecord & >()))
std::vector< std::shared_ptr< transport::Base > > get_transports()
Atomically retrieve the set of transports.
std::unique_ptr< BaseStreamer > attach_streamer(std::unique_ptr< BaseStreamer > streamer)
Attach a streaming provider object, inherited from BaseStreamer, such as CheckpointStreamer.
std::shared_ptr< const std::string > share_string(K &&key, const KnowledgeReferenceSettings &settings=KnowledgeReferenceSettings()) const
Returns a shared_ptr, sharing with the internal one.
int apply_modified(const EvalSettings &settings=EvalSettings())
Applies current time and modified to all global variables and tries to send them.
void acquire(void)
Acquires the recursive lock on the knowledge base.
void close_transport(void)
Closes the transport mechanism so no dissemination is possible.
int64_t save_context(const std::string &filename) const
Saves the context to a file.
void add_modifieds(const VariableReferences &modifieds) const
Adds a list of VariableReferences to the current modified list.
int set(K &&key, V &&val, const EvalSettings &settings)
void mark_modified(const VariableReference &variable, const KnowledgeUpdateSettings &settings=KnowledgeUpdateSettings())
Marks the variable reference as updated.
size_t to_map(const std::string &subject, std::map< std::string, knowledge::KnowledgeRecord > &target)
Fills a variable map with Knowledge Records that match an expression.
void clear_modifieds(void)
Clear all modifications to the knowledge base.
bool clear(const std::string &key, const KnowledgeReferenceSettings &settings=KnowledgeReferenceSettings())
Clears a variable.
std::shared_ptr< const std::vector< KnowledgeRecord::Integer > > share_integers(K &&key, const KnowledgeReferenceSettings &settings=KnowledgeReferenceSettings()) const
Returns a shared_ptr, sharing with the internal one.
size_t remove_transport(size_t index)
Removes a transport.
std::string file_to_string(CheckpointSettings &checkpoint_settings)
Loads and returns a karl script from a file with encode/decode.
void attach_logger(logger::Logger &logger) const
Attaches a logger to be used for printing.
transport::QoSTransportSettings settings_
size_t get_num_transports(void)
Gets the number of transports.
madara::knowledge::KnowledgeRecord evaluate(const std::string &expression)
Evaluates an expression.
void copy(const KnowledgeBaseImpl &source, const KnowledgeRequirements &reqs, const EvalSettings &settings=EvalSettings())
Copies variables and values from source to this context.
int set_xml(const VariableReference &variable, const char *value, size_t size, const EvalSettings &settings=EvalSettings())
Atomically sets the value of a variable to an XML string.
int set_text(const VariableReference &variable, const char *value, size_t size, const EvalSettings &settings=EvalSettings())
Atomically sets the value of a variable to a text file's contents.
int set_index(K &&key, size_t i, V &&val, const EvalSettings &settings)
VariableReference get_ref(const std::string &key, const KnowledgeReferenceSettings &settings=KnowledgeReferenceSettings())
Atomically returns a reference to the variable.
void unlock(void)
Unlocks the context to allow updates over the network (is only necessary if the context has been expl...
CompiledExpression compile(const std::string &expression)
Compiles a KaRL expression into an expression tree.
void define_function(const std::string &name, knowledge::KnowledgeRecord(*func)(FunctionArguments &, Variables &))
Defines a function.
auto invoke(const VariableReference &key, Callable &&callable, const KnowledgeReferenceSettings &settings=KnowledgeReferenceSettings()) const -> decltype(utility::invoke_(std::forward< Callable >(callable), std::declval< KnowledgeRecord & >()))
void get_matches(const std::string &prefix, const std::string &suffix, VariableReferences &matches)
Creates an iteration of VariableReferences to all keys matching the prefix and suffix.
void lock(void)
Locks the context to prevent updates over the network.
MADARA_EXPORT int send_modifieds(const std::string &prefix, const EvalSettings &settings=EvalSettings::SEND)
Sends all modified variables through the attached transports.
int set_jpeg(const VariableReference &variable, const unsigned char *value, size_t size, const EvalSettings &settings=EvalSettings())
Atomically sets the value of a variable to a JPEG image.
int64_t load_context(const std::string &filename, bool use_id, const KnowledgeUpdateSettings &settings=KnowledgeUpdateSettings(true, true, true, false))
Loads the context from a file.
knowledge::KnowledgeMap to_map_stripped(const std::string &prefix) const
Creates a map with Knowledge Records that begin with the given prefix.
madara::knowledge::KnowledgeRecord wait(const std::string &expression)
Waits for an expression to be non-zero.
void reset_checkpoint(void) const
Resets the local changed map, which tracks checkpointing modifieds.
auto cinvoke(const std::string &key, Callable &&callable, const KnowledgeReferenceSettings &settings=KnowledgeReferenceSettings()) const -> decltype(utility::invoke_(std::forward< Callable >(callable), std::declval< KnowledgeRecord & >()))
int set_file(const VariableReference &variable, const unsigned char *value, size_t size, const EvalSettings &settings=EvalSettings())
Atomically sets the value of a variable to the contents of a file.
int64_t save_as_karl(const std::string &filename) const
Saves the context to a file as karl assignments, rather than binary.
void wait_for_change(void)
Wait for a change to happen to the context (e.g., from transports)
bool exists(const std::string &key, const KnowledgeReferenceSettings &settings=KnowledgeReferenceSettings()) const
Checks if a knowledge location exists in the context.
std::vector< std::shared_ptr< transport::Base > > transports_
int64_t save_checkpoint(const std::string &filename, bool reset_modifieds=true)
Saves a checkpoint of a list of changes to a file.
int set(K &&key, const V *arr, size_t size, const EvalSettings &settings)
void to_string(std::string &target, const std::string &array_delimiter=",", const std::string &record_delimiter=";\n", const std::string &key_val_delimiter="=") const
Saves all keys and values into a string, using the underlying knowledge::KnowledgeRecord::to_string f...
auto invoke(const VariableReference &key, Callable &&callable, const EvalSettings &settings=EvalSettings()) -> decltype(utility::invoke_(std::forward< Callable >(callable), std::declval< KnowledgeRecord & >()))
This class encapsulates an entry in a KnowledgeBase.
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...
std::shared_ptr< const std::string > share_string(const std::string &key, const KnowledgeReferenceSettings &settings=KnowledgeReferenceSettings()) const
void for_each(Func &&func) const
Call given Callable on each element in this context.
int set_index(const std::string &key, size_t index, T &&value, const KnowledgeUpdateSettings &settings=KnowledgeUpdateSettings())
Atomically sets the value of an array index to a value.
std::unique_ptr< BaseStreamer > attach_streamer(std::unique_ptr< BaseStreamer > streamer)
Attach a streaming provider object, inherited from BaseStreamer, such as CheckpointStreamer.
int set(const std::string &key, T &&value, const KnowledgeUpdateSettings &settings=KnowledgeUpdateSettings())
Atomically sets the value of a variable to the specific record.
std::shared_ptr< const std::vector< KnowledgeRecord::Integer > > share_integers(const std::string &key, const KnowledgeReferenceSettings &settings=KnowledgeReferenceSettings()) const
std::shared_ptr< const std::vector< unsigned char > > share_binary(const std::string &key, const KnowledgeReferenceSettings &settings=KnowledgeReferenceSettings()) const
auto cinvoke(const std::string &key, Callable &&callable, const KnowledgeReferenceSettings &settings=KnowledgeReferenceSettings()) const -> decltype(utility::invoke_(std::forward< Callable >(callable), std::declval< KnowledgeRecord & >()))
auto invoke(const std::string &key, Callable &&callable, const KnowledgeUpdateSettings &settings=KnowledgeUpdateSettings()) -> decltype(utility::invoke_(std::forward< Callable >(callable), std::declval< KnowledgeRecord & >()))
std::shared_ptr< const std::vector< double > > share_doubles(const std::string &key, const KnowledgeReferenceSettings &settings=KnowledgeReferenceSettings()) const
Optimized reference to a variable within the knowledge base.
Provides an interface for external functions into the MADARA KaRL variable settings.
Definition: Variables.h:53
A multi-threaded logger for logging to one or more destinations.
Definition: Logger.h:165
Base class from which all transports must be derived.
Definition: Transport.h:46
Container for quality-of-service settings.
Holds basic transport settings.
constexpr string_t string
Provides functions and classes for the distributed knowledge base.
std::map< std::string, bool > CopySet
Typedef for set of copyable keys.
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.
Definition: GlobalLogger.h:12
Provides utility functions and classes for common tasks and needs.
Definition: IteratorImpl.h:15
auto invoke_(Func func, Arg0 &&arg0) -> decltype(std::forward< Arg0 >(arg0).*func)
Definition: StlHelper.h:193
Copyright(c) 2020 Galois.
Encapsulates settings for an evaluation statement.
Definition: EvalSettings.h:26
static const EvalSettings SEND
Settings to immediately send modifieds and expand variables.
Definition: EvalSettings.h:57
Holds settings requirements for knowledge, usually in copying.
Encapsulates settings for a wait statement.
Definition: WaitSettings.h:25