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

Represents a variable. More...

#include <ArtifactModel.h>

Collaboration diagram for nnc::ArtifactVariable:

Public Member Functions

 ArtifactVariable (std::string type_name, std::string var_name, std::list< std::shared_ptr< ArtifactExpr > > dimensions={}, std::list< std::shared_ptr< ArtifactExpr > > initializers={})
 
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::string & typeName () const
 
const std::list< std::shared_ptr< ArtifactExpr > > & getDimensions () const
 
const std::list< std::shared_ptr< ArtifactExpr > > & getInitializers () const
 
std::shared_ptr< ArtifactIduse ()
 
- 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 variable.

Definition at line 325 of file ArtifactModel.h.

Constructor & Destructor Documentation

◆ ArtifactVariable()

nnc::ArtifactVariable::ArtifactVariable ( std::string  type_name,
std::string  var_name,
std::list< std::shared_ptr< ArtifactExpr > >  dimensions = {},
std::list< std::shared_ptr< ArtifactExpr > >  initializers = {} 
)
inline

Definition at line 328 of file ArtifactModel.h.

329 {},
330 std::list<std::shared_ptr<ArtifactExpr>> initializers = {})
331 : _typeName(std::move(type_name)), _dimensions(std::move(dimensions)),
332 _initializers(std::move(initializers)), ArtifactNamed(std::move(var_name))
333 {
334 }
ArtifactNamed(std::string name)

Member Function Documentation

◆ accept()

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

336{ g->visit(this); }

◆ getDimensions()

const std::list< std::shared_ptr< ArtifactExpr > > & nnc::ArtifactVariable::getDimensions ( ) const
inline

Definition at line 339 of file ArtifactModel.h.

339{ return _dimensions; };

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

◆ getInitializers()

const std::list< std::shared_ptr< ArtifactExpr > > & nnc::ArtifactVariable::getInitializers ( ) const
inline

Definition at line 340 of file ArtifactModel.h.

340{ return _initializers; }

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

◆ typeName()

const std::string & nnc::ArtifactVariable::typeName ( ) const
inline

◆ use()

std::shared_ptr< ArtifactId > nnc::ArtifactVariable::use ( )
inline

Definition at line 341 of file ArtifactModel.h.

341{ return std::make_shared<ArtifactId>(this); }

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