| 1 | #ifndef _GI_GST_BIN_EXTRA_DEF_HPP_ |
| 2 | #define _GI_GST_BIN_EXTRA_DEF_HPP_ |
| 3 | |
| 4 | namespace gi |
| 5 | { |
| 6 | namespace repository |
| 7 | { |
| 8 | namespace Gst |
| 9 | { |
| 10 | namespace base |
| 11 | { |
| 12 | class BinExtra : public GI_GST_BIN_BASE |
| 13 | { |
| 14 | typedef GI_GST_BIN_BASE super; |
| 15 | |
| 16 | public: |
| 17 | using super::add; |
| 18 | |
| 19 | // Syntax sugar add with multiple arguments to reflect a non-introspectable gst_bin_add_many |
| 20 | template <typename ...Args> |
| 21 | GI_INLINE_DECL void add(Gst::Element arg0, Args ...args) GI_NOEXCEPT_DECL(true) { |
| 22 | super::add(gi::object_cast<Gst::Element>(arg0)); |
| 23 | // We don't need extra code to stop the recursion because of `using |
| 24 | // super::add` above. When the number of arguments reaches 1, the base class |
| 25 | // `add` will be called. |
| 26 | add(args...); |
| 27 | } |
| 28 | |
| 29 | }; // class |
| 30 | |
| 31 | #undef GI_GST_BIN_BASE |
| 32 | #define GI_GST_BIN_BASE base::BinExtra |
| 33 | |
| 34 | } // namespace base |
| 35 | |
| 36 | } // namespace Gst |
| 37 | |
| 38 | } // namespace repository |
| 39 | |
| 40 | } // namespace gi |
| 41 | |
| 42 | |
| 43 | #endif |