| 1 | // Generated by gmmproc 2.50.1 -- DO NOT MODIFY!cxx . . $ `<file>/gstreamer/gstreamermm/iterator.h`/ |
| 2 | #ifndef _GSTREAMERMM_ITERATOR_H |
| 3 | #define _GSTREAMERMM_ITERATOR_Hcxx . . $ `gstreamer/gstreamermm/iterator.h:3:9`! |
| 4 | |
| 5 | |
| 6 | #include <glibmm/ustring.h> |
| 7 | #include <sigc++/sigc++.h> |
| 8 | |
| 9 | /* gstreamermm - a C++ wrapper for gstreamer |
| 10 | * |
| 11 | * Copyright 2008 The gstreamermm Development Team |
| 12 | * |
| 13 | * This library is free software; you can redistribute it and/or |
| 14 | * modify it under the terms of the GNU Lesser General Public |
| 15 | * License as published by the Free Software Foundation; either |
| 16 | * version 2.1 of the License, or (at your option) any later version. |
| 17 | * |
| 18 | * This library is distributed in the hope that it will be useful, |
| 19 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 20 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 21 | * Lesser General Public License for more details. |
| 22 | * |
| 23 | * You should have received a copy of the GNU Lesser General Public |
| 24 | * License along with this library; if not, write to the Free |
| 25 | * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
| 26 | */ |
| 27 | |
| 28 | #include <gst/gst.h> |
| 29 | #include <gstreamermm/handle_error.h>cxx . . $ `<file>/gstreamer/gstreamermm/handle_error.h`/ |
| 30 | |
| 31 | |
| 32 | namespace Gstcxx . . $ Gst/ |
| 33 | { |
| 34 | |
| 35 | /** @addtogroup gstreamermmEnums gstreamermm Enums and Flags */ |
| 36 | |
| 37 | /** |
| 38 | * @var IteratorItem ITERATOR_ITEM_SKIP |
| 39 | * Skip this item. |
| 40 | * |
| 41 | * @var IteratorItem ITERATOR_ITEM_PASS |
| 42 | * Return item. |
| 43 | * |
| 44 | * @var IteratorItem ITERATOR_ITEM_END |
| 45 | * Stop after this item. |
| 46 | * |
| 47 | * @enum IteratorItem |
| 48 | * |
| 49 | * The result of a Gst::IteratorItemFunction. |
| 50 | * |
| 51 | * @ingroup gstreamermmEnums |
| 52 | */ |
| 53 | enum IteratorItemcxx . . $ Gst/IteratorItem# |
| 54 | { |
| 55 | ITERATOR_ITEM_SKIPcxx . . $ Gst/ITERATOR_ITEM_SKIP., |
| 56 | ITERATOR_ITEM_PASScxx . . $ Gst/ITERATOR_ITEM_PASS., |
| 57 | ITERATOR_ITEM_ENDcxx . . $ Gst/ITERATOR_ITEM_END. |
| 58 | }; |
| 59 | |
| 60 | } // namespace Gst |
| 61 | |
| 62 | #ifndef DOXYGEN_SHOULD_SKIP_THIS |
| 63 | namespace Glibcxx . . $ Glib/ |
| 64 | { |
| 65 | |
| 66 | template <> |
| 67 | class Valuecxx . . $ Glib/Value#<Gstcxx . . $ Gst/::IteratorItemcxx . . $ Gst/IteratorItem#> : public Glibcxx . . $ Glib/::Value_Enumcxx . . $ Glib/Value_Enum#<Gstcxx . . $ Gst/::IteratorItemcxx . . $ Gst/IteratorItem#> |
| 68 | { |
| 69 | public: |
| 70 | static GType value_typecxx . . $ Glib/Value#value_type(f708dce9a8856c70).() G_GNUC_CONSTcxx . . $ `<external>/12741050725406041920/gmacros.h:640:9`!; |
| 71 | }; |
| 72 | |
| 73 | } // namespace Glib |
| 74 | #endif /* DOXYGEN_SHOULD_SKIP_THIS */ |
| 75 | |
| 76 | namespace Gstcxx . . $ Gst/ |
| 77 | { |
| 78 | |
| 79 | /** |
| 80 | * @var IteratorResult ITERATOR_DONE |
| 81 | * No more items in the iterator. |
| 82 | * |
| 83 | * @var IteratorResult ITERATOR_OK |
| 84 | * An item was retrieved. |
| 85 | * |
| 86 | * @var IteratorResult ITERATOR_RESYNC |
| 87 | * Datastructure changed while iterating. |
| 88 | * |
| 89 | * @var IteratorResult ITERATOR_ERROR |
| 90 | * An error happened. |
| 91 | * |
| 92 | * @enum IteratorResult |
| 93 | * |
| 94 | * The result of Gst::Iterator::next(). |
| 95 | * |
| 96 | * @ingroup gstreamermmEnums |
| 97 | */ |
| 98 | enum IteratorResultcxx . . $ Gst/IteratorResult# |
| 99 | { |
| 100 | ITERATOR_DONEcxx . . $ Gst/ITERATOR_DONE., |
| 101 | ITERATOR_OKcxx . . $ Gst/ITERATOR_OK., |
| 102 | ITERATOR_RESYNCcxx . . $ Gst/ITERATOR_RESYNC., |
| 103 | ITERATOR_ERRORcxx . . $ Gst/ITERATOR_ERROR. |
| 104 | }; |
| 105 | |
| 106 | } // namespace Gst |
| 107 | |
| 108 | #ifndef DOXYGEN_SHOULD_SKIP_THIS |
| 109 | namespace Glibcxx . . $ Glib/ |
| 110 | { |
| 111 | |
| 112 | template <> |
| 113 | class Valuecxx . . $ Glib/Value#<Gstcxx . . $ Gst/::IteratorResultcxx . . $ Gst/IteratorResult#> : public Glibcxx . . $ Glib/::Value_Enumcxx . . $ Glib/Value_Enum#<Gstcxx . . $ Gst/::IteratorResultcxx . . $ Gst/IteratorResult#> |
| 114 | { |
| 115 | public: |
| 116 | static GType value_typecxx . . $ Glib/Value#value_type(f708dce9a8856c70).() G_GNUC_CONSTcxx . . $ `<external>/12741050725406041920/gmacros.h:640:9`!; |
| 117 | }; |
| 118 | |
| 119 | } // namespace Glib |
| 120 | #endif /* DOXYGEN_SHOULD_SKIP_THIS */ |
| 121 | |
| 122 | namespace Gstcxx . . $ Gst/ |
| 123 | { |
| 124 | |
| 125 | |
| 126 | /** The base class for classes that retrieve multiple elements in a thread |
| 127 | * safe way. |
| 128 | * |
| 129 | * Classes derived from Gst::IteratorBase are used to retrieve multiple objects |
| 130 | * from another object in a thread safe way. They are implemented as C++ like |
| 131 | * input iterators so they do not support multi-passing, but they are usable |
| 132 | * enough for iterating through a list of items and referencing them in a |
| 133 | * single pass. |
| 134 | * |
| 135 | * Various GStreamer objects provide access to their internal structures using |
| 136 | * an iterator. |
| 137 | */ |
| 138 | template <class CppType> |
| 139 | class IteratorBasecxx . . $ Gst/IteratorBase# |
| 140 | { |
| 141 | public: |
| 142 | /** Moves to the next iterator item. |
| 143 | * |
| 144 | * @return The result of the iteration. MT safe. |
| 145 | */ |
| 146 | virtual IteratorResultcxx . . $ Gst/IteratorResult# nextcxx . . $ Gst/IteratorBase#next(13ddd060d74cffe7).(); |
| 147 | |
| 148 | /** Resynchronize the iterator. This function is mostly called after next() |
| 149 | * returns Gst::ITERATOR_RESYNC. A result of Gst::ITERATOR_RESYNC from |
| 150 | * next() means that a concurrent update was made to the iterator list during |
| 151 | * iteration and the iterator needs to be resynchronized before continuing. |
| 152 | * Use this function to resynchronize. |
| 153 | */ |
| 154 | void resynccxx . . $ Gst/IteratorBase#resync(49f6e7a06ebc5aa8).(); |
| 155 | |
| 156 | /** Tells if the iterator is at the start of the list (not on the first item, |
| 157 | * but just before it). Increment the iterator or use |
| 158 | * Gst::IteratorBasic::begin() to go to the first item. |
| 159 | * |
| 160 | * @return true if the iterator is at the start of the list, false otherwise. |
| 161 | */ |
| 162 | bool is_startcxx . . $ Gst/IteratorBase#is_start(50ce9a9e25b4a850).() const; |
| 163 | |
| 164 | /** Tells if the iterator is at the end of the list (just after the last |
| 165 | * element). |
| 166 | * |
| 167 | * @return true if the iterator is at the end of the list, false otherwise. |
| 168 | */ |
| 169 | bool is_endcxx . . $ Gst/IteratorBase#is_end(50ce9a9e25b4a850).() const; |
| 170 | |
| 171 | /** Tells whether the iterator is valid and can be dereferenced. |
| 172 | */ |
| 173 | operatorcxx . . $ Gst/IteratorBase#`operator bool`(50ce9a9e25b4a850). bool() const; |
| 174 | |
| 175 | ///Provides access to the underlying C GObject. |
| 176 | GstIterator* cobjcxx . . $ Gst/IteratorBase#cobj(ff7798d90e250330).() { return cobject_cxx . . $ Gst/IteratorBase#cobject_.; }; |
| 177 | |
| 178 | ///Provides access to the underlying C GObject. |
| 179 | const GstIterator* cobjcxx . . $ Gst/IteratorBase#cobj(5a723afc42f196bd).() const { return cobject_cxx . . $ Gst/IteratorBase#cobject_.; }; |
| 180 | |
| 181 | /** Frees the underlying C instance if a take_ownership value of true was |
| 182 | * used to wrap it. |
| 183 | */ |
| 184 | virtual ~cxx . . $ Gst/IteratorBase#`~IteratorBase<CppType>`(49f6e7a06ebc5aa8).IteratorBase(); |
| 185 | |
| 186 | protected: |
| 187 | /// Default constructor. |
| 188 | IteratorBasecxx . . $ Gst/IteratorBase#`IteratorBase<CppType>`(49f6e7a06ebc5aa8).(); |
| 189 | |
| 190 | /** Copy constructor. Please note that copying and assigning merely shares |
| 191 | * the underlying C object. Operations on the copy are also performed in the |
| 192 | * underlying C object of the original and if the original is destroyed, the |
| 193 | * copy is invalid. |
| 194 | */ |
| 195 | IteratorBasecxx . . $ Gst/IteratorBase#`IteratorBase<CppType>`(52712e001ba6f5b).(const IteratorBasecxx . . $ Gst/IteratorBase#<CppType>&); |
| 196 | |
| 197 | /** Constructs an IteratorBase from an underlying C object. |
| 198 | * @param castitem The underlying C object. |
| 199 | * @param take_ownership Whether to take over the underlying C object. If |
| 200 | * true, C object is freed when wrapper is destroyed. |
| 201 | */ |
| 202 | explicit IteratorBasecxx . . $ Gst/IteratorBase#`IteratorBase<CppType>`(cfb8458cd5cd4f3d).(GstIterator* castitem, bool take_ownership = true); |
| 203 | |
| 204 | /** Assignment operator. It replaces the contents of the iterator with the |
| 205 | * contents of the new one freeing the underlying C object if a |
| 206 | * take_ownership value of true was used when wrapping it. Please note that |
| 207 | * copying and assigning merely shares the underlying C object. Operations |
| 208 | * on the copy are also performed in the underlying C object of the original |
| 209 | * and if the original is destroyed, the copy is invalid. |
| 210 | */ |
| 211 | IteratorBasecxx . . $ Gst/IteratorBase#<CppType>& operatorcxx . . $ Gst/IteratorBase#`operator=`(f2a00d4ab812a41d).=(const IteratorBasecxx . . $ Gst/IteratorBase#<CppType>& other); |
| 212 | |
| 213 | #ifndef DOXYGEN_SHOULD_SKIP_THIS |
| 214 | GValue currentcxx . . $ Gst/IteratorBase#current.; // The current element the iterator is referencing. |
| 215 | IteratorResultcxx . . $ Gst/IteratorResult# current_resultcxx . . $ Gst/IteratorBase#current_result.; // The current result of a next() call. |
| 216 | #endif /* DOXYGEN_SHOULD_SKIP_THIS */ |
| 217 | |
| 218 | private: |
| 219 | #ifndef DOXYGEN_SHOULD_SKIP_THIS |
| 220 | GstIterator* cobject_cxx . . $ Gst/IteratorBase#cobject_.; // The underlying C object. |
| 221 | bool take_ownershipcxx . . $ Gst/IteratorBase#take_ownership.; // Whether to destroy C object with the wrapper. |
| 222 | #endif /* DOXYGEN_SHOULD_SKIP_THIS */ |
| 223 | }; |
| 224 | |
| 225 | /** A class used to retrieve multiple elements in a thread safe way. |
| 226 | * Gst::IteratorBasic iterates specifically through elements that are not |
| 227 | * reference counted. Gst::Iterator is used for iterating through reference |
| 228 | * counted objects. |
| 229 | */ |
| 230 | template <class CppType> |
| 231 | class IteratorBasiccxx . . $ Gst/IteratorBasic# : public IteratorBasecxx . . $ Gst/IteratorBase#<CppType> |
| 232 | { |
| 233 | public: |
| 234 | ///Default constructor. |
| 235 | IteratorBasiccxx . . $ Gst/IteratorBasic#`IteratorBasic<CppType>`(49f6e7a06ebc5aa8).(); |
| 236 | |
| 237 | /** Creates a Gst::IteratorBasic wrapper for a GstIterator object. The |
| 238 | * underlying @a castitem will be freed with the Gst::IteratorBasic |
| 239 | * destruction if a take_ownership value of true is given. |
| 240 | * |
| 241 | * @param castitem The C instance to wrap. |
| 242 | * @param take_ownership Whether to take over the underlying C object. If |
| 243 | * true, C object is freed when wrapper is destroyed. |
| 244 | */ |
| 245 | explicit IteratorBasiccxx . . $ Gst/IteratorBasic#`IteratorBasic<CppType>`(cfb8458cd5cd4f3d).(GstIterator* castitem, bool take_ownership = true); |
| 246 | |
| 247 | /** Resynchronizes the iterator and moves the iterator to the first item. |
| 248 | * |
| 249 | * @throw std::runtime_error (if a Gst::ITERATOR_ERROR is encountered or if a |
| 250 | * concurrent update to the iterator occurs while it is advanced to the first |
| 251 | * element). |
| 252 | */ |
| 253 | void begincxx . . $ Gst/IteratorBasic#begin(49f6e7a06ebc5aa8).(); |
| 254 | |
| 255 | /** Dereferences the iterator and obtains the underlying object. |
| 256 | */ |
| 257 | CppType operatorcxx . . $ Gst/IteratorBasic#`operator*`(8f5363d873dd4781).*() const; |
| 258 | |
| 259 | /** Accesses underlying object member through the iterator. |
| 260 | */ |
| 261 | CppType* operatorcxx . . $ Gst/IteratorBasic#`operator->`(5a2a78a048fb49a8).->() const; |
| 262 | |
| 263 | /** Prefix auto-increment operator. It advances to the next item in the |
| 264 | * iterator. It is faster than the postfix operator. |
| 265 | * @throw std::runtime_error (if a Gst::ITERATOR_ERROR is encountered or if a |
| 266 | * concurrent update to the iterator occurs while it iterates). |
| 267 | */ |
| 268 | IteratorBasiccxx . . $ Gst/IteratorBasic#<CppType>& operatorcxx . . $ Gst/IteratorBasic#operator++(595500d1da7e97e6).++(); |
| 269 | |
| 270 | /** Postfix auto-increment operator. It advances to the next item in the |
| 271 | * iterator. |
| 272 | * @throw std::runtime_error (if a Gst::ITERATOR_ERROR is encountered or if a |
| 273 | * concurrent update to the iterator occurs while it iterates). |
| 274 | */ |
| 275 | IteratorBasiccxx . . $ Gst/IteratorBasic#<CppType> operatorcxx . . $ Gst/IteratorBasic#operator++(4723cc080e0bf55e).++(int); |
| 276 | }; |
| 277 | |
| 278 | /** A class used to retrieve multiple reference counted elements in a thread |
| 279 | * safe way. |
| 280 | * Gst::Iterator iterates specifically through elements that are reference |
| 281 | * counted and therefore dereferencing the elements of the iterator yields a |
| 282 | * Glib::RefPtr<> to the C++ element type. |
| 283 | */ |
| 284 | template <class CppType> |
| 285 | class Iteratorcxx . . $ Gst/Iterator# : public IteratorBasiccxx . . $ Gst/IteratorBasic#<CppType> |
| 286 | { |
| 287 | public: |
| 288 | ///Default constructor. |
| 289 | Iteratorcxx . . $ Gst/Iterator#`Iterator<CppType>`(49f6e7a06ebc5aa8).(); |
| 290 | |
| 291 | /** Creates a Gst::Iterator wrapper for a GstIterator object. The underlying |
| 292 | * @a castitem will be freed with the Gst::Iterator destruction if a |
| 293 | * take_ownership value of true is given. |
| 294 | * |
| 295 | * @param castitem The C instance to wrap. |
| 296 | * @param take_ownership Whether to take over the underlying C object. If |
| 297 | * true, C object is freed when wrapper is destroyed. |
| 298 | */ |
| 299 | explicit Iteratorcxx . . $ Gst/Iterator#`Iterator<CppType>`(cfb8458cd5cd4f3d).(GstIterator* castitem, bool take_ownership = true); |
| 300 | |
| 301 | /** Moves to the next iterator item. |
| 302 | * |
| 303 | * @return The result of the iteration. MT safe. |
| 304 | */ |
| 305 | IteratorResultcxx . . $ Gst/IteratorResult# nextcxx . . $ Gst/Iterator#next(13ddd060d74cffe7).(); |
| 306 | |
| 307 | /** Dereferences the iterator and obtains the underlying Glib::RefPtr<>. |
| 308 | */ |
| 309 | Glibcxx . . $ Glib/::RefPtrcxx . . $ Glib/RefPtr#<CppType> operatorcxx . . $ Gst/Iterator#`operator*`(8fecbfafe8250536).*() const; |
| 310 | |
| 311 | /** Accesses underlying object member through the RefPtr<>. |
| 312 | */ |
| 313 | CppType* operatorcxx . . $ Gst/Iterator#`operator->`(5a2a78a048fb49a8).->() const; |
| 314 | |
| 315 | /** Prefix auto-increment operator. It advances to the next item in the |
| 316 | * iterator. It is faster than the postfix operator. |
| 317 | * @throw std::runtime_error (if a Gst::ITERATOR_ERROR is encountered or if a |
| 318 | * concurrent update to the iterator occurs while it iterates). |
| 319 | */ |
| 320 | Iteratorcxx . . $ Gst/Iterator#<CppType>& operatorcxx . . $ Gst/Iterator#operator++(9bf4d8d3f14ce400).++(); |
| 321 | |
| 322 | /** Postfix auto-increment operator. It advances to the next item in the |
| 323 | * iterator. |
| 324 | * @throw std::runtime_error (if a Gst::ITERATOR_ERROR is encountered or if a |
| 325 | * concurrent update to the iterator occurs while it iterates). |
| 326 | */ |
| 327 | Iteratorcxx . . $ Gst/Iterator#<CppType> operatorcxx . . $ Gst/Iterator#operator++(7bdcc5fe15ab0a55).++(int); |
| 328 | }; |
| 329 | |
| 330 | #ifndef DOXYGEN_SHOULD_SKIP_THIS |
| 331 | |
| 332 | /***************** Gst::IteratorBase<CppType> ************************/ |
| 333 | |
| 334 | template<class CppType> |
| 335 | IteratorBasecxx . . $ Gst/IteratorBase#<CppType>::IteratorBasecxx . . $ Gst/IteratorBase#`IteratorBase<CppType>`(49f6e7a06ebc5aa8).() |
| 336 | : currentcxx . . $ Gst/IteratorBase#current.(G_VALUE_INITcxx . . $ `<external>/17218264759549183453/gvalue.h:250:9`!), |
| 337 | current_resultcxx . . $ Gst/IteratorBase#current_result.(Gstcxx . . $ Gst/::ITERATOR_OKcxx . . $ Gst/ITERATOR_OK.), |
| 338 | cobject_cxx . . $ Gst/IteratorBase#cobject_.(nullptr), |
| 339 | take_ownershipcxx . . $ Gst/IteratorBase#take_ownership.(true) |
| 340 | { |
| 341 | } |
| 342 | |
| 343 | template<class CppType> |
| 344 | IteratorBasecxx . . $ Gst/IteratorBase#<CppType>::IteratorBasecxx . . $ Gst/IteratorBase#`IteratorBase<CppType>`(52712e001ba6f5b).(const IteratorBasecxx . . $ Gst/IteratorBase#<CppType>& other) |
| 345 | : currentcxx . . $ Gst/IteratorBase#current.(G_VALUE_INITcxx . . $ `<external>/17218264759549183453/gvalue.h:250:9`!), |
| 346 | current_resultcxx . . $ Gst/IteratorBase#current_result.(other.current_resultcxx . . $ Gst/IteratorBase#current_result.), |
| 347 | take_ownershipcxx . . $ Gst/IteratorBase#take_ownership.(other.take_ownershipcxx . . $ Gst/IteratorBase#take_ownership.) |
| 348 | { |
| 349 | cobject_cxx . . $ Gst/IteratorBase#cobject_. = other.take_ownershipcxx . . $ Gst/IteratorBase#take_ownership. ? gst_iterator_copy(other.cobject_cxx . . $ Gst/IteratorBase#cobject_.) : other.cobject_cxx . . $ Gst/IteratorBase#cobject_.; |
| 350 | |
| 351 | if (G_IS_VALUEcxx . . $ Gst/IteratorBase#current. (&other.current)) |
| 352 | { |
| 353 | g_value_init(¤tcxx . . $ Gst/IteratorBase#current., G_VALUE_TYPEcxx . . $ Gst/IteratorBase#current.(&other.current)); |
| 354 | g_value_copy(&other.currentcxx . . $ Gst/IteratorBase#current., ¤tcxx . . $ Gst/IteratorBase#current.); |
| 355 | } |
| 356 | } |
| 357 | |
| 358 | template<class CppType> |
| 359 | IteratorBasecxx . . $ Gst/IteratorBase#<CppType>::IteratorBasecxx . . $ Gst/IteratorBase#`IteratorBase<CppType>`(cfb8458cd5cd4f3d).(GstIterator* castitem, bool take_ownership) |
| 360 | : currentcxx . . $ Gst/IteratorBase#current.(G_VALUE_INITcxx . . $ `<external>/17218264759549183453/gvalue.h:250:9`!), |
| 361 | current_resultcxx . . $ Gst/IteratorBase#current_result.(Gstcxx . . $ Gst/::ITERATOR_OKcxx . . $ Gst/ITERATOR_OK.), |
| 362 | cobject_cxx . . $ Gst/IteratorBase#cobject_.(castitem), |
| 363 | take_ownershipcxx . . $ Gst/IteratorBase#take_ownership.(take_ownership) |
| 364 | {} |
| 365 | |
| 366 | template<class CppType> |
| 367 | IteratorBasecxx . . $ Gst/IteratorBase#<CppType>& IteratorBasecxx . . $ Gst/IteratorBase#<CppType>::operatorcxx . . $ Gst/IteratorBase#`operator=`(f2a00d4ab812a41d).=(const IteratorBasecxx . . $ Gst/IteratorBase#<CppType>& other) |
| 368 | { |
| 369 | if (cobject_cxx . . $ Gst/IteratorBase#cobject_. && take_ownershipcxx . . $ Gst/IteratorBase#take_ownership.) |
| 370 | { |
| 371 | gst_iterator_free(cobject_cxx . . $ Gst/IteratorBase#cobject_.); |
| 372 | } |
| 373 | |
| 374 | if (G_IS_VALUEcxx . . $ `<external>/17218264759549183453/gvalue.h:56:9`!(¤t)) |
| 375 | { |
| 376 | g_value_unset(¤tcxx . . $ Gst/IteratorBase#current.); |
| 377 | } |
| 378 | |
| 379 | current_resultcxx . . $ Gst/IteratorBase#current_result. = other.current_resultcxx . . $ Gst/IteratorBase#current_result.; |
| 380 | cobject_cxx . . $ Gst/IteratorBase#cobject_. = other.take_ownershipcxx . . $ Gst/IteratorBase#take_ownership. ? gst_iterator_copy(other.cobject_cxx . . $ Gst/IteratorBase#cobject_.) : other.cobject_cxx . . $ Gst/IteratorBase#cobject_.; |
| 381 | |
| 382 | if (G_IS_VALUEcxx . . $ `<external>/17218264759549183453/gvalue.h:56:9`! (&other.current)) |
| 383 | { |
| 384 | g_value_init(¤tcxx . . $ Gst/IteratorBase#current., G_VALUE_TYPEcxx . . $ Gst/IteratorBase#current.(&other.current)); |
| 385 | g_value_copy(&other.currentcxx . . $ Gst/IteratorBase#current., ¤tcxx . . $ Gst/IteratorBase#current.); |
| 386 | } |
| 387 | |
| 388 | return *this; |
| 389 | } |
| 390 | |
| 391 | template<class CppType> |
| 392 | IteratorResultcxx . . $ Gst/IteratorResult# IteratorBasecxx . . $ Gst/IteratorBase#<CppType>::nextcxx . . $ Gst/IteratorBase#next(13ddd060d74cffe7).() |
| 393 | { |
| 394 | // Unset current before calling gst_iterator_next() |
| 395 | if(G_IS_VALUEcxx . . $ `<external>/17218264759549183453/gvalue.h:56:9`!(¤t)) |
| 396 | g_value_unset(¤tcxx . . $ Gst/IteratorBase#current.); |
| 397 | |
| 398 | current_resultcxx . . $ Gst/IteratorBase#current_result. = |
| 399 | static_cast<Gstcxx . . $ Gst/::IteratorResultcxx . . $ Gst/IteratorResult#>(gst_iterator_next(cobjcxx . . $ Gst/IteratorBase#cobj(ff7798d90e250330).(), ¤tcxx . . $ Gst/IteratorBase#current.)); |
| 400 | |
| 401 | // Reset current if iterator is done: |
| 402 | if(current_resultcxx . . $ Gst/IteratorBase#current_result. == Gstcxx . . $ Gst/::ITERATOR_DONEcxx . . $ Gst/ITERATOR_DONE.) |
| 403 | g_value_reset (¤tcxx . . $ Gst/IteratorBase#current.); |
| 404 | |
| 405 | return current_resultcxx . . $ Gst/IteratorBase#current_result.; |
| 406 | } |
| 407 | |
| 408 | template<class CppType> |
| 409 | void IteratorBasecxx . . $ Gst/IteratorBase#<CppType>::resynccxx . . $ Gst/IteratorBase#resync(49f6e7a06ebc5aa8).() |
| 410 | { |
| 411 | gst_iterator_resync(cobjcxx . . $ Gst/IteratorBase#cobj(5a723afc42f196bd).()); |
| 412 | g_value_reset (¤tcxx . . $ Gst/IteratorBase#current.); |
| 413 | current_resultcxx . . $ Gst/IteratorBase#current_result. = Gstcxx . . $ Gst/::ITERATOR_OKcxx . . $ Gst/ITERATOR_OK.; |
| 414 | } |
| 415 | |
| 416 | template<class CppType> |
| 417 | bool IteratorBasecxx . . $ Gst/IteratorBase#<CppType>::is_startcxx . . $ Gst/IteratorBase#is_start(50ce9a9e25b4a850).() const |
| 418 | { |
| 419 | return (G_VALUE_HOLDS_OBJECTcxx . . $ _GValue#g_type.(¤t) && current_resultcxx . . $ Gst/IteratorBase#current_result. == Gstcxx . . $ Gst/::ITERATOR_OKcxx . . $ Gst/ITERATOR_OK.); |
| 420 | } |
| 421 | |
| 422 | template<class CppType> |
| 423 | bool IteratorBasecxx . . $ Gst/IteratorBase#<CppType>::is_endcxx . . $ Gst/IteratorBase#is_end(50ce9a9e25b4a850).() const |
| 424 | { |
| 425 | return (current_resultcxx . . $ Gst/IteratorBase#current_result. == Gstcxx . . $ Gst/::ITERATOR_DONEcxx . . $ Gst/ITERATOR_DONE.); |
| 426 | } |
| 427 | |
| 428 | template<class CppType> |
| 429 | IteratorBasecxx . . $ Gst/IteratorBase#<CppType>::operatorcxx . . $ Gst/IteratorBase#`operator bool`(50ce9a9e25b4a850). bool() const |
| 430 | { |
| 431 | return (! G_VALUE_HOLDS_OBJECTcxx . . $ `<external>/1341695927569185362/gobject.h:136:9`!(¤t)); |
| 432 | } |
| 433 | |
| 434 | //virtual |
| 435 | template<class CppType> |
| 436 | IteratorBasecxx . . $ Gst/IteratorBase#<CppType>::~cxx . . $ Gst/IteratorBase#`~IteratorBase<CppType>`(49f6e7a06ebc5aa8).IteratorBase() |
| 437 | { |
| 438 | if(take_ownershipcxx . . $ Gst/IteratorBase#take_ownership. && cobject_cxx . . $ Gst/IteratorBase#cobject_.) |
| 439 | { |
| 440 | gst_iterator_free(cobject_cxx . . $ Gst/IteratorBase#cobject_.); |
| 441 | cobject_cxx . . $ Gst/IteratorBase#cobject_. = nullptr; |
| 442 | } |
| 443 | if(G_IS_VALUEcxx . . $ `<external>/17218264759549183453/gvalue.h:56:9`!(¤t)) |
| 444 | g_value_unset(¤tcxx . . $ Gst/IteratorBase#current.); |
| 445 | } |
| 446 | |
| 447 | /***************** Gst::IteratorBasic<CppType> ***********************/ |
| 448 | |
| 449 | template <class CppType> |
| 450 | IteratorBasiccxx . . $ Gst/IteratorBasic#<CppType>::IteratorBasiccxx . . $ Gst/IteratorBasic#`IteratorBasic<CppType>`(49f6e7a06ebc5aa8).() |
| 451 | : IteratorBasecxx . . $ Gst/IteratorBase#<CppType>() |
| 452 | {} |
| 453 | |
| 454 | template <class CppType> |
| 455 | IteratorBasiccxx . . $ Gst/IteratorBasic#<CppType>::IteratorBasiccxx . . $ Gst/IteratorBasic#`IteratorBasic<CppType>`(cfb8458cd5cd4f3d).(GstIterator* castitem, |
| 456 | bool take_ownership) |
| 457 | : IteratorBasecxx . . $ Gst/IteratorBase#<CppType>(castitem, take_ownership) |
| 458 | {} |
| 459 | |
| 460 | template<class CppType> |
| 461 | void IteratorBasiccxx . . $ Gst/IteratorBasic#<CppType>::begincxx . . $ Gst/IteratorBasic#begin(49f6e7a06ebc5aa8).() |
| 462 | { |
| 463 | this->resynccxx . . $ Gst/IteratorBase#resync(49f6e7a06ebc5aa8).(); |
| 464 | ++(*this); |
| 465 | } |
| 466 | |
| 467 | template <class CppType> |
| 468 | CppType IteratorBasiccxx . . $ Gst/IteratorBasic#<CppType>::operatorcxx . . $ Gst/IteratorBasic#`operator*`(8f5363d873dd4781).*() const |
| 469 | { |
| 470 | typedef typename CppType::BaseObjectType CTypecxx . . $ Gst/IteratorBasic#`operator*`(8f5363d873dd4781).CType#; |
| 471 | |
| 472 | if(G_IS_VALUEcxx . . $ `<external>/17218264759549183453/gvalue.h:56:9`!(&this->current)) |
| 473 | return CppType(static_cast<CTypecxx . . $ Gst/IteratorBasic#`operator*`(8f5363d873dd4781).CType#*>(g_value_get_object(&cxx . . $ Gst/`operator&`(f89b2c4e92c161b).this->currentcxx . . $ Gst/IteratorBase#current.))); |
| 474 | else |
| 475 | return CppType(); |
| 476 | } |
| 477 | |
| 478 | template <class CppType> |
| 479 | CppType* IteratorBasiccxx . . $ Gst/IteratorBasic#<CppType>::operatorcxx . . $ Gst/IteratorBasic#`operator->`(5a2a78a048fb49a8).->() const |
| 480 | { |
| 481 | static typename CppType::CppObjectType result; |
| 482 | |
| 483 | if(G_IS_VALUEcxx . . $ Gst/`operator&`(e83125ca27815e3).(&this->current)) |
| 484 | { |
| 485 | result = this->operator*(); |
| 486 | return &cxx . . $ Gst/`operator&`(76209222dcf0d27a).result; |
| 487 | } |
| 488 | else |
| 489 | return static_cast<CppType*>(0); |
| 490 | } |
| 491 | |
| 492 | template<class CppType> |
| 493 | IteratorBasiccxx . . $ Gst/IteratorBasic#<CppType>& IteratorBasiccxx . . $ Gst/IteratorBasic#<CppType>::operatorcxx . . $ Gst/IteratorBasic#operator++(595500d1da7e97e6).++() |
| 494 | { |
| 495 | const IteratorResultcxx . . $ Gst/IteratorResult# result = this->nextcxx . . $ Gst/IteratorBase#next(13ddd060d74cffe7).(); |
| 496 | |
| 497 | if(result == Gstcxx . . $ Gst/::ITERATOR_RESYNCcxx . . $ Gst/ITERATOR_RESYNC.) |
| 498 | gstreamermm_handle_errorcxx . . $ Gst/gstreamermm_handle_error(1ff0bff2cee2bc51).("Concurrent update of iterator elements. "cxx . . $ Glib/ustring#ustring(85c52e162fed56f9). |
| 499 | "Please resync."); |
| 500 | else if(result == Gstcxx . . $ Gst/::ITERATOR_ERRORcxx . . $ Gst/ITERATOR_ERROR.) |
| 501 | gstreamermm_handle_errorcxx . . $ Gst/gstreamermm_handle_error(1ff0bff2cee2bc51).("Iterator error while incrementing."cxx . . $ Glib/ustring#ustring(85c52e162fed56f9).); |
| 502 | |
| 503 | return *this; |
| 504 | } |
| 505 | |
| 506 | template<class CppType> |
| 507 | IteratorBasiccxx . . $ Gst/IteratorBasic#<CppType> IteratorBasiccxx . . $ Gst/IteratorBasic#<CppType>::operatorcxx . . $ Gst/IteratorBasic#operator++(4723cc080e0bf55e).++(int) |
| 508 | { |
| 509 | IteratorBasiccxx . . $ Gst/IteratorBasic#<CppType> original = *this; |
| 510 | ++(*this); |
| 511 | return original; |
| 512 | } |
| 513 | |
| 514 | /******************* Gst::Iterator<CppType> **************************/ |
| 515 | |
| 516 | template <class CppType> |
| 517 | Iteratorcxx . . $ Gst/Iterator#<CppType>::Iteratorcxx . . $ Gst/Iterator#`Iterator<CppType>`(49f6e7a06ebc5aa8).() |
| 518 | : IteratorBasiccxx . . $ Gst/IteratorBasic#<CppType>() |
| 519 | {} |
| 520 | |
| 521 | template <class CppType> |
| 522 | Iteratorcxx . . $ Gst/Iterator#<CppType>::Iteratorcxx . . $ Gst/Iterator#`Iterator<CppType>`(cfb8458cd5cd4f3d).(GstIterator* castitem, bool take_ownership) |
| 523 | : IteratorBasiccxx . . $ Gst/IteratorBasic#<CppType>(castitem, take_ownership) |
| 524 | {} |
| 525 | |
| 526 | template <class CppType> |
| 527 | IteratorResultcxx . . $ Gst/IteratorResult# Iteratorcxx . . $ Gst/Iterator#<CppType>::nextcxx . . $ Gst/Iterator#next(13ddd060d74cffe7).() |
| 528 | { |
| 529 | const IteratorResultcxx . . $ Gst/IteratorResult# result = IteratorBasiccxx . . $ Gst/IteratorBasic#<CppType>::next(); |
| 530 | |
| 531 | return result; |
| 532 | } |
| 533 | |
| 534 | template <class CppType> |
| 535 | Glibcxx . . $ Glib/::RefPtrcxx . . $ Glib/RefPtr#<CppType> Iteratorcxx . . $ Gst/Iterator#<CppType>::operatorcxx . . $ Gst/Iterator#`operator*`(8fecbfafe8250536).*() const |
| 536 | { |
| 537 | typedef typename CppType::BaseObjectType CTypecxx . . $ Gst/Iterator#`operator*`(8fecbfafe8250536).CType#; |
| 538 | |
| 539 | if(G_IS_VALUEcxx . . $ Gst/`operator&`(e83125ca27815e3).(&this->current)) |
| 540 | { |
| 541 | //Take extra reference when dereferencing. The reference will disappear |
| 542 | //when Glib::RefPtr<> is destroyed. |
| 543 | return Glibcxx . . $ Glib/::wrapcxx . . $ Glib/wrap(a1d92e9fa0642438).(static_cast<CTypecxx . . $ Gst/Iterator#`operator*`(8fecbfafe8250536).CType#*>(g_value_get_object (&cxx . . $ Gst/`operator&`(e83125ca27815e3).this->currentcxx . . $ Gst/IteratorBase#current.)), true); |
| 544 | } |
| 545 | else |
| 546 | return Glibcxx . . $ Glib/::RefPtrcxx . . $ Glib/RefPtr#<CppType>(0); |
| 547 | } |
| 548 | |
| 549 | template <class CppType> |
| 550 | CppType* Iteratorcxx . . $ Gst/Iterator#<CppType>::operatorcxx . . $ Gst/Iterator#`operator->`(5a2a78a048fb49a8).->() const |
| 551 | { |
| 552 | typedef typename CppType::BaseObjectType CTypecxx . . $ Gst/Iterator#`operator->`(5a2a78a048fb49a8).CType#; |
| 553 | |
| 554 | if(G_IS_VALUEcxx . . $ Gst/`operator&`(784fe20c296a1852).(&this->current)) |
| 555 | { |
| 556 | //Take extra reference when dereferencing. The reference will disappear |
| 557 | //when Glib::RefPtr<> is destroyed. |
| 558 | return Glibcxx . . $ Glib/::wrapcxx . . $ Glib/wrap(cf037a2e82e55e6b).(static_cast<CTypecxx . . $ Gst/Iterator#`operator->`(5a2a78a048fb49a8).CType#*>(g_value_get_object (&cxx . . $ Gst/`operator&`(d961e76ffb092db3).this->currentcxx . . $ Gst/IteratorBase#current.)), true).operator->(); |
| 559 | } |
| 560 | else |
| 561 | return static_cast<CppType*>(0); |
| 562 | } |
| 563 | |
| 564 | template<class CppType> |
| 565 | Iteratorcxx . . $ Gst/Iterator#<CppType>& Iteratorcxx . . $ Gst/Iterator#<CppType>::operatorcxx . . $ Gst/Iterator#operator++(9bf4d8d3f14ce400).++() |
| 566 | { |
| 567 | IteratorBasiccxx . . $ Gst/IteratorBasic#<CppType>::operator++(); |
| 568 | return *this; |
| 569 | } |
| 570 | |
| 571 | template<class CppType> |
| 572 | Iteratorcxx . . $ Gst/Iterator#<CppType> Iteratorcxx . . $ Gst/Iterator#<CppType>::operatorcxx . . $ Gst/Iterator#operator++(7bdcc5fe15ab0a55).++(int) |
| 573 | { |
| 574 | Iteratorcxx . . $ Gst/Iterator#<CppType> original = *this; |
| 575 | ++(*this); |
| 576 | return original; |
| 577 | } |
| 578 | |
| 579 | #endif /* DOXYGEN_SHOULD_SKIP_THIS */ |
| 580 | |
| 581 | } //namespace Gst |
| 582 | |
| 583 | |
| 584 | #endif /* _GSTREAMERMM_ITERATOR_H */ |
| 585 |