#pragma once

#include <registry/CastRegistry.hpp>

#include <registration/NormalizationRegistration.hpp>

namespace registration {

template < class To, class From >
class CastRegister {
	registration::NormalizationRegister < To > normalize;

public:
	explicit CastRegister ( bool isExplicit = false ) {
		abstraction::CastRegistry::registerCast < To, From > ( isExplicit );
	}

	explicit CastRegister ( To ( * castFunction ) ( const From & ), bool isExplicit = false ) {
        abstraction::CastRegistry::registerCastAlgorithm < To, From > ( castFunction, isExplicit );
    }

	~CastRegister ( ) {
		abstraction::CastRegistry::unregisterCast < To, From > ( );
	}
};

} /* namespace registration */

