Commit d841790e authored by Ing. Jan Trávníček's avatar Ing. Jan Trávníček

fix tuple vs pair inconsistency

parent 1ac160e9
......@@ -14,12 +14,12 @@
namespace abstraction {
class RawAbstraction : virtual public OperationAbstraction {
ext::vector < ext::tuple < std::string, abstraction::TypeQualifiers::TypeQualifierSet > > m_paramSpecs;
ext::vector < ext::pair < std::string, abstraction::TypeQualifiers::TypeQualifierSet > > m_paramSpecs; //FIXME is it needed?
std::function < std::shared_ptr < abstraction::Value > ( std::vector < std::shared_ptr < abstraction::Value > > ) > m_callback;
ext::vector < std::shared_ptr < abstraction::Value > > m_params;
public:
RawAbstraction ( ext::vector < ext::tuple < std::string, abstraction::TypeQualifiers::TypeQualifierSet > > paramSpecs, std::function < std::shared_ptr < abstraction::Value > ( std::vector < std::shared_ptr < abstraction::Value > > ) > callback ) : m_paramSpecs ( paramSpecs ), m_callback ( std::move ( callback ) ), m_params ( m_paramSpecs.size ( ) ) {
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 ) : m_paramSpecs ( paramSpecs ), m_callback ( std::move ( callback ) ), m_params ( m_paramSpecs.size ( ) ) {
}
private:
......
......@@ -161,7 +161,7 @@ public:
}
template < class Algo >
static void unregisterRaw ( ext::vector < ext::tuple < std::string, abstraction::TypeQualifiers::TypeQualifierSet > > parameterSpecs ) {
static void unregisterRaw ( ext::vector < ext::pair < std::string, abstraction::TypeQualifiers::TypeQualifierSet > > parameterSpecs ) {
std::string algorithm = ext::to_string < Algo > ( );
ext::vector < std::string > templateParams = ext::get_template_info ( algorithm );
algorithm = ext::erase_template_info ( algorithm );
......
......@@ -21,12 +21,12 @@ namespace abstraction {
class AlgorithmBaseInfo {
AlgorithmCategories::AlgorithmCategory m_category;
ext::vector < ext::tuple < std::string, abstraction::TypeQualifiers::TypeQualifierSet > > m_params;
ext::vector < ext::pair < std::string, abstraction::TypeQualifiers::TypeQualifierSet > > m_params;
protected:
template < class ... ParamTypes >
static ext::vector < ext::tuple < std::string, abstraction::TypeQualifiers::TypeQualifierSet > > convertTypes ( ) {
ext::vector < ext::tuple < std::string, abstraction::TypeQualifiers::TypeQualifierSet > > params { convertType < ParamTypes > ( ) ... };
static ext::vector < ext::pair < std::string, abstraction::TypeQualifiers::TypeQualifierSet > > convertTypes ( ) {
ext::vector < ext::pair < std::string, abstraction::TypeQualifiers::TypeQualifierSet > > params { convertType < ParamTypes > ( ) ... };
return params;
}
......@@ -37,14 +37,14 @@ protected:
}
public:
AlgorithmBaseInfo ( AlgorithmCategories::AlgorithmCategory category, ext::vector < ext::tuple < std::string, abstraction::TypeQualifiers::TypeQualifierSet > > params ) : m_category ( category ), m_params ( std::move ( params ) ) {
AlgorithmBaseInfo ( AlgorithmCategories::AlgorithmCategory category, ext::vector < ext::pair < std::string, abstraction::TypeQualifiers::TypeQualifierSet > > params ) : m_category ( category ), m_params ( std::move ( params ) ) {
}
AlgorithmCategories::AlgorithmCategory getCategory ( ) const {
return m_category;
}
const ext::vector < ext::tuple < std::string, abstraction::TypeQualifiers::TypeQualifierSet > > & getParams ( ) const {
const ext::vector < ext::pair < std::string, abstraction::TypeQualifiers::TypeQualifierSet > > & getParams ( ) const {
return m_params;
}
......@@ -52,7 +52,7 @@ public:
static AlgorithmBaseInfo methodEntryInfo ( ) {
AlgorithmCategories::AlgorithmCategory category = AlgorithmCategories::AlgorithmCategory::DEFAULT;
ext::vector < ext::tuple < std::string, abstraction::TypeQualifiers::TypeQualifierSet > > params = convertTypes < ParamTypes ... > ( );
ext::vector < ext::pair < std::string, abstraction::TypeQualifiers::TypeQualifierSet > > params = convertTypes < ParamTypes ... > ( );
params.insert ( params.begin ( ), convertType < ObjectType & > ( ) );
return AlgorithmBaseInfo ( category, std::move ( params ) );
......@@ -60,7 +60,7 @@ public:
template < class ... ParamTypes >
static AlgorithmBaseInfo algorithmEntryInfo ( AlgorithmCategories::AlgorithmCategory category ) {
ext::vector < ext::tuple < std::string, abstraction::TypeQualifiers::TypeQualifierSet > > params = convertTypes < ParamTypes ... > ( );
ext::vector < ext::pair < std::string, abstraction::TypeQualifiers::TypeQualifierSet > > params = convertTypes < ParamTypes ... > ( );
return AlgorithmBaseInfo ( category, std::move ( params ) );
}
......@@ -69,12 +69,12 @@ public:
static AlgorithmBaseInfo wrapperEntryInfo ( ) {
AlgorithmCategories::AlgorithmCategory category = AlgorithmCategories::AlgorithmCategory::DEFAULT;
ext::vector < ext::tuple < std::string, abstraction::TypeQualifiers::TypeQualifierSet > > params = convertTypes < ParamTypes ... > ( );
ext::vector < ext::pair < std::string, abstraction::TypeQualifiers::TypeQualifierSet > > params = convertTypes < ParamTypes ... > ( );
return AlgorithmBaseInfo ( category, std::move ( params ) );
}
static AlgorithmBaseInfo rawEntryInfo ( ext::vector < ext::tuple < std::string, abstraction::TypeQualifiers::TypeQualifierSet > > paramSpec ) {
static AlgorithmBaseInfo rawEntryInfo ( ext::vector < ext::pair < std::string, abstraction::TypeQualifiers::TypeQualifierSet > > paramSpec ) {
AlgorithmCategories::AlgorithmCategory category = AlgorithmCategories::AlgorithmCategory::DEFAULT;
return AlgorithmBaseInfo ( category, std::move ( paramSpec ) );
......@@ -84,7 +84,7 @@ public:
static AlgorithmBaseInfo operatorEntryInfo ( ) {
AlgorithmCategories::AlgorithmCategory category = AlgorithmCategories::AlgorithmCategory::DEFAULT;
ext::vector < ext::tuple < std::string, abstraction::TypeQualifiers::TypeQualifierSet > > params = convertTypes < ParamTypes ... > ( );
ext::vector < ext::pair < std::string, abstraction::TypeQualifiers::TypeQualifierSet > > params = convertTypes < ParamTypes ... > ( );
return AlgorithmBaseInfo ( category, std::move ( params ) );
}
......@@ -140,7 +140,7 @@ public:
static AlgorithmFullInfo rawEntryInfo ( ext::pair < std::string, abstraction::TypeQualifiers::TypeQualifierSet > result, ext::vector < ext::tuple < std::string, abstraction::TypeQualifiers::TypeQualifierSet, std::string > > paramSpecs ) {
ext::vector < std::string > parameterNames;
ext::vector < ext::tuple < std::string, abstraction::TypeQualifiers::TypeQualifierSet > > parameterSpecs;
ext::vector < ext::pair < std::string, abstraction::TypeQualifiers::TypeQualifierSet > > parameterSpecs;
for ( ext::tuple < std::string, abstraction::TypeQualifiers::TypeQualifierSet, std::string > & paramSpec : paramSpecs ) {
parameterNames.push_back ( std::move ( std::get < 2 > ( paramSpec ) ) );
parameterSpecs.push_back ( ext::make_pair ( std::move ( std::get < 0 > ( paramSpec ) ), std::get < 1 > ( paramSpec ) ) );
......
......@@ -14,7 +14,7 @@ namespace {
auto move = ext::Register < void > ( [ ] ( ) {
abstraction::AlgorithmRegistry::registerRaw < cli::builtin::Move > ( cli::builtin::Move::move, ext::pair < std::string, abstraction::TypeQualifiers::TypeQualifierSet > { "auto", abstraction::TypeQualifiers::TypeQualifierSet::RREF }, ext::vector < ext::tuple < std::string, abstraction::TypeQualifiers::TypeQualifierSet, std::string > > { { "auto", abstraction::TypeQualifiers::TypeQualifierSet::LREF, "arg0" } } );
}, [ ] ( ) {
abstraction::AlgorithmRegistry::unregisterRaw < cli::builtin::Move > ( ext::vector < ext::tuple < std::string, abstraction::TypeQualifiers::TypeQualifierSet > > { { "auto", abstraction::TypeQualifiers::TypeQualifierSet::LREF } } );
abstraction::AlgorithmRegistry::unregisterRaw < cli::builtin::Move > ( ext::vector < ext::pair < std::string, abstraction::TypeQualifiers::TypeQualifierSet > > { { "auto", abstraction::TypeQualifiers::TypeQualifierSet::LREF } } );
} );
} /* namespace */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment