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

A Update represents an edge between a Bag and its Updater. More...

#include <Update.h>

Public Member Functions

 Update (Bag::Updater *u)
 
 ~Update ()
 
Bagbag (void) const
 
void bag (Bag *bag)
 
Bag::Updaterupdater (void) const
 
void updater (Bag::Updater *u)
 

Detailed Description

A Update represents an edge between a Bag and its Updater.

Definition at line 28 of file Update.h.

Constructor & Destructor Documentation

◆ Update()

coco::Update::Update ( Bag::Updater u)
inline

Definition at line 31 of file Update.h.

31{ updater(u); }
Bag::Updater * updater(void) const
Definition Update.h:41

References updater().

◆ ~Update()

coco::Update::~Update ( )

Definition at line 24 of file Update.cpp.

25{
26 // Unlink self from a linked bag if it exists
27 bag(nullptr);
28}
Bag * bag(void) const
Definition Update.h:37

References bag().

Member Function Documentation

◆ bag() [1/2]

void coco::Update::bag ( Bag bag)

Definition at line 30 of file Update.cpp.

31{
32 if (_bag)
33 {
34 _bag->mutable_updates()->erase(this);
35 _bag = nullptr;
36 }
37
38 assert(_bag == nullptr);
39
40 if (bag)
41 {
42 _bag = bag;
43 _bag->mutable_updates()->insert(this);
44 }
45
46 assert(_bag == bag);
47}

References bag().

◆ bag() [2/2]

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

Definition at line 37 of file Update.h.

37{ return _bag; }

Referenced by bag(), coco::Shuffle::into(), coco::Shuffle::into(), and ~Update().

◆ updater() [1/2]

void coco::Update::updater ( Bag::Updater u)
inline

Definition at line 42 of file Update.h.

42{ _updater = u; }

◆ updater() [2/2]

Bag::Updater * coco::Update::updater ( void  ) const
inline

Definition at line 41 of file Update.h.

41{ return _updater; }

Referenced by Update().


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