gstreamermm  1.10.0
Public Member Functions | List of all members
Gst::Iterator< CppType > Class Template Reference

A class used to retrieve multiple reference counted elements in a thread safe way. More...

#include <gstreamermm/pad.h>

Public Member Functions

 Iterator ()
 Default constructor. More...
 
 Iterator (GstIterator* castitem, bool take_ownership=true)
 Creates a Gst::Iterator wrapper for a GstIterator object. More...
 
IteratorResult next ()
 Moves to the next iterator item. More...
 
Glib::RefPtr< CppType > operator* () const
 Dereferences the iterator and obtains the underlying Glib::RefPtr<>. More...
 
CppType* operator-> () const
 Accesses underlying object member through the RefPtr<>. More...
 
Iterator< CppType >& operator++ ()
 Prefix auto-increment operator. More...
 
Iterator< CppType > operator++ (int)
 Postfix auto-increment operator. More...
 

Detailed Description

template<class CppType>
class Gst::Iterator< CppType >

A class used to retrieve multiple reference counted elements in a thread safe way.

Gst::Iterator iterates specifically through elements that are reference counted and therefore dereferencing the elements of the iterator yields a Glib::RefPtr<> to the C++ element type.

Examples
basics/bin.cc.

Constructor & Destructor Documentation

◆ Iterator() [1/2]

template <class CppType >
Gst::Iterator< CppType >::Iterator ( )

Default constructor.

◆ Iterator() [2/2]

template <class CppType >
Gst::Iterator< CppType >::Iterator ( GstIterator< CppType > *  castitem,
bool  take_ownership = true 
)
explicit

Creates a Gst::Iterator wrapper for a GstIterator object.

The underlying castitem will be freed with the Gst::Iterator destruction if a take_ownership value of true is given.

Parameters
castitemThe C instance to wrap.
take_ownershipWhether to take over the underlying C object. If true, C object is freed when wrapper is destroyed.

Member Function Documentation

◆ next()

template <class CppType >
IteratorResult Gst::Iterator< CppType >::next ( )

Moves to the next iterator item.

Returns
The result of the iteration. MT safe.

◆ operator*()

template <class CppType >
Glib::RefPtr<CppType> Gst::Iterator< CppType >::operator* ( ) const

Dereferences the iterator and obtains the underlying Glib::RefPtr<>.

◆ operator++() [1/2]

template <class CppType >
Iterator<CppType>& Gst::Iterator< CppType >::operator++ ( )

Prefix auto-increment operator.

It advances to the next item in the iterator. It is faster than the postfix operator.

Exceptions
std::runtime_error(if a Gst::ITERATOR_ERROR is encountered or if a concurrent update to the iterator occurs while it iterates).

◆ operator++() [2/2]

template <class CppType >
Iterator<CppType> Gst::Iterator< CppType >::operator++ ( int  )

Postfix auto-increment operator.

It advances to the next item in the iterator.

Exceptions
std::runtime_error(if a Gst::ITERATOR_ERROR is encountered or if a concurrent update to the iterator occurs while it iterates).

◆ operator->()

template <class CppType >
CppType* Gst::Iterator< CppType >::operator-> ( ) const

Accesses underlying object member through the RefPtr<>.