Fawkes API  Fawkes Development Version
Computable Class Reference

#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...
 

Detailed Description

Class holding information for a single computable this class also enhances computed documents by additional information, such as the caching time

Author
Frederik Zwilling

Definition at line 30 of file computable.h.

Constructor & Destructor Documentation

◆ Computable()

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.

Parameters
query_to_computeComputable specification. Queries matching to this spec invoke the computable
collectionCollection covered
compute_functionReference to the function providing the computation
caching_timeHow long should computed results for a query be cached and be used for identical queries in that time?
priorityComputable priority ordering the evaluation

Definition at line 43 of file computable.cpp.

Member Function Documentation

◆ compute()

std::list< bsoncxx::document::value > Computable::compute ( bsoncxx::document::view  query)

Compute demanded information and insert it into the robot memory.

Parameters
queryThe query demanding the computable information
Returns
Documents to insert extended with computable meta information (e.g. caching time)

Definition at line 67 of file computable.cpp.

◆ get_collection()

std::string Computable::get_collection ( )

Gets the collection the computable adds information to.

Returns
The query

Definition at line 105 of file computable.cpp.

◆ get_priority()

int Computable::get_priority ( )

Gets the priority of the computable.

Returns
The query

Definition at line 115 of file computable.cpp.

◆ get_query()

bsoncxx::document::value Computable::get_query ( )

Gets the query that defines what information is computed by the Computable.

Returns
The query

Definition at line 95 of file computable.cpp.


The documentation for this class was generated from the following files: