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

Represents if block. More...

#include <ArtifactModel.h>

Collaboration diagram for nnc::ArtifactIf:

Public Member Functions

 ArtifactIf (std::shared_ptr< ArtifactExpr > cond)
 
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< ArtifactExprgetCond () const
 
const ArtifactBlockgetBlock () const
 
ArtifactBlockgetBlock ()
 
const ArtifactBlockgetElseBlock () const
 
ArtifactBlockgetElseBlock ()
 
- 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 if block.

Definition at line 496 of file ArtifactModel.h.

Constructor & Destructor Documentation

◆ ArtifactIf()

nnc::ArtifactIf::ArtifactIf ( std::shared_ptr< ArtifactExpr cond)
inlineexplicit

Definition at line 499 of file ArtifactModel.h.

499: _cond(std::move(cond)) {}

Member Function Documentation

◆ accept()

void nnc::ArtifactIf::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 502 of file ArtifactModel.h.

502{ g->visit(this); }

Referenced by TEST().

◆ getBlock() [1/2]

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

Definition at line 506 of file ArtifactModel.h.

506{ return &_body; }

◆ getBlock() [2/2]

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

Definition at line 505 of file ArtifactModel.h.

505{ return &_body; }

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

◆ getCond()

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

Definition at line 504 of file ArtifactModel.h.

504{ return _cond; }

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

◆ getElseBlock() [1/2]

ArtifactBlock * nnc::ArtifactIf::getElseBlock ( )
inline

Definition at line 508 of file ArtifactModel.h.

508{ return &_elseBody; }

◆ getElseBlock() [2/2]

const ArtifactBlock * nnc::ArtifactIf::getElseBlock ( ) const
inline

Definition at line 507 of file ArtifactModel.h.

507{ return &_elseBody; }

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

◆ isBlock()

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

If this entity represents something containing a block of instructions.

Reimplemented from nnc::ArtifactEntity.

Definition at line 500 of file ArtifactModel.h.

500{ return true; }

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