SObjectizer
5.5
|
The creation of agent instances was one of the few places where usage of operator new()
was necessary. The agents creation could look like:
This approach of agent creation was inherited from the times when advanced C++11 features like variadic templates and rvalue references were not supported in all major C++ compilers at the required quality level. But times have changed. Now SObjectizer-5.5 actively uses variadic templates and doesn't support old compilers without this very important C++11 feature. Because of that a new, more convenient way for agent creation has been introduced in version 5.5.4.
Just compare:
The same make_agent
has been added to so_5::rt::agent_coop_t
class:
There is also so_5::rt::agent_coop_t::make_agent_with_binder()
method for the case when new agent should be bound to the specific dispatcher:
Attention!** Please note that new make_agent
and make_agent_with_binder
methods require that the first argument of agent's constructor must be a reference to so_5::rt::environment_t
object.