diff options
feat: Add a virtual function for extra output
6 files changed, 16 insertions, 2 deletions
| -rw-r--r-- | src/LEDVideoWall.cpp | 4 | ||||
| -rw-r--r-- | src/LEDVideoWall.h | 3 | ||||
| -rw-r--r-- | src/Screen.cpp | 2 | ||||
| -rw-r--r-- | src/Screen.h | 2 | ||||
| -rw-r--r-- | src/Television.cpp | 4 | ||||
| -rw-r--r-- | src/Television.h | 3 |
diff --git a/src/LEDVideoWall.cpp b/src/LEDVideoWall.cpp index 521dcbe..2d42fbf 100644 --- a/src/LEDVideoWall.cpp +++ b/src/LEDVideoWall.cpp @@ -66,3 +66,7 @@ LEDVideoWall* LEDVideoWall::fromCommandLine() { } throw std::logic_error("Implementation error: didn't handle all types of LED video walls!"); } + +std::string LEDVideoWall::extraOutput() const { + return std::string(); +} diff --git a/src/LEDVideoWall.h b/src/LEDVideoWall.h index fe8b9ea..1007249 100644 --- a/src/LEDVideoWall.h +++ b/src/LEDVideoWall.h @@ -14,8 +14,9 @@ public: static LEDVideoWall* fromCommandLine(); -private: +protected: LEDVideoWall(mm width, mm height); + virtual std::string extraOutput() const; }; #endif /* SG_LEDVIDEOWALL */ diff --git a/src/Screen.cpp b/src/Screen.cpp index 3ff3183..878f86d 100644 --- a/src/Screen.cpp +++ b/src/Screen.cpp @@ -13,5 +13,5 @@ mm Screen::getWidth() const { } std::ostream& operator<<(std::ostream& ostr, const Screen& screen) { - return ostr << "Screen: " << screen.width << "x" << screen.height; + return ostr << "Screen: " << screen.width << "x" << screen.height << screen.extraOutput(); } diff --git a/src/Screen.h b/src/Screen.h index 950aab4..346d04d 100644 --- a/src/Screen.h +++ b/src/Screen.h @@ -2,6 +2,7 @@ #define SG_SCREEN #include <ostream> +#include <string> typedef unsigned int mm; @@ -19,6 +20,7 @@ protected: mm height; Screen(mm width, mm height); + virtual std::string extraOutput() const = 0; }; std::ostream& operator<<(std::ostream& ostr, const Screen& screen); diff --git a/src/Television.cpp b/src/Television.cpp index cf60d73..35f1d46 100644 --- a/src/Television.cpp +++ b/src/Television.cpp @@ -14,3 +14,7 @@ Television* Television::fromCommandLine() { return new Television(iwidth, iheight); } + +std::string Television::extraOutput() const { + return std::string(); +} diff --git a/src/Television.h b/src/Television.h index 2c766a0..6cfb688 100644 --- a/src/Television.h +++ b/src/Television.h @@ -9,6 +9,9 @@ public: virtual ~Television(); static Television* fromCommandLine(); + +protected: + virtual std::string extraOutput() const; }; #endif /* SG_TELEVISION */ |