mirror of
https://github.com/FairRootGroup/FairMQ.git
synced 2025-10-15 09:31:45 +00:00
Refactor state machine.
This commit is contained in:
committed by
Mohammad Al-Turany
parent
70e46a0b86
commit
f6365d013e
@@ -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
|
||||
|
Reference in New Issue
Block a user