#include <nncc/foundation/Memory.h>
+using nncc::foundation::make_unique;
+
namespace
{
std::unique_ptr<Module> Module::create(void)
{
- auto bag_link = nncc::foundation::make_unique<coco::PtrLink<Bag, BagInfo>>();
- auto obj_link = nncc::foundation::make_unique<coco::PtrLink<Object, ObjectInfo>>();
- auto op_link = nncc::foundation::make_unique<coco::PtrLink<Op, Instr>>();
- auto ins_link = nncc::foundation::make_unique<coco::PtrLink<Instr, Block>>();
- auto blk_link = nncc::foundation::make_unique<coco::PtrLink<Block, Module>>();
+ auto bag_link = make_unique<coco::PtrLink<Bag, BagInfo>>();
+ auto obj_link = make_unique<coco::PtrLink<Object, ObjectInfo>>();
+ auto op_link = make_unique<coco::PtrLink<Op, Instr>>();
+ auto ins_link = make_unique<coco::PtrLink<Instr, Block>>();
+ auto blk_link = make_unique<coco::PtrLink<Block, Module>>();
- auto m = nncc::foundation::make_unique<::ModuleImpl>();
+ auto m = make_unique<::ModuleImpl>();
- auto mgr = nncc::foundation::make_unique<::EntityManagerImpl>();
+ auto mgr = make_unique<::EntityManagerImpl>();
{
- mgr->_bag = nncc::foundation::make_unique<coco::BagManager>(bag_link.get());
- mgr->_object =
- nncc::foundation::make_unique<coco::ObjectManager>(obj_link.get(), bag_link.get());
- mgr->_op = nncc::foundation::make_unique<coco::OpManager>(op_link.get(), obj_link.get());
- mgr->_instr = nncc::foundation::make_unique<coco::InstrManager>(op_link.get(), ins_link.get(),
- obj_link.get(), bag_link.get());
- mgr->_block = nncc::foundation::make_unique<coco::BlockManager>(blk_link.get(), ins_link.get());
- mgr->_input = nncc::foundation::make_unique<coco::InputManager>(bag_link.get());
- mgr->_output = nncc::foundation::make_unique<coco::OutputManager>(bag_link.get());
+ mgr->_bag = make_unique<coco::BagManager>(bag_link.get());
+ mgr->_object = make_unique<coco::ObjectManager>(obj_link.get(), bag_link.get());
+ mgr->_op = make_unique<coco::OpManager>(op_link.get(), obj_link.get());
+ mgr->_instr = make_unique<coco::InstrManager>(op_link.get(), ins_link.get(), obj_link.get(),
+ bag_link.get());
+ mgr->_block = make_unique<coco::BlockManager>(blk_link.get(), ins_link.get());
+ mgr->_input = make_unique<coco::InputManager>(bag_link.get());
+ mgr->_output = make_unique<coco::OutputManager>(bag_link.get());
}
m->_entity = std::move(mgr);
// NOTE BlockManager and BlockList SHOULD share 'blk_link'
- m->_block = nncc::foundation::make_unique<coco::BlockList>(m.get(), blk_link.get());
- m->_input = nncc::foundation::make_unique<coco::InputList>();
- m->_output = nncc::foundation::make_unique<coco::OutputList>();
+ m->_block = make_unique<coco::BlockList>(m.get(), blk_link.get());
+ m->_input = make_unique<coco::InputList>();
+ m->_output = make_unique<coco::OutputList>();
m->_bag_link = std::move(bag_link);
m->_obj_link = std::move(obj_link);