diff --git a/alib2common/src/container/ObjectsDeque.h b/alib2common/src/container/ObjectsDeque.h index aa421c50eccd4652fb80e9538a16b6d1a9fe562d..4d87b8e0a7a75e0f0f5726aa7f2758f2a45cb652 100644 --- a/alib2common/src/container/ObjectsDeque.h +++ b/alib2common/src/container/ObjectsDeque.h @@ -98,8 +98,8 @@ object::ObjectBase* ObjectsDeque < ElementType >::inc() && { namespace core { template < class ElementType > -struct normalize < ext::deque < ElementType > > { - static ext::deque < object::Object > eval ( ext::deque < ElementType > && source ) { +struct normalize < container::ObjectsDeque < ElementType > > { + static ext::deque < object::Object > raw ( ext::deque < ElementType > && source ) { ext::deque < object::Object > res; for ( ElementType & element : source ) @@ -107,12 +107,9 @@ struct normalize < ext::deque < ElementType > > { return res; } -}; -template < class ElementType > -struct normalize < container::ObjectsDeque < ElementType > > { static container::ObjectsDeque < > eval ( container::ObjectsDeque < ElementType > && value ) { - return container::ObjectsDeque < > ( normalize < ext::deque < ElementType > >::eval ( std::move ( value ) ) ); + return container::ObjectsDeque < > ( raw ( std::move ( value ) ) ); } }; diff --git a/alib2common/src/container/ObjectsList.h b/alib2common/src/container/ObjectsList.h index 693dbc2a8e7324473a5e5517d7f6ad2fe6fec7c2..9d86a22aa9702f95eeef5976ee608b614fe95f60 100644 --- a/alib2common/src/container/ObjectsList.h +++ b/alib2common/src/container/ObjectsList.h @@ -98,8 +98,8 @@ object::ObjectBase* ObjectsList < ElementType >::inc() && { namespace core { template < class ElementType > -struct normalize < ext::list < ElementType > > { - static ext::list < object::Object > eval ( ext::list < ElementType > && source ) { +struct normalize < container::ObjectsList < ElementType > > { + static ext::list < object::Object > raw ( ext::list < ElementType > && source ) { ext::list < object::Object > res; for ( ElementType & element : source ) @@ -107,12 +107,9 @@ struct normalize < ext::list < ElementType > > { return res; } -}; -template < class ElementType > -struct normalize < container::ObjectsList < ElementType > > { static container::ObjectsList < > eval ( container::ObjectsList < ElementType > && value ) { - return container::ObjectsList < > ( normalize < ext::list < ElementType > >::eval ( std::move ( value ) ) ); + return container::ObjectsList < > ( raw ( std::move ( value ) ) ); } }; diff --git a/alib2common/src/container/ObjectsMap.h b/alib2common/src/container/ObjectsMap.h index 5f07f1c730fbdd5233c7c9d855988705dcad48d5..5be8ce6930a766fdfa63f7ef503446ddf10cd652 100644 --- a/alib2common/src/container/ObjectsMap.h +++ b/alib2common/src/container/ObjectsMap.h @@ -100,21 +100,18 @@ object::ObjectBase* ObjectsMap < KeyType, ValueType >::inc() && { namespace core { template < class KeyType, class ValueType > -struct normalize < ext::map < KeyType, ValueType > > { - static ext::map < object::Object, object::Object > eval ( ext::map < KeyType, ValueType > && source ) { +struct normalize < container::ObjectsMap < KeyType, ValueType > > { + static ext::map < object::Object, object::Object > raw ( ext::map < KeyType, ValueType > && source ) { ext::map < object::Object, object::Object > res; for ( std::pair < KeyType, ValueType > && element : ext::make_moveable_map ( source ) ) - res.insert ( normalize < std::pair < KeyType, ValueType > >::eval ( std::move ( element ) ) ); + res.insert ( normalize < container::ObjectsPair < KeyType, ValueType > >::raw2 ( std::move ( element ) ) ); return res; } -}; -template < class KeyType, class ValueType > -struct normalize < container::ObjectsMap < KeyType, ValueType > > { static container::ObjectsMap < > eval ( container::ObjectsMap < KeyType, ValueType > && value ) { - return container::ObjectsMap < > ( normalize < ext::map < KeyType, ValueType > >::eval ( std::move ( value ) ) ); + return container::ObjectsMap < > ( raw ( std::move ( value ) ) ); } }; diff --git a/alib2common/src/container/ObjectsPair.h b/alib2common/src/container/ObjectsPair.h index 138bd26edb35204ccbb00cc016d5eaa7a9adbed1..21223d4fd6c05f379601782cd1eb12c1f9f7e518 100644 --- a/alib2common/src/container/ObjectsPair.h +++ b/alib2common/src/container/ObjectsPair.h @@ -99,23 +99,17 @@ object::ObjectBase* ObjectsPair < FirstType, SecondType >::inc() && { namespace core { template < class FirstType, class SecondType > -struct normalize < std::pair < FirstType, SecondType > > { - static std::pair < object::Object, object::Object > eval ( std::pair < FirstType, SecondType > && source ) { +struct normalize < container::ObjectsPair < FirstType, SecondType > > { + static std::pair < object::Object, object::Object > raw2 ( std::pair < FirstType, SecondType > && source ) { return std::make_pair ( object::ObjectFactory::make ( std::move ( source.first ) ), object::ObjectFactory::make ( std::move ( source.second ) ) ); } -}; -template < class FirstType, class SecondType > -struct normalize < ext::pair < FirstType, SecondType > > { - static ext::pair < object::Object, object::Object > eval ( ext::pair < FirstType, SecondType > && source ) { + static ext::pair < object::Object, object::Object > raw ( ext::pair < FirstType, SecondType > && source ) { return ext::make_pair ( object::ObjectFactory::make ( std::move ( source.first ) ), object::ObjectFactory::make ( std::move ( source.second ) ) ); } -}; -template < class FirstType, class SecondType > -struct normalize < container::ObjectsPair < FirstType, SecondType > > { static container::ObjectsPair < > eval ( container::ObjectsPair < FirstType, SecondType > && value ) { - return container::ObjectsPair < > ( normalize < ext::pair < FirstType, SecondType > >::eval ( std::move ( value ) ) ); + return container::ObjectsPair < > ( raw ( std::move ( value ) ) ); } }; diff --git a/alib2common/src/container/ObjectsSet.h b/alib2common/src/container/ObjectsSet.h index 0bddd728ddba652c5f7c817a923f36c270ad10f2..631249cc815580c921b446e1f438a98af1aab7a5 100644 --- a/alib2common/src/container/ObjectsSet.h +++ b/alib2common/src/container/ObjectsSet.h @@ -99,8 +99,8 @@ object::ObjectBase* ObjectsSet < ElementType >::inc() && { namespace core { template < class ElementType > -struct normalize < ext::set < ElementType > > { - static ext::set < object::Object > eval ( ext::set < ElementType > && source ) { +struct normalize < container::ObjectsSet < ElementType > > { + static ext::set < object::Object > raw ( ext::set < ElementType > && source ) { ext::set < object::Object > res; for ( ElementType && element : ext::make_moveable_set ( source ) ) @@ -108,12 +108,9 @@ struct normalize < ext::set < ElementType > > { return res; } -}; -template < class ElementType > -struct normalize < container::ObjectsSet < ElementType > > { static container::ObjectsSet < > eval ( container::ObjectsSet < ElementType > && value ) { - return container::ObjectsSet < > ( normalize < ext::set < ElementType > >::eval ( std::move ( value ) ) ); + return container::ObjectsSet < > ( raw ( std::move ( value ) ) ); } }; diff --git a/alib2common/src/container/ObjectsTree.h b/alib2common/src/container/ObjectsTree.h index 09a2b7d2afbca79f59d5e9a70b2214fb8e451135..4a4cd3448ea08735a09c062ad38e5ce09c01c539 100644 --- a/alib2common/src/container/ObjectsTree.h +++ b/alib2common/src/container/ObjectsTree.h @@ -93,22 +93,19 @@ object::ObjectBase* ObjectsTree < ElementType >::inc() && { namespace core { template < class ElementType > -struct normalize < ext::tree < ElementType > > { - static ext::tree < object::Object > eval ( ext::tree < ElementType > && source ) { +struct normalize < container::ObjectsTree < ElementType > > { + static ext::tree < object::Object > raw ( ext::tree < ElementType > && source ) { ext::vector < ext::tree < object::Object > > children; for ( ext::tree < ElementType > & child : source.getChildren ( ) ) { - children.push_back ( normalize < ext::tree < ElementType > >::eval ( std::move ( child ) ) ); + children.push_back ( raw ( std::move ( child ) ) ); } return ext::tree < object::Object > ( object::ObjectFactory::make ( std::move ( source.getData ( ) ) ), std::move ( children ) ); } -}; -template < class ElementType > -struct normalize < container::ObjectsTree < ElementType > > { static container::ObjectsTree < > eval ( container::ObjectsTree < ElementType > && value ) { - return container::ObjectsTree < > ( normalize < ext::tree < ElementType > >::eval ( std::move ( value ) ) ); + return container::ObjectsTree < > ( raw ( std::move ( value ) ) ); } }; diff --git a/alib2common/src/container/ObjectsTrie.h b/alib2common/src/container/ObjectsTrie.h index 6c0c81d57e81ddbdb748fcec0edc23d4309e3ccb..65e49a2085228cbe0e1cc6125b750e89e8711b16 100644 --- a/alib2common/src/container/ObjectsTrie.h +++ b/alib2common/src/container/ObjectsTrie.h @@ -93,22 +93,19 @@ object::ObjectBase* ObjectsTrie < KeyType, ValueType >::inc() && { namespace core { template < class KeyType, class ValueType > -struct normalize < ext::trie < KeyType, ValueType > > { - static ext::trie < object::Object, object::Object > eval ( ext::trie < KeyType, ValueType > && source ) { +struct normalize < container::ObjectsTrie < KeyType, ValueType > > { + static ext::trie < object::Object, object::Object > raw ( ext::trie < KeyType, ValueType > && source ) { ext::map < object::Object, ext::trie < object::Object, object::Object > > children; for ( std::pair < KeyType, ext::trie < KeyType, ValueType > > && child : ext::make_moveable_map ( source.getChildren ( ) ) ) { - children.insert ( std::make_pair ( object::ObjectFactory::make ( std::move ( child.first ) ), normalize < ext::trie < KeyType, ValueType > >::eval ( std::move ( child.second ) ) ) ); + children.insert ( std::make_pair ( object::ObjectFactory::make ( std::move ( child.first ) ), raw ( std::move ( child.second ) ) ) ); } return ext::trie < object::Object, object::Object > ( object::ObjectFactory::make ( std::move ( source.getData ( ) ) ), std::move ( children ) ); } -}; -template < class KeyType, class ValueType > -struct normalize < container::ObjectsTrie < KeyType, ValueType > > { static container::ObjectsTrie < > eval ( container::ObjectsTrie < KeyType, ValueType > && value ) { - return container::ObjectsTrie < > ( normalize < ext::trie < KeyType, ValueType > >::eval ( std::move ( value ) ) ); + return container::ObjectsTrie < > ( raw ( std::move ( value ) ) ); } }; diff --git a/alib2common/src/container/ObjectsVector.h b/alib2common/src/container/ObjectsVector.h index dc9685716566e0d6728e5ea02b0898c033fdf1b7..c9fefc9dcc40f0acac552281bae0b08c16ea0ff5 100644 --- a/alib2common/src/container/ObjectsVector.h +++ b/alib2common/src/container/ObjectsVector.h @@ -98,8 +98,8 @@ object::ObjectBase* ObjectsVector < ElementType >::inc() && { namespace core { template < class ElementType > -struct normalize < ext::vector < ElementType > > { - static ext::vector < object::Object > eval ( ext::vector < ElementType > && source ) { +struct normalize < container::ObjectsVector < ElementType > > { + static ext::vector < object::Object > raw ( ext::vector < ElementType > && source ) { ext::vector < object::Object > res; for ( ElementType & element : source ) @@ -107,12 +107,9 @@ struct normalize < ext::vector < ElementType > > { return res; } -}; -template < class ElementType > -struct normalize < container::ObjectsVector < ElementType > > { static container::ObjectsVector < > eval ( container::ObjectsVector < ElementType > && value ) { - return container::ObjectsVector < > ( normalize < ext::vector < ElementType > >::eval ( std::move ( value ) ) ); + return container::ObjectsVector < > ( raw ( std::move ( value ) ) ); } }; diff --git a/alib2common/test-src/container/ContainerTest.cpp b/alib2common/test-src/container/ContainerTest.cpp index f06c5aee22d939e3b63d168de8e74e0213c42c66..2ffbb9d5959b685ab8719f3efb6cf5b61e3b16b0 100644 --- a/alib2common/test-src/container/ContainerTest.cpp +++ b/alib2common/test-src/container/ContainerTest.cpp @@ -25,8 +25,8 @@ void ContainerTest::testProperties ( ) { void ContainerTest::testNormalize ( ) { ext::deque < int > dint; - ext::deque < object::Object > dnor = core::normalize < ext::deque < int > >::eval ( std::move ( dint ) ); - ext::deque < object::Object > dnor2 = core::normalize < ext::deque < object::Object > >::eval ( std::move ( dnor ) ); + ext::deque < object::Object > dnor = core::normalize < container::ObjectsDeque < int > >::raw ( std::move ( dint ) ); + ext::deque < object::Object > dnor2 = core::normalize < container::ObjectsDeque < object::Object > >::raw ( std::move ( dnor ) ); container::ObjectsDeque < int > Dint; container::ObjectsDeque < object::Object > Dnor = core::normalize < container::ObjectsDeque < int > >::eval ( std::move ( Dint ) );