| Top |
TpBaseConnectionManagerTpBaseConnectionManager — base class for TpSvcConnectionManager implementations |
| gboolean | (*TpCMParamFilter) () |
| gboolean | tp_cm_param_filter_string_nonempty () |
| gboolean | tp_cm_param_filter_uint_nonzero () |
| void | (*TpCMParamSetter) () |
| void | tp_cm_param_setter_offset () |
| TpBaseConnection * | (*TpBaseConnectionManagerNewConnFunc) () |
| GPtrArray * | (*TpBaseConnectionManagerGetInterfacesFunc) () |
| TpDBusDaemon * | tp_base_connection_manager_get_dbus_daemon () |
| gboolean | tp_base_connection_manager_register () |
| void | tp_base_connection_manager_add_protocol () |
| TpDBusDaemon * | dbus-daemon | Read / Write / Construct Only |
| GStrv | interfaces | Read |
| GHashTable_gchararray+GHashTable_gchararray+GValue__* | protocols | Read |
| struct | TpCMParamSpec |
| TpCMProtocolSpec | |
| struct | TpBaseConnectionManager |
| struct | TpBaseConnectionManagerClass |
TpBaseConnectionManager implements TpSvcDBusProperties and TpSvcConnectionManager.
This base class makes it easier to write TpSvcConnectionManager implementations by managing the D-Bus object path and bus name, and maintaining a table of active connections. Subclasses should usually only need to override the members of the class data structure.
gboolean (*TpCMParamFilter) (const TpCMParamSpec *paramspec,GValue *value,GError **error);
Signature of a callback used to validate and/or normalize user-provided CM parameter values.
paramspec |
The parameter specification. The filter is likely to use name (for the error message if the value is invalid) and filter_data. |
|
value |
The value for that parameter provided by the user. May be changed to contain a different value of the same type, if some sort of normalization is required |
|
error |
Used to raise |
gboolean tp_cm_param_filter_string_nonempty (const TpCMParamSpec *paramspec,GValue *value,GError **error);
A TpCMParamFilter which rejects empty strings.
gboolean tp_cm_param_filter_uint_nonzero (const TpCMParamSpec *paramspec,GValue *value,GError **error);
A TpCMParamFilter which rejects zero, useful for server port numbers.
void (*TpCMParamSetter) (const TpCMParamSpec *paramspec,const GValue *value,gpointer params);
The signature of a callback used to set a parameter within the opaque data structure used for a protocol.
paramspec |
The parameter specification. The setter is likely to use some combination of the name, offset and setter_data fields. |
|
value |
The value for that parameter provided by the user. |
|
params |
An opaque data structure, created by TpCMProtocolSpec.params_new. |
Since: 0.7.0
void tp_cm_param_setter_offset (const TpCMParamSpec *paramspec,const GValue *value,gpointer params);
A TpCMParamSetter which sets parameters by dereferencing an offset
from params
. If paramspec->offset
is G_MAXSIZE, the parameter is
deemed obsolete, and is accepted but ignored.
paramspec |
A parameter specification with offset set to some meaningful value. |
|
value |
The value for that parameter, either provided by the user or constructed from the parameter's default. |
|
params |
An opaque data structure such that the address at ( |
Since: 0.7.0
TpBaseConnection * (*TpBaseConnectionManagerNewConnFunc) (TpBaseConnectionManager *self,const gchar *proto,TpIntset *params_present,void *parsed_params,GError **error);
A function that will return a new connection according to the parsed parameters; used to implement RequestConnection.
The connection manager base class will register the bus name for the new connection, and place a reference to it in its table of connections until the connection's shutdown process finishes.
self |
The connection manager implementation |
|
proto |
The protocol name from the D-Bus request |
|
params_present |
A set of integers representing the indexes into the array of TpCMParamSpec of those parameters that were present in the request |
|
parsed_params |
An opaque data structure as returned by the protocol's params_new function, populated according to the parameter specifications |
|
error |
if not |
GPtrArray *
(*TpBaseConnectionManagerGetInterfacesFunc)
(TpBaseConnectionManager *self);
Signature of an implementation of TpBaseConnectionManagerClass.get_interfaces virtual function.
Implementation must first chainup on parent class implementation and then add extra interfaces into the GPtrArray.
1 2 3 4 5 6 7 8 9 10 11 12 |
static GPtrArray * my_connection_manager_get_interfaces (TpBaseConnectionManager *self) { GPtrArray *interfaces; interfaces = TP_BASE_CONNECTION_MANAGER_CLASS ( my_connection_manager_parent_class)->get_interfaces (self); g_ptr_array_add (interfaces, TP_IFACE_BADGERS); return interfaces; } |
a GPtrArray of static strings for D-Bus interfaces implemented by this client.
[transfer container]
Since: 0.19.4
TpDBusDaemon *
tp_base_connection_manager_get_dbus_daemon
(TpBaseConnectionManager *self);
the value of the
“dbus-daemon” property. The caller must reference
the returned object with g_object_ref() if it will be kept.
[transfer none]
Since: 0.11.3
gboolean
tp_base_connection_manager_register (TpBaseConnectionManager *self);
Register the connection manager with an appropriate object path as
determined from its cm_dbus_name
, and register the appropriate well-known
bus name.