For consistency, this commit introduces create method for Generic
FeatureLayout.
Signed-off-by: Jonghyun Park <jh1302.park@samsung.com>
*/
class Generic final : public FeatureLayout
{
-public:
+private:
Generic(const FeatureShape &shape);
public:
private:
std::vector<ElemID> _content;
+
+public:
+ static std::unique_ptr<Generic> create(const FeatureShape &shape);
};
} // namespace FeatureLayouts
}
}
+std::unique_ptr<Generic> Generic::create(const nncc::core::ADT::feature::Shape &shape)
+{
+ // NOTE It is impossible to use make_unique here as the constructor is private
+ return std::unique_ptr<Generic>{new Generic{shape}};
+}
+
} // namespace FeatureLayouts
} // namespace coco
FeatureObject::FeatureObject(const nncc::core::ADT::feature::Shape &shape)
{
- _layout = make_unique<FeatureLayouts::Generic>(shape);
+ _layout = FeatureLayouts::Generic::create(shape);
}
FeatureObject::~FeatureObject()