ONE - On-device Neural Engine
Loading...
Searching...
No Matches
nnc::ArtifactForLoop Class Reference

Represents for loops. More...

#include <ArtifactModel.h>

Collaboration diagram for nnc::ArtifactForLoop:

Public Member Functions

 ArtifactForLoop (std::shared_ptr< ArtifactVariable > init=nullptr, std::shared_ptr< ArtifactExpr > cond=nullptr, std::shared_ptr< ArtifactExpr > iter=nullptr)
 
bool isBlock () const override
 If this entity represents something containing a block of instructions.
 
void accept (IArtifactGenerator *g) const override
 This is the core function of each artifact entity and is implemented by all concrete classes in the hierarchy.
 
std::shared_ptr< ArtifactVariablegetInit () const
 
std::shared_ptr< ArtifactExprgetCond () const
 
std::shared_ptr< ArtifactExprgetIter () const
 
const ArtifactBlockgetBlock () const
 
ArtifactBlockgetBlock ()
 
- Public Member Functions inherited from nnc::ArtifactEntity
virtual ~ArtifactEntity ()=default
 

Additional Inherited Members

- Protected Member Functions inherited from nnc::ArtifactEntity
 ArtifactEntity ()=default
 

Detailed Description

Represents for loops.

Definition at line 466 of file ArtifactModel.h.

Constructor & Destructor Documentation

◆ ArtifactForLoop()

nnc::ArtifactForLoop::ArtifactForLoop ( std::shared_ptr< ArtifactVariable init = nullptr,
std::shared_ptr< ArtifactExpr cond = nullptr,
std::shared_ptr< ArtifactExpr iter = nullptr 
)
inlineexplicit

Definition at line 469 of file ArtifactModel.h.

472 : _init(std::move(init)), _cond(std::move(cond)), _iter(std::move(iter))
473 {
474 }

Member Function Documentation

◆ accept()

void nnc::ArtifactForLoop::accept ( IArtifactGenerator g) const
inlineoverridevirtual

This is the core function of each artifact entity and is implemented by all concrete classes in the hierarchy.

Implements nnc::ArtifactEntity.

Definition at line 478 of file ArtifactModel.h.

478{ g->visit(this); }

Referenced by TEST().

◆ getBlock() [1/2]

ArtifactBlock * nnc::ArtifactForLoop::getBlock ( )
inline

Definition at line 484 of file ArtifactModel.h.

484{ return &_body; }

◆ getBlock() [2/2]

const ArtifactBlock * nnc::ArtifactForLoop::getBlock ( ) const
inline

Definition at line 483 of file ArtifactModel.h.

483{ return &_body; }

Referenced by TEST(), and nnc::ArtifactGeneratorCppCode::visit().

◆ getCond()

std::shared_ptr< ArtifactExpr > nnc::ArtifactForLoop::getCond ( ) const
inline

Definition at line 481 of file ArtifactModel.h.

481{ return _cond; }

Referenced by nnc::ArtifactGeneratorCppCode::visit().

◆ getInit()

std::shared_ptr< ArtifactVariable > nnc::ArtifactForLoop::getInit ( ) const
inline

Definition at line 480 of file ArtifactModel.h.

480{ return _init; }

Referenced by nnc::ArtifactGeneratorCppCode::visit().

◆ getIter()

std::shared_ptr< ArtifactExpr > nnc::ArtifactForLoop::getIter ( ) const
inline

Definition at line 482 of file ArtifactModel.h.

482{ return _iter; }

Referenced by nnc::ArtifactGeneratorCppCode::visit().

◆ isBlock()

bool nnc::ArtifactForLoop::isBlock ( ) const
inlineoverridevirtual

If this entity represents something containing a block of instructions.

Reimplemented from nnc::ArtifactEntity.

Definition at line 476 of file ArtifactModel.h.

476{ return true; }

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