MADARA  3.4.1
madara::knowledge Namespace Reference

Provides functions and classes for the distributed knowledge base. More...

Namespaces

 containers
 Provides container classes for fast knowledge base access and mutation.
 
 impl
 Internal implementation details.
 
 tags
 Tags to specify what type to construct in KnowledgeRecord forwarding constructors.
 

Classes

class  AggregateFilter
 This class stores a function definition. More...
 
class  BaseStreamer
 Interface for knowledge update streaming. More...
 
class  CheckpointPlayer
 Plays back a checkpoint over time, based on recorded TOI. More...
 
class  CheckpointReader
 Class for iterating binary checkpoint files. More...
 
class  CheckpointSettings
 Holds settings for checkpoints to load or save. More...
 
class  CheckpointStreamer
 Implementation of BaseStreamer which writes updates to a Madara checkpoint file. More...
 
class  CompiledExpression
 Compiled, optimized KaRL logic. More...
 
class  ContextGuard
 A thread-safe guard for a context or knowledge base. More...
 
class  EvalSettings
 Encapsulates settings for an evaluation statement. More...
 
class  FileFragmenter
 Splits files into fragments that can be saved to and loaded from a knowledge base. More...
 
class  FileHeader
 Defines a file header which is the default for KaRL checkpointing. More...
 
class  FileRequester
 A helper class that can reconstruct files or request files be transferred in fragments from a Madara File Service (MFS) More...
 
class  FileSettings
 This class provides an interface into the KnowledgeEngine that governs how files are prioritized, modified, and handled. More...
 
class  FileStreamer
 Splits files into fragments that can be saved to and loaded from a knowledge base. More...
 
class  Function
 This class stores a function definition. More...
 
class  Hive
 Knowledge bases linked with shared memory to a central hive concept. More...
 
class  KnowledgeBase
 This class provides a distributed knowledge base to users. More...
 
class  KnowledgeBaseImpl
 This class provides a distributed knowledge base implementation. More...
 
class  KnowledgeRecord
 This class encapsulates an entry in a KnowledgeBase. More...
 
class  KnowledgeRecordFilters
 Provides map of data types to a filter chain to apply to the data. More...
 
class  KnowledgeReferenceSettings
 Settings for applying knowledge updates. More...
 
class  KnowledgeRequirements
 Holds settings requirements for knowledge, usually in copying. More...
 
class  KnowledgeUpdateSettings
 Settings for applying knowledge updates. More...
 
class  ThreadSafeContext
 This class stores variables and their values for use by any entity needing state information in a thread safe way. More...
 
struct  type
 
class  VariableReference
 Optimized reference to a variable within the knowledge base. More...
 
class  VariableReferenceMapReader
 Helper class for iterating over VariableReferenceMaps, optionally including history of changed records, since a given TOI. More...
 
class  Variables
 Provides an interface for external functions into the MADARA KaRL variable settings. More...
 
class  VariablesLister
 
class  WaitSettings
 Encapsulates settings for a wait statement. More...
 

Typedefs

typedef std::list< AggregateFilterAggregateFilters
 Typedef for a list of aggregate filters. More...
 
typedef std::map< std::string, bool > CopySet
 Typedef for set of copyable keys. More...
 
typedef std::list< FunctionFilterChain
 a chain of filters More...
 
typedef std::map< uint32_t, FilterChainFilterMap
 a map of types to filter chain More...
 
typedef std::vector< KnowledgeRecordFunctionArguments
 
typedef std::map< std::string, FunctionFunctionMap
 
typedef std::string KnowledgeKey
 
typedef ::std::map< std::string, KnowledgeRecordKnowledgeMap
 
typedef ::std::multimap< std::string, KnowledgeRecordKnowledgeMultiMap
 
typedef ::std::map< std::string, KnowledgeRecord * > KnowledgeRecords
 
typedef ::std::vector< std::string > KnowledgeRules
 
typedef KnowledgeRecord KnowledgeValue
 
typedef ::std::vector< KnowledgeRecordKnowledgeVector
 
typedef std::vector< std::string > PrefixVector
 Typedef for vector of prefixes to use for a generic task. More...
 
typedef ::std::vector< std::string > StringVector
 
typedef madara::knowledge::KnowledgeRecord VALUE_TYPE
 
typedef std::map< const char *, VariableReference, utility::ComparisonLessThanVariableReferenceMap
 a map of variable references More...
 
typedef std::vector< VariableReferenceVariableReferences
 a vector of variable references More...
 

Enumerations

enum  { ASSIGNMENT = 0 , MULTIPLE_ASSIGNMENT = 1 }
 

Functions

static void checkpoint_do_incremental (const ThreadSafeContext &context, logger::Logger *logger_, uint64_t clock_, const CheckpointSettings &settings, std::fstream &file, FileHeader &meta, transport::MessageHeader &checkpoint_header)
 
static void checkpoint_do_initial (const ThreadSafeContext &context, logger::Logger *logger_, uint64_t clock_, const CheckpointSettings &settings, std::fstream &file, FileHeader &meta, transport::MessageHeader &checkpoint_header)
 
static void checkpoint_write_record (logger::Logger *logger_, const std::string &name, const KnowledgeRecord *record, const CheckpointSettings &settings, transport::MessageHeader &checkpoint_header, char *&current, utility::ScopedArray< char > &buffer, int64_t &buffer_remaining)
 
static void checkpoint_write_records (const ThreadSafeContext &context, logger::Logger *logger_, const CheckpointSettings &settings, transport::MessageHeader &checkpoint_header, char *&current, utility::ScopedArray< char > &buffer, int64_t &buffer_remaining)
 
template<typename T >
void destruct (T &x)
 
template<typename T >
get (const KnowledgeRecord &kr)
 Get the value of a KnowlegeRecord. More...
 
static char * init_checkpoint_header (logger::Logger *logger_, uint64_t clock_, const CheckpointSettings &settings, FileHeader &meta, transport::MessageHeader &checkpoint_header, int64_t &buffer_remaining, utility::ScopedArray< char > &buffer)
 
template<typename T >
auto knowledge_cast (const KnowledgeRecord &in) -> decltype(knowledge_cast(type< T >{}, in))
 For explicit type form, call through to form taking type struct. More...
 
const KnowledgeRecordknowledge_cast (const KnowledgeRecord &in, KnowledgeRecord &out)
 Identity NOP. More...
 
template<typename Container >
void knowledge_cast (const KnowledgeRecord &in, std::back_insert_iterator< Container > iter)
 
template<typename CharT , typename Traits , typename Allocator >
std::basic_string< CharT, Traits, Allocator > & knowledge_cast (const KnowledgeRecord &in, std::basic_string< CharT, Traits, Allocator > &out)
 Conert KnowlegeRecord into an existing std::basic_string<...> More...
 
template<typename T >
auto knowledge_cast (const KnowledgeRecord &in, T &&out) -> decltype(*out=knowledge_cast(type< typename utility::decay_< T >::container_type::value_type >{}, in))
 
template<typename T >
auto knowledge_cast (const T &in) -> typename std::enable_if< std::is_integral< typename std::decay< decltype(in[0])>::type >::value &&!std::is_same< typename std::decay< decltype(in[0])>::type, char >::value &&!std::is_same< typename std::decay< decltype(in[0])>::type, unsigned char >::value &&!std::is_same< T, std::vector< int64_t >>::value, typename std::decay< decltype(KnowledgeRecord{ tags::integers, std::begin(in), std::end(in)})>::type >::type
 Construct a KnowledgeRecord with integer array type, from a container of integers, except char types. More...
 
KnowledgeRecordknowledge_cast (KnowledgeRecord &in)
 Identity NOP. More...
 
template<class O >
auto knowledge_cast (O &&in) -> typename std::decay< decltype(KnowledgeRecord{std::forward< O >(in)})>::type
 Convert a value to KnowledgeRecord By default, if no other overload specified, this overload just calls KnowledgeRecord constructor. More...
 
bool knowledge_cast (type< bool >, const KnowledgeRecord &in)
 Convert KnowledgeRecord to bool (using in.is_true()) More...
 
KnowledgeRecord knowledge_cast (type< KnowledgeRecord >, const KnowledgeRecord &in)
 Convert KnowledgeRecord into an existing native C array, passed via a pointer and size. More...
 
template<class O >
auto knowledge_cast (type< O >, const KnowledgeRecord &in) -> typename std::enable_if< std::is_constructible< O, const KnowledgeRecord & >::value, O >::type
 By default, call constructor of target class; for other semantics, define specializations. More...
 
std::string knowledge_cast (type< std::string >, const KnowledgeRecord &in)
 Convert KnowledgeRecord to a std::string. More...
 
std::vector< double > knowledge_cast (type< std::vector< double >>, const KnowledgeRecord &in)
 Convert KnowledgeRecord to a std::vector<double> More...
 
std::vector< int64_t > knowledge_cast (type< std::vector< int64_t >>, const KnowledgeRecord &in)
 Convert KnowledgeRecord to a std::vector<int64_t> More...
 
template<typename T >
auto knowledge_cast (type< std::vector< T >>, const KnowledgeRecord &in) -> typename std::enable_if< std::is_integral< T >::value, std::vector< T >>::type
 Convert KnowledgeRecord to a std::vector of integral types besides int64_t. More...
 
uint32_t max_quality (const KnowledgeRecords &records)
 Returns the maximum quality within the records. More...
 
bool operator!= (const char *l, const KnowledgeRecord &r)
 
bool operator!= (const KnowledgeRecord &l, const char *r)
 
bool operator!= (const KnowledgeRecord &l, const std::string &r)
 
template<typename T , typename std::enable_if< !std::is_convertible< T, KnowledgeRecord >::value &&std::is_fundamental< T >::value, void * >::type = nullptr>
auto operator!= (const KnowledgeRecord &l, const T &r) -> decltype(knowledge_cast< T >(l) !=r)
 
bool operator!= (const KnowledgeRecord &l, std::nullptr_t)
 
bool operator!= (const std::string &l, const KnowledgeRecord &r)
 
template<typename T , typename std::enable_if< !std::is_convertible< T, KnowledgeRecord >::value &&std::is_fundamental< T >::value, void * >::type = nullptr>
auto operator!= (const T &l, const KnowledgeRecord &r) -> decltype(l !=knowledge_cast< T >(r))
 
template<typename T , typename std::enable_if< !std::is_convertible< T, KnowledgeRecord >::value &&std::is_fundamental< T >::value, void * >::type = nullptr>
auto operator% (const KnowledgeRecord &l, const T &r) -> decltype(l % knowledge_cast(r))
 
template<typename T , typename std::enable_if< !std::is_convertible< T, KnowledgeRecord >::value &&std::is_fundamental< T >::value, void * >::type = nullptr>
auto operator% (const T &l, const KnowledgeRecord &r) -> decltype(knowledge_cast(l) % r)
 
template<typename T , typename std::enable_if< !std::is_convertible< T, KnowledgeRecord >::value &&std::is_fundamental< T >::value, void * >::type = nullptr>
auto operator%= (KnowledgeRecord &l, const T &r) -> decltype(l %=knowledge_cast(r))
 
template<typename T , typename std::enable_if< !std::is_convertible< T, KnowledgeRecord >::value &&std::is_fundamental< T >::value, void * >::type = nullptr>
auto operator* (const KnowledgeRecord &l, const T &r) -> decltype(l *knowledge_cast(r))
 
template<typename T , typename std::enable_if< !std::is_convertible< T, KnowledgeRecord >::value &&std::is_fundamental< T >::value, void * >::type = nullptr>
auto operator* (const T &l, const KnowledgeRecord &r) -> decltype(knowledge_cast(l) *r)
 
template<typename T , typename std::enable_if< !std::is_convertible< T, KnowledgeRecord >::value &&std::is_fundamental< T >::value, void * >::type = nullptr>
auto operator*= (KnowledgeRecord &l, const T &r) -> decltype(l *=knowledge_cast(r))
 
template<typename T , typename std::enable_if< !std::is_convertible< T, KnowledgeRecord >::value &&std::is_fundamental< T >::value, void * >::type = nullptr>
auto operator+ (const KnowledgeRecord &l, const T &r) -> decltype(l+knowledge_cast(r))
 
template<typename T , typename std::enable_if< !std::is_convertible< T, KnowledgeRecord >::value &&std::is_fundamental< T >::value, void * >::type = nullptr>
auto operator+ (const T &l, const KnowledgeRecord &r) -> decltype(knowledge_cast(l)+r)
 
template<typename T , typename std::enable_if< !std::is_convertible< T, KnowledgeRecord >::value &&std::is_fundamental< T >::value, void * >::type = nullptr>
auto operator+= (KnowledgeRecord &l, const T &r) -> decltype(l+=knowledge_cast(r))
 
template<typename T , typename std::enable_if< !std::is_convertible< T, KnowledgeRecord >::value &&std::is_fundamental< T >::value, void * >::type = nullptr>
auto operator- (const KnowledgeRecord &l, const T &r) -> decltype(l - knowledge_cast(r))
 
template<typename T , typename std::enable_if< !std::is_convertible< T, KnowledgeRecord >::value &&std::is_fundamental< T >::value, void * >::type = nullptr>
auto operator- (const T &l, const KnowledgeRecord &r) -> decltype(knowledge_cast(l) - r)
 
template<typename T , typename std::enable_if< !std::is_convertible< T, KnowledgeRecord >::value &&std::is_fundamental< T >::value, void * >::type = nullptr>
auto operator-= (KnowledgeRecord &l, const T &r) -> decltype(l -=knowledge_cast(r))
 
template<typename T , typename std::enable_if< !std::is_convertible< T, KnowledgeRecord >::value &&std::is_fundamental< T >::value, void * >::type = nullptr>
auto operator/ (const KnowledgeRecord &l, const T &r) -> decltype(l/knowledge_cast(r))
 
template<typename T , typename std::enable_if< !std::is_convertible< T, KnowledgeRecord >::value &&std::is_fundamental< T >::value, void * >::type = nullptr>
auto operator/ (const T &l, const KnowledgeRecord &r) -> decltype(knowledge_cast(l)/r)
 
template<typename T , typename std::enable_if< !std::is_convertible< T, KnowledgeRecord >::value &&std::is_fundamental< T >::value, void * >::type = nullptr>
auto operator/= (KnowledgeRecord &l, const T &r) -> decltype(l/=knowledge_cast(r))
 
bool operator< (const char *l, const KnowledgeRecord &r)
 
bool operator< (const KnowledgeRecord &l, const char *r)
 
bool operator< (const KnowledgeRecord &l, const std::string &r)
 
template<typename T , typename std::enable_if< !std::is_convertible< T, KnowledgeRecord >::value &&std::is_fundamental< T >::value, void * >::type = nullptr>
auto operator< (const KnowledgeRecord &l, const T &r) -> decltype(knowledge_cast< T >(l)< r)
 
bool operator< (const KnowledgeRecord &l, std::nullptr_t)
 
bool operator< (const std::string &l, const KnowledgeRecord &r)
 
template<typename T , typename std::enable_if< !std::is_convertible< T, KnowledgeRecord >::value &&std::is_fundamental< T >::value, void * >::type = nullptr>
auto operator< (const T &l, const KnowledgeRecord &r) -> decltype(l< knowledge_cast< T >(r))
 
std::ostream & operator<< (std::ostream &stream, const KnowledgeRecord &rhs)
 output stream buffering More...
 
bool operator<= (const char *l, const KnowledgeRecord &r)
 
bool operator<= (const KnowledgeRecord &l, const char *r)
 
bool operator<= (const KnowledgeRecord &l, const std::string &r)
 
template<typename T , typename std::enable_if< !std::is_convertible< T, KnowledgeRecord >::value &&std::is_fundamental< T >::value, void * >::type = nullptr>
auto operator<= (const KnowledgeRecord &l, const T &r) -> decltype(knowledge_cast< T >(l)<=r)
 
bool operator<= (const KnowledgeRecord &l, std::nullptr_t)
 
bool operator<= (const std::string &l, const KnowledgeRecord &r)
 
template<typename T , typename std::enable_if< !std::is_convertible< T, KnowledgeRecord >::value &&std::is_fundamental< T >::value, void * >::type = nullptr>
auto operator<= (const T &l, const KnowledgeRecord &r) -> decltype(l<=knowledge_cast< T >(r))
 
bool operator== (const char *l, const KnowledgeRecord &r)
 
bool operator== (const KnowledgeRecord &l, const char *r)
 
bool operator== (const KnowledgeRecord &l, const std::string &r)
 
template<typename T , typename std::enable_if< !std::is_convertible< T, KnowledgeRecord >::value &&std::is_fundamental< T >::value, void * >::type = nullptr>
auto operator== (const KnowledgeRecord &l, const T &r) -> decltype(knowledge_cast< T >(l)==r)
 
bool operator== (const KnowledgeRecord &l, std::nullptr_t)
 
bool operator== (const std::string &l, const KnowledgeRecord &r)
 
template<typename T , typename std::enable_if< !std::is_convertible< T, KnowledgeRecord >::value &&std::is_fundamental< T >::value, void * >::type = nullptr>
auto operator== (const T &l, const KnowledgeRecord &r) -> decltype(l==knowledge_cast< T >(r))
 
bool operator> (const char *l, const KnowledgeRecord &r)
 
bool operator> (const KnowledgeRecord &l, const char *r)
 
bool operator> (const KnowledgeRecord &l, const std::string &r)
 
template<typename T , typename std::enable_if< !std::is_convertible< T, KnowledgeRecord >::value &&std::is_fundamental< T >::value, void * >::type = nullptr>
auto operator> (const KnowledgeRecord &l, const T &r) -> decltype(knowledge_cast< T >(l) > r)
 
bool operator> (const KnowledgeRecord &l, std::nullptr_t)
 
bool operator> (const std::string &l, const KnowledgeRecord &r)
 
template<typename T , typename std::enable_if< !std::is_convertible< T, KnowledgeRecord >::value &&std::is_fundamental< T >::value, void * >::type = nullptr>
auto operator> (const T &l, const KnowledgeRecord &r) -> decltype(l > knowledge_cast< T >(r))
 
bool operator>= (const char *l, const KnowledgeRecord &r)
 
bool operator>= (const KnowledgeRecord &l, const char *r)
 
bool operator>= (const KnowledgeRecord &l, const std::string &r)
 
template<typename T , typename std::enable_if< !std::is_convertible< T, KnowledgeRecord >::value &&std::is_fundamental< T >::value, void * >::type = nullptr>
auto operator>= (const KnowledgeRecord &l, const T &r) -> decltype(knowledge_cast< T >(l) >=r)
 
bool operator>= (const KnowledgeRecord &l, std::nullptr_t)
 
bool operator>= (const std::string &l, const KnowledgeRecord &r)
 
template<typename T , typename std::enable_if< !std::is_convertible< T, KnowledgeRecord >::value &&std::is_fundamental< T >::value, void * >::type = nullptr>
auto operator>= (const T &l, const KnowledgeRecord &r) -> decltype(l >=knowledge_cast< T >(r))
 
void safe_clear (KnowledgeMap &map)
 
template<typename T >
bool type_match (type< T > t, const KnowledgeRecord &kr)
 Check if a KnowledgeRecord type matches a specified type. More...
 
static uint64_t update_checkpoint_header (logger::Logger *logger_, uint64_t clock_, const CheckpointSettings &settings, std::fstream &file, FileHeader &meta, transport::MessageHeader &checkpoint_header, int64_t &buffer_remaining, utility::ScopedArray< char > &buffer)
 

Detailed Description

Provides functions and classes for the distributed knowledge base.

Main entry point to library.

Typedef Documentation

◆ AggregateFilters

Typedef for a list of aggregate filters.

Definition at line 164 of file AggregateFilter.h.

◆ CopySet

typedef std::map<std::string, bool> madara::knowledge::CopySet

Typedef for set of copyable keys.

See also
copy. We use map instead of set so we are not wasting significant memory/time with copying the key to the value (a STL set uses the type as both the key and value).

Definition at line 60 of file ThreadSafeContext.h.

◆ FilterChain

a chain of filters

Definition at line 42 of file KnowledgeRecordFilters.h.

◆ FilterMap

typedef std::map<uint32_t, FilterChain> madara::knowledge::FilterMap

a map of types to filter chain

Definition at line 45 of file KnowledgeRecordFilters.h.

◆ FunctionArguments

Definition at line 20 of file FunctionArguments.h.

◆ FunctionMap

typedef std::map<std::string, Function> madara::knowledge::FunctionMap

Definition at line 17 of file FunctionMap.h.

◆ KnowledgeKey

typedef std::string madara::knowledge::KnowledgeKey

Definition at line 1825 of file KnowledgeRecord.h.

◆ KnowledgeMap

typedef ::std::map<std::string, KnowledgeRecord> madara::knowledge::KnowledgeMap

Definition at line 1818 of file KnowledgeRecord.h.

◆ KnowledgeMultiMap

typedef ::std::multimap<std::string, KnowledgeRecord> madara::knowledge::KnowledgeMultiMap

Definition at line 1819 of file KnowledgeRecord.h.

◆ KnowledgeRecords

typedef ::std::map<std::string, KnowledgeRecord*> madara::knowledge::KnowledgeRecords

Definition at line 1823 of file KnowledgeRecord.h.

◆ KnowledgeRules

typedef ::std::vector<std::string> madara::knowledge::KnowledgeRules

Definition at line 1821 of file KnowledgeRecord.h.

◆ KnowledgeValue

◆ KnowledgeVector

Definition at line 1820 of file KnowledgeRecord.h.

◆ PrefixVector

typedef std::vector<std::string> madara::knowledge::PrefixVector

Typedef for vector of prefixes to use for a generic task.

See also
copy.

Definition at line 65 of file ThreadSafeContext.h.

◆ StringVector

typedef ::std::vector<std::string> madara::knowledge::StringVector

Definition at line 1822 of file KnowledgeRecord.h.

◆ VALUE_TYPE

◆ VariableReferenceMap

a map of variable references

Definition at line 100 of file VariableReference.h.

◆ VariableReferences

a vector of variable references

Definition at line 96 of file VariableReference.h.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
ASSIGNMENT 
MULTIPLE_ASSIGNMENT 

Definition at line 8 of file UpdateTypes.h.

Function Documentation

◆ checkpoint_do_incremental()

static void madara::knowledge::checkpoint_do_incremental ( const ThreadSafeContext context,
logger::Logger logger_,
uint64_t  clock_,
const CheckpointSettings settings,
std::fstream &  file,
FileHeader meta,
transport::MessageHeader checkpoint_header 
)
static

Definition at line 2555 of file ThreadSafeContext.cpp.

◆ checkpoint_do_initial()

static void madara::knowledge::checkpoint_do_initial ( const ThreadSafeContext context,
logger::Logger logger_,
uint64_t  clock_,
const CheckpointSettings settings,
std::fstream &  file,
FileHeader meta,
transport::MessageHeader checkpoint_header 
)
static

Definition at line 2681 of file ThreadSafeContext.cpp.

◆ checkpoint_write_record()

static void madara::knowledge::checkpoint_write_record ( logger::Logger logger_,
const std::string &  name,
const KnowledgeRecord record,
const CheckpointSettings settings,
transport::MessageHeader checkpoint_header,
char *&  current,
utility::ScopedArray< char > &  buffer,
int64_t &  buffer_remaining 
)
static

Definition at line 2401 of file ThreadSafeContext.cpp.

◆ checkpoint_write_records()

static void madara::knowledge::checkpoint_write_records ( const ThreadSafeContext context,
logger::Logger logger_,
const CheckpointSettings settings,
transport::MessageHeader checkpoint_header,
char *&  current,
utility::ScopedArray< char > &  buffer,
int64_t &  buffer_remaining 
)
static

Definition at line 2525 of file ThreadSafeContext.cpp.

◆ destruct()

template<typename T >
void madara::knowledge::destruct ( T &  x)
inline

Definition at line 961 of file KnowledgeRecord.inl.

◆ get()

template<typename T >
T madara::knowledge::get ( const KnowledgeRecord kr)
inline

Get the value of a KnowlegeRecord.

INTEGER records can be retrieved as any integral type (bool, int, uint, etc) DOUBLE records can be retrieved as any floating point type (double, float) STRING records can be retrieved as std::string INTEGER_ARRAY and DOUBLE_ARRAY can be retreived as an std::vector of integral or floating point types respectively.

Exceptions
MissingValueExceptionif the Record in empty
MismatchedTypeExceptionif template type does not match stored type
Template Parameters
Ttype of expected value
Parameters
krRecord to read from
Returns
the stored value

Definition at line 121 of file GetRecord.h.

◆ init_checkpoint_header()

static char* madara::knowledge::init_checkpoint_header ( logger::Logger logger_,
uint64_t  clock_,
const CheckpointSettings settings,
FileHeader meta,
transport::MessageHeader checkpoint_header,
int64_t &  buffer_remaining,
utility::ScopedArray< char > &  buffer 
)
static

Definition at line 2364 of file ThreadSafeContext.cpp.

◆ knowledge_cast() [1/15]

template<typename T >
const KnowledgeRecord & madara::knowledge::knowledge_cast ( const KnowledgeRecord in) -> decltype(knowledge_cast(type<T>{}, in))
inline

For explicit type form, call through to form taking type struct.

Identity NOP.

Definition at line 288 of file KnowledgeCast.h.

◆ knowledge_cast() [2/15]

const KnowledgeRecord& madara::knowledge::knowledge_cast ( const KnowledgeRecord in,
KnowledgeRecord out 
)
inline

Identity NOP.

Definition at line 384 of file KnowledgeCast.h.

◆ knowledge_cast() [3/15]

template<typename Container >
void madara::knowledge::knowledge_cast ( const KnowledgeRecord in,
std::back_insert_iterator< Container >  iter 
)
inline

Definition at line 364 of file KnowledgeCast.h.

◆ knowledge_cast() [4/15]

template<typename CharT , typename Traits , typename Allocator >
std::basic_string<CharT, Traits, Allocator>& madara::knowledge::knowledge_cast ( const KnowledgeRecord in,
std::basic_string< CharT, Traits, Allocator > &  out 
)
inline

Conert KnowlegeRecord into an existing std::basic_string<...>

Definition at line 256 of file KnowledgeCast.h.

◆ knowledge_cast() [5/15]

template<typename T >
auto madara::knowledge::knowledge_cast ( const KnowledgeRecord in,
T &&  out 
) -> decltype(*out = knowledge_cast( type<typename utility::decay_<T>::container_type::value_type>{}, in))
inline

Definition at line 355 of file KnowledgeCast.h.

◆ knowledge_cast() [6/15]

template<typename T >
auto madara::knowledge::knowledge_cast ( const T &  in) -> typename std::enable_if< std::is_integral<typename std::decay<decltype(in[0])>::type>::value && !std::is_same<typename std::decay<decltype(in[0])>::type, char>::value && !std::is_same<typename std::decay<decltype(in[0])>::type, unsigned char>::value && !std::is_same<T, std::vector<int64_t>>::value, typename std::decay<decltype(KnowledgeRecord{ tags::integers, std::begin(in), std::end(in)})>::type>::type
inline

Construct a KnowledgeRecord with integer array type, from a container of integers, except char types.

Construct a KnowledgeRecord with binary type.

Construct a KnowledgeRecord with string type.

Construct a KnowledgeRecord with floating point array type.

Definition at line 307 of file KnowledgeCast.h.

◆ knowledge_cast() [7/15]

KnowledgeRecord& madara::knowledge::knowledge_cast ( KnowledgeRecord in)
inline

Identity NOP.

Definition at line 372 of file KnowledgeCast.h.

◆ knowledge_cast() [8/15]

template<class O >
auto madara::knowledge::knowledge_cast ( O &&  in) -> typename std::decay<decltype(KnowledgeRecord{std::forward<O>(in)})>::type
inline

Convert a value to KnowledgeRecord By default, if no other overload specified, this overload just calls KnowledgeRecord constructor.

Definition at line 298 of file KnowledgeCast.h.

◆ knowledge_cast() [9/15]

bool madara::knowledge::knowledge_cast ( type< bool >  ,
const KnowledgeRecord in 
)
inline

Convert KnowledgeRecord to bool (using in.is_true())

Definition at line 105 of file KnowledgeCast.h.

◆ knowledge_cast() [10/15]

KnowledgeRecord madara::knowledge::knowledge_cast ( type< KnowledgeRecord ,
const KnowledgeRecord in 
)
inline

Convert KnowledgeRecord into an existing native C array, passed via a pointer and size.

Identity NOP for converting KnowledgeRecord to KnowledgeRecord

Definition at line 280 of file KnowledgeCast.h.

◆ knowledge_cast() [11/15]

template<class O >
auto madara::knowledge::knowledge_cast ( type< O >  ,
const KnowledgeRecord in 
) -> typename std::enable_if< std::is_constructible<O, const KnowledgeRecord&>::value, O>::type
inline

By default, call constructor of target class; for other semantics, define specializations.

Convert KnowledgeRecord to integer.

Convert KnowledgeRecord to floating point.

Definition at line 80 of file KnowledgeCast.h.

◆ knowledge_cast() [12/15]

std::string madara::knowledge::knowledge_cast ( type< std::string >  ,
const KnowledgeRecord in 
)
inline

Convert KnowledgeRecord to a std::string.

Definition at line 111 of file KnowledgeCast.h.

◆ knowledge_cast() [13/15]

std::vector<double> madara::knowledge::knowledge_cast ( type< std::vector< double >>  ,
const KnowledgeRecord in 
)
inline

Convert KnowledgeRecord to a std::vector<double>

Definition at line 133 of file KnowledgeCast.h.

◆ knowledge_cast() [14/15]

std::vector<int64_t> madara::knowledge::knowledge_cast ( type< std::vector< int64_t >>  ,
const KnowledgeRecord in 
)
inline

Convert KnowledgeRecord to a std::vector<int64_t>

Definition at line 117 of file KnowledgeCast.h.

◆ knowledge_cast() [15/15]

template<typename T >
auto madara::knowledge::knowledge_cast ( type< std::vector< T >>  ,
const KnowledgeRecord in 
) -> typename std::enable_if<std::is_integral<T>::value, std::vector<T>>::type
inline

Convert KnowledgeRecord to a std::vector of integral types besides int64_t.

Convert KnowledgeRecord to a std::vector of float type other than double.

Definition at line 125 of file KnowledgeCast.h.

◆ max_quality()

uint32_t madara::knowledge::max_quality ( const KnowledgeRecords records)
inline

Returns the maximum quality within the records.

Parameters
recordsthe list of records to gauge quality of
Returns
the maximum quality within the list of records

Definition at line 934 of file KnowledgeRecord.inl.

◆ operator!=() [1/7]

bool madara::knowledge::operator!= ( const char *  l,
const KnowledgeRecord r 
)
inline

Definition at line 471 of file KnowledgeCast.h.

◆ operator!=() [2/7]

bool madara::knowledge::operator!= ( const KnowledgeRecord l,
const char *  r 
)
inline

Definition at line 471 of file KnowledgeCast.h.

◆ operator!=() [3/7]

bool madara::knowledge::operator!= ( const KnowledgeRecord l,
const std::string &  r 
)
inline

Definition at line 471 of file KnowledgeCast.h.

◆ operator!=() [4/7]

template<typename T , typename std::enable_if< !std::is_convertible< T, KnowledgeRecord >::value &&std::is_fundamental< T >::value, void * >::type = nullptr>
auto madara::knowledge::operator!= ( const KnowledgeRecord l,
const T &  r 
) -> decltype(knowledge_cast<T>(l) != r)
inline

Definition at line 471 of file KnowledgeCast.h.

◆ operator!=() [5/7]

bool madara::knowledge::operator!= ( const KnowledgeRecord l,
std::nullptr_t   
)
inline

Definition at line 471 of file KnowledgeCast.h.

◆ operator!=() [6/7]

bool madara::knowledge::operator!= ( const std::string &  l,
const KnowledgeRecord r 
)
inline

Definition at line 471 of file KnowledgeCast.h.

◆ operator!=() [7/7]

template<typename T , typename std::enable_if< !std::is_convertible< T, KnowledgeRecord >::value &&std::is_fundamental< T >::value, void * >::type = nullptr>
auto madara::knowledge::operator!= ( const T &  l,
const KnowledgeRecord r 
) -> decltype(l != knowledge_cast<T>(r))
inline

Definition at line 471 of file KnowledgeCast.h.

◆ operator%() [1/2]

template<typename T , typename std::enable_if< !std::is_convertible< T, KnowledgeRecord >::value &&std::is_fundamental< T >::value, void * >::type = nullptr>
auto madara::knowledge::operator% ( const KnowledgeRecord l,
const T &  r 
) -> decltype(l % knowledge_cast(r))
inline

Definition at line 504 of file KnowledgeCast.h.

◆ operator%() [2/2]

template<typename T , typename std::enable_if< !std::is_convertible< T, KnowledgeRecord >::value &&std::is_fundamental< T >::value, void * >::type = nullptr>
auto madara::knowledge::operator% ( const T &  l,
const KnowledgeRecord r 
) -> decltype(knowledge_cast(l) % r)
inline

Definition at line 504 of file KnowledgeCast.h.

◆ operator%=()

template<typename T , typename std::enable_if< !std::is_convertible< T, KnowledgeRecord >::value &&std::is_fundamental< T >::value, void * >::type = nullptr>
auto madara::knowledge::operator%= ( KnowledgeRecord l,
const T &  r 
) -> decltype(l %= knowledge_cast(r))
inline

Definition at line 523 of file KnowledgeCast.h.

◆ operator*() [1/2]

template<typename T , typename std::enable_if< !std::is_convertible< T, KnowledgeRecord >::value &&std::is_fundamental< T >::value, void * >::type = nullptr>
auto madara::knowledge::operator* ( const KnowledgeRecord l,
const T &  r 
) -> decltype(l * knowledge_cast(r))
inline

Definition at line 503 of file KnowledgeCast.h.

◆ operator*() [2/2]

template<typename T , typename std::enable_if< !std::is_convertible< T, KnowledgeRecord >::value &&std::is_fundamental< T >::value, void * >::type = nullptr>
auto madara::knowledge::operator* ( const T &  l,
const KnowledgeRecord r 
) -> decltype(knowledge_cast(l) * r)
inline

Definition at line 503 of file KnowledgeCast.h.

◆ operator*=()

template<typename T , typename std::enable_if< !std::is_convertible< T, KnowledgeRecord >::value &&std::is_fundamental< T >::value, void * >::type = nullptr>
auto madara::knowledge::operator*= ( KnowledgeRecord l,
const T &  r 
) -> decltype(l *= knowledge_cast(r))
inline

Definition at line 522 of file KnowledgeCast.h.

◆ operator+() [1/2]

template<typename T , typename std::enable_if< !std::is_convertible< T, KnowledgeRecord >::value &&std::is_fundamental< T >::value, void * >::type = nullptr>
auto madara::knowledge::operator+ ( const KnowledgeRecord l,
const T &  r 
) -> decltype(l + knowledge_cast(r))
inline

Definition at line 500 of file KnowledgeCast.h.

◆ operator+() [2/2]

template<typename T , typename std::enable_if< !std::is_convertible< T, KnowledgeRecord >::value &&std::is_fundamental< T >::value, void * >::type = nullptr>
auto madara::knowledge::operator+ ( const T &  l,
const KnowledgeRecord r 
) -> decltype(knowledge_cast(l) + r)
inline

Definition at line 500 of file KnowledgeCast.h.

◆ operator+=()

template<typename T , typename std::enable_if< !std::is_convertible< T, KnowledgeRecord >::value &&std::is_fundamental< T >::value, void * >::type = nullptr>
auto madara::knowledge::operator+= ( KnowledgeRecord l,
const T &  r 
) -> decltype(l += knowledge_cast(r))
inline

Definition at line 519 of file KnowledgeCast.h.

◆ operator-() [1/2]

template<typename T , typename std::enable_if< !std::is_convertible< T, KnowledgeRecord >::value &&std::is_fundamental< T >::value, void * >::type = nullptr>
auto madara::knowledge::operator- ( const KnowledgeRecord l,
const T &  r 
) -> decltype(l - knowledge_cast(r))
inline

Definition at line 501 of file KnowledgeCast.h.

◆ operator-() [2/2]

template<typename T , typename std::enable_if< !std::is_convertible< T, KnowledgeRecord >::value &&std::is_fundamental< T >::value, void * >::type = nullptr>
auto madara::knowledge::operator- ( const T &  l,
const KnowledgeRecord r 
) -> decltype(knowledge_cast(l) - r)
inline

Definition at line 501 of file KnowledgeCast.h.

◆ operator-=()

template<typename T , typename std::enable_if< !std::is_convertible< T, KnowledgeRecord >::value &&std::is_fundamental< T >::value, void * >::type = nullptr>
auto madara::knowledge::operator-= ( KnowledgeRecord l,
const T &  r 
) -> decltype(l -= knowledge_cast(r))
inline

Definition at line 520 of file KnowledgeCast.h.

◆ operator/() [1/2]

template<typename T , typename std::enable_if< !std::is_convertible< T, KnowledgeRecord >::value &&std::is_fundamental< T >::value, void * >::type = nullptr>
auto madara::knowledge::operator/ ( const KnowledgeRecord l,
const T &  r 
) -> decltype(l / knowledge_cast(r))
inline

Definition at line 502 of file KnowledgeCast.h.

◆ operator/() [2/2]

template<typename T , typename std::enable_if< !std::is_convertible< T, KnowledgeRecord >::value &&std::is_fundamental< T >::value, void * >::type = nullptr>
auto madara::knowledge::operator/ ( const T &  l,
const KnowledgeRecord r 
) -> decltype(knowledge_cast(l) / r)
inline

Definition at line 502 of file KnowledgeCast.h.

◆ operator/=()

template<typename T , typename std::enable_if< !std::is_convertible< T, KnowledgeRecord >::value &&std::is_fundamental< T >::value, void * >::type = nullptr>
auto madara::knowledge::operator/= ( KnowledgeRecord l,
const T &  r 
) -> decltype(l /= knowledge_cast(r))
inline

Definition at line 521 of file KnowledgeCast.h.

◆ operator<() [1/7]

bool madara::knowledge::operator< ( const char *  l,
const KnowledgeRecord r 
)
inline

Definition at line 474 of file KnowledgeCast.h.

◆ operator<() [2/7]

bool madara::knowledge::operator< ( const KnowledgeRecord l,
const char *  r 
)
inline

Definition at line 474 of file KnowledgeCast.h.

◆ operator<() [3/7]

bool madara::knowledge::operator< ( const KnowledgeRecord l,
const std::string &  r 
)
inline

Definition at line 474 of file KnowledgeCast.h.

◆ operator<() [4/7]

template<typename T , typename std::enable_if< !std::is_convertible< T, KnowledgeRecord >::value &&std::is_fundamental< T >::value, void * >::type = nullptr>
auto madara::knowledge::operator< ( const KnowledgeRecord l,
const T &  r 
) -> decltype(knowledge_cast<T>(l) < r)
inline

Definition at line 474 of file KnowledgeCast.h.

◆ operator<() [5/7]

bool madara::knowledge::operator< ( const KnowledgeRecord l,
std::nullptr_t   
)
inline

Definition at line 474 of file KnowledgeCast.h.

◆ operator<() [6/7]

bool madara::knowledge::operator< ( const std::string &  l,
const KnowledgeRecord r 
)
inline

Definition at line 474 of file KnowledgeCast.h.

◆ operator<() [7/7]

template<typename T , typename std::enable_if< !std::is_convertible< T, KnowledgeRecord >::value &&std::is_fundamental< T >::value, void * >::type = nullptr>
auto madara::knowledge::operator< ( const T &  l,
const KnowledgeRecord r 
) -> decltype(l < knowledge_cast<T>(r))
inline

Definition at line 474 of file KnowledgeCast.h.

◆ operator<<()

std::ostream& madara::knowledge::operator<< ( std::ostream &  stream,
const KnowledgeRecord rhs 
)
inline

output stream buffering

Definition at line 648 of file KnowledgeRecord.inl.

◆ operator<=() [1/7]

bool madara::knowledge::operator<= ( const char *  l,
const KnowledgeRecord r 
)
inline

Definition at line 472 of file KnowledgeCast.h.

◆ operator<=() [2/7]

bool madara::knowledge::operator<= ( const KnowledgeRecord l,
const char *  r 
)
inline

Definition at line 472 of file KnowledgeCast.h.

◆ operator<=() [3/7]

bool madara::knowledge::operator<= ( const KnowledgeRecord l,
const std::string &  r 
)
inline

Definition at line 472 of file KnowledgeCast.h.

◆ operator<=() [4/7]

template<typename T , typename std::enable_if< !std::is_convertible< T, KnowledgeRecord >::value &&std::is_fundamental< T >::value, void * >::type = nullptr>
auto madara::knowledge::operator<= ( const KnowledgeRecord l,
const T &  r 
) -> decltype(knowledge_cast<T>(l) <= r)
inline

Definition at line 472 of file KnowledgeCast.h.

◆ operator<=() [5/7]

bool madara::knowledge::operator<= ( const KnowledgeRecord l,
std::nullptr_t   
)
inline

Definition at line 472 of file KnowledgeCast.h.

◆ operator<=() [6/7]

bool madara::knowledge::operator<= ( const std::string &  l,
const KnowledgeRecord r 
)
inline

Definition at line 472 of file KnowledgeCast.h.

◆ operator<=() [7/7]

template<typename T , typename std::enable_if< !std::is_convertible< T, KnowledgeRecord >::value &&std::is_fundamental< T >::value, void * >::type = nullptr>
auto madara::knowledge::operator<= ( const T &  l,
const KnowledgeRecord r 
) -> decltype(l <= knowledge_cast<T>(r))
inline

Definition at line 472 of file KnowledgeCast.h.

◆ operator==() [1/7]

bool madara::knowledge::operator== ( const char *  l,
const KnowledgeRecord r 
)
inline

Definition at line 470 of file KnowledgeCast.h.

◆ operator==() [2/7]

bool madara::knowledge::operator== ( const KnowledgeRecord l,
const char *  r 
)
inline

Definition at line 470 of file KnowledgeCast.h.

◆ operator==() [3/7]

bool madara::knowledge::operator== ( const KnowledgeRecord l,
const std::string &  r 
)
inline

Definition at line 470 of file KnowledgeCast.h.

◆ operator==() [4/7]

template<typename T , typename std::enable_if< !std::is_convertible< T, KnowledgeRecord >::value &&std::is_fundamental< T >::value, void * >::type = nullptr>
auto madara::knowledge::operator== ( const KnowledgeRecord l,
const T &  r 
) -> decltype(knowledge_cast<T>(l) == r)
inline

Definition at line 470 of file KnowledgeCast.h.

◆ operator==() [5/7]

bool madara::knowledge::operator== ( const KnowledgeRecord l,
std::nullptr_t   
)
inline

Definition at line 470 of file KnowledgeCast.h.

◆ operator==() [6/7]

bool madara::knowledge::operator== ( const std::string &  l,
const KnowledgeRecord r 
)
inline

Definition at line 470 of file KnowledgeCast.h.

◆ operator==() [7/7]

template<typename T , typename std::enable_if< !std::is_convertible< T, KnowledgeRecord >::value &&std::is_fundamental< T >::value, void * >::type = nullptr>
auto madara::knowledge::operator== ( const T &  l,
const KnowledgeRecord r 
) -> decltype(l == knowledge_cast<T>(r))
inline

Definition at line 470 of file KnowledgeCast.h.

◆ operator>() [1/7]

bool madara::knowledge::operator> ( const char *  l,
const KnowledgeRecord r 
)
inline

Definition at line 475 of file KnowledgeCast.h.

◆ operator>() [2/7]

bool madara::knowledge::operator> ( const KnowledgeRecord l,
const char *  r 
)
inline

Definition at line 475 of file KnowledgeCast.h.

◆ operator>() [3/7]

bool madara::knowledge::operator> ( const KnowledgeRecord l,
const std::string &  r 
)
inline

Definition at line 475 of file KnowledgeCast.h.

◆ operator>() [4/7]

template<typename T , typename std::enable_if< !std::is_convertible< T, KnowledgeRecord >::value &&std::is_fundamental< T >::value, void * >::type = nullptr>
auto madara::knowledge::operator> ( const KnowledgeRecord l,
const T &  r 
) -> decltype(knowledge_cast<T>(l) > r)
inline

Definition at line 475 of file KnowledgeCast.h.

◆ operator>() [5/7]

bool madara::knowledge::operator> ( const KnowledgeRecord l,
std::nullptr_t   
)
inline

Definition at line 475 of file KnowledgeCast.h.

◆ operator>() [6/7]

bool madara::knowledge::operator> ( const std::string &  l,
const KnowledgeRecord r 
)
inline

Definition at line 475 of file KnowledgeCast.h.

◆ operator>() [7/7]

template<typename T , typename std::enable_if< !std::is_convertible< T, KnowledgeRecord >::value &&std::is_fundamental< T >::value, void * >::type = nullptr>
auto madara::knowledge::operator> ( const T &  l,
const KnowledgeRecord r 
) -> decltype(l > knowledge_cast<T>(r))
inline

Definition at line 475 of file KnowledgeCast.h.

◆ operator>=() [1/7]

bool madara::knowledge::operator>= ( const char *  l,
const KnowledgeRecord r 
)
inline

Definition at line 473 of file KnowledgeCast.h.

◆ operator>=() [2/7]

bool madara::knowledge::operator>= ( const KnowledgeRecord l,
const char *  r 
)
inline

Definition at line 473 of file KnowledgeCast.h.

◆ operator>=() [3/7]

bool madara::knowledge::operator>= ( const KnowledgeRecord l,
const std::string &  r 
)
inline

Definition at line 473 of file KnowledgeCast.h.

◆ operator>=() [4/7]

template<typename T , typename std::enable_if< !std::is_convertible< T, KnowledgeRecord >::value &&std::is_fundamental< T >::value, void * >::type = nullptr>
auto madara::knowledge::operator>= ( const KnowledgeRecord l,
const T &  r 
) -> decltype(knowledge_cast<T>(l) >= r)
inline

Definition at line 473 of file KnowledgeCast.h.

◆ operator>=() [5/7]

bool madara::knowledge::operator>= ( const KnowledgeRecord l,
std::nullptr_t   
)
inline

Definition at line 473 of file KnowledgeCast.h.

◆ operator>=() [6/7]

bool madara::knowledge::operator>= ( const std::string &  l,
const KnowledgeRecord r 
)
inline

Definition at line 473 of file KnowledgeCast.h.

◆ operator>=() [7/7]

template<typename T , typename std::enable_if< !std::is_convertible< T, KnowledgeRecord >::value &&std::is_fundamental< T >::value, void * >::type = nullptr>
auto madara::knowledge::operator>= ( const T &  l,
const KnowledgeRecord r 
) -> decltype(l >= knowledge_cast<T>(r))
inline

Definition at line 473 of file KnowledgeCast.h.

◆ safe_clear()

void madara::knowledge::safe_clear ( KnowledgeMap map)

Definition at line 1412 of file KnowledgeRecord.cpp.

◆ type_match()

template<typename T >
bool madara::knowledge::type_match ( type< T >  t,
const KnowledgeRecord kr 
)
inline

Check if a KnowledgeRecord type matches a specified type.

Parameters
tan instance of the type helper struct to infer the target type
krthe KnowledgeRecord to read from
Returns
true if the types match

◆ update_checkpoint_header()

static uint64_t madara::knowledge::update_checkpoint_header ( logger::Logger logger_,
uint64_t  clock_,
const CheckpointSettings settings,
std::fstream &  file,
FileHeader meta,
transport::MessageHeader checkpoint_header,
int64_t &  buffer_remaining,
utility::ScopedArray< char > &  buffer 
)
static

Definition at line 2291 of file ThreadSafeContext.cpp.