v_sim.Pool

g GObject.Object GObject.Object v_sim.Pool v_sim.Pool GObject.Object->v_sim.Pool

Subclasses:

None

Methods

Inherited:

GObject.Object (37)

Structs:

GObject.ObjectClass (5)

class

new (type, compare)

add (boxed)

getByData (boxed)

getById (num)

index (boxed)

take (boxed)

Virtual Methods

Inherited:

GObject.Object (7)

Properties

Name

Type

Flags

Short Description

type

GObject.GType

r/w/co

stored type.

Signals

Inherited:

GObject.Object (1)

Name

Short Description

new-element

A new object is available in the pool.

Fields

Inherited:

GObject.Object (1)

Name

Type

Access

Description

parent

GObject.Object

r

Class Details

class v_sim.Pool(**kwargs)
Bases:

GObject.Object

Abstract:

No

Structure:

v_sim.PoolClass

Structure defining v_sim.Pool objects.

New in version 3.8.

classmethod new(type, compare)
Parameters:
Returns:

a newly created v_sim.Pool object.

Return type:

v_sim.Pool

Create a new v_sim.Pool object to store GObject.GBoxed objects defined by type. These objects must be comparable with compare function.

New in version 3.8.

add(boxed)
Parameters:

boxed (object or None) – a GObject.GBoxed pointer.

Returns:

a pointer on the copy of boxed. This copy is owned by V_Sim.

Return type:

object or None

Copy boxed into self if not already present.

New in version 3.8.

getByData(boxed)
Parameters:

boxed (object or None) – a GObject.GBoxed object.

Returns:

the corresponding object, or None if none has been found.

Return type:

object or None

This function retrieves the stored object that is equivalent to boxed.

New in version 3.8.

getById(num)
Parameters:

num (int) – an integer (>0).

Returns:

the corresponding object, or None if none has been found.

Return type:

object or None

This function retrieves the nth stored object. Number 0, is the last added object.

index(boxed)
Parameters:

boxed (object or None) – an object.

Returns:

an index.

Return type:

int

Retrieve the storage index of boxed if it exists, or -1 if not.

New in version 3.8.

take(boxed)
Parameters:

boxed (object or None) – a GObject.GBoxed pointer.

Returns:

a pointer on boxed. This pointer is owned by V_Sim.

Return type:

object or None

Insert boxed in self and takes ownership.

New in version 3.8.

Signal Details

v_sim.Pool.signals.new_element(pool, boxed)
Signal Name:

new-element

Flags:

RUN_LAST, NO_RECURSE, NO_HOOKS

Parameters:
  • pool (v_sim.Pool) – The object which received the signal

  • boxed (object or None) – the newly added object.

A new object is available in the pool.

New in version 3.8.

Property Details

v_sim.Pool.props.type
Name:

type

Type:

GObject.GType

Default Value:

<GType GBoxed>

Flags:

READABLE, WRITABLE, CONSTRUCT_ONLY

stored type.