BashSpark
Loading...
Searching...
No Matches
bs::shell_node_function Class Referencefinal

Create function and adds to the shell session. More...

#include <shell_node.h>

Inheritance diagram for bs::shell_node_function:
Collaboration diagram for bs::shell_node_function:

Public Member Functions

 shell_node_function (std::size_t nPos, std::unique_ptr< shell_node_expandable > &&pName, std::unique_ptr< shell_node_evaluable > &&pBody)
 Construct an function node.
 
shell_status evaluate (shell_session &oSession) const override
 Adds function to the shell session vtable.
 
const shell_node_expandableget_name () const noexcept
 Get the function name node.
 
const shell_node_evaluableget_body () const noexcept
 Get the function body node.
 
- Public Member Functions inherited from bs::shell_node_evaluable
 shell_node_evaluable (const shell_node_type nType, const std::size_t nPos)
 Construct an evaluable node.
 
- Public Member Functions inherited from bs::shell_node
virtual ~shell_node ()=default
 Virtual default destructor for polymorphic deletion.
 
shell_node_type get_type () const noexcept
 Get the node type.
 
std::size_t get_pos () const noexcept
 Get node position in the original input stream.
 

Additional Inherited Members

- Protected Member Functions inherited from bs::shell_node
 shell_node (const shell_node_type nType, const std::size_t nPos)
 Protected constructor used by derived classes.
 
- Protected Attributes inherited from bs::shell_node
const shell_node_type m_nType
 Node type.
 
const std::size_t m_nPos
 Position in the input stream.
 

Detailed Description

Create function and adds to the shell session.

Constructor & Destructor Documentation

◆ shell_node_function()

bs::shell_node_function::shell_node_function ( std::size_t  nPos,
std::unique_ptr< shell_node_expandable > &&  pName,
std::unique_ptr< shell_node_evaluable > &&  pBody 
)

Construct an function node.

Exceptions
shell_node_invalid_argumentIf pBody is null.
Parameters
nPosPosition in the input stream where the until loop starts.
pNameOwned expandable function name.
pBodyOwned evaluable function body.

Member Function Documentation

◆ evaluate()

shell_status bs::shell_node_function::evaluate ( shell_session oSession) const
overridevirtual

Adds function to the shell session vtable.

Parameters
oSessionSession context used for evaluation.
Returns
shell_status Status code.

Implements bs::shell_node_evaluable.

◆ get_body()

const shell_node_evaluable * bs::shell_node_function::get_body ( ) const
inlinenoexcept

Get the function body node.

Returns
const Non-owning pointer to the body.

◆ get_name()

const shell_node_expandable * bs::shell_node_function::get_name ( ) const
inlinenoexcept

Get the function name node.

Returns
const Non-owning pointer to the name.

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