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

Pipe operator node (connects stdout of left to stdin of right). More...

#include <shell_node.h>

Inheritance diagram for bs::shell_node_pipe:
Collaboration diagram for bs::shell_node_pipe:

Public Member Functions

 shell_node_pipe (const std::size_t nPos, std::unique_ptr< shell_node_evaluable > &&pLeft, std::unique_ptr< shell_node_evaluable > &&pRight)
 Construct a pipe node.
 
shell_status evaluate (shell_session &oSession) const override
 Evaluate pipe semantics (setup streams and execute both sides).
 
- 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

Pipe operator node (connects stdout of left to stdin of right).

Constructor & Destructor Documentation

◆ shell_node_pipe()

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

Construct a pipe node.

Exceptions
shell_node_invalid_argumentIf pLeft or pRight is null.
Parameters
nPosPosition in stream.
pLeftLeft operand (producer).
pRightRight operand (consumer).

Member Function Documentation

◆ evaluate()

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

Evaluate pipe semantics (setup streams and execute both sides).

Parameters
oSessionSession context.
Returns
shell_status Result of the pipeline or last command status.

Implements bs::shell_node_evaluable.


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