TelepathyGLib.IntsetIter

Fields

Name

Type

Access

Description

element

int

r/w

Must be (int)(-1) before iteration starts. Set to the next element in the set by TelepathyGLib.IntsetIter.next(); undefined after TelepathyGLib.IntsetIter.next() returns False.

set

TelepathyGLib.Intset

r/w

The set iterated over.

Methods

init (set)

next ()

reset ()

Details

class TelepathyGLib.IntsetIter

A structure representing iteration over a set of integers. Must be initialized with either TP_INTSET_ITER_INIT() or TelepathyGLib.IntsetIter.init().

Since 0.11.6, consider using TelepathyGLib.IntsetFastIter if iteration in numerical order is not required.

Before 0.11.16, this type was called TpIntSetIter, which is now a backwards compatibility typedef.

Deprecated since version ???: since 0.19.0. Use TelepathyGLib.IntsetFastIter instead

init(set)
Parameters:

set (TelepathyGLib.Intset) – An integer set to be used by that iterator

Reset the iterator self to the beginning and make it iterate over set.

Deprecated since version ???: since 0.19.0. Use TelepathyGLib.IntsetFastIter instead

next()
Returns:

True if (self->element) has been advanced

Return type:

bool

If there are integers in (self->set) higher than (self->element), set (iter->element) to the next one and return True. Otherwise return False.

Usage:

TpIntsetIter iter = TP_INTSET_INIT (intset);
while (tp_intset_iter_next (&iter))
{
  printf ("%u is in the intset\n", iter.element);
}

Since 0.11.6, consider using TelepathyGLib.IntsetFastIter if iteration in numerical order is not required.

reset()

Reset the iterator self to the beginning. It must already be associated with a set.

Deprecated since version ???: since 0.19.0. Use TelepathyGLib.IntsetFastIter instead