#include <iterator.h>
Public Member Functions | |
virtual IteratorResult | next () |
Moves to the next iterator item. | |
void | resync () |
Resynchronize the iterator. | |
bool | is_start () const |
Tells if the iterator is at the start of the list (not on the first item, but just before it). | |
bool | is_end () const |
Tells if the iterator is at the end of the list (just after the last element). | |
operator bool () const | |
Tells whether the iterator is valid and can be dereferenced. | |
GstIterator* | cobj () |
Provides access to the underlying C GObject. | |
const GstIterator* | cobj () const |
Provides access to the underlying C GObject. | |
virtual | ~IteratorBase () |
Frees the underlying C instance if a take_ownership value of true was used to wrap it. | |
Protected Member Functions | |
IteratorBase () | |
Default constructor. | |
IteratorBase (const IteratorBase<CppType>&) | |
Copy constructor. | |
IteratorBase (GstIterator* castitem, bool take_ownership=true) | |
Constructs an IteratorBase from an underlying C object. | |
IteratorBase<CppType>& | operator= (const IteratorBase<CppType>& other) |
Assignment operator. |
Classes derived from Gst::IteratorBase are used to retrieve multiple objects from another object in a thread safe way. They are implemented as C++ like input iterators so they do not support multi-passing, but they are usable enough for iterating through a list of items and referencing them in a single pass.
Various GStreamer objects provide access to their internal structures using an iterator.
virtual Gst::IteratorBase<CppType>::~IteratorBase | ( | ) | [virtual] |
Frees the underlying C instance if a take_ownership value of true was used to wrap it.
Gst::IteratorBase<CppType>::IteratorBase | ( | ) | [protected] |
Default constructor.
Gst::IteratorBase<CppType>::IteratorBase | ( | const IteratorBase<CppType>& | ) | [protected] |
Copy constructor.
Please note that copying and assigning merely shares the underlying C object. Operations on the copy are also performed in the underlying C object of the original and if the original is destroyed, the copy is invalid.
Gst::IteratorBase<CppType>::IteratorBase | ( | GstIterator * | castitem, | |
bool | take_ownership = true | |||
) | [protected] |
Constructs an IteratorBase from an underlying C object.
castitem | The underlying C object. | |
take_ownership | Whether to take over the underlying C object. If true, C object is freed when wrapper is destroyed. |
const GstIterator* Gst::IteratorBase<CppType>::cobj | ( | ) | const [inline] |
Provides access to the underlying C GObject.
GstIterator* Gst::IteratorBase<CppType>::cobj | ( | ) | [inline] |
Provides access to the underlying C GObject.
bool Gst::IteratorBase<CppType>::is_end | ( | ) | const |
Tells if the iterator is at the end of the list (just after the last element).
bool Gst::IteratorBase<CppType>::is_start | ( | ) | const |
Tells if the iterator is at the start of the list (not on the first item, but just before it).
Increment the iterator or use Gst::IteratorBasic::begin() to go to the first item.
virtual IteratorResult Gst::IteratorBase<CppType>::next | ( | ) | [virtual] |
Moves to the next iterator item.
Reimplemented in Gst::Iterator<CppType>.
Gst::IteratorBase<CppType>::operator bool | ( | ) | const |
Tells whether the iterator is valid and can be dereferenced.
IteratorBase<CppType>& Gst::IteratorBase<CppType>::operator= | ( | const IteratorBase<CppType>& | other | ) | [protected] |
Assignment operator.
It replaces the contents of the iterator with the contents of the new one freeing the underlying C object if a take_ownership value of true was used when wrapping it. Please note that copying and assigning merely shares the underlying C object. Operations on the copy are also performed in the underlying C object of the original and if the original is destroyed, the copy is invalid.
void Gst::IteratorBase<CppType>::resync | ( | ) |
Resynchronize the iterator.
This function is mostly called after next() returns Gst::ITERATOR_RESYNC. A result of Gst::ITERATOR_RESYNC from next() means that a concurrent update was made to the iterator list during iteration and the iterator needs to be resynchronized before continuing. Use this function to resynchronize.