Reinforcement Learning  1.1
reinforcement_learning Namespace Reference

[Error Generator] More...

Classes

class  live_model
 Interface class for the Inference API. More...
 
class  ranking_response
 choose_rank() returns the action choice using ranking_response. ranking_response contains all the actions and distribution from with the action was sampled. It also contains the chosen action id and the unique event_id representing the choice. This unique event_id must be used to report back outcomes against this choice for the online trainer. More...
 
class  api_status
 Report status of all API calls. More...
 
struct  status_builder
 Helper class used in report_error template funcstions to return status from API calls. More...
 

Functions

template<typename Last >
void report_error (std::ostringstream &oss, const Last &last)
 Ends recursion of report_error variadic template with the Last argument. More...
 
template<typename First , typename... Rest>
void report_error (std::ostringstream &oss, const First &first, const Rest &... rest)
 Begins recursion of report_error variadic template with ostringstream to serialize error information. More...
 
template<typename... All>
int report_error (api_status *status, int scode, const All &... all)
 The main report_error template used to serialize error into api_status The method most end users will use with a status code and a number of objects to be serialised into an api_status. More...
 
template<typename T >
reinforcement_learning::status_builderoperator<< (reinforcement_learning::status_builder &sbuilder, const T &val)
 left shift operator to serialize types into stringstream held in status_builder More...
 
int report_error (status_builder &sbuilder)
 Terminates recursion of report_error. More...
 
template<typename Last >
int report_error (status_builder &sbuilder, const Last &last)
 report_error that takes the final paramter More...
 
template<typename First , typename... Rest>
int report_error (status_builder &sbuilder, const First &first, const Rest &... rest)
 variadic template report_error that takes a list of parameters More...
 

Detailed Description

[Error Generator]

Function Documentation

◆ operator<<()

template<typename T >
reinforcement_learning::status_builder& reinforcement_learning::operator<< ( reinforcement_learning::status_builder sbuilder,
const T &  val 
)

left shift operator to serialize types into stringstream held in status_builder

Template Parameters
TType to serialize
Parameters
sbuilderStatus builder that holds serialized error message
valError code
Returns
reinforcement_learning::status_builder& Passed in status builder so left shift operators can be chained together.

◆ report_error() [1/6]

template<typename... All>
int reinforcement_learning::report_error ( api_status status,
int  scode,
const All &...  all 
)

The main report_error template used to serialize error into api_status The method most end users will use with a status code and a number of objects to be serialised into an api_status.

Template Parameters
AllAll the type arguments to the variadic template
Parameters
statusStatus object to serialize error description into
scodeError code
allParameter list argument for the variadic template
Returns
int Error code that was passed in

◆ report_error() [2/6]

int reinforcement_learning::report_error ( status_builder sbuilder)
inline

Terminates recursion of report_error.

Parameters
sbuilderstatus_builder that contains the serialized error string
Returns
int Error status

◆ report_error() [3/6]

template<typename First , typename... Rest>
int reinforcement_learning::report_error ( status_builder sbuilder,
const First &  first,
const Rest &...  rest 
)

variadic template report_error that takes a list of parameters

Template Parameters
FirstType of first parameter in parameter list
RestTail parameter types in paramter list
Parameters
sbuilderstatus_builder that contains the serialized error string
firstFirst parameter value
restTail paramter value list
Returns
int Error status

◆ report_error() [4/6]

template<typename Last >
int reinforcement_learning::report_error ( status_builder sbuilder,
const Last &  last 
)

report_error that takes the final paramter

Template Parameters
LastFinal paramter type
Parameters
sbuilderstatus_builder that contains the serialized error string
lastFinal parameter value
Returns
int Error status

◆ report_error() [5/6]

template<typename First , typename... Rest>
void reinforcement_learning::report_error ( std::ostringstream &  oss,
const First &  first,
const Rest &...  rest 
)

Begins recursion of report_error variadic template with ostringstream to serialize error information.

Template Parameters
FirstType of first parameter to report_error
RestRest of the parameter type list
Parameters
ossostringstream that contains serialized error data
firstvalue of the first parameter to report_error
restrest of the values to report error

◆ report_error() [6/6]

template<typename Last >
void reinforcement_learning::report_error ( std::ostringstream &  oss,
const Last &  last 
)

Ends recursion of report_error variadic template with the Last argument.

Template Parameters
Lasttype of Last argument to report_error
Parameters
ossostringstream that contains serialized error data
lastvalue of last argument to report_error