diff options
feat: Implement entrypoint function
1 files changed, 32 insertions, 0 deletions
| -rw-r--r-- | src/main.cpp | 32 |
diff --git a/src/main.cpp b/src/main.cpp new file mode 100644 index 0000000..704b439 --- /dev/null +++ b/src/main.cpp @@ -0,0 +1,32 @@ +#include <iostream> +#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<ScreenType>(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; +} |