Infinity.AdoptedRequest¶
| Subclasses: | None | 
|---|
Methods¶
| Inherited: | GObject.Object (37) | 
|---|---|
| Structs: | GObject.ObjectClass (5) | 
| class | new_do(vector, user_id, operation, received) | 
| class | new_redo(vector, user_id, received) | 
| class | new_undo(vector, user_id, received) | 
| affects_buffer() | |
| copy() | |
| fold(into, by) | |
| get_execute_time() | |
| get_index() | |
| get_operation() | |
| get_receive_time() | |
| get_request_type() | |
| get_user_id() | |
| get_vector() | |
| mirror(by) | |
| need_concurrency_id(against) | |
| set_execute_time(time) | |
| transform(against, request_lcs, against_lcs) | 
Virtual Methods¶
| Inherited: | GObject.Object (7) | 
|---|
Properties¶
| Name | Type | Flags | Short Description | 
|---|---|---|---|
| executed | int | r/w | Time the request was executed, in microseconds | 
| operation | Infinity.AdoptedOperation | r/w/co | The operation of the request | 
| received | int | r/w/co | Time the request was received, in microseconds | 
| type | Infinity.AdoptedRequestType | r/w/co | The type of the operation | 
| user-id | int | r/w/co | The ID of the user that made the request | 
| vector | Infinity.AdoptedStateVector | r/w/co | The vector time at which the request was made | 
Signals¶
| Inherited: | GObject.Object (1) | 
|---|
Fields¶
| Inherited: | GObject.Object (1) | 
|---|
| Name | Type | Access | Description | 
|---|---|---|---|
| parent | GObject.Object | r | |
| priv | object | r | 
Class Details¶
- 
class Infinity.AdoptedRequest(**kwargs)¶
- Bases: - GObject.Object- Abstract: - No - Structure: - Infinity.AdoptedRequestClass- Infinity.AdoptedRequestis an opaque data type. You should only access it via the public API functions.- 
classmethod new_do(vector, user_id, operation, received)¶
- Parameters: - vector (Infinity.AdoptedStateVector) – The vector time at which the request was made.
- user_id (int) – The ID of the user that made the request.
- operation (Infinity.AdoptedOperation) – The operation the user performed.
- received (int) – Time the request was received, in microseconds since the epoch.
 - Returns: - A new DO request. - Return type: - Creates a new - Infinity.AdoptedRequestwith type- Infinity.AdoptedRequestType.DO.
- vector (
 - 
classmethod new_redo(vector, user_id, received)¶
- Parameters: - vector (Infinity.AdoptedStateVector) – The vector time at which the request was made.
- user_id (int) – The ID of the user that made the request.
- received (int) – Time the request was received, in microseconds since the epoch.
 - Returns: - A new REDO request. - Return type: - Creates a new - Infinity.AdoptedRequestwith type- Infinity.AdoptedRequestType.REDO. The operation performed is implicitely defined by reverting the operation of the associated UNDO request, but must still be computed by- Infinity.AdoptedAlgorithm.
- vector (
 - 
classmethod new_undo(vector, user_id, received)¶
- Parameters: - vector (Infinity.AdoptedStateVector) – The vector time at which the request was made.
- user_id (int) – The ID of the user that made the request.
- received (int) – Time the request was received, in microseconds since the epoch.
 - Returns: - A new UNDO request. - Return type: - Creates a new - Infinity.AdoptedRequestwith type- Infinity.AdoptedRequestType.UNDO. The operation performed is implicitely defined by reverting the operation of the associated DO or REDO request, but must still be computed by- Infinity.AdoptedAlgorithm.
- vector (
 - 
affects_buffer()¶
- Returns: - Whether self affects the session’s buffer. - Return type: - bool- Returns whether this request, when applied, changes the content of the buffer. If this is a - Infinity.AdoptedRequestType.UNDOor- Infinity.AdoptedRequestType.REDOrequest, than it always affects the buffer, because only requests that affect the buffer can be undone or redone. If it is a- Infinity.AdoptedRequestType.DOrequest, than it returns whether its operation has the- Infinity.AdoptedOperationFlags.AFFECTS_BUFFERflag set.
 - 
copy()¶
- Returns: - A new - Infinity.AdoptedRequest.- Return type: - Infinity.AdoptedRequest- Creates a copy of self with an initial reference count of 1. 
 - 
fold(into, by)¶
- Parameters: - Returns: - The folded request as a new - Infinity.AdoptedRequest.- Return type: - Folds self as described in “Reducing the Problems of Group Undo” by Matthias Ressel and Rul Gunzenhäuser (http://portal.acm.org/citation.cfm?doid=320297.320312). - Note that by is the total amount of requests between the original and the fold request, and thus equivalent to 2j in the paper’s definition. - into must not be the same user as the one that issued self. 
 - 
get_execute_time()¶
- Returns: - The time when the function was executed, or 0. - Return type: - int- Returns the time when the request was executed by an - Infinity.AdoptedAlgorithm, see- Infinity.AdoptedAlgorithm.execute_request(). The time is given in microseconds since January 1, 1970. If the request was not yet executed, the function returns 0.
 - 
get_index()¶
- Returns: - The vector time component of the request’s own user. - Return type: - int- Returns the vector time component of the request’s own users. This corresponds to the request index by that user. 
 - 
get_operation()¶
- Returns: - The request’s operation. - Return type: - Infinity.AdoptedOperation- Returns the operation carried by the request. This can only be called if the request’s type is - Infinity.AdoptedRequestType.DO.
 - 
get_receive_time()¶
- Returns: - Time when the request was received. - Return type: - int- Returns the time when the request was received, or, if it’s a local request, generated. The time is given in microseconds since January 1, 1970. 
 - 
get_request_type()¶
- Returns: - The type of self. - Return type: - Infinity.AdoptedRequestType- Returns the request type of self. 
 - 
get_user_id()¶
- Returns: - The request’s user ID. - Return type: - int- Returns the user ID of the user that issued self. 
 - 
get_vector()¶
- Returns: - The state vector of self. The returned value should not be freed, it is owned by the - Infinity.AdoptedRequest.- Return type: - Infinity.AdoptedStateVector- Returns the vector time the request was made i.e. its operation can be applied to the buffer. 
 - 
mirror(by)¶
- Parameters: - by ( - int) – The number of requests between the original and the mirrored operation.- Returns: - The mirrored request as a new - Infinity.AdoptedRequest.- Return type: - Infinity.AdoptedRequest- Mirrors self as described in “Reducing the Problems of Group Undo” by Matthias Ressel and Rul Gunzenhäuser (http://portal.acm.org/citation.cfm?doid=320297.320312). - Note that by is the total amount of requests between the original and mirrored request, and thus equivalent to 2j-1 in the paper’s definition. - self must be of type - Infinity.AdoptedRequestType.DOand its operation must be reversible.
 - 
need_concurrency_id(against)¶
- Parameters: - against ( - Infinity.AdoptedRequest) – The request to transform against.- Returns: - Whether transformation of self against against requires a concurrency ID. - Return type: - bool- Returns whether transforming self against against requires a concurrency ID. If this function returns - True, you must provide the request_lcs and against_lcs parameters when calling- Infinity.AdoptedRequest.transform().- Both request need to be of type - Infinity.AdoptedRequestType.DO, and their state vectors must be the same.
 - 
set_execute_time(time)¶
- Parameters: - time ( - int) – A time in microseconds since January 1, 1970.- Sets the time when self was executed. Usually this is called by - Infinity.AdoptedAlgorithmwhen it executes a request, i.e. translates it to the current state of the document.
 - 
transform(against, request_lcs, against_lcs)¶
- Parameters: - against (Infinity.AdoptedRequest) – The request to transform against.
- request_lcs (Infinity.AdoptedRequest) – The request to transform in a previous state, orNone.
- against_lcs (Infinity.AdoptedRequest) – The request to transform against in a previous state, orNone.
 - Returns: - A new - Infinity.AdoptedRequest, the result of the transformation.- Return type: - Transforms the operation of self against the operation of against. Both requests must be of type - Infinity.AdoptedRequestType.DO, and their state vectors must be the same.- If the function - Infinity.AdoptedRequest.need_concurrency_id() returns- True, request_lcs and against_lcs must not be- None.
- against (
 
- 
classmethod 
Property Details¶
- 
Infinity.AdoptedRequest.props.executed¶
- Name: - executed- Type: - int- Default Value: - 0- Flags: - READABLE,- WRITABLE- Time the request was executed, in microseconds 
- 
Infinity.AdoptedRequest.props.operation¶
- Name: - operation- Type: - Infinity.AdoptedOperation- Default Value: - None- Flags: - READABLE,- WRITABLE,- CONSTRUCT_ONLY- The operation of the request 
- 
Infinity.AdoptedRequest.props.received¶
- Name: - received- Type: - int- Default Value: - 0- Flags: - READABLE,- WRITABLE,- CONSTRUCT_ONLY- Time the request was received, in microseconds 
- 
Infinity.AdoptedRequest.props.type¶
- Name: - type- Type: - Infinity.AdoptedRequestType- Default Value: - Infinity.AdoptedRequestType.DO- Flags: - READABLE,- WRITABLE,- CONSTRUCT_ONLY- The type of the operation 
- 
Infinity.AdoptedRequest.props.user_id¶
- Name: - user-id- Type: - int- Default Value: - 0- Flags: - READABLE,- WRITABLE,- CONSTRUCT_ONLY- The ID of the user that made the request 
- 
Infinity.AdoptedRequest.props.vector¶
- Name: - vector- Type: - Infinity.AdoptedStateVector- Default Value: - None- Flags: - READABLE,- WRITABLE,- CONSTRUCT_ONLY- The vector time at which the request was made