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

Represents a function. More...

#include <ArtifactModel.h>

Collaboration diagram for nnc::ArtifactFunction:

Public Member Functions

 ArtifactFunction (std::string ret_type_name, const std::string &func_name, std::list< std::shared_ptr< ArtifactVariable > > params={})
 Constructs a function object.
 
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.
 
const std::list< std::shared_ptr< ArtifactVariable > > & getParameters () const
 
const std::string & getRetTypeName () const
 
const ArtifactBlockgetBlock () const
 
ArtifactBlockgetBlock ()
 
- Public Member Functions inherited from nnc::ArtifactNamed
 ArtifactNamed (std::string name)
 
const std::string & name () const
 
- Public Member Functions inherited from nnc::ArtifactEntity
virtual ~ArtifactEntity ()=default
 
virtual bool isBlock () const
 If this entity represents something containing a block of instructions.
 

Additional Inherited Members

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

Detailed Description

Represents a function.

Definition at line 519 of file ArtifactModel.h.

Constructor & Destructor Documentation

◆ ArtifactFunction()

nnc::ArtifactFunction::ArtifactFunction ( std::string  ret_type_name,
const std::string &  func_name,
std::list< std::shared_ptr< ArtifactVariable > >  params = {} 
)
inline

Constructs a function object.

Parameters
ret_type_name- the name of the returned type
func_name- the function name.
params- the parameter list.

Definition at line 528 of file ArtifactModel.h.

529 {})
530 : ArtifactNamed(func_name), _params(std::move(params)), _retTypeName(std::move(ret_type_name))
531 {
532 }
ArtifactNamed(std::string name)

Member Function Documentation

◆ accept()

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

534{ g->visit(this); }

Referenced by TEST().

◆ getBlock() [1/2]

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

Definition at line 539 of file ArtifactModel.h.

539{ return &_body; }

◆ getBlock() [2/2]

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

Definition at line 538 of file ArtifactModel.h.

538{ return &_body; }

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

◆ getParameters()

const std::list< std::shared_ptr< ArtifactVariable > > & nnc::ArtifactFunction::getParameters ( ) const
inline

◆ getRetTypeName()

const std::string & nnc::ArtifactFunction::getRetTypeName ( ) const
inline

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