Top | ![]() |
![]() |
![]() |
![]() |
const gchar * | inf_communication_group_get_name () |
InfCommunicationObject * | inf_communication_group_get_target () |
void | inf_communication_group_set_target () |
gboolean | inf_communication_group_is_member () |
void | inf_communication_group_send_message () |
void | inf_communication_group_send_group_message () |
void | inf_communication_group_cancel_messages () |
const gchar * | inf_communication_group_get_method_for_network () |
const gchar * | inf_communication_group_get_method_for_connection () |
gchar * | inf_communication_group_get_publisher_id () |
InfCommunicationManager * | communication-manager | Write / Construct Only |
InfCommunicationRegistry * | communication-registry | Write / Construct Only |
char * | name | Read / Write / Construct Only |
InfCommunicationObject * | target | Read / Write |
GObject ╰── InfCommunicationGroup ├── InfCommunicationHostedGroup ╰── InfCommunicationJoinedGroup
InfCommunicationGroup represents a group of different hosts. The group supports sending messages between group members and to the whole group.
A communication group supports multiple networks. Each connection belongs to a network, identified by the “network” property. It is assumed that hosts on different networks can't directly communicate with each other. Examples for networks are "tcp/ip" or "jabber".
All communication for a given network is performed by a InfCommunicationMethod. The method defines how data is sent is sent to the group. For example, a method could choose to relay all data via a central server, or to send all data directly between the hosts, or in case of a jabber network, use jabber groupchat functionality.
const gchar *
inf_communication_group_get_name (InfCommunicationGroup *group
);
Returns the name of the group.
InfCommunicationObject *
inf_communication_group_get_target (InfCommunicationGroup *group
);
Returns the group's target. The target of a group is the InfCommunicationObject to which received and sent messages are reported.
void inf_communication_group_set_target (InfCommunicationGroup *group
,InfCommunicationObject *target
);
Sets the group's target. The target of a group is the
InfCommunicationObject to which received and sent messages are reported.
If target
is NULL
, then the target will be unset.
You can safely call this function with an object that holds a reference on
the group since the InfCommunicationGroup only holds a weak reference to
its target
. This means that you need to keep a reference on target
yourself.
gboolean inf_communication_group_is_member (InfCommunicationGroup *group
,InfXmlConnection *connection
);
Returns whether connection
is a member of group
.
void inf_communication_group_send_message (InfCommunicationGroup *group
,InfXmlConnection *connection
,xmlNodePtr xml
);
Sends a message connection
which must be a member of group
. connection
needs to be a member of this group. This function takes ownership of xml
.
group |
||
connection |
The InfXmlConnection to which to send the message. |
|
xml |
The message to send. |
[transfer full] |
void inf_communication_group_send_group_message (InfCommunicationGroup *group
,xmlNodePtr xml
);
Sends a message to all members of group
. This function takes ownership
of xml
.
void inf_communication_group_cancel_messages (InfCommunicationGroup *group
,InfXmlConnection *connection
);
Stops all messages scheduled to be sent to connection
from being sent.
Messages for which inf_communication_object_enqueued()
has already been
called cannot be cancelled anymore.
const gchar * inf_communication_group_get_method_for_network (InfCommunicationGroup *group
,const gchar *network
);
Returns the method name of the method used for communication on network
within group
.
const gchar * inf_communication_group_get_method_for_connection (InfCommunicationGroup *grp
,InfXmlConnection *conn
);
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 grp
for this
function to be called.
gchar * inf_communication_group_get_publisher_id (InfCommunicationGroup *group
,InfXmlConnection *for_connection
);
Returns a host identifier for the group's publisher (see
“local-id” and “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.
struct InfCommunicationGroup;
InfCommunicationGroup is an opaque data type. You should only access it via the public API functions.
struct InfCommunicationGroupClass { /* Signals */ void (*member_added)(InfCommunicationGroup* group, InfXmlConnection* connection); void (*member_removed)(InfCommunicationGroup* group, InfXmlConnection* connection); /* Virtual functions */ /* TODO: Should this be const gchar* const* get_methods? */ const gchar* (*get_method)(InfCommunicationGroup* group, unsigned int index); gchar* (*get_publisher_id)(InfCommunicationGroup* group, InfXmlConnection* for_connection); };
The virtual methods and default signal handlers of InfCommunicationGroup.
Default signal handler of the “member-added” signal. |
||
Default signal handler of the “member-removed” signal. |
||
Virtual function to determine the methods to use for the group, in order of priority. |
||
Virtual function to obtain the ID of the publishing host of this group. |
“communication-manager”
property“communication-manager” InfCommunicationManager *
The communication manager used for sending requests.
Owner: InfCommunicationGroup
Flags: Write / Construct Only
“communication-registry”
property“communication-registry” InfCommunicationRegistry *
The registry to register connections with.
Owner: InfCommunicationGroup
Flags: Write / Construct Only
“name”
property “name” char *
The name of the group.
Owner: InfCommunicationGroup
Flags: Read / Write / Construct Only
Default value: NULL
“target”
property“target” InfCommunicationObject *
The communication object to call on received and sent data.
Owner: InfCommunicationGroup
Flags: Read / Write
“member-added”
signalvoid user_function (InfCommunicationGroup *group, InfXmlConnection *connection, gpointer user_data)
This signal is emitted when a connection has been added to the group.
group |
The InfCommunicationGroup emitting the signal. |
|
connection |
The newly joined connection. |
|
user_data |
user data set when the signal handler was connected. |
Flags: Run Last
“member-removed”
signalvoid user_function (InfCommunicationGroup *group, InfXmlConnection *connection, gpointer user_data)
This signal is emitted when a connection has been removed from the group.
group |
The InfCommunicationGroup emitting the signal. |
|
connection |
The connection that was removed |
|
user_data |
user data set when the signal handler was connected. |
Flags: Run Last