Algorithms Library Toolkit
A toolkit for algorithms, especially for algorithms on formal languages
CastAbstraction.hpp
Go to the documentation of this file.
1
6#pragma once
7
10
11namespace abstraction {
12
13template < class ReturnType, class ParamType >
14class CastAbstraction : virtual public NaryOperationAbstraction < const ParamType & >, virtual public ValueOperationAbstraction < ReturnType > {
15public:
16 std::shared_ptr < abstraction::Value > run ( ) const override {
17 const std::shared_ptr < abstraction::Value > & param = std::get < 0 > ( this->getParams ( ) );
18
19 return std::make_shared < abstraction::ValueHolder < ReturnType > > ( ReturnType ( retrieveValue < const ParamType & > ( param ) ), true );
20 }
21
22};
23
24} /* namespace abstraction */
25
Definition: CastAbstraction.hpp:14
std::shared_ptr< abstraction::Value > run() const override
Definition: CastAbstraction.hpp:16
const ext::array< std::shared_ptr< abstraction::Value >, NumberOfParams > & getParams() const
Definition: NaryOperationAbstraction.hpp:21
Definition: NaryOperationAbstraction.hpp:77
Definition: ValueOperationAbstraction.hpp:19
Definition: AlgorithmAbstraction.hpp:11