15 std::function < std::shared_ptr < abstraction::Value > (
const std::vector < std::shared_ptr < abstraction::Value > > & ) > m_callback;
16 std::vector < std::shared_ptr < abstraction::Value > > m_params;
23 std::shared_ptr < abstraction::Value > run ( )
const {
24 return m_callback ( m_params );
27 void attachInput (
const std::shared_ptr < abstraction::Value > & input,
size_t index )
override;
29 void detachInput (
size_t index )
override;
34 std::shared_ptr < abstraction::Value >
eval ( )
override;
37 return m_params.size ( );
45 if ( index >= m_params.size ( ) )
46 throw std::invalid_argument (
"Parameter index " +
ext::to_string ( index ) +
" out of bounds.");
48 if ( m_params [ index ] ==
nullptr )
49 throw std::domain_error (
"Parameter index " +
ext::to_string ( index ) +
" not yet set.");
51 return m_params [ index ]->getTypeIndex ( );
55 if ( index >= m_params.size ( ) )
56 throw std::invalid_argument (
"Parameter index " +
ext::to_string ( index ) +
" out of bounds.");
58 if ( m_params [ index ] ==
nullptr )
59 throw std::domain_error (
"Parameter index " +
ext::to_string ( index ) +
" not yet set.");
61 return m_params [ index ]->getTypeQualifiers ( );
69 throw std::domain_error (
"Return type not available.");
73 throw std::domain_error (
"Return type not available.");
Definition: OperationAbstraction.hpp:19
Definition: RawAbstraction.hpp:13
ext::type_index getParamTypeIndex(size_t index) const override
Definition: RawAbstraction.hpp:44
abstraction::TypeQualifiers::TypeQualifierSet getReturnTypeQualifiers() const override
Definition: RawAbstraction.hpp:68
size_t numberOfParams() const override
Definition: RawAbstraction.hpp:36
bool isParamTypeUniversal(size_t) const override
Definition: RawAbstraction.hpp:40
RawAbstraction(ext::vector< ext::pair< std::string, abstraction::TypeQualifiers::TypeQualifierSet > > paramSpecs, std::function< std::shared_ptr< abstraction::Value >(std::vector< std::shared_ptr< abstraction::Value > >) > callback)
Definition: RawAbstraction.hpp:19
abstraction::TypeQualifiers::TypeQualifierSet getParamTypeQualifiers(size_t index) const override
Definition: RawAbstraction.hpp:54
std::shared_ptr< abstraction::Value > eval() override
Definition: RawAbstraction.cpp:32
bool isReturnTypeUniversal() const override
Definition: RawAbstraction.hpp:64
bool inputsAttached() const override
Definition: RawAbstraction.cpp:24
ext::type_index getReturnTypeIndex() const override
Definition: RawAbstraction.hpp:72
TypeQualifierSet
Definition: TypeQualifiers.hpp:15
Class extending the pair class from the standard library. Original reason is to allow printing of the...
Definition: pair.hpp:43
Definition: typeindex.h:37
Class extending the vector class from the standard library. Original reason is to allow printing of t...
Definition: vector.hpp:45
Definition: AlgorithmAbstraction.hpp:11
int callback(struct dl_phdr_info *info, size_t, void *data)
Definition: simpleStacktrace.cpp:25
std::string to_string(const T &value)
To string method designated for objects that can be casted to string.
Definition: string.hpp:131
Definition: FordFulkerson.hpp:16