ONE - On-device Neural Engine
Loading...
Searching...
No Matches
onert::ir::Operations Class Reference

#include <Operations.h>

Collaboration diagram for onert::ir::Operations:

Public Member Functions

 Operations ()=default
 
 Operations (const Operations &obj)
 
 Operations (Operations &&)=default
 
Operationsoperator= (const Operations &)=delete
 
Operationsoperator= (Operations &&)=default
 
 ~Operations ()=default
 
- Public Member Functions inherited from onert::util::ObjectManager< OperationIndex, IOperation >
 ObjectManager ()
 
OperationIndex emplace (Args &&...args)
 Create an object with args and put it in the container with a newly assigned Index.
 
OperationIndex push (std::unique_ptr< IOperation > &&object, OperationIndex index)
 Put the object in the container with given index.
 
OperationIndex push (std::unique_ptr< IOperation > &&object)
 Put the object in the container with a newly assigned index.
 
OperationIndex set (OperationIndex index, std::unique_ptr< IOperation > &&object)
 Set the object in the container with given index.
 
void remove (const OperationIndex &index)
 Remove the object that is associated with the given index.
 
const IOperation & at (const OperationIndex &index) const
 Get the object that is associated with the given index.
 
IOperation & at (const OperationIndex &index)
 Get the object that is associated with the given index.
 
const IOperation * getRawPtr (const OperationIndex &index) const
 Get the object that is associated with the given index.
 
IOperation * getRawPtr (const OperationIndex &index)
 Get the object that is associated with the given index.
 
bool exist (const OperationIndex &index) const
 Get the object that is associated with the given index.
 
size_t size () const
 Return the number of objects that the manager contains.
 
void iterate (const std::function< void(const OperationIndex &, const IOperation &)> &fn) const
 Iterate over the container with given function.
 
void iterate (const std::function< void(const OperationIndex &, IOperation &)> &fn)
 Iterate over the container with given function.
 

Additional Inherited Members

- Protected Attributes inherited from onert::util::ObjectManager< OperationIndex, IOperation >
std::unordered_map< OperationIndex, std::unique_ptr< IOperation > > _objects
 
uint32_t _next_index
 

Detailed Description

Definition at line 29 of file Operations.h.

Constructor & Destructor Documentation

◆ Operations() [1/3]

onert::ir::Operations::Operations ( )
default

◆ Operations() [2/3]

onert::ir::Operations::Operations ( const Operations obj)

Definition at line 26 of file Operations.cc.

27{
28 obj.iterate(
29 [&](const OperationIndex &index, const IOperation &op) { _objects.emplace(index, clone(op)); });
30 _next_index = obj._next_index;
31}
std::unordered_map< OperationIndex, std::unique_ptr< IOperation > > _objects
std::unique_ptr< Operation > clone(const IOperation &operation)
::onert::util::Index< uint32_t, OperationIndexTag > OperationIndex
Definition Index.h:32

References onert::util::ObjectManager< OperationIndex, IOperation >::_next_index, onert::util::ObjectManager< OperationIndex, IOperation >::_objects, and onert::ir::clone().

◆ Operations() [3/3]

onert::ir::Operations::Operations ( Operations &&  )
default

◆ ~Operations()

onert::ir::Operations::~Operations ( )
default

Member Function Documentation

◆ operator=() [1/2]

Operations & onert::ir::Operations::operator= ( const Operations )
delete

◆ operator=() [2/2]

Operations & onert::ir::Operations::operator= ( Operations &&  )
default

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