TelepathyGLib.Intset

Fields

None

Methods

class

from_array (array)

class

new ()

class

new_containing (element)

class

sized_new (size)

add (element)

clear ()

copy ()

destroy ()

difference (right)

difference_update (other)

dump ()

foreach (func, *userdata)

intersection (right)

is_empty ()

is_equal (right)

is_member (element)

remove (element)

size ()

symmetric_difference (right)

to_array ()

union (right)

union_update (other)

Details

class TelepathyGLib.Intset

Opaque type representing a set of unsigned integers.

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

classmethod from_array(array)
Parameters:

array ([int]) – An array of int

Returns:

A set containing the same integers as array.

Return type:

TelepathyGLib.Intset

Returns: says it all

classmethod new()
Returns:

a new, empty integer set to be destroyed with TelepathyGLib.Intset.destroy()

Return type:

TelepathyGLib.Intset

Allocate a new integer set.

classmethod new_containing(element)
Parameters:

element (int) – integer to add to a new set

Returns:

a new integer set containing element, to be destroyed with TelepathyGLib.Intset.destroy()

Return type:

TelepathyGLib.Intset

Allocate a new integer set containing the given integer.

New in version 0.7.26.

classmethod sized_new(size)
Parameters:

size (int) – ignored (it was previously 1 more than the largest integer you expect to store)

Returns:

a new, empty integer set to be destroyed with TelepathyGLib.Intset.destroy()

Return type:

TelepathyGLib.Intset

Allocate a new integer set.

add(element)
Parameters:

element (int) – integer to add

Add an integer into a TelepathyGLib.Intset.

clear()

Unset every integer in the set.

copy()
Returns:

A set containing the same integers as self, to be freed with TelepathyGLib.Intset.destroy() by the caller

Return type:

TelepathyGLib.Intset

Returns: says it all

destroy()

Free all memory used by the set.

difference(right)
Parameters:

right (TelepathyGLib.Intset) – The right operand

Returns:

The set of those integers which are in self and not in right (analogous to the bitwise operation left & (~right)), to be freed with TelepathyGLib.Intset.destroy() by the caller

Return type:

TelepathyGLib.Intset

Returns: says it all

difference_update(other)
Parameters:

other (TelepathyGLib.Intset) – members to remove

Remove each integer in other from self, analogous to the bitwise operation self &= (~other).

New in version 0.13.10.

dump()
Returns:

a string which the caller must free with GLib.free, listing the numbers in self in a human-readable format

Return type:

str

Returns: says it all

foreach(func, *userdata)
Parameters:

Call func(element, userdata) for each element of self, in order.

intersection(right)
Parameters:

right (TelepathyGLib.Intset) – The right operand

Returns:

The set of those integers which are in both self and right (analogous to the bitwise operation left & right), to be freed with TelepathyGLib.Intset.destroy() by the caller

Return type:

TelepathyGLib.Intset

Returns: says it all

is_empty()
Returns:

True if self is empty

Return type:

bool

Return the same thing as (TelepathyGLib.Intset.size (set) == 0), but calculated more efficiently.

New in version 0.11.6.

is_equal(right)
Parameters:

right (TelepathyGLib.Intset) – A set of integers

Returns:

True if self and right contain the same bits

Return type:

bool

Returns: says it all

is_member(element)
Parameters:

element (int) – integer to test

Returns:

True if element is in self

Return type:

bool

Tests if element is a member of self

remove(element)
Parameters:

element (int) – integer to add

Returns:

True if element was previously in self

Return type:

bool

Remove an integer from a TelepathyGLib.Intset

size()
Returns:

The number of integers in self

Return type:

int

Returns: says it all

symmetric_difference(right)
Parameters:

right (TelepathyGLib.Intset) – The right operand

Returns:

The set of those integers which are in either self or right but not both (analogous to the bitwise operation left ^ right), to be freed with TelepathyGLib.Intset.destroy() by the caller

Return type:

TelepathyGLib.Intset

Returns: says it all

to_array()
Returns:

a GLib.Array of int (which must be freed by the caller) containing the same integers as self.

Return type:

[int]

Returns: says it all

union(right)
Parameters:

right (TelepathyGLib.Intset) – The right operand

Returns:

The set of those integers which are in either self or right (analogous to the bitwise operation left | right), to be freed with TelepathyGLib.Intset.destroy() by the caller

Return type:

TelepathyGLib.Intset

Returns: says it all

union_update(other)
Parameters:

other (TelepathyGLib.Intset) – members to add

Add each integer in other to self, analogous to the bitwise operation self |= other.

New in version 0.13.10.