![]() |
![]() |
![]() |
Dee Reference Manual | ![]() |
---|---|---|---|---|
Top | Description | Object Hierarchy | Implemented Interfaces | Properties | Signals |
DeeSharedModelDeeSharedModel — A DeeModel that can synchronize with other DeeSharedModel objects across D-Bus. |
#include <dee.h> DeeSharedModel; DeeSharedModelClass; DeeSharedModelPrivate; #define DEE_SHARED_MODEL_DBUS_IFACE enum DeeSharedModelError; DeeModel* dee_shared_model_new (const gchar *name
,guint n_columns
,...
); DeeModel* dee_shared_model_new_with_name (const gchar *name
); DeeModel* dee_shared_model_new_with_back_end (const gchar *name
,DeeModel *back_end
); void dee_shared_model_connect (DeeSharedModel *self
); const gchar* dee_shared_model_get_swarm_name (DeeSharedModel *self
); DeePeer* dee_shared_model_get_peer (DeeSharedModel *self
);
"columns" gchar* : Read "peer" DeePeer* : Read / Write / Construct Only "seqnum" guint64 : Read "size" guint : Read
"ready" : Run Last / Has Details "rows-added" : Run Last / Has Details "rows-changed" : Run Last / Has Details "rows-removed" : Run Last / Has Details
DeeSharedModel is created with a name (usually namespaced and unique to your program(s)) which is used to locate other DeeSharedModels created with the same name through D-Bus, and will keep synchronized with them.
This allows to you build MVC programs with a sane model API, but have the controller (or multiple views) in a seperate process.
typedef struct _DeeSharedModel DeeSharedModel;
All fields in the DeeSharedModel structure are private and should never be accessed directly
typedef struct _DeeSharedModelPrivate DeeSharedModelPrivate;
Ignore this structure.
typedef enum { DEE_SHARED_MODEL_ERROR_LEADER_INVALIDATED } DeeSharedModelError;
DeeModel* dee_shared_model_new (const gchar *name
,guint n_columns
,...
);
Creates a new DeeSharedModel with the specified name
, and with n_columns
columns of the types passed in.
A shared model created with this constructor will store row data in a suitably picked memory backed model.
In order to start synchronizing the new model with peer models you must call
dee_shared_model_connect()
on it.
|
A well known name to publish this model under. Models sharing this name will synchronize with each other |
|
number of columns in the model |
|
n_columns number of GTypes
|
Returns : |
a new DeeSharedModel |
DeeModel* dee_shared_model_new_with_name (const gchar *name
);
Create a new empty shared model without any column schema associated.
The column schema will be set in one of two ways: Firstly you may set it
manually with dee_model_set_n_columns()
and dee_model_set_column_type()
,
or secondly it will be set once the first rows are exchanged with a
peer model.
In the second case the
column schema will constructed exlicitly from the Clone metadata or
implicitly from the row value types which ever arrives first.
A shared model created with this constructor will store row data in a suitably picked memory backed model.
In order to start synchronizing the new model with peer models you must call
dee_shared_model_connect()
on it.
|
A well known name to publish this model under. Models sharing this name will synchronize with each other |
Returns : |
a new DeeSharedModel |
DeeModel* dee_shared_model_new_with_back_end (const gchar *name
,DeeModel *back_end
);
Create a new shared model storing all data in back_end
.
In order to start synchronizing the new model with peer models you must call
dee_shared_model_connect()
on it.
|
A well known name to publish this model under. Models sharing this name will synchronize with each other. [transfer none] |
|
The DeeModel that will actually store
the model data. Ownership of the ref to back_end is transfered to
the shared model. [transfer full]
|
Returns : |
void dee_shared_model_connect (DeeSharedModel *self
);
Connect to the swarm of peer models and start listening for updates on peer models. Updates to this model will not be broadcast to the swarm until after this method has been called.
|
The model to export on the bus |
const gchar* dee_shared_model_get_swarm_name (DeeSharedModel *self
);
Convenience function for accessing the "swarm-name" property of the DeePeer defined in the "peer" property.
|
The model to get the name for |
Returns : |
The name of the swarm this model synchrnonizes with |
DeePeer* dee_shared_model_get_peer (DeeSharedModel *self
);
Convenience function for accessing the "peer" property
"columns"
property"columns" gchar* : Read
Expert: The last known sequence number
Default value: ""
"peer"
property"peer" DeePeer* : Read / Write / Construct Only
The peer object that monitors the swarm.
"seqnum"
property"seqnum" guint64 : Read
Expert: The last known sequence number
Default value: 0
"ready"
signalvoid user_function (DeeSharedModel *deesharedmodel, gpointer user_data) : Run Last / Has Details
|
the object which received the signal. |
|
user data set when the signal handler was connected. |
"rows-added"
signalvoid user_function (DeeSharedModel *arg0, GPtrArray_GPtrArray_GValue__ *arg1, GArray_guint_ *arg2, GArray_guint64_ *arg3, gpointer user_data) : Run Last / Has Details
Private signal leaked because of how dbus-glib work with signals
|
user data set when the signal handler was connected. |
"rows-changed"
signalvoid user_function (DeeSharedModel *arg0, GPtrArray_GPtrArray_GValue__ *arg1, GArray_guint_ *arg2, GArray_guint64_ *arg3, gpointer user_data) : Run Last / Has Details
Private signal leaked because of how dbus-glib work with signals
|
user data set when the signal handler was connected. |
"rows-removed"
signalvoid user_function (DeeSharedModel *arg0, GArray_guint_ *arg1, GArray_guint64_ *arg2, gpointer user_data) : Run Last / Has Details
Private signal leaked because of how dbus-glib work with signals
|
user data set when the signal handler was connected. |