Infinity.CommunicationGroup¶
Methods¶
- Inherited:
- Structs:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
|
|
|
|
|
|
|
Properties¶
Name |
Type |
Flags |
Short Description |
|---|---|---|---|
w/co |
The communication manager used for sending requests |
||
w/co |
The registry to register connections with |
||
r/w/co |
The name of the group |
||
r/w |
The communication object to call on received and sent data |
Signals¶
- Inherited:
Name |
Short Description |
|---|---|
This signal is emitted when a connection has been added to the group. |
|
This signal is emitted when a connection has been removed from the group. |
Fields¶
- Inherited:
Name |
Type |
Access |
Description |
|---|---|---|---|
parent_instance |
r |
Class Details¶
- class Infinity.CommunicationGroup(**kwargs)¶
- Bases:
- Abstract:
Yes
- Structure:
Infinity.CommunicationGroupis an opaque data type. You should only access it via the public API functions.- cancel_messages(connection)¶
- Parameters:
connection (
Infinity.XmlConnection) – TheInfinity.XmlConnectionfor which to cancel messages.
Stops all messages scheduled to be sent to connection from being sent. Messages for which
Infinity.CommunicationObject.enqueued() has already been called cannot be cancelled anymore.
- get_method_for_connection(conn)¶
- Parameters:
conn (
Infinity.XmlConnection) – TheInfinity.XmlConnectionfor which to retrieve the method.- Returns:
A method name. The string is owned by the group, you don’t need to free it.
- Return type:
Returns the method name of the method used for communication on conn's network within group. conn does not need to be a member of self for this function to be called.
- get_method_for_network(network)¶
- Parameters:
network (
str) – A network specifier, such as “tcp/ip” or “jabber”.- Returns:
A method name. The string is owned by the group, you don’t need to free it.
- Return type:
Returns the method name of the method used for communication on network within self.
- get_name()¶
- Returns:
The name of the group. The returned string is owned by the group, you don’t need to free it.
- Return type:
Returns the name of the group.
- get_publisher_id(for_connection)¶
- Parameters:
for_connection (
Infinity.XmlConnection) – AInfinity.XmlConnection.- Returns:
The publisher’s host ID. Free with
GLib.free().- Return type:
Returns a host identifier for the group’s publisher (see
Infinity.XmlConnection:local-idandInfinity.XmlConnection:remote-id). If the local host is the publisher, then this will simply return for_connection's local ID, otherwise the remote ID of the connection to the publisher on for_connection's network is returned.
- get_target()¶
- Returns:
A
Infinity.CommunicationGroup, orNone.- Return type:
Returns the group’s target. The target of a group is the
Infinity.CommunicationObjectto which received and sent messages are reported.
- is_member(connection)¶
- Parameters:
connection (
Infinity.XmlConnection) – AInfinity.XmlConnection.- Returns:
- Return type:
Returns whether connection is a member of self.
- send_group_message(xml)¶
- Parameters:
xml (
libxml2.NodePtr) – The message to send.
Sends a message to all members of self. This function takes ownership of xml.
- send_message(connection, xml)¶
- Parameters:
connection (
Infinity.XmlConnection) – TheInfinity.XmlConnectionto which to send the message.xml (
libxml2.NodePtr) – The message to send.
Sends a message connection which must be a member of self. connection needs to be a member of this group. This function takes ownership of xml.
- set_target(target)¶
- Parameters:
target (
Infinity.CommunicationObject) – AInfinity.CommunicationObject, orNone.
Sets the group’s target. The target of a group is the
Infinity.CommunicationObjectto which received and sent messages are reported. If target isNone, then the target will be unset.You can safely call this function with an object that holds a reference on the group since the
Infinity.CommunicationGrouponly holds a weak reference to its target. This means that you need to keep a reference on target yourself.
- do_get_method(index) virtual¶
-
Virtual function to determine the methods to use for the group, in order of priority.
- do_get_publisher_id(for_connection) virtual¶
- Parameters:
for_connection (
Infinity.XmlConnection) – AInfinity.XmlConnection.- Returns:
The publisher’s host ID. Free with
GLib.free().- Return type:
Returns a host identifier for the group’s publisher (see
Infinity.XmlConnection:local-idandInfinity.XmlConnection:remote-id). If the local host is the publisher, then this will simply return for_connection's local ID, otherwise the remote ID of the connection to the publisher on for_connection's network is returned.
- do_member_added(connection) virtual¶
- Parameters:
connection (
Infinity.XmlConnection) –
Default signal handler of the
Infinity.CommunicationGroup::member-addedsignal.
- do_member_removed(connection) virtual¶
- Parameters:
connection (
Infinity.XmlConnection) –
Default signal handler of the
Infinity.CommunicationGroup::member-removedsignal.
Signal Details¶
- Infinity.CommunicationGroup.signals.member_added(communication_group, connection)¶
- Signal Name:
member-added- Flags:
- Parameters:
communication_group (
Infinity.CommunicationGroup) – The object which received the signalconnection (
Infinity.XmlConnection) – The newly joined connection.
This signal is emitted when a connection has been added to the group.
- Infinity.CommunicationGroup.signals.member_removed(communication_group, connection)¶
- Signal Name:
member-removed- Flags:
- Parameters:
communication_group (
Infinity.CommunicationGroup) – The object which received the signalconnection (
Infinity.XmlConnection) – The connection that was removed
This signal is emitted when a connection has been removed from the group.
Property Details¶
- Infinity.CommunicationGroup.props.communication_manager¶
- Name:
communication-manager- Type:
- Default Value:
- Flags:
The communication manager used for sending requests
- Infinity.CommunicationGroup.props.communication_registry¶
- Name:
communication-registry- Type:
- Default Value:
- Flags:
The registry to register connections with
- Infinity.CommunicationGroup.props.name¶
- Name:
name- Type:
- Default Value:
- Flags:
The name of the group
- Infinity.CommunicationGroup.props.target¶
- Name:
target- Type:
- Default Value:
- Flags:
The communication object to call on received and sent data