Fawkes API  Fawkes Development Version
Computable Class Reference

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 (mongo::Query query_to_compute, std::string collection, const boost::function< std::list< mongo::BSONObj >(mongo::BSONObj, std::string)> &compute_function, double caching_time=0.0, int priority=0)
 Constructor for object holding information about a computable. More...
 
std::list< mongo::BSONObj > compute (mongo::BSONObj query)
 Compute demanded information and insert it into the robot memory. More...
 
mongo::Query 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 29 of file computable.h.

Constructor & Destructor Documentation

◆ Computable()

Computable::Computable ( mongo::Query  query_to_compute,
std::string  collection,
const boost::function< std::list< mongo::BSONObj >(mongo::BSONObj, 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 42 of file computable.cpp.

Member Function Documentation

◆ compute()

std::list< BSONObj > Computable::compute ( mongo::BSONObj  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 103 of file computable.cpp.

◆ get_priority()

int Computable::get_priority ( )

Gets the priority of the computable.

Returns
The query

Definition at line 113 of file computable.cpp.

◆ get_query()

mongo::Query Computable::get_query ( )

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

Returns
The query

Definition at line 93 of file computable.cpp.


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