ONE - On-device Neural Engine
Loading...
Searching...
No Matches
coco::Dep Class Referencefinal

A Dep represents the edge between a Bag and its dependent Object. More...

#include <Dep.h>

Public Member Functions

 Dep ()=default
 
 Dep (const Dep &)=delete
 
 Dep (Dep &&)=delete
 
 ~Dep ()
 
Bagbag (void) const
 
void bag (Bag *)
 
Objectobject (void) const
 
void object (Object *object)
 

Detailed Description

A Dep represents the edge between a Bag and its dependent Object.

WARNING A Dep will update dependent Object set (stored BagInfo) only when users properly initialize object and link values.

Definition at line 32 of file Dep.h.

Constructor & Destructor Documentation

◆ Dep() [1/3]

coco::Dep::Dep ( )
default

◆ Dep() [2/3]

coco::Dep::Dep ( const Dep )
delete

◆ Dep() [3/3]

coco::Dep::Dep ( Dep &&  )
delete

◆ ~Dep()

coco::Dep::~Dep ( )

Definition at line 25 of file Dep.cpp.

25{ bag(nullptr); }
Bag * bag(void) const
Definition Dep.h:45

References bag().

Member Function Documentation

◆ bag() [1/2]

void coco::Dep::bag ( Bag bag)

Definition at line 27 of file Dep.cpp.

28{
29 if (_bag != nullptr)
30 {
31 // Remove bag <-> dep link
32 assert(_bag->deps()->find(this) != _bag->deps()->end());
33 _bag->mutable_deps()->erase(this);
34
35 // Reset _bag
36 _bag = nullptr;
37 }
38
39 assert(_bag == nullptr);
40
41 if (bag != nullptr)
42 {
43 // Set _bag
44 _bag = bag;
45
46 // Create bag <-> dep link
47 _bag->mutable_deps()->insert(this);
48 }
49
50 assert(_bag == bag);
51}
const DepSet * deps(void) const
Return the set of Dep links that point to this bag.
Definition Bag.cpp:46

References bag(), and coco::Bag::deps().

◆ bag() [2/2]

Bag * coco::Dep::bag ( void  ) const
inline

Definition at line 45 of file Dep.h.

45{ return _bag; }

Referenced by bag(), coco::Object::bag(), coco::Object::bag(), and ~Dep().

◆ object() [1/2]

void coco::Dep::object ( Object object)
inline

Definition at line 50 of file Dep.h.

50{ _object = object; }
Object * object(void) const
Definition Dep.h:49

References object().

Referenced by object().

◆ object() [2/2]

Object * coco::Dep::object ( void  ) const
inline

Definition at line 49 of file Dep.h.

49{ return _object; }

Referenced by coco::Object::Object().


The documentation for this class was generated from the following files: