#include "coco/IR/BagInfo.forward.h"
-#include "coco/IR/ObjectList.h"
+#include "coco/IR/ObjectSet.h"
#include <memory>
uint32_t size(void) const;
public:
- const ObjectList *object(void) const;
+ const ObjectSet *object(void) const;
public:
bool isInput(void) const;
#ifndef __COCO_IR_BAG_INFO_H__
#define __COCO_IR_BAG_INFO_H__
-#include "coco/IR/ObjectList.h"
+#include "coco/IR/ObjectSet.h"
#include <cstdint>
uint32_t const _size;
public:
- ObjectList *object(void) { return &_object; }
- const ObjectList *object(void) const { return &_object; }
+ ObjectSet *object(void) { return &_object; }
+ const ObjectSet *object(void) const { return &_object; }
private:
- ObjectList _object;
+ ObjectSet _object;
public:
BagType type(void) const { return _type; }
--- /dev/null
+#ifndef __COCO_IR_OBJECT_SET_H__
+#define __COCO_IR_OBJECT_SET_H__
+
+#include "coco/IR/Object.forward.h"
+
+#include <set>
+
+namespace coco
+{
+
+using ObjectSet = std::set<Object *>;
+
+} // namespace coco
+
+#endif // __COCO_IR_OBJECT_SET_H__
uint32_t Bag::size(void) const { return _info->size(); }
-const ObjectList *Bag::object(void) const { return _info->object(); }
+const ObjectSet *Bag::object(void) const { return _info->object(); }
bool Bag::isInput(void) const { return _info->type() == BagType::Input; }
bool Bag::isOutput(void) const { return _info->type() == BagType::Output; }
auto bag_info = link.find(bag);
ASSERT_EQ(bag_info->object()->size(), 1);
- ASSERT_EQ(bag_info->object()->at(0), &obj);
+ ASSERT_EQ(bag_info->object()->count(&obj), 1);
// User SHOULD be able to access dependent objects through 'bag'
ASSERT_EQ(bag->object()->size(), 1);
- ASSERT_EQ(bag->object()->at(0), &obj);
+ ASSERT_EQ(bag->object()->count(&obj), 1);
}