presage  0.8.7
Classes | Defines | Functions
presage.cpp File Reference
#include "presage.h"
#include "core/profileManager.h"
#include "core/predictorRegistry.h"
#include "core/context_tracker/contextTracker.h"
#include "core/selector.h"
#include "core/predictorActivator.h"
Include dependency graph for presage.cpp:

Go to the source code of this file.

Classes

struct  _presage
class  CPresageCallback

Defines

#define presage_exception_handler(CODE)
#define presage_exception_handler_with_result(CODE)

Functions

static char * alloc_c_str (const std::string &str)
presage_error_code_t presage_new (_presage_callback_get_past_stream past_stream_cb, void *past_stream_cb_arg, _presage_callback_get_future_stream future_stream_cb, void *future_stream_cb_arg, presage_t *result)
presage_error_code_t presage_new_with_config (_presage_callback_get_past_stream past_stream_cb, void *past_stream_cb_arg, _presage_callback_get_future_stream future_stream_cb, void *future_stream_cb_arg, const char *config, presage_t *result)
void presage_free (presage_t prsg)
void presage_free_string (char *str)
void presage_free_string_array (char **strs)
presage_error_code_t presage_predict (presage_t prsg, char ***result)
presage_error_code_t presage_completion (presage_t prsg, const char *token, char **result)
presage_error_code_t presage_context (presage_t prsg, char **result)
presage_error_code_t presage_context_change (presage_t prsg, int *result)
presage_error_code_t presage_prefix (presage_t prsg, char **result)
presage_error_code_t presage_config (presage_t prsg, const char *variable, char **result)
presage_error_code_t presage_config_set (presage_t prsg, const char *variable, const char *value)
presage_error_code_t presage_save_config (presage_t prsg)

Define Documentation

#define presage_exception_handler (   CODE)
Value:
try \
    { \
        CODE; \
    } \
    catch (PresageException& ex) \
    { \
        return ex.code (); \
    } \
    return PRESAGE_OK;

Definition at line 272 of file presage.cpp.

Referenced by presage_config_set(), and presage_save_config().

Value:
try \
    { \
        CODE; \
    } \
    catch (PresageException& ex) \
    { \
        (*result) = 0; \
        return ex.code (); \
    } \
    return PRESAGE_OK;

Definition at line 283 of file presage.cpp.

Referenced by presage_completion(), presage_config(), presage_context(), presage_context_change(), presage_new(), presage_new_with_config(), presage_predict(), and presage_prefix().


Function Documentation

static char* alloc_c_str ( const std::string &  str) [static]

Definition at line 295 of file presage.cpp.

Referenced by presage_completion(), presage_config(), presage_context(), and presage_prefix().

Here is the caller graph for this function:

presage_error_code_t presage_completion ( presage_t  prsg,
const char *  token,
char **  result 
)

Definition at line 389 of file presage.cpp.

References alloc_c_str(), Presage::completion(), presage_exception_handler_with_result, and _presage::presage_object.

Here is the call graph for this function:

presage_error_code_t presage_config ( presage_t  prsg,
const char *  variable,
char **  result 
)

Definition at line 421 of file presage.cpp.

References alloc_c_str(), Presage::config(), presage_exception_handler_with_result, and _presage::presage_object.

Here is the call graph for this function:

presage_error_code_t presage_config_set ( presage_t  prsg,
const char *  variable,
const char *  value 
)

Definition at line 429 of file presage.cpp.

References Presage::config(), presage_exception_handler, and _presage::presage_object.

Here is the call graph for this function:

presage_error_code_t presage_context ( presage_t  prsg,
char **  result 
)

Definition at line 397 of file presage.cpp.

References alloc_c_str(), Presage::context(), presage_exception_handler_with_result, and _presage::presage_object.

Here is the call graph for this function:

Definition at line 405 of file presage.cpp.

References Presage::context_change(), presage_exception_handler_with_result, and _presage::presage_object.

Here is the call graph for this function:

void presage_free ( presage_t  prsg)

Definition at line 341 of file presage.cpp.

References _presage::presage_callback_object, and _presage::presage_object.

void presage_free_string ( char *  str)

Definition at line 352 of file presage.cpp.

void presage_free_string_array ( char **  strs)

Definition at line 357 of file presage.cpp.

presage_error_code_t presage_new ( _presage_callback_get_past_stream  past_stream_cb,
void *  past_stream_cb_arg,
_presage_callback_get_future_stream  future_stream_cb,
void *  future_stream_cb_arg,
presage_t result 
)

Definition at line 303 of file presage.cpp.

References presage_exception_handler_with_result.

presage_error_code_t presage_new_with_config ( _presage_callback_get_past_stream  past_stream_cb,
void *  past_stream_cb_arg,
_presage_callback_get_future_stream  future_stream_cb,
void *  future_stream_cb_arg,
const char *  config,
presage_t result 
)

Definition at line 322 of file presage.cpp.

References presage_exception_handler_with_result.

presage_error_code_t presage_predict ( presage_t  prsg,
char ***  result 
)

Definition at line 367 of file presage.cpp.

References Presage::predict(), presage_exception_handler_with_result, and _presage::presage_object.

Here is the call graph for this function:

presage_error_code_t presage_prefix ( presage_t  prsg,
char **  result 
)

Definition at line 413 of file presage.cpp.

References alloc_c_str(), Presage::prefix(), presage_exception_handler_with_result, and _presage::presage_object.

Here is the call graph for this function:

Definition at line 437 of file presage.cpp.

References presage_exception_handler, _presage::presage_object, and Presage::save_config().

Here is the call graph for this function: