TelepathyGLib.Intset¶
Fields¶
None
Methods¶
class |
|
class |
|
class |
|
class |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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:
- Returns:
A set containing the same integers as array.
- Return type:
Returns: says it all
- classmethod new()¶
- Returns:
a new, empty integer set to be destroyed with
TelepathyGLib.Intset.destroy
()- Return type:
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:
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:
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:
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:
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:
Returns: says it all
- foreach(func, *userdata)¶
- Parameters:
func (
TelepathyGLib.IntFunc
) – TpIntFunc to use to iterate the setuserdata (
object
orNone
) – user data to pass to each call of func
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:
Returns: says it all
- is_empty()¶
-
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:
Returns: says it all
- is_member(element)¶
-
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:
Remove an integer from a
TelepathyGLib.Intset
- 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:
Returns: says it all
- to_array()¶
- Returns:
a
GLib.Array
ofint
(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:
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.