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

Logical AND operator node (executes right only if left succeeded). More...

#include <shell_node.h>

Inheritance diagram for bs::shell_node_and:
Collaboration diagram for bs::shell_node_and:

Public Member Functions

 shell_node_and (const std::size_t nPos, std::unique_ptr< shell_node_evaluable > &&pLeft, std::unique_ptr< shell_node_evaluable > &&pRight)
 Construct an AND node.
 
shell_status evaluate (shell_session &oSession) const override
 Evaluate logical AND semantics.
 
- Public Member Functions inherited from bs::shell_node_operator
int get_priority () const noexcept
 Get the operator priority.
 
const shell_node_evaluableget_left () const noexcept
 Get (non-owning) pointer to the left operand.
 
const shell_node_evaluableget_right () const noexcept
 Get (non-owning) pointer to the right operand.
 
std::unique_ptr< shell_node_evaluableswap_left (std::unique_ptr< shell_node_evaluable > &&pLeft)
 Swap-in a new left operand, returning the old one.
 
std::unique_ptr< shell_node_evaluableswap_right (std::unique_ptr< shell_node_evaluable > &&pRight)
 Swap-in a new right operand, returning the old one.
 
- 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.
 

Friends

class shell_node_operator
 

Additional Inherited Members

- Static Public Member Functions inherited from bs::shell_node_operator
static std::unique_ptr< shell_node_evaluablemake (shell_node_type nType, std::size_t nPos, std::unique_ptr< shell_node_evaluable > &&pLeft, std::unique_ptr< shell_node_evaluable > &&pRight)
 Makes an operator node.
 
- Static Public Attributes inherited from bs::shell_node_operator
static constexpr int PRIORITY_PIPE = 5
 Priority for operator pipe.
 
static constexpr int PRIORITY_AND = 4
 Priority for operator and.
 
static constexpr int PRIORITY_OR = 3
 Priority for operator or.
 
- Protected Member Functions inherited from bs::shell_node_operator
 shell_node_operator (shell_node_type nType, std::size_t nPos, int nPriority, std::unique_ptr< shell_node_evaluable > &&pLeft, std::unique_ptr< shell_node_evaluable > &&pRight)
 Construct an operator with both operands.
 
 shell_node_operator (shell_node_type nType, std::size_t nPos, int nPriority)
 
- 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

Logical AND operator node (executes right only if left succeeded).

Constructor & Destructor Documentation

◆ shell_node_and()

bs::shell_node_and::shell_node_and ( const std::size_t  nPos,
std::unique_ptr< shell_node_evaluable > &&  pLeft,
std::unique_ptr< shell_node_evaluable > &&  pRight 
)
inline

Construct an AND node.

Exceptions
shell_node_invalid_argumentIf pLeft or pRight is null.
Parameters
nPosPosition in stream.
pLeftLeft operand.
pRightRight operand.

Member Function Documentation

◆ evaluate()

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

Evaluate logical AND semantics.

Parameters
oSessionSession context.
Returns
shell_status Last command result according to AND semantics.

Implements bs::shell_node_evaluable.


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