libcaf  0.15.0
Public Types | Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | List of all members
caf::actor_system_config Class Reference

Configures an actor_system on startup. More...

#include <actor_system_config.hpp>

Public Types

using module_factory = std::function< actor_system::module *(actor_system &)>
 
using module_factory_vector = std::vector< module_factory >
 
using value_factory = std::function< type_erased_value_ptr()>
 
using value_factory_string_map = std::unordered_map< std::string, value_factory >
 
using value_factory_rtti_map = std::unordered_map< std::type_index, value_factory >
 
using actor_factory_map = std::unordered_map< std::string, actor_factory >
 
using portable_name_map = std::unordered_map< std::type_index, std::string >
 
using error_renderer = std::function< std::string(uint8_t, atom_value, const message &)>
 
using error_renderer_map = std::unordered_map< atom_value, error_renderer >
 
using option_ptr = std::unique_ptr< config_option >
 
using options_vector = std::vector< option_ptr >
 

Public Member Functions

 actor_system_config (actor_system_config &&)=default
 
 actor_system_config (const actor_system_config &)=delete
 
actor_system_configoperator= (const actor_system_config &)=delete
 
actor_system_configparse (message &args, std::istream &ini_stream)
 
actor_system_configparse (int argc, char **argv, std::istream &ini_stream)
 
actor_system_configparse (int argc, char **argv, const char *config_file_name=nullptr)
 
actor_system_configadd_actor_factory (std::string name, actor_factory fun)
 Allows other nodes to spawn actors created by fun dynamically by using name as identifier. More...
 
template<class T , class... Ts>
actor_system_configadd_actor_type (std::string name)
 Allows other nodes to spawn actors of type T dynamically by using name as identifier. More...
 
template<class F >
actor_system_configadd_actor_type (std::string name, F f)
 Allows other nodes to spawn actors implemented by function f dynamically by using name as identifier. More...
 
template<class T >
actor_system_configadd_message_type (std::string name)
 Adds message type T with runtime type info name.
 
actor_system_configadd_error_category (atom_value category, error_renderer renderer)
 Enables the actor system to convert errors of this error category to human-readable strings via renderer. More...
 
template<class T >
actor_system_configadd_error_category (atom_value category)
 Enables the actor system to convert errors of this error category to human-readable strings via to_string(T). More...
 
template<class T , class... Ts>
actor_system_configload ()
 Loads module T with optional template parameters Ts....
 
actor_system_configset (const char *config_name, config_value config_value)
 Sets a config by using its INI name config_name to config_value.
 

Public Attributes

bool cli_helptext_printed
 Stores whether the help text for this config object was printed. More...
 
bool slave_mode
 Stores whether this node was started in slave mode.
 
std::string slave_name
 Stores the name of this node when started in slave mode.
 
std::string bootstrap_node
 Stores credentials for connecting to the bootstrap node when using the caf-run launcher. More...
 
message args_remainder
 Stores CLI arguments that were not consumed by CAF.
 
atom_value scheduler_policy
 
size_t scheduler_max_threads
 
size_t scheduler_max_throughput
 
bool scheduler_enable_profiling
 
size_t scheduler_profiling_ms_resolution
 
std::string scheduler_profiling_output_file
 
size_t work_stealing_aggressive_poll_attempts
 
size_t work_stealing_aggressive_steal_interval
 
size_t work_stealing_moderate_poll_attempts
 
size_t work_stealing_moderate_steal_interval
 
size_t work_stealing_moderate_sleep_duration_us
 
size_t work_stealing_relaxed_steal_interval
 
size_t work_stealing_relaxed_sleep_duration_us
 
atom_value middleman_network_backend
 
bool middleman_enable_automatic_connections
 
size_t middleman_max_consecutive_reads
 
size_t middleman_heartbeat_interval
 
std::string nexus_host
 
uint16_t nexus_port
 
std::string opencl_device_ids
 
value_factory_string_map value_factories_by_name
 
value_factory_rtti_map value_factories_by_rtti
 
portable_name_map type_names_by_rtti
 
actor_factory_map actor_factories
 
module_factory_vector module_factories
 
error_renderer_map error_renderers
 
int(* slave_mode_fun )(actor_system &, const actor_system_config &)
 

Protected Member Functions

virtual std::string make_help_text (const std::vector< message::cli_arg > &)
 

Protected Attributes

options_vector custom_options_
 

Detailed Description

Configures an actor_system on startup.

Member Function Documentation

actor_system_config& caf::actor_system_config::add_actor_factory ( std::string  name,
actor_factory  fun 
)

Allows other nodes to spawn actors created by fun dynamically by using name as identifier.

Attention
This feature is experimental.
template<class T , class... Ts>
actor_system_config& caf::actor_system_config::add_actor_type ( std::string  name)

Allows other nodes to spawn actors of type T dynamically by using name as identifier.

Attention
This feature is experimental.
template<class F >
actor_system_config& caf::actor_system_config::add_actor_type ( std::string  name,
f 
)

Allows other nodes to spawn actors implemented by function f dynamically by using name as identifier.

Attention
This feature is experimental.
actor_system_config& caf::actor_system_config::add_error_category ( atom_value  category,
error_renderer  renderer 
)

Enables the actor system to convert errors of this error category to human-readable strings via renderer.

template<class T >
actor_system_config& caf::actor_system_config::add_error_category ( atom_value  category)

Enables the actor system to convert errors of this error category to human-readable strings via to_string(T).

Member Data Documentation

std::string caf::actor_system_config::bootstrap_node

Stores credentials for connecting to the bootstrap node when using the caf-run launcher.

bool caf::actor_system_config::cli_helptext_printed

Stores whether the help text for this config object was printed.

If set to true, the application should not use this config object to initialize an actor_system and return from main immediately.


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