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

#include <BagManager.h>

Collaboration diagram for coco::BagManager:

Public Member Functions

 BagManager (Module *m=nullptr)
 
Bagcreate (uint32_t size)
 
void destroy (Bag *b)
 Destroy (= deallocate) a Bag entity.
 
- Public Member Functions inherited from coco::PtrManager< Bag >
uint32_t size (void) const
 Return the number of managed objects.
 
Bagat (uint32_t n) const
 
- Public Member Functions inherited from coco::EntityBuilder
virtual ~EntityBuilder ()=default
 

Additional Inherited Members

- Protected Member Functions inherited from coco::PtrManager< Bag >
U * take (std::unique_ptr< U > &&o)
 
std::unique_ptr< Bagrelease (Bag *ptr)
 
- Protected Member Functions inherited from coco::EntityBuilder
Modulemodule (void) const
 
void module (Module *m)
 
void modulize (Entity *entity) const
 

Detailed Description

Definition at line 28 of file BagManager.h.

Constructor & Destructor Documentation

◆ BagManager()

coco::BagManager::BagManager ( Module m = nullptr)
inline

Definition at line 31 of file BagManager.h.

31{ module(m); }
Module * module(void) const

References m, and coco::EntityBuilder::module().

Member Function Documentation

◆ create()

Bag * coco::BagManager::create ( uint32_t  size)

Definition at line 24 of file BagManager.cpp.

25{
26 auto bag = std::make_unique<Bag>(size);
27 modulize(bag.get());
28 return take(std::move(bag));
29}
void modulize(Entity *entity) const
uint32_t size(void) const
Return the number of managed objects.
Definition PtrManager.h:32
U * take(std::unique_ptr< U > &&o)
Definition PtrManager.h:38

References coco::EntityBuilder::modulize(), coco::PtrManager< Bag >::size(), and coco::PtrManager< Bag >::take().

◆ destroy()

void coco::BagManager::destroy ( Bag b)

Destroy (= deallocate) a Bag entity.

NOTE A Bag SHOULD BE detached from IR before destruction

Definition at line 31 of file BagManager.cpp.

31{ release(b); }
std::unique_ptr< Bag > release(Bag *ptr)
Definition PtrManager.h:46

References coco::PtrManager< Bag >::release().


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