class ANNModuleBuilder
{
private:
- std::set<coco::Bag *> inputs(coco::Block *blk) const;
- std::set<coco::Bag *> outputs(coco::Block *blk) const;
+ std::set<coco::Bag *> inputs(ANNBinder *binder) const;
+ std::set<coco::Bag *> outputs(ANNBinder *binder) const;
public:
void build(ANNContext *ann_ctx) const;
};
-std::set<coco::Bag *> ANNModuleBuilder::inputs(coco::Block *blk) const
+std::set<coco::Bag *> ANNModuleBuilder::inputs(ANNBinder *binder) const
{
std::set<coco::Bag *> res;
- for (auto bag : enco::reads(blk))
+ for (auto bag : binder->bags())
{
auto u = enco::updaters(bag);
- u.erase(blk);
+ u.erase(binder->block());
/**
* A bag is the input of this block if
return res;
}
-std::set<coco::Bag *> ANNModuleBuilder::outputs(coco::Block *blk) const
+std::set<coco::Bag *> ANNModuleBuilder::outputs(ANNBinder *binder) const
{
std::set<coco::Bag *> res;
- for (auto bag : enco::updates(blk))
+ for (auto bag : binder->bags())
{
auto r = enco::readers(bag);
- r.erase(blk);
+ r.erase(binder->block());
/**
* A bag is the output of this block if
for (uint32_t n = 0; n < ann_ctx->count(); ++n)
{
auto binder = ann_ctx->nth(n);
- auto block = binder->block();
// Let's identify input/output bags
- binder->identifyInputs(inputs(binder->block()));
- binder->identifyOutputs(outputs(binder->block()));
+ binder->identifyInputs(inputs(binder));
+ binder->identifyOutputs(outputs(binder));
}
}