Source/Util/Util.h
raw| 1 | /* |
| 2 | * Util.h |
| 3 | * |
| 4 | * Created on: 20 Jun 2018 |
| 5 | * Author: jeremy |
| 6 | */ |
| 7 | |
| 8 | #ifndef SOURCE_UTIL_UTIL_H_ |
| 9 | #define SOURCE_UTIL_UTIL_H_ |
| 10 | |
| 11 | #include <string> |
| 12 | |
| 13 | namespace Util |
| 14 | { |
| 15 | |
| 16 | template <typename T, typename B> |
| 17 | inline T* GetWidget(B& builder, const std::string& name) |
| 18 | { |
| 19 | T* widget = nullptr; |
| 20 | builder->get_widget(name.data(), widget); |
| 21 | |
| 22 | return widget; |
| 23 | } |
| 24 | |
| 25 | |
| 26 | } |
| 27 | |
| 28 | #endif /* SOURCE_UTIL_UTIL_H_ */ |