MicrofeedProvider
[libmicrofeed-provider - Modules that are used in the provider side]

A providers connection to the DBus system. More...

Data Structures

struct  _MicrofeedProviderCallbacks

Typedefs

typedef struct _MicrofeedProvider MicrofeedProvider
 An opaque datatype presenting a provider.
typedef void(* MicrofeedProviderNoMorePublishersCallback )(MicrofeedProvider *provider, void *user_data)
typedef struct
_MicrofeedProviderCallbacks 
MicrofeedProviderCallbacks

Functions

MicrofeedProvidermicrofeed_provider_new (const char *bus_name, DBusConnection *connection, MicrofeedProviderCallbacks *callbacks, void *user_data)
 Instantiates a new provider.
void microfeed_provider_free (MicrofeedProvider *provider)
 Frees the resources allocated for the provider.
void microfeed_provider_add_publisher (MicrofeedProvider *provider, MicrofeedPublisher *publisher)
 Adds a new publisher.
void microfeed_provider_remove_publisher (MicrofeedProvider *provider, MicrofeedPublisher *publisher)
 Removes an existing publisher.
DBusConnection * microfeed_provider_get_dbus_connection (MicrofeedProvider *provider)
 Returns the DBus connection used by the provider.
const char * microfeed_provider_get_bus_name (MicrofeedProvider *provider)
 Return the well-known DBus bus name reserved by the provider.

Detailed Description

A providers connection to the DBus system.

Provider instantiates existing publishers as requested by subscribers. In addition, a new or existing publisher can also be instantiated using microfeed_publisher_new function and then added into Provider with the microfeed_provider_add_publisher function. Provider also monitors name changes in the DBus and informs its publishers by calling microfeed_publisher_remove_subscriber when a potential subscriber has terminated.


Typedef Documentation

An opaque datatype presenting a provider.

Definition at line 27 of file microfeedprovider.h.

typedef void(* MicrofeedProviderNoMorePublishersCallback)(MicrofeedProvider *provider, void *user_data)

Definition at line 39 of file microfeedprovider.h.


Function Documentation

void microfeed_provider_add_publisher ( MicrofeedProvider provider,
MicrofeedPublisher publisher 
)

Adds a new publisher.

Normally this function is not needed since the provider autimatically instantiates existing publishers when a first message to a non-instantiated publisher is received from a subscriber.

Parameters:
provider Instantiated MicrofeedProvider.
publisher Instantiated MicrofeedPublisher.

Definition at line 96 of file microfeedprovider.c.

References microfeed_store_insert(), and _MicrofeedProvider::publishers.

void microfeed_provider_free ( MicrofeedProvider provider  ) 

Frees the resources allocated for the provider.

Removes the DBUs message filter and releases the DBus bus name.

Parameters:
publisher Instantiated MicrofeedPublisher.

Definition at line 74 of file microfeedprovider.c.

References _MicrofeedProvider::bus_name, _MicrofeedProvider::connection, and microfeed_memory_free().

const char* microfeed_provider_get_bus_name ( MicrofeedProvider provider  ) 

Return the well-known DBus bus name reserved by the provider.

Parameters:
provider Instantiated MicrofeedProvider.
Returns:
A DBus bus name.

Definition at line 127 of file microfeedprovider.c.

References _MicrofeedProvider::bus_name.

DBusConnection* microfeed_provider_get_dbus_connection ( MicrofeedProvider provider  ) 

Returns the DBus connection used by the provider.

Parameters:
Instantiated MicrofeedProvider.
Returns:
DBus connection.

Definition at line 116 of file microfeedprovider.c.

References _MicrofeedProvider::connection.

MicrofeedProvider* microfeed_provider_new ( const char *  bus_name,
DBusConnection *  connection,
MicrofeedProviderCallbacks callbacks,
void *  user_data 
)

Instantiates a new provider.

The provider requests the given DBus bus name and adds a DBus message filter to monitor name owner changes.

Usually there is one provider in the provider implementation. If you use MicrofeedMain as a main loop, you can get the connection with microfeed_main_get_dbus_connection.

Parameters:
bus_name A well-known DBus bus name for the provider.
configuration Instantiated MicrofeedConfiguration.
connection A DBus connection.
callbacks A callback functions that are needed when a new MicrofeedPublisher is instantiated.
user_data A pointer to user data that is needed when a new MicrofeedPublisher is instantiated.
Returns:
Instantiated MicrofeedProvider, or NULL if the registration of the bus name failed.

Definition at line 36 of file microfeedprovider.c.

References _MicrofeedProvider::bus_name, _MicrofeedProvider::callbacks, _MicrofeedProvider::configuration, _MicrofeedProvider::connection, microfeed_configuration_new(), microfeed_memory_allocate, microfeed_memory_free(), microfeed_publisher_get_object_path(), microfeed_store_new_sorted(), _MicrofeedProvider::publishers, and _MicrofeedProvider::user_data.

void microfeed_provider_remove_publisher ( MicrofeedProvider provider,
MicrofeedPublisher publisher 
)

Removes an existing publisher.

Parameters:
provider Instantiated MicrofeedProvider.
publisher Instantiated MicrofeedPublisher that has previously added with microfeed_provider_add_publisher.

Definition at line 106 of file microfeedprovider.c.

References microfeed_store_remove(), and _MicrofeedProvider::publishers.


Generated on Fri Jun 26 21:48:57 2009 for Microfeed by  doxygen 1.5.6