-#ifndef __COCO_IR_DEF_SLOT_H__
-#define __COCO_IR_DEF_SLOT_H__
+#ifndef __COCO_IR_DEF_H__
+#define __COCO_IR_DEF_H__
#include "coco/IR/Object.h"
#include "coco/IR/ObjectInfo.forward.h"
namespace coco
{
-class DefSlot final
+class Def final
{
public:
- DefSlot(const PtrLink<Object, ObjectInfo> *link, Object::Producer *producer)
+ Def(const PtrLink<Object, ObjectInfo> *link, Object::Producer *producer)
: _link{link}, _producer{producer}
{
// DO NOTHING
}
public:
- ~DefSlot() { value(nullptr); }
+ ~Def() { value(nullptr); }
public:
Object *value(void) const { return _value; }
} // namespace coco
-#endif // __COCO_IR_DEF_SLOT_H__
+#endif // __COCO_IR_DEF_H__
#include "coco/IR/FeatureObject.h"
#include "coco/IR/UseSlot.h"
-#include "coco/IR/DefSlot.h"
+#include "coco/IR/Def.h"
/**
* @brief Explicit computation step that emits a feature map from another feature map
void ifm(FeatureObject *ifm);
private:
- DefSlot _ofm;
+ Def _ofm;
public:
FeatureObject *ofm(void) const;
-#include "coco/IR/DefSlot.h"
+#include "coco/IR/Def.h"
#include "coco/IR/ObjectInfo.h"
#include "coco/IR/ObjectManager.h"
namespace
{
-class DefSlotTest : public ::testing::Test
+class DefTest : public ::testing::Test
{
protected:
coco::PtrLink<coco::Bag, coco::BagInfo> bag_link;
};
} // namespace
-TEST_F(DefSlotTest, constructor)
+TEST_F(DefTest, constructor)
{
auto o = obj_mgr.create(nncc::core::ADT::feature::Shape{1, 1, 1});
::mock::Def def;
- coco::DefSlot slot{&obj_link, &def};
+ // TODO Rename 'slot'
+ coco::Def slot{&obj_link, &def};
ASSERT_EQ(slot.value(), nullptr);
}
-TEST_F(DefSlotTest, value)
+TEST_F(DefTest, value)
{
auto o = obj_mgr.create(nncc::core::ADT::feature::Shape{1, 1, 1});
::mock::Def def;
- coco::DefSlot slot{&obj_link, &def};
+ // TODO Rename 'slot'
+ coco::Def slot{&obj_link, &def};
slot.value(o);
ASSERT_EQ(o->def(), nullptr);
}
-TEST_F(DefSlotTest, unlink_on_destruction)
+TEST_F(DefTest, unlink_on_destruction)
{
auto o = obj_mgr.create(nncc::core::ADT::feature::Shape{1, 1, 1});
::mock::Def def;
- auto slot = make_unique<coco::DefSlot>(&obj_link, &def);
+ // TODO Rename 'slot'
+ auto slot = make_unique<coco::Def>(&obj_link, &def);
slot->value(o);
ASSERT_EQ(o->def(), &def);