Refactor state machine.

This commit is contained in:
Alexey Rybalchenko
2017-09-07 11:42:43 +02:00
committed by Mohammad Al-Turany
parent 70e46a0b86
commit f6365d013e
9 changed files with 395 additions and 430 deletions

View File

@@ -13,15 +13,17 @@
#include <nanomsg/FairMQTransportFactoryNN.h>
#endif /* NANOMSG_FOUND */
#include <FairMQLogger.h>
#include <memory>
#include <boost/uuid/uuid.hpp>
#include <boost/uuid/uuid_generators.hpp>
#include <boost/uuid/uuid_io.hpp>
#include <memory>
#include <string>
#include <sstream>
FairMQTransportFactory::FairMQTransportFactory(const std::string& id)
: fkId(id)
: fkId(id)
{
}
@@ -29,26 +31,26 @@ auto FairMQTransportFactory::CreateTransportFactory(const std::string& type, con
{
using namespace std;
auto final_id = id;
auto finalId = id;
// Generate uuid if empty
if (final_id == "")
if (finalId == "")
{
final_id = boost::uuids::to_string(boost::uuids::random_generator()());
finalId = boost::uuids::to_string(boost::uuids::random_generator()());
}
if (type == "zeromq")
{
return std::make_shared<FairMQTransportFactoryZMQ>(final_id, config);
return std::make_shared<FairMQTransportFactoryZMQ>(finalId, config);
}
else if (type == "shmem")
{
return std::make_shared<FairMQTransportFactorySHM>(final_id, config);
return std::make_shared<FairMQTransportFactorySHM>(finalId, config);
}
#ifdef NANOMSG_FOUND
else if (type == "nanomsg")
{
return std::make_shared<FairMQTransportFactoryNN>(final_id, config);
return std::make_shared<FairMQTransportFactoryNN>(finalId, config);
}
#endif /* NANOMSG_FOUND */
else