InfAdoptedSplitOperation

InfAdoptedSplitOperation — Operation wrapping two operations

Stability Level

Unstable, unless otherwise indicated

Synopsis

#include <libinfinity/adopted/inf-adopted-split-operation.h>

                    InfAdoptedSplitOperation;
struct              InfAdoptedSplitOperationClass;
InfAdoptedSplitOperation * inf_adopted_split_operation_new
                                                        (InfAdoptedOperation *first,
                                                         InfAdoptedOperation *second);
GSList *            inf_adopted_split_operation_unsplit (InfAdoptedSplitOperation *operation);
InfAdoptedOperation * inf_adopted_split_operation_transform_other
                                                        (InfAdoptedSplitOperation *op,
                                                         InfAdoptedOperation *other,
                                                         InfAdoptedOperation *op_lcs,
                                                         InfAdoptedOperation *other_lcs,
                                                         gint concurrency_id);

Object Hierarchy

  GObject
   +----InfAdoptedSplitOperation

Implemented Interfaces

InfAdoptedSplitOperation implements InfAdoptedOperation.

Properties

  "first"                    InfAdoptedOperation*  : Read / Write / Construct Only
  "second"                   InfAdoptedOperation*  : Read / Write / Construct Only

Description

InfAdoptedSplitOperation is a wrapper around that two InfAdoptedOperations. This is normally not required directly but may be a result of some transformation. It can also be used to atomically perform multiple operations at once.

If A denotes the first operation of the split operation and B denotes the second operation, the split operation applies first A and then B to the document. Note that a split operation is not commutative, i.e. the order of the two operations is important and cannot be interchanged at will. When the second operation, B, is applied, it is assumed that the operation A was already applied before.

The reverse of the split operation (A, B) is (R(B), R(A)) where R indicates the reverse operation. When the split operation is transformed against an operation T, the result is (T A, (A T) B). When another operation T is transformed against the split operation, the result is B (A T). The functions inf_adopted_operation_revert(), inf_adopted_operation_transform() and inf_adopted_split_operation_transform_other() perform these three operations, respectively.

Details

InfAdoptedSplitOperation

typedef struct _InfAdoptedSplitOperation InfAdoptedSplitOperation;

InfAdoptedSplitOperation is an opaque data type. You should only access it via the public API functions.


struct InfAdoptedSplitOperationClass

struct InfAdoptedSplitOperationClass {
};

This structure does not contain any public fields.


inf_adopted_split_operation_new ()

InfAdoptedSplitOperation * inf_adopted_split_operation_new
                                                        (InfAdoptedOperation *first,
                                                         InfAdoptedOperation *second);

Creates a new InfAdoptedSplitOperation. A split operation is simply a wrapper around two operations (which may in turn be split operations).

first :

one of the InfAdoptedOperations to be wrapped

second :

the other InfAdoptedOperation to be wrapped

Returns :

A new InfAdoptedSplitOperation.

inf_adopted_split_operation_unsplit ()

GSList *            inf_adopted_split_operation_unsplit (InfAdoptedSplitOperation *operation);

Returns a list of the operations contained by the split operation. If the splitted operation are in turn split operations, they will also be unsplitted. The returned list is guarenteed to not contain a InfAdoptedSplitOperation.

operation :

A InfAdoptedSplitOperation.

Returns :

A list of operations. Free with g_slist_free() when done.

inf_adopted_split_operation_transform_other ()

InfAdoptedOperation * inf_adopted_split_operation_transform_other
                                                        (InfAdoptedSplitOperation *op,
                                                         InfAdoptedOperation *other,
                                                         InfAdoptedOperation *op_lcs,
                                                         InfAdoptedOperation *other_lcs,
                                                         gint concurrency_id);

Transforms other against op.

op :

A InfAdoptedSplitOperation.

other :

An arbitrary InfAdoptedOperation.

op_lcs :

The operation op at a previous state, or NULL.

other_lcs :

The operation other at a previous state, or NULL.

concurrency_id :

The concurrency id for the transformation of other against op.

Returns :

The transformed operation.

Property Details

The "first" property

  "first"                    InfAdoptedOperation*  : Read / Write / Construct Only

The first operation of the split operation.


The "second" property

  "second"                   InfAdoptedOperation*  : Read / Write / Construct Only

The second operation of the split operation.