Fawkes API Fawkes Development Version
|
Class holding information for a single computable this class also enhances computed documents by additional information, such as the caching time. More...
#include <computable.h>
Public Member Functions | |
Computable (bsoncxx::document::value query_to_compute, std::string collection, const boost::function< std::list< bsoncxx::document::value >(bsoncxx::document::view, std::string)> &compute_function, double caching_time=0.0, int priority=0) | |
Constructor for object holding information about a computable. More... | |
std::list< bsoncxx::document::value > | compute (bsoncxx::document::view query) |
Compute demanded information and insert it into the robot memory. More... | |
bsoncxx::document::value | get_query () |
Gets the query that defines what information is computed by the Computable. More... | |
std::string | get_collection () |
Gets the collection the computable adds information to. More... | |
int | get_priority () |
Gets the priority of the computable. More... | |
Class holding information for a single computable this class also enhances computed documents by additional information, such as the caching time.
Definition at line 31 of file computable.h.
Computable::Computable | ( | bsoncxx::document::value | query_to_compute, |
std::string | collection, | ||
const boost::function< std::list< bsoncxx::document::value >(bsoncxx::document::view, std::string)> & | compute_function, | ||
double | caching_time = 0.0 , |
||
int | priority = 0 |
||
) |
Constructor for object holding information about a computable.
query_to_compute | Computable specification. Queries matching to this spec invoke the computable |
collection | Collection covered |
compute_function | Reference to the function providing the computation |
caching_time | How long should computed results for a query be cached and be used for identical queries in that time? |
priority | Computable priority ordering the evaluation |
Definition at line 44 of file computable.cpp.
|
virtual |
Definition at line 58 of file computable.cpp.
std::list< bsoncxx::document::value > Computable::compute | ( | bsoncxx::document::view | query | ) |
Compute demanded information and insert it into the robot memory.
query | The query demanding the computable information |
Definition at line 68 of file computable.cpp.
std::string Computable::get_collection | ( | ) |
Gets the collection the computable adds information to.
Definition at line 106 of file computable.cpp.
int Computable::get_priority | ( | ) |
Gets the priority of the computable.
Definition at line 116 of file computable.cpp.
bsoncxx::document::value Computable::get_query | ( | ) |
Gets the query that defines what information is computed by the Computable.
Definition at line 96 of file computable.cpp.