Refactor TransportFactory to RAII

* Remove explicit Initialize and Terminate states,
    map them onto ctor/dtor
  * Remove no longer needed Shutdown state
  * Remove deprecated SetTransport()
This commit is contained in:
Dennis Klein
2017-05-23 16:13:43 +02:00
committed by Mohammad Al-Turany
parent 733794657c
commit 8bc21675af
11 changed files with 24 additions and 136 deletions

View File

@@ -25,7 +25,7 @@ FairMQTransportFactory::FairMQTransportFactory(const std::string& id)
{
}
auto FairMQTransportFactory::CreateTransportFactory(const std::string& type, const std::string& id) -> std::shared_ptr<FairMQTransportFactory>
auto FairMQTransportFactory::CreateTransportFactory(const std::string& type, const std::string& id, const FairMQProgOptions* config) -> std::shared_ptr<FairMQTransportFactory>
{
using namespace std;
@@ -39,16 +39,16 @@ auto FairMQTransportFactory::CreateTransportFactory(const std::string& type, con
if (type == "zeromq")
{
return std::make_shared<FairMQTransportFactoryZMQ>(final_id);
return std::make_shared<FairMQTransportFactoryZMQ>(final_id, config);
}
else if (type == "shmem")
{
return std::make_shared<FairMQTransportFactorySHM>(final_id);
return std::make_shared<FairMQTransportFactorySHM>(final_id, config);
}
#ifdef NANOMSG_FOUND
else if (type == "nanomsg")
{
return std::make_shared<FairMQTransportFactoryNN>(final_id);
return std::make_shared<FairMQTransportFactoryNN>(final_id, config);
}
#endif /* NANOMSG_FOUND */
else