SObjectizer  5.5
Classes | Public Types | Public Member Functions | Static Public Member Functions | List of all members
so_5::environment_infrastructure_t Class Referenceabstract

An interface for environment_infrastructure entity. More...

#include <environment_infrastructure.hpp>

Inheritance diagram for so_5::environment_infrastructure_t:
so_5::env_infrastructures::default_mt::impl::mt_env_infrastructure_t so_5::env_infrastructures::simple_mtsafe::impl::env_infrastructure_t< Activity_Tracker > so_5::env_infrastructures::simple_not_mtsafe::impl::env_infrastructure_t< Activity_Tracker >

Classes

struct  coop_repository_stats_t
 Statistical data for run-time monitoring of coop repository content. More...
 

Public Types

using env_init_t = std::function< void() >
 Type of function for performing environment initialization actions. More...
 

Public Member Functions

 environment_infrastructure_t ()=default
 
 environment_infrastructure_t (const environment_infrastructure_t &)=delete
 
 environment_infrastructure_t (environment_infrastructure_t &&)=delete
 
environment_infrastructure_toperator= (const environment_infrastructure_t &)=delete
 
environment_infrastructure_toperator= (environment_infrastructure_t &&)=delete
 
virtual ~environment_infrastructure_t () noexcept=default
 
virtual void launch (env_init_t init_fn)=0
 Do actual launch of SObjectizer's Environment. More...
 
virtual void stop ()=0
 Initiate a signal for shutdown of Environment. More...
 
virtual SO_5_NODISCARD coop_unique_holder_t make_coop (coop_handle_t parent, disp_binder_shptr_t default_binder)=0
 Create an instance of a new coop. More...
 
virtual SO_5_NODISCARD coop_handle_t register_coop (coop_unique_holder_t coop)=0
 Register new cooperation. More...
 
virtual void ready_to_deregister_notify (coop_shptr_t coop) noexcept=0
 
virtual bool final_deregister_coop (coop_shptr_t coop)=0
 Do final actions of the cooperation deregistration. More...
 
virtual so_5::timer_id_t schedule_timer (const std::type_index &type_wrapper, const message_ref_t &msg, const mbox_t &mbox, std::chrono::steady_clock::duration pause, std::chrono::steady_clock::duration period)=0
 Initiate a timer (delayed or periodic message). More...
 
virtual void single_timer (const std::type_index &type_wrapper, const message_ref_t &msg, const mbox_t &mbox, std::chrono::steady_clock::duration pause)=0
 Initiate a delayed message. More...
 
virtual ::so_5::stats::controller_tstats_controller () noexcept=0
 Get stats controller for the environment. More...
 
virtual ::so_5::stats::repository_tstats_repository () noexcept=0
 Get stats repository for the environment. More...
 
virtual coop_repository_stats_t query_coop_repository_stats ()=0
 Query run-time statistics for cooperation repository. More...
 
virtual timer_thread_stats_t query_timer_thread_stats ()=0
 Query run-time statistics for timer (thread or manager). More...
 
virtual disp_binder_shptr_t make_default_disp_binder ()=0
 Create a binder for the default dispatcher. More...
 

Static Public Member Functions

static environment_infrastructure_deleter_fnptr_t default_deleter ()
 Default deleter for environment_infrastructure object. More...
 

Detailed Description

An interface for environment_infrastructure entity.

Environment infrastructure implements several important parts of SObjectizer's Environment:

This class defines the interface of environment_infrastructure. All environment_infrastructure implementations must inherit this interface.

Since
v.5.5.19

Member Typedef Documentation

◆ env_init_t

using so_5::environment_infrastructure_t::env_init_t = std::function< void() >

Type of function for performing environment initialization actions.

Constructor & Destructor Documentation

◆ environment_infrastructure_t() [1/3]

so_5::environment_infrastructure_t::environment_infrastructure_t ( )
default

◆ environment_infrastructure_t() [2/3]

so_5::environment_infrastructure_t::environment_infrastructure_t ( const environment_infrastructure_t )
delete

◆ environment_infrastructure_t() [3/3]

so_5::environment_infrastructure_t::environment_infrastructure_t ( environment_infrastructure_t &&  )
delete

◆ ~environment_infrastructure_t()

virtual so_5::environment_infrastructure_t::~environment_infrastructure_t ( )
virtualdefaultnoexcept

Member Function Documentation

◆ default_deleter()

static environment_infrastructure_deleter_fnptr_t so_5::environment_infrastructure_t::default_deleter ( )
inlinestatic

Default deleter for environment_infrastructure object.

This function is intended for simplification of code where environment_infrastructure_unique_ptr_t must be created with default deleter.

For example:

auto my_env = new some_user_specific_env_infrastructure(...);

◆ final_deregister_coop()

virtual bool so_5::environment_infrastructure_t::final_deregister_coop ( coop_shptr_t  coop)
pure virtual

Do final actions of the cooperation deregistration.

Return values
truethere are some live cooperations.
falsethere is no more live cooperations.
Parameters
coopCooperation to be deregistered.

Implemented in so_5::env_infrastructures::simple_mtsafe::impl::env_infrastructure_t< Activity_Tracker >, so_5::env_infrastructures::simple_not_mtsafe::impl::env_infrastructure_t< Activity_Tracker >, and so_5::env_infrastructures::default_mt::impl::mt_env_infrastructure_t.

◆ launch()

virtual void so_5::environment_infrastructure_t::launch ( env_init_t  init_fn)
pure virtual

Do actual launch of SObjectizer's Environment.

This method is called as a final step of environment lauch procedure.

Stats_controller, all additional layers and dispatchers are already started before calling on this method.

This method must lock the current thread and return only when SObjectizer's Environment finishes its work.

Parameters
init_fnActions from Environment which must be performed to complete launch procedure.

Implemented in so_5::env_infrastructures::simple_mtsafe::impl::env_infrastructure_t< Activity_Tracker >, so_5::env_infrastructures::simple_not_mtsafe::impl::env_infrastructure_t< Activity_Tracker >, and so_5::env_infrastructures::default_mt::impl::mt_env_infrastructure_t.

◆ make_coop()

virtual SO_5_NODISCARD coop_unique_holder_t so_5::environment_infrastructure_t::make_coop ( coop_handle_t  parent,
disp_binder_shptr_t  default_binder 
)
pure virtual

◆ make_default_disp_binder()

virtual disp_binder_shptr_t so_5::environment_infrastructure_t::make_default_disp_binder ( )
pure virtual

◆ operator=() [1/2]

environment_infrastructure_t& so_5::environment_infrastructure_t::operator= ( const environment_infrastructure_t )
delete

◆ operator=() [2/2]

environment_infrastructure_t& so_5::environment_infrastructure_t::operator= ( environment_infrastructure_t &&  )
delete

◆ query_coop_repository_stats()

virtual coop_repository_stats_t so_5::environment_infrastructure_t::query_coop_repository_stats ( )
pure virtual

◆ query_timer_thread_stats()

virtual timer_thread_stats_t so_5::environment_infrastructure_t::query_timer_thread_stats ( )
pure virtual

◆ ready_to_deregister_notify()

virtual void so_5::environment_infrastructure_t::ready_to_deregister_notify ( coop_shptr_t  coop)
pure virtualnoexcept

Notification about cooperation for which the final dereg step can be performed.

Parameters
coopA cooperation which can be finaly deregistered.

Implemented in so_5::env_infrastructures::simple_mtsafe::impl::env_infrastructure_t< Activity_Tracker >, so_5::env_infrastructures::simple_not_mtsafe::impl::env_infrastructure_t< Activity_Tracker >, and so_5::env_infrastructures::default_mt::impl::mt_env_infrastructure_t.

◆ register_coop()

virtual SO_5_NODISCARD coop_handle_t so_5::environment_infrastructure_t::register_coop ( coop_unique_holder_t  coop)
pure virtual

◆ schedule_timer()

virtual so_5::timer_id_t so_5::environment_infrastructure_t::schedule_timer ( const std::type_index &  type_wrapper,
const message_ref_t msg,
const mbox_t mbox,
std::chrono::steady_clock::duration  pause,
std::chrono::steady_clock::duration  period 
)
pure virtual

◆ single_timer()

virtual void so_5::environment_infrastructure_t::single_timer ( const std::type_index &  type_wrapper,
const message_ref_t msg,
const mbox_t mbox,
std::chrono::steady_clock::duration  pause 
)
pure virtual

◆ stats_controller()

virtual ::so_5::stats::controller_t& so_5::environment_infrastructure_t::stats_controller ( )
pure virtualnoexcept

Get stats controller for the environment.

Note
An instance of stats_controller is created and destroyed by environment_infrastructure object. But stats_controller is started and stopped by environment object itself. It means that stats_controller must be constructed and must be ready to use just after creation of environment_infrastructure instance and long before invocation of launch() method.

Implemented in so_5::env_infrastructures::simple_mtsafe::impl::env_infrastructure_t< Activity_Tracker >, so_5::env_infrastructures::simple_not_mtsafe::impl::env_infrastructure_t< Activity_Tracker >, and so_5::env_infrastructures::default_mt::impl::mt_env_infrastructure_t.

◆ stats_repository()

virtual ::so_5::stats::repository_t& so_5::environment_infrastructure_t::stats_repository ( )
pure virtualnoexcept

◆ stop()

virtual void so_5::environment_infrastructure_t::stop ( )
pure virtual

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