#include <iostream>
#include <time.h>
{
const state_t st_first{ this, "first" };
const state_t st_second{ this, "second" };
const state_t st_third{ this, "third" };
public :
a_example_t( context_t ctx )
{
st_first.event( &a_example_t::on_first );
st_first.event( &a_example_t::on_finish );
st_second.event( &a_example_t::on_second );
st_third.event( &a_example_t::on_third );
}
{
this >>= st_first;
}
private :
void on_first( mhood_t<first> ) {}
void on_second( mhood_t<first> ) {}
void on_third( mhood_t<first> ) {}
void on_finish( mhood_t<finish> )
{
}
};
int main()
{
try
{
} );
},
params.message_delivery_tracer(
params.message_delivery_tracer_filter(
return h && (nullptr == *h);
} ) );
} );
}
catch( const std::exception & ex )
{
std::cerr << "Error: " << ex.what() << std::endl;
return 1;
}
return 0;
}
A helper header file for including all public SObjectizer stuff.
void so_deregister_agent_coop_normally()
A helper method for deregistering agent's coop in case of normal deregistration.
virtual void so_evt_start()
Hook on agent start inside SObjectizer.
Agent * make_agent(Args &&... args)
Helper method for simplification of agents creation.
Parameters for the SObjectizer Environment initialization.
decltype(auto) introduce_coop(Args &&... args)
Helper method for simplification of cooperation creation and registration.
An interface of object for accessing trace details.
virtual optional< const so_5::impl::event_handler_data_t * > event_handler_data_ptr() const noexcept=0
Get pointer to event handler.
A base class for agent signals.
SO_5_FUNC tracer_unique_ptr_t std_cout_tracer()
Factory for tracer which uses std::cout stream.
filter_shptr_t make_filter(L &&lambda)
A helper function for creation of new filter from lambda-function.
void launch(Init_Routine &&init_routine)
Launch a SObjectizer Environment with default parameters.
void send(Target &&to, Args &&... args)
A utility function for creating and delivering a message or a signal.