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

#include <Operands.h>

Collaboration diagram for onert::ir::Operands:

Public Member Functions

 Operands ()=default
 
 Operands (const Operands &obj)
 
 Operands (Operands &&)=default
 
Operandsoperator= (const Operands &)=delete
 
Operandsoperator= (Operands &&)=default
 
 ~Operands ()=default
 
- Public Member Functions inherited from onert::util::ObjectManager< OperandIndex, Operand >
 ObjectManager ()
 
OperandIndex emplace (Args &&...args)
 Create an object with args and put it in the container with a newly assigned Index.
 
OperandIndex push (std::unique_ptr< Operand > &&object, OperandIndex index)
 Put the object in the container with given index.
 
OperandIndex push (std::unique_ptr< Operand > &&object)
 Put the object in the container with a newly assigned index.
 
OperandIndex set (OperandIndex index, std::unique_ptr< Operand > &&object)
 Set the object in the container with given index.
 
void remove (const OperandIndex &index)
 Remove the object that is associated with the given index.
 
const Operandat (const OperandIndex &index) const
 Get the object that is associated with the given index.
 
Operandat (const OperandIndex &index)
 Get the object that is associated with the given index.
 
const OperandgetRawPtr (const OperandIndex &index) const
 Get the object that is associated with the given index.
 
OperandgetRawPtr (const OperandIndex &index)
 Get the object that is associated with the given index.
 
bool exist (const OperandIndex &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 OperandIndex &, const Operand &)> &fn) const
 Iterate over the container with given function.
 
void iterate (const std::function< void(const OperandIndex &, Operand &)> &fn)
 Iterate over the container with given function.
 

Additional Inherited Members

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

Detailed Description

Definition at line 32 of file Operands.h.

Constructor & Destructor Documentation

◆ Operands() [1/3]

onert::ir::Operands::Operands ( )
default

◆ Operands() [2/3]

onert::ir::Operands::Operands ( const Operands obj)

Definition at line 27 of file Operands.cc.

28{
29 obj.iterate([&](const OperandIndex &index, const Operand &operand) {
30 _objects.emplace(index, std::make_unique<Operand>(operand));
31 });
32 _next_index = obj._next_index;
33}
std::unordered_map< OperandIndex, std::unique_ptr< Operand > > _objects
::onert::util::Index< uint32_t, OperandIndexTag > OperandIndex
Definition Index.h:35

References onert::util::ObjectManager< OperandIndex, Operand >::_next_index, and onert::util::ObjectManager< OperandIndex, Operand >::_objects.

◆ Operands() [3/3]

onert::ir::Operands::Operands ( Operands &&  )
default

◆ ~Operands()

onert::ir::Operands::~Operands ( )
default

Member Function Documentation

◆ operator=() [1/2]

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

◆ operator=() [2/2]

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

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