class Use final
{
public:
- Use(const PtrLink<Object, ObjectInfo> *obj_link, Object::Consumer *use)
- : _link{obj_link}, _value{nullptr}, _consumer{use}
+ // NOTE Object-to-ObjectInfo link is no longer used
+ // TODO Do NOT take Object-to-ObjectInfo link as an arugment
+ Use(const PtrLink<Object, ObjectInfo> *, Object::Consumer *use) : _value{nullptr}, _consumer{use}
{
// DO NOTHING
}
void value(Object *value);
private:
- const PtrLink<Object, ObjectInfo> *_link = nullptr;
-
-private:
Object *_value;
Object::Consumer *_consumer = nullptr;
};
{
if (_value)
{
- if (_link)
+ // TODO Remove unnecessary indentation
{
- auto info = _link->find(_value);
+ auto info = _value->info();
assert(info != nullptr);
info->user()->erase(_consumer);
}
if (value)
{
_value = value;
- if (_link)
+ // TODO Remove unnecessary indentation
{
- auto info = _link->find(_value);
+ auto info = _value->info();
assert(info != nullptr);
info->user()->insert(_consumer);
}