2 #ifndef _MADARA_EXTERNAL_FUNCTION_VARIABLES_H_
3 #define _MADARA_EXTERNAL_FUNCTION_VARIABLES_H_
6 #include "madara/MadaraExport.h"
15 #ifdef _MADARA_PYTHON_CALLBACKS_
16 #include "madara/Boost.h"
17 #include "boost/python/object.hpp"
22 #include "madara_jni.h"
37 class CompositeFunctionNode;
42 class ThreadSafeContext;
43 class KnowledgeRecordFilters;
169 const std::vector<KnowledgeRecord::Integer>& value,
181 const std::vector<KnowledgeRecord::Integer>& value,
215 int set(
const std::string& key,
const double* value, uint32_t size,
238 int set(
const std::string& key,
const std::vector<double>& value,
369 void print(
unsigned int level = 0)
const;
377 void print(
const std::string& statement,
unsigned int level = 0)
const;
441 #ifndef _MADARA_NO_KARL_
517 void define_function(
const std::string& name, jobject callable);
520 #ifdef _MADARA_PYTHON_CALLBACKS_
526 void define_function(
const std::string& name, boost::python::object callable);
541 void define_function(
560 size_t to_vector(
const std::string& subject,
unsigned int start,
561 unsigned int end, std::vector<KnowledgeRecord>& target);
584 std::map<std::string, knowledge::KnowledgeRecord>& target);
591 int64_t save_as_karl(
const std::string& filename)
const;
607 int64_t save_checkpoint(
608 const std::string& filename,
bool reset_modifieds =
true);
618 true,
true,
true,
false));
const ThreadSafeContext * context_
A composite node that calls a function.
Compiled, optimized KaRL logic.
Provides map of data types to a filter chain to apply to the data.
void operator=(const KnowledgeRecordFilters &rhs)
Assignment operator.
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...
Optimized reference to a variable within the knowledge base.
Provides an interface for external functions into the MADARA KaRL variable settings.
void define_function(const std::string &name, knowledge::KnowledgeRecord(*func)(const char *, FunctionArguments &, Variables &))
Defines a named function that can distinguish the name it was called with in MADARA.
Variables(ThreadSafeContext *new_context=0)
Constructor.
Variables(const Variables &rhs)
Constructor.
ThreadSafeContext * context_
Variables context that is directly used by the KaRL engine.
Provides functions and classes for the distributed knowledge base.
T get(const KnowledgeRecord &kr)
Get the value of a KnowlegeRecord.
madara::knowledge::KnowledgeRecord VALUE_TYPE
std::vector< KnowledgeRecord > FunctionArguments
std::vector< VariableReference > VariableReferences
a vector of variable references
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.
ssize_t write_file(const std::string &filename, void *buffer, size_t size)
Writes a file with provided contents.
Copyright(c) 2020 Galois.