#include #include "cli.hpp" #include "Screen.h" #include "Television.h" #include "LEDVideoWall.h" enum class ScreenType { TV = 0, LED }; Screen* newScreen() { unsigned int itype = 2; cli::readUserInputMax( itype, (unsigned int)2, "Select a screen type [0 for TV, 1 for LED]: ", "Invalid type, try again!"); ScreenType type = static_cast(itype); switch (type) { case ScreenType::TV: return Television::fromCommandLine(); case ScreenType::LED: return LEDVideoWall::fromCommandLine(); } throw std::logic_error("Implementation error: not all ScreenType values are handled!"); } int main() { Screen* screen = newScreen(); std::cout << *screen << std::endl; delete screen; return 0; }