diff --git a/alib2abstraction/src/object/ObjectFactory.cpp b/alib2abstraction/src/object/ObjectFactory.cpp new file mode 100644 index 0000000000000000000000000000000000000000..d092fc5f0f716acb1a4308bf17a0fbc6b221fb5d --- /dev/null +++ b/alib2abstraction/src/object/ObjectFactory.cpp @@ -0,0 +1,51 @@ +#include "ObjectFactory.h" + +namespace object { + +Object ObjectFactoryImpl < Object >::construct ( Object && object ) { + return std::move ( object ); +} + +Object ObjectFactoryImpl < const Object & >::construct ( const Object & object ) { + return object; +} + +Object ObjectFactoryImpl < Object & >::construct ( Object & object ) { + return object; +} + +Object ObjectFactoryImpl < const char * const & >::construct ( const char * const string ) { + return ObjectFactoryImpl < std::string >::construct ( std::string ( string ) ); +} + +Object ObjectFactoryImpl < char * const & >::construct ( char * const string ) { + return ObjectFactoryImpl < std::string >::construct ( std::string ( string ) ); +} + +Object ObjectFactoryImpl < const char * & >::construct ( const char * const string ) { + return ObjectFactoryImpl < std::string >::construct ( std::string ( string ) ); +} + +Object ObjectFactoryImpl < char * & >::construct ( char * const string ) { + return ObjectFactoryImpl < std::string >::construct ( std::string ( string ) ); +} + +Object ObjectFactoryImpl < const char * const >::construct ( const char * const string ) { + return ObjectFactoryImpl < std::string >::construct ( std::string ( string ) ); +} + +Object ObjectFactoryImpl < char * const >::construct ( char * const string ) { + return ObjectFactoryImpl < std::string >::construct ( std::string ( string ) ); +} + +Object ObjectFactoryImpl < const char * >::construct ( const char * string ) { + return ObjectFactoryImpl < std::string >::construct ( std::string ( string ) ); +} + +Object ObjectFactoryImpl < char * >::construct ( char * string ) { + return ObjectFactoryImpl < std::string >::construct ( std::string ( string ) ); +} + +template Object ObjectFactoryImpl < std::string >::construct ( std::string && ); + +} /* namespace core */ diff --git a/alib2abstraction/src/object/ObjectFactory.h b/alib2abstraction/src/object/ObjectFactory.h index d9fc8bca1600f7af4b28ae181f07f5793fc5cd04..67b94f6888160a385175ae010784728f3743f061 100644 --- a/alib2abstraction/src/object/ObjectFactory.h +++ b/alib2abstraction/src/object/ObjectFactory.h @@ -21,89 +21,67 @@ public: template < > class ObjectFactoryImpl < Object > { public: - static Object construct ( Object && object ) { - return std::move ( object ); - } + static Object construct ( Object && object ); }; template < > class ObjectFactoryImpl < const Object & > { public: - static Object construct ( const Object & object ) { - return object; - } + static Object construct ( const Object & object ); }; template < > class ObjectFactoryImpl < Object & > { public: - static Object construct ( Object & object ) { - return object; - } + static Object construct ( Object & object ); }; template < > class ObjectFactoryImpl < const char * const & > { public: - static Object construct ( const char * const string ) { - return ObjectFactoryImpl < std::string >::construct ( std::string ( string ) ); - } + static Object construct ( const char * const string ); }; template < > class ObjectFactoryImpl < char * const & > { public: - static Object construct ( char * const string ) { - return ObjectFactoryImpl < std::string >::construct ( std::string ( string ) ); - } + static Object construct ( char * const string ); }; template < > class ObjectFactoryImpl < const char * & > { public: - static Object construct ( const char * const string ) { - return ObjectFactoryImpl < std::string >::construct ( std::string ( string ) ); - } + static Object construct ( const char * const string ); }; template < > class ObjectFactoryImpl < char * & > { public: - static Object construct ( char * const string ) { - return ObjectFactoryImpl < std::string >::construct ( std::string ( string ) ); - } + static Object construct ( char * const string ); }; template < > class ObjectFactoryImpl < const char * const > { public: - static Object construct ( const char * const string ) { - return ObjectFactoryImpl < std::string >::construct ( std::string ( string ) ); - } + static Object construct ( const char * const string ); }; template < > class ObjectFactoryImpl < char * const > { public: - static Object construct ( char * const string ) { - return ObjectFactoryImpl < std::string >::construct ( std::string ( string ) ); - } + static Object construct ( char * const string ); }; template < > class ObjectFactoryImpl < const char * > { public: - static Object construct ( const char * string ) { - return ObjectFactoryImpl < std::string >::construct ( std::string ( string ) ); - } + static Object construct ( const char * string ); }; template < > class ObjectFactoryImpl < char * > { public: - static Object construct ( char * string ) { - return ObjectFactoryImpl < std::string >::construct ( std::string ( string ) ); - } + static Object construct ( char * string ); }; namespace details { @@ -217,4 +195,6 @@ public: } }; +extern template Object ObjectFactoryImpl < std::string >::construct ( std::string && ); + } /* namespace core */