Algorithms Library Toolkit
A toolkit for algorithms, especially for algorithms on formal languages
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Concepts
SetAbstraction.hpp
Go to the documentation of this file.
1
6#pragma once
7
8#include <ext/memory>
9
12
13namespace abstraction {
14
15template < class ParamType >
16class SetAbstraction : virtual public AnyaryOperationAbstraction < ParamType >, virtual public ValueOperationAbstraction < ext::set < ParamType > > {
17public:
18 std::shared_ptr < abstraction::Value > run ( ) const override {
20 for ( const std::shared_ptr < abstraction::Value > & param : this->getParams ( ) ) {
21 theSet.insert ( abstraction::retrieveValue < ParamType > ( param ) );
22 }
23
24 return std::make_shared < abstraction::ValueHolder < ext::set < ParamType > > > ( std::move ( theSet ), true );
25 }
26
27};
28
29} /* namespace abstraction */
30
const ext::vector< std::shared_ptr< abstraction::Value > > & getParams() const
Definition: AnyaryOperationAbstraction.hpp:19
Definition: AnyaryOperationAbstraction.hpp:44
Definition: SetAbstraction.hpp:16
std::shared_ptr< abstraction::Value > run() const override
Definition: SetAbstraction.hpp:18
Definition: ValueOperationAbstraction.hpp:19
Definition: set.hpp:44
Definition: AlgorithmAbstraction.hpp:11