Bobox
Public Types | Public Member Functions
bobox::manager Class Reference

The manager is responsible for request management. i.e. their instatiation and evaluation. In the application at most one instance of this class must exist. More...

#include <bobox_manager.hpp>

List of all members.

Public Types

enum  event_type {
  ET_NONE = 0, ET_INPUT = 1, ET_OUTPUT = 2, ET_LOG = 4,
  ET_EVENT = 8, ET_ALL = ET_INPUT|ET_OUTPUT|ET_LOG|ET_EVENT
}
 Enumerates the types of event. More...

Public Member Functions

 manager (scheduling_strategy_type scheduling_strategy=SS_NUMA_AWARE, size_t memory_limit=0, plevel_type optimal_plevel=plevel_type::invalid())
 Constructor.
void add_breakpoint (request_id_type rqid, size_t event_idx)
 Adds a breakpoint which will occur when the event number event_idx is fired.
void add_listener (manager_listener *listener)
 Adds a new listener.
void cancel_request (request_id_type rqid, request_result_type=RRT_CANCELED)
 Cancels the request.
void capture_events (request_id_type rqid, box_id_type id, event_type type)
 Enable event capturing.
request_id_type create_request (const box_model_ptr_type &main, const parameters_ptr_type &params=parameters::get_empty_parameters())
 Creates a new request.
void destroy_request (request_id_type rqid)
 Destroys the request.
void dump_request (request_id_type rqid, std::ostream &dot, bool dump_box_info=true, bool dump_arcs_info=true)
 Dumps the information about the request evaluation.
request_result_type get_result (request_id_type rqid)
 Gets the result of the request.
const resultsget_results (request_id_type rqid)
 Gets the results of the request.
void remove_listener (manager_listener *listener)
 Removes the listener.
void run_request (request_id_type rqid)
 Runs the request.
void set_event_stream (request_id_type rqid, std::ostream *out)
 Sets the stream to which all captured events will be logged.
void wait_on_request (request_id_type rqid)
 Waits until the request finishes.

Detailed Description

The manager is responsible for request management. i.e. their instatiation and evaluation. In the application at most one instance of this class must exist.


Member Enumeration Documentation

Enumerates the types of event.

Remarks:
Present only if macro BOBOX_DEBUG is defined.
Enumerator:
ET_NONE 

None.

ET_INPUT 

A box received an envelope.

ET_OUTPUT 

A box sent an envelope.

ET_LOG 

A box wrote something to the log.

ET_EVENT 

A box fired an event.

ET_ALL 

All events together.


Constructor & Destructor Documentation

bobox::manager::manager ( scheduling_strategy_type  scheduling_strategy = SS_NUMA_AWARE,
size_t  memory_limit = 0,
plevel_type  optimal_plevel = plevel_type::invalid() 
)

Constructor.

Parameters:
scheduling_strategy(optional) The scheduling strategy.
memory_limit(optional) The memory limit, zero if unlimited.
optimal_plevel(optional) The optimal level of parallelization .

Member Function Documentation

void bobox::manager::add_breakpoint ( request_id_type  rqid,
size_t  event_idx 
)

Adds a breakpoint which will occur when the event number event_idx is fired.

Parameters:
rqidThe request identifier.
event_idxOne-based index of the event.
Remarks:
Present only if macro BOBOX_DEBUG is defined.

Cancels the request.

Parameters:
rqidThe request identifier.

Enable event capturing.

Parameters:
rqidThe request identifier.
idThe identifier of the box.
typeThe type of the event to capture.
Remarks:
Present only if macro BOBOX_DEBUG is defined.
request_id_type bobox::manager::create_request ( const box_model_ptr_type main,
const parameters_ptr_type &  params = parameters::get_empty_parameters() 
)

Creates a new request.

Parameters:
mainThe main model.
params(optional) Global parameters for the request.
Returns:
The new request.

Destroys the request.

Parameters:
rqidThe request identifier.
void bobox::manager::dump_request ( request_id_type  rqid,
std::ostream &  dot,
bool  dump_box_info = true,
bool  dump_arcs_info = true 
)

Dumps the information about the request evaluation.

Parameters:
rqidThe request identifier.
dotThe output stream to which the dot output is written.

Gets the result of the request.

Parameters:
rqidThe request identifier.

Gets the results of the request.

Parameters:
rqidThe request identifier.

Runs the request.

Parameters:
rqidThe request identifier.
void bobox::manager::set_event_stream ( request_id_type  rqid,
std::ostream *  out 
)

Sets the stream to which all captured events will be logged.

Parameters:
rqidThe request identifier.
outThe event stream.
Remarks:
Present only if macro BOBOX_DEBUG is defined.

Waits until the request finishes.

Parameters:
rqidThe request identifier.

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