SPRpc Object

SPRpc Object — The main data struct of Spread RPC

Synopsis

typedef             SPRpc;
SPRpc*              sp_rpc_new                          (void);
void                sp_rpc_ref                          (SPRpc *rpc);
void                sp_rpc_unref                        (SPRpc *rpc);
mailbox             sp_rpc_get_mailbox                  (SPRpc *rpc);
void                sp_rpc_set_mailbox                  (SPRpc *rpc,
                                                         mailbox mailbox);
const gchar*        sp_rpc_get_id                       (SPRpc *rpc);
void                sp_rpc_set_id                       (SPRpc *rpc,
                                                         gchar *id);
gboolean            sp_rpc_id_exists                    (SPRpc *rpc);
const gchar*        sp_rpc_get_group                    (SPRpc *rpc);
void                sp_rpc_set_group                    (SPRpc *rpc,
                                                         gchar *group);
gboolean            sp_rpc_group_exists                 (SPRpc *rpc);

Description

The SPRpc struct is the main opaque data type.

Details

SPRpc

typedef struct sp_rpc_t SPRpc;

The main data struct of Spread RPC


sp_rpc_new ()

SPRpc*              sp_rpc_new                          (void);

Creates a new SPRpc that must be initialized before using though the sp_rpc_set_mailbox() and the spread functions (SP_connect(), SP_join(), ...).

Use sp_rpc_unref() to free this data.

Returns :

a new SPRpc with a reference count of 1.

sp_rpc_ref ()

void                sp_rpc_ref                          (SPRpc *rpc);

Increases the reference count of a SPRpc.

rpc :

a SPRpc

sp_rpc_unref ()

void                sp_rpc_unref                        (SPRpc *rpc);

Decreases the reference count of a SPRpc. When its reference count drops to 0, the SPRpc is finalized.

rpc :

a SPRpc

sp_rpc_get_mailbox ()

mailbox             sp_rpc_get_mailbox                  (SPRpc *rpc);

Returns the internal mailbox element of a SPRpc. This mailbox can be used for the initialization of spread through (SP_connect(), SP_join(), ...) or for the disconnect procedure (SP_disconnect(), ...).

rpc :

a SPRpc

Returns :

the mailbox of the SPRpc object

sp_rpc_set_mailbox ()

void                sp_rpc_set_mailbox                  (SPRpc *rpc,
                                                         mailbox mailbox);

Sets a new mailbox for a SPRpc. Normally, this function is used with a new mailbox could be connected to the spread ring.

rpc :

a SPRpc

mailbox :

a Spread mailbox, or 0

sp_rpc_get_id ()

const gchar*        sp_rpc_get_id                       (SPRpc *rpc);

Returns the id string of a SPRpc.

rpc :

a SPRpc

Returns :

The id of a SPRpc. This string is owned by the SPRpc and must not be modified or freed.

sp_rpc_set_id ()

void                sp_rpc_set_id                       (SPRpc *rpc,
                                                         gchar *id);

Sets a new id for a SPRpc.

rpc :

a SPRpc

id :

the id

sp_rpc_id_exists ()

gboolean            sp_rpc_id_exists                    (SPRpc *rpc);

Returns TRUE if the id exists into the SPRpc object

rpc :

a SPRpc

Returns :

TRUE/FALSE

sp_rpc_get_group ()

const gchar*        sp_rpc_get_group                    (SPRpc *rpc);

Returns the group string of a SPRpc.

rpc :

a SPRpc

Returns :

The group of a SPRpc. This string is owned by the SPRpc and must not be modified or freed.

sp_rpc_set_group ()

void                sp_rpc_set_group                    (SPRpc *rpc,
                                                         gchar *group);

Sets a new group for a SPRpc.

rpc :

a SPRpc

group :

the group

sp_rpc_group_exists ()

gboolean            sp_rpc_group_exists                 (SPRpc *rpc);

Returns TRUE if the group exists into the SPRpc object

rpc :

a SPRpc

Returns :

TRUE/FALSE