Module replica

Source

Structs§

TCReplica
***** TCReplica *****
TCReplicaOp
***** TCReplicaOp *****
TCReplicaOpList
***** TCReplicaOpList *****

Enums§

TCReplicaOpType
***** TCReplicaOpType *****

Functions§

tc_replica_add_undo_point
Add an UndoPoint, if one has not already been added by this Replica. This occurs automatically when a change is made. The force flag allows forcing a new UndoPoint even if one has already been created by this Replica, and may be useful when a Replica instance is held for a long time and used to apply more than one user-visible change.
tc_replica_all_task_uuids
Get a list of all uuids for tasks in the replica.
tc_replica_all_tasks
Get a list of all tasks in the replica.
tc_replica_commit_undo_ops
Undo local operations in storage.
tc_replica_delete_task
Delete a task. The task must exist. Note that this is different from setting status to Deleted; this is the final purge of the task.
tc_replica_error
Get the latest error for a replica, or a string with NULL ptr if no error exists. Subsequent calls to this function will return NULL. The rep pointer must not be NULL. The caller must free the returned string.
tc_replica_free
Free a replica. The replica may not be used after this function returns and must not be freed more than once.
tc_replica_get_task
Get an existing task by its UUID.
tc_replica_get_undo_ops
Return undo local operations until the most recent UndoPoint.
tc_replica_import_task_with_uuid
Create a new task. The task must not already exist.
tc_replica_new_in_memory
Create a new TCReplica with an in-memory database. The contents of the database will be lost when it is freed with tc_replica_free.
tc_replica_new_on_disk
Create a new TCReplica with an on-disk database having the given filename. On error, a string is written to the error_out parameter (if it is not NULL) and NULL is returned. The caller must free this string.
tc_replica_new_task
Create a new task. The task must not already exist.
tc_replica_num_local_operations
Get the number of local, un-synchronized operations (not including undo points), or -1 on error.
tc_replica_num_undo_points
Get the number of undo points (number of undo calls possible), or -1 on error.
tc_replica_op_get_old_task_description
Return description field of old task field of ReplicaOp.
tc_replica_op_get_old_value
Return old value field of ReplicaOp.
tc_replica_op_get_property
Return property field of ReplicaOp.
tc_replica_op_get_timestamp
Return timestamp field of ReplicaOp.
tc_replica_op_get_uuid
Return uuid field of ReplicaOp.
tc_replica_op_get_value
Return value field of ReplicaOp.
tc_replica_op_list_free
Free a vector of ReplicaOp. The vector may not be used after this function returns and must not be freed more than once.
tc_replica_rebuild_working_set
Rebuild this replica’s working set, based on whether tasks are pending or not. If renumber is true, then existing tasks may be moved to new working-set indices; in any case, on completion all pending tasks are in the working set and all non- pending tasks are not.
tc_replica_sync
Synchronize this replica with a server.
tc_replica_working_set
Get the current working set for this replica. The resulting value must be freed with tc_working_set_free.