libamxs
0.6.0
Data Model Synchronization C API
|
Ambiorix Object Synchronization API header file. More...
#include <amxs/amxs_types.h>
Go to the source code of this file.
Functions | |
amxs_status_t | amxs_sync_ctx_new (amxs_sync_ctx_t **ctx, const char *object_a, const char *object_b, int attributes) |
Synchronization context constructor function. More... | |
void | amxs_sync_ctx_delete (amxs_sync_ctx_t **ctx) |
Synchronization context destructor function. More... | |
amxs_status_t | amxs_sync_ctx_init (amxs_sync_ctx_t *ctx, const char *object_a, const char *object_b, int attributes) |
Synchronization context initialization function. More... | |
void | amxs_sync_ctx_clean (amxs_sync_ctx_t *ctx) |
Synchronization context cleanup function. More... | |
amxs_status_t | amxs_sync_ctx_copy (amxs_sync_ctx_t **dest, amxs_sync_ctx_t *src, void *priv) |
Copies an existing synchronization context to a new synchronization context. More... | |
amxs_status_t | amxs_sync_ctx_start_sync (amxs_sync_ctx_t *ctx) |
Starts the object synchronization. More... | |
void | amxs_sync_ctx_stop_sync (amxs_sync_ctx_t *ctx) |
Stops the object synchronization. More... | |
static bool | amxs_sync_ctx_is_started (const amxs_sync_ctx_t *const ctx) |
Checks is the synchronization context is running. More... | |
amxs_status_t | amxs_sync_ctx_set_paths (amxs_sync_ctx_t *const ctx, const char *object_a, const char *object_b) |
Updates the object paths of the synchronization context. More... | |
amxs_status_t | amxs_sync_ctx_add_param (amxs_sync_ctx_t *ctx, amxs_sync_param_t *param) |
Adds a synchronization parameter to a synchronization context. More... | |
amxs_status_t | amxs_sync_ctx_add_new_param (amxs_sync_ctx_t *ctx, const char *param_a, const char *param_b, int attributes, amxs_translation_cb_t translation_cb, amxs_action_cb_t action_cb, void *priv) |
Creates and adds a synchronization parameter to a synchronization context. More... | |
amxs_status_t | amxs_sync_ctx_add_new_copy_param (amxs_sync_ctx_t *ctx, const char *param_a, const char *param_b, int attributes) |
Creates and adds a synchronization parameter to a synchronization context. More... | |
amxs_status_t | amxs_sync_ctx_add_object (amxs_sync_ctx_t *ctx, amxs_sync_object_t *object) |
Adds a synchronization object to a synchronization context. More... | |
amxs_status_t | amxs_sync_ctx_add_new_object (amxs_sync_ctx_t *ctx, const char *object_a, const char *object_b, int attributes, amxs_translation_cb_t translation_cb, amxs_action_cb_t action_cb, void *priv) |
Creates and adds a synchronization object to a synchronization context. More... | |
amxs_status_t | amxs_sync_ctx_add_new_copy_object (amxs_sync_ctx_t *ctx, const char *object_a, const char *object_b, int attributes) |
Creates and adds a synchronization object to a synchronization context. More... | |
amxs_status_t | amxs_sync_ctx_set_local_dm (amxs_sync_ctx_t *ctx, amxd_dm_t *dm_a, amxd_dm_t *dm_b) |
Set the local datamodel pointer for the sync root objects. More... | |
Ambiorix Object Synchronization API header file.
Definition in file amxs_sync_ctx.h.
amxs_status_t amxs_sync_ctx_add_new_copy_object | ( | amxs_sync_ctx_t * | ctx, |
const char * | object_a, | ||
const char * | object_b, | ||
int | attributes | ||
) |
Creates and adds a synchronization object to a synchronization context.
Allocates memory for a new synchronization object and initializes this object. Then adds it to the synchronization context.
Adding the synchronization object fails when:
If the context attributes are more strict than those of the object, the object attributes will be updated to match those of the context.
Uses default translation amxs_sync_object_copy_trans_cb and action amxs_sync_object_copy_action_cb callbacks.
ctx | Pointer to a synchronization context. |
object_a | Name of the object in object A |
object_b | Name of the object in object B |
attributes | Bitwise OR of zero or more of the following attributes: |
Definition at line 951 of file amxs_sync_ctx.c.
amxs_status_t amxs_sync_ctx_set_local_dm | ( | amxs_sync_ctx_t * | ctx, |
amxd_dm_t * | dm_a, | ||
amxd_dm_t * | dm_b | ||
) |
Set the local datamodel pointer for the sync root objects.
If one or both root objects for the synchronization are located in the same process as the synchronization code, it is possible to add read-only parameters to the sync.
Having access to the datamodel enables the writing of read-only parameters.
The datamodel pointer should only be set if the synchronization needs to write the object.
ctx | Pointer to a synchronization context. |
dm_a | Pointer to the local datamodel which contains object A, may be NULL |
dm_b | Pointer to the local datamodel which contains object B, may be NULL |
Definition at line 964 of file amxs_sync_ctx.c.