MADARA  3.1.8
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.
 
 rcw
 Namespace holding Read-Compute-Write based abstractions for knowledge base access.
 
 tags
 Tags to specify what type to construct in KnowledgeRecord forwarding constructors.
 

Classes

class  AggregateFilter
 This class stores a function definition. More...
 
class  CheckpointSettings
 Holds settings for checkpoints to load or save. 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  Event
 Expression container for timed event. More...
 
class  FileHeader
 Defines a file header which is the default for KaRL checkpointing. More...
 
class  Files
 This class provides file repo capabilities to the knowledge base. More...
 
class  FileSettings
 This class provides an interface into the KnowledgeEngine that governs how files are prioritized, modified, and handled. More...
 
class  Function
 This class stores a function definition. 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...
 
class  TimedEventThread
 Thread executing timed events. More...
 
struct  TimedEventThreadInfo
 A struct that is passed to Timed Event Thread Executors to control job handling, shutdowns, etc. More...
 
class  TimedExecutor
 This class executes expression events at specified times. More...
 
class  VariableReference
 Optimized reference to a variable within the knowledge base. More...
 
class  Variables
 Provides an interface for external functions into the MADARA KaRL variable settings. More...
 
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::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 std::pair< ACE_Time_Value, Event * > TimedEvent
 
typedef madara::knowledge::KnowledgeRecord VALUE_TYPE
 
typedef std::vector< VariableReferenceVariableReferences
 a vector of variable references More...
 

Enumerations

enum  { ASSIGNMENT = 0, MULTIPLE_ASSIGNMENT = 1 }
 

Functions

template<typename T >
void destruct (T &x)
 
MADARA_Export Event fill_event (KnowledgeBase &knowledge, const std::string &expression, double delay=0.0, double period=0.0, int executions=-1)
 Fills an event struct. More...
 
template<class O >
knowledge_cast (const KnowledgeRecord &in)
 By default, call constructor of target class; for other semantics, define specializations. More...
 
KnowledgeRecord knowledge_cast (const int &in)
 
KnowledgeRecord knowledge_cast (const unsigned int &in)
 
KnowledgeRecord knowledge_cast (const long int &in)
 
KnowledgeRecord knowledge_cast (const unsigned long int &in)
 
KnowledgeRecord knowledge_cast (const long long int &in)
 
KnowledgeRecord knowledge_cast (const unsigned long long int &in)
 
KnowledgeRecord knowledge_cast (const short &in)
 
KnowledgeRecord knowledge_cast (const unsigned short &in)
 
KnowledgeRecord knowledge_cast (const char &in)
 
KnowledgeRecord knowledge_cast (const unsigned char &in)
 
KnowledgeRecord knowledge_cast (const bool &in)
 
KnowledgeRecord knowledge_cast (const float &in)
 
KnowledgeRecord knowledge_cast (const double &in)
 
KnowledgeRecord knowledge_cast (const long double &in)
 
KnowledgeRecord knowledge_cast (const std::string &in)
 
KnowledgeRecord knowledge_cast (const std::vector< int64_t > &in)
 
KnowledgeRecord knowledge_cast (const std::vector< double > &in)
 
template<size_t N>
KnowledgeRecord knowledge_cast (const uint64_t(&in)[N])
 
template<size_t N>
KnowledgeRecord knowledge_cast (const double(&in)[N])
 
KnowledgeRecordknowledge_cast (KnowledgeRecord &in)
 
template<>
bool knowledge_cast< bool > (const KnowledgeRecord &in)
 
template<>
char knowledge_cast< char > (const KnowledgeRecord &in)
 
template<>
double knowledge_cast< double > (const KnowledgeRecord &in)
 
template<>
float knowledge_cast< float > (const KnowledgeRecord &in)
 
template<>
int knowledge_cast< int > (const KnowledgeRecord &in)
 
template<>
KnowledgeRecord knowledge_cast< KnowledgeRecord > (const KnowledgeRecord &in)
 
template<>
long double knowledge_cast< long double > (const KnowledgeRecord &in)
 
template<>
long int knowledge_cast< long int > (const KnowledgeRecord &in)
 
template<>
long long int knowledge_cast< long long int > (const KnowledgeRecord &in)
 
template<>
short knowledge_cast< short > (const KnowledgeRecord &in)
 
template<>
std::string knowledge_cast< std::string > (const KnowledgeRecord &in)
 
template<>
std::vector< double > knowledge_cast< std::vector< double > > (const KnowledgeRecord &in)
 
template<>
std::vector< int64_t > knowledge_cast< std::vector< int64_t > > (const KnowledgeRecord &in)
 
template<>
unsigned char knowledge_cast< unsigned char > (const KnowledgeRecord &in)
 
template<>
unsigned int knowledge_cast< unsigned int > (const KnowledgeRecord &in)
 
template<>
unsigned long int knowledge_cast< unsigned long int > (const KnowledgeRecord &in)
 
template<>
unsigned long long int knowledge_cast< unsigned long long int > (const KnowledgeRecord &in)
 
template<>
unsigned short knowledge_cast< unsigned short > (const KnowledgeRecord &in)
 
uint32_t max_quality (const KnowledgeRecords &records)
 Returns the maximum quality within the records. More...
 
std::ostream & operator<< (std::ostream &stream, const KnowledgeRecord &rhs)
 output stream buffering More...
 

Detailed Description

Provides functions and classes for the distributed knowledge base.

Main entry point to library.

Typedef Documentation

Typedef for a list of aggregate filters.

Definition at line 175 of file AggregateFilter.h.

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 67 of file ThreadSafeContext.h.

a chain of filters

Definition at line 41 of file KnowledgeRecordFilters.h.

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

a map of types to filter chain

Definition at line 44 of file KnowledgeRecordFilters.h.

Definition at line 20 of file FunctionArguments.h.

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

Definition at line 17 of file FunctionMap.h.

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

Definition at line 1463 of file KnowledgeRecord.h.

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

Definition at line 1457 of file KnowledgeRecord.h.

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

Definition at line 1461 of file KnowledgeRecord.h.

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

Definition at line 1459 of file KnowledgeRecord.h.

Definition at line 1458 of file KnowledgeRecord.h.

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 72 of file ThreadSafeContext.h.

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

Definition at line 1460 of file KnowledgeRecord.h.

typedef std::pair<ACE_Time_Value, Event *> madara::knowledge::TimedEvent

Definition at line 69 of file TimedExecutor.h.

a vector of variable references

Definition at line 109 of file VariableReference.h.

Enumeration Type Documentation

anonymous enum
Enumerator
ASSIGNMENT 
MULTIPLE_ASSIGNMENT 

Definition at line 8 of file UpdateTypes.h.

Function Documentation

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

Definition at line 847 of file KnowledgeRecord.inl.

madara::knowledge::Event madara::knowledge::fill_event ( KnowledgeBase knowledge,
const std::string &  expression,
double  delay = 0.0,
double  period = 0.0,
int  executions = -1 
)

Fills an event struct.

It is highly recommended that you use this function.

Parameters
knowledgethe knowledge base to reference and execute in
expressionKaRL expression to execute
delaytime, in seconds, before executing
periodtime, in seconds, between executions
executionsnumber of executions. -1 means infinite executions until a shutdown is called on the timed executor

Definition at line 217 of file TimedExecutor.cpp.

template<class O >
const KnowledgeRecord & madara::knowledge::knowledge_cast ( const KnowledgeRecord in)
inline

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

Definition at line 72 of file knowledge_cast.h.

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

Definition at line 185 of file knowledge_cast.h.

KnowledgeRecord madara::knowledge::knowledge_cast ( const unsigned int &  in)
inline

Definition at line 190 of file knowledge_cast.h.

KnowledgeRecord madara::knowledge::knowledge_cast ( const long int &  in)
inline

Definition at line 195 of file knowledge_cast.h.

KnowledgeRecord madara::knowledge::knowledge_cast ( const unsigned long int &  in)
inline

Definition at line 200 of file knowledge_cast.h.

KnowledgeRecord madara::knowledge::knowledge_cast ( const long long int &  in)
inline

Definition at line 205 of file knowledge_cast.h.

KnowledgeRecord madara::knowledge::knowledge_cast ( const unsigned long long int &  in)
inline

Definition at line 210 of file knowledge_cast.h.

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

Definition at line 215 of file knowledge_cast.h.

KnowledgeRecord madara::knowledge::knowledge_cast ( const unsigned short &  in)
inline

Definition at line 220 of file knowledge_cast.h.

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

Definition at line 225 of file knowledge_cast.h.

KnowledgeRecord madara::knowledge::knowledge_cast ( const unsigned char &  in)
inline

Definition at line 230 of file knowledge_cast.h.

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

Definition at line 235 of file knowledge_cast.h.

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

Definition at line 240 of file knowledge_cast.h.

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

Definition at line 245 of file knowledge_cast.h.

KnowledgeRecord madara::knowledge::knowledge_cast ( const long double &  in)
inline

Definition at line 250 of file knowledge_cast.h.

KnowledgeRecord madara::knowledge::knowledge_cast ( const std::string &  in)
inline

Definition at line 255 of file knowledge_cast.h.

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

Definition at line 260 of file knowledge_cast.h.

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

Definition at line 265 of file knowledge_cast.h.

template<size_t N>
KnowledgeRecord madara::knowledge::knowledge_cast ( const uint64_t(&)  in[N])
inline

Definition at line 271 of file knowledge_cast.h.

template<size_t N>
KnowledgeRecord madara::knowledge::knowledge_cast ( const double(&)  in[N])
inline

Definition at line 277 of file knowledge_cast.h.

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

Definition at line 282 of file knowledge_cast.h.

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

Definition at line 96 of file knowledge_cast.h.

template<>
char madara::knowledge::knowledge_cast< char > ( const KnowledgeRecord in)
inline

Definition at line 102 of file knowledge_cast.h.

template<>
double madara::knowledge::knowledge_cast< double > ( const KnowledgeRecord in)
inline

Definition at line 84 of file knowledge_cast.h.

template<>
float madara::knowledge::knowledge_cast< float > ( const KnowledgeRecord in)
inline

Definition at line 78 of file knowledge_cast.h.

template<>
int madara::knowledge::knowledge_cast< int > ( const KnowledgeRecord in)
inline

Definition at line 126 of file knowledge_cast.h.

Definition at line 180 of file knowledge_cast.h.

template<>
long double madara::knowledge::knowledge_cast< long double > ( const KnowledgeRecord in)
inline

Definition at line 90 of file knowledge_cast.h.

template<>
long int madara::knowledge::knowledge_cast< long int > ( const KnowledgeRecord in)
inline

Definition at line 138 of file knowledge_cast.h.

template<>
long long int madara::knowledge::knowledge_cast< long long int > ( const KnowledgeRecord in)
inline

Definition at line 150 of file knowledge_cast.h.

template<>
short madara::knowledge::knowledge_cast< short > ( const KnowledgeRecord in)
inline

Definition at line 114 of file knowledge_cast.h.

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

Definition at line 162 of file knowledge_cast.h.

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

Definition at line 174 of file knowledge_cast.h.

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

Definition at line 168 of file knowledge_cast.h.

template<>
unsigned char madara::knowledge::knowledge_cast< unsigned char > ( const KnowledgeRecord in)
inline

Definition at line 108 of file knowledge_cast.h.

template<>
unsigned int madara::knowledge::knowledge_cast< unsigned int > ( const KnowledgeRecord in)
inline

Definition at line 132 of file knowledge_cast.h.

template<>
unsigned long int madara::knowledge::knowledge_cast< unsigned long int > ( const KnowledgeRecord in)
inline

Definition at line 144 of file knowledge_cast.h.

template<>
unsigned long long int madara::knowledge::knowledge_cast< unsigned long long int > ( const KnowledgeRecord in)
inline

Definition at line 156 of file knowledge_cast.h.

template<>
unsigned short madara::knowledge::knowledge_cast< unsigned short > ( const KnowledgeRecord in)
inline

Definition at line 120 of file knowledge_cast.h.

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 819 of file KnowledgeRecord.inl.

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

output stream buffering

Definition at line 542 of file KnowledgeRecord.inl.