Steppable 0.0.1
A CAS project written from scratch in C++
Loading...
Searching...
No Matches
steppable::types::ResultBase< StatusType, ResultT, ResultTName > Class Template Reference

A base class for a result of a calculation. You should use the Result and ResultBool aliases instead of this class, which has the Status and StatusBool enums as the status type respectively. More...

#include <result.hpp>

Public Member Functions

 ResultBase ()=delete
 
 ResultBase (const std::vector< std::string > &_inputs, std::vector< std::string > _out, ResultT result, StatusType _done)
 Constructs a new result object.
 
StatusType getStatus () const
 Gets how the calculation is done.
 
ResultT getResult () const
 
std::string getOutput (size_t idx=0) const
 Gets the output of the calculation.
 
std::vector< std::string > getInputs () const
 Gets the inputs to the calculation.
 

Private Attributes

StatusType done
 Whether the calculation is done.
 
std::vector< std::string > inputs
 The inputs to the calculation.
 
std::vector< std::string > outputs
 The output of the calculation.
 
ResultT result
 The result of the calculation.
 

Detailed Description

template<typename StatusType, typename ResultT, StringLiteral ResultTName>
class steppable::types::ResultBase< StatusType, ResultT, ResultTName >

A base class for a result of a calculation. You should use the Result and ResultBool aliases instead of this class, which has the Status and StatusBool enums as the status type respectively.

Template Parameters
StatusTypeThe type of the status of the calculation.

Constructor & Destructor Documentation

◆ ResultBase() [1/2]

template<typename StatusType, typename ResultT, StringLiteral ResultTName>
steppable::types::ResultBase< StatusType, ResultT, ResultTName >::ResultBase ( )
delete

◆ ResultBase() [2/2]

template<typename StatusType, typename ResultT, StringLiteral ResultTName>
steppable::types::ResultBase< StatusType, ResultT, ResultTName >::ResultBase ( const std::vector< std::string > & _inputs,
std::vector< std::string > _out,
ResultT result,
StatusType _done )
inline

Constructs a new result object.

Parameters
[in]_inputsThe inputs to the calculation.
[in]_outThe output of the calculation.
resultThe result of the calculation.
[in]_doneA flag indicating how the calculation is done.

Member Function Documentation

◆ getInputs()

template<typename StatusType, typename ResultT, StringLiteral ResultTName>
std::vector< std::string > steppable::types::ResultBase< StatusType, ResultT, ResultTName >::getInputs ( ) const
inlinenodiscard

Gets the inputs to the calculation.

◆ getOutput()

template<typename StatusType, typename ResultT, StringLiteral ResultTName>
std::string steppable::types::ResultBase< StatusType, ResultT, ResultTName >::getOutput ( size_t idx = 0) const
inlinenodiscard

Gets the output of the calculation.

◆ getResult()

template<typename StatusType, typename ResultT, StringLiteral ResultTName>
ResultT steppable::types::ResultBase< StatusType, ResultT, ResultTName >::getResult ( ) const
inlinenodiscard

◆ getStatus()

template<typename StatusType, typename ResultT, StringLiteral ResultTName>
StatusType steppable::types::ResultBase< StatusType, ResultT, ResultTName >::getStatus ( ) const
inline

Gets how the calculation is done.

Member Data Documentation

◆ done

template<typename StatusType, typename ResultT, StringLiteral ResultTName>
StatusType steppable::types::ResultBase< StatusType, ResultT, ResultTName >::done
private

Whether the calculation is done.

◆ inputs

template<typename StatusType, typename ResultT, StringLiteral ResultTName>
std::vector<std::string> steppable::types::ResultBase< StatusType, ResultT, ResultTName >::inputs
private

The inputs to the calculation.

◆ outputs

template<typename StatusType, typename ResultT, StringLiteral ResultTName>
std::vector<std::string> steppable::types::ResultBase< StatusType, ResultT, ResultTName >::outputs
private

The output of the calculation.

◆ result

template<typename StatusType, typename ResultT, StringLiteral ResultTName>
ResultT steppable::types::ResultBase< StatusType, ResultT, ResultTName >::result
private

The result of the calculation.

Attention
This is different from inputs, as it stores only the result of the operation.

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