Porytiles
Loading...
Searching...
No Matches
porytiles2::Operation Class Referenceabstract

Abstract base class for operations in a processing pipeline. More...

#include <operation.hpp>

Public Member Functions

virtual ~Operation ()=default
 
virtual std::vector< OperandDeclarationdeclare_inputs () const =0
 Declares the input operands required by this operation.
 
virtual std::vector< OperandDeclarationdeclare_outputs () const =0
 Declares the output operands produced by this operation.
 
virtual ChainableResult< OperandBundleapply (const OperandBundle &inputs)
 Applies this operation to the given input operands.
 
const std::string & name () const
 Gets the name of this operation.
 
void set_name (const std::string &name)
 Sets the name of this operation.
 

Protected Member Functions

virtual ChainableResult< OperandBundleexecute (const OperandBundle &inputs)=0
 Executes the operation's processing logic.
 

Detailed Description

Abstract base class for operations in a processing pipeline.

Operation represents a single processing unit in a pipeline that takes input operands and produces output operands. Each operation must declare its expected inputs and outputs, and implement the execute method to perform its specific processing logic. The apply method validates inputs against declared requirements before execution.

Definition at line 22 of file operation.hpp.

Constructor & Destructor Documentation

◆ ~Operation()

virtual porytiles2::Operation::~Operation ( )
virtualdefault

Member Function Documentation

◆ apply()

virtual ChainableResult< OperandBundle > porytiles2::Operation::apply ( const OperandBundle inputs)
inlinevirtual

Applies this operation to the given input operands.

Validates that the provided inputs satisfy the declared input requirements before delegating to the execute method. Panics if inputs are invalid.

Parameters
inputsBundle of input operands to process
Returns
ChainableResult containing the output operand bundle or an error

Definition at line 50 of file operation.hpp.

◆ declare_inputs()

virtual std::vector< OperandDeclaration > porytiles2::Operation::declare_inputs ( ) const
pure virtual

Declares the input operands required by this operation.

Returns
Vector of OperandDeclaration objects describing required inputs

◆ declare_outputs()

virtual std::vector< OperandDeclaration > porytiles2::Operation::declare_outputs ( ) const
pure virtual

Declares the output operands produced by this operation.

Returns
Vector of OperandDeclaration objects describing produced outputs

◆ execute()

virtual ChainableResult< OperandBundle > porytiles2::Operation::execute ( const OperandBundle inputs)
protectedpure virtual

Executes the operation's processing logic.

Subclasses must implement this method to define their specific processing behavior. This method is called by apply after input validation has passed.

Parameters
inputsValidated bundle of input operands
Returns
ChainableResult containing the output operand bundle or an error

◆ name()

const std::string & porytiles2::Operation::name ( ) const
inline

Gets the name of this operation.

Returns
Const reference to the operation name

Definition at line 64 of file operation.hpp.

◆ set_name()

void porytiles2::Operation::set_name ( const std::string &  name)
inline

Sets the name of this operation.

Parameters
nameThe new name for this operation

Definition at line 74 of file operation.hpp.


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