Base class for all operations.
More...
#include <SUIT_Operation.h>
Base class for all operations. If you perform an action it is reasonable to create operation intended for this. This is a base class for all operations which provides mechanism for correct starting operations, starting operations above already started ones, committing operations and so on. To create own operation it is reasonable to inherit it from this class and redefines virtual methods to provide own behavior Main virtual methods are
Enum describes execution status of operation. Execution status often used after ending work of operation which was started from this one. In this case this operation can ask previously started operation whether it finished successfully.
Enumerator |
---|
Rejected |
Operation has not performed any action (modification of data model for example)
|
Accepted |
Operation has performed an actions and must be stopped.
|
Enum describes setting of the operation.
Enumerator |
---|
None |
None options.
|
Transaction |
Automatically open (commit/abort) transaction during start (commit/abort).
|
Enum describes state of operation
Enumerator |
---|
Waiting |
Operation is not used (it is not run or suspended)
|
Running |
Operation is started.
|
Suspended |
Operation is started but suspended (other operation is performed above it)
|
- Parameters
-
Constructs an empty operation. Constructor should work very fast because many operators may be created after starting application but only several from them may be used. As result this constructor stores given application in myApp field and set Waiting status.
SUIT_Operation::~SUIT_Operation |
( |
| ) |
|
|
virtual |
void SUIT_Operation::abort |
( |
| ) |
|
|
slot |
void SUIT_Operation::abortOperation |
( |
| ) |
|
|
protectedvirtual |
bool SUIT_Operation::abortTransaction |
( |
| ) |
|
|
protectedvirtual |
- Returns
- Pointer to application
Gets application for this operation
References myApp.
void SUIT_Operation::callSlot |
( |
| ) |
|
|
signal |
void SUIT_Operation::clearFlags |
( |
const int |
f | ) |
|
- Parameters
-
f | - flags of operation to be cleared |
Clears flags of operation (see Flags enumeration)
References myFlags.
void SUIT_Operation::commit |
( |
| ) |
|
|
slot |
void SUIT_Operation::commitOperation |
( |
| ) |
|
|
protectedvirtual |
bool SUIT_Operation::commitTransaction |
( |
const QString & |
name = QString() | ) |
|
|
protectedvirtual |
int SUIT_Operation::execStatus |
( |
| ) |
const |
- Returns
- Execution status
Gets execution status
References myExecStatus.
bool SUIT_Operation::hasTransaction |
( |
| ) |
const |
|
protectedvirtual |
bool SUIT_Operation::isActive |
( |
| ) |
const |
- Returns
true
if operation is active, false
otherwise
Verifies whether operation is an active on. Returns true
if this operator is active for study
References SUIT_Study::activeOperation(), and study().
bool SUIT_Operation::isGranted |
( |
| ) |
const |
|
virtual |
- Returns
- Returns
true
if current operation must not be checked for ActiveOperation->IsValid( this )
This method must be redefined in derived operation if operation of derived class must be always can start above any launched one. Default implementation returns false
, so it is being checked for IsValid, but some operations may overload IsGranted() In this case they will always start, no matter what operation is running.
bool SUIT_Operation::isReadyToStart |
( |
| ) |
const |
|
protectedvirtual |
- Returns
true
if operation is ready to start
Default implementation returns true
. Redefine this method to add own verifications
bool SUIT_Operation::isRunning |
( |
| ) |
const |
- Returns
true
if operation is active, false
otherwise
Verifies whether operation is an running. Returns true
if state of operator is Running
References Running, and state().
- Parameters
-
theOtherOp | - other operation |
- Returns
- Returns
true
if the given operator is valid for this one
Verifies whether given operator is valid for this one (i.e. can be started "above" this operator)
bool SUIT_Operation::openTransaction |
( |
| ) |
|
|
protectedvirtual |
QString SUIT_Operation::operationName |
( |
| ) |
const |
|
virtual |
Returns string name of the operation. This name will be used for automatically commited transaction.
void SUIT_Operation::resume |
( |
| ) |
|
|
slot |
void SUIT_Operation::resumeOperation |
( |
| ) |
|
|
protectedvirtual |
- Parameters
-
theApp | - application for this operation |
Gets application for this operation
References myApp.
void SUIT_Operation::setExecStatus |
( |
const int |
theVal | ) |
|
|
protected |
- Parameters
-
theStatus | - execution status |
Sets myExecStatus to the given value
References myExecStatus.
void SUIT_Operation::setFlags |
( |
const int |
f | ) |
|
- Parameters
-
f | - flags of operation to be set |
Sets flags of operation (see Flags enumeration)
References myFlags.
- Parameters
-
theReceiver | - object containing slot |
theSlot | - slot of theReceiver object |
- Returns
true
if slot was connected successfully, false
otherwise
Sets slot which is called when operation is started. There is no point in using this method. It would be better to inherit own operator from base one and redefine startOperation method
References callSlot().
- Parameters
-
theState | - state of operation to be set |
Sets state of operation (see OperationState enumeration)
References myState.
void SUIT_Operation::setStudy |
( |
SUIT_Study * |
theStudy | ) |
|
|
virtual |
- Parameters
-
theStudy | - study corresponding to this operation |
Sets study corresponding to this operation i.e. study which starts this operation.
References myStudy.
void SUIT_Operation::start |
( |
| ) |
|
|
slot |
Public slot. Verifies whether operation can be started and starts operation. This slot is not virtual and cannot be redefined. Redefine startOperation method to change behavior of operation. There is no point in using this method. It would be better to inherit own operator from base one and redefine startOperation method instead.
References SUIT_Study::start(), started(), startOperation(), and study().
void SUIT_Operation::startOperation |
( |
| ) |
|
|
protectedvirtual |
- Returns
- Value from OperationState enumeration
Gets state of operation (see OperationState enumeration)
References myState.
void SUIT_Operation::stopOperation |
( |
| ) |
|
|
protectedvirtual |
Virtual method called when operation stopped - comitted or aborted.
- Returns
- Pointer to study
Get study corresponding to this operation i.e. study which starts this operation.
References myStudy.
void SUIT_Operation::suspend |
( |
| ) |
|
|
slot |
void SUIT_Operation::suspendOperation |
( |
| ) |
|
|
protectedvirtual |
bool SUIT_Operation::testFlags |
( |
const int |
f | ) |
const |
- Parameters
-
f | - flags of operation to be tested |
Returns true
if the specified flags setted in the operation (see Flags enumeration)
References myFlags.
int SUIT_Operation::myFlags |
|
private |
The documentation for this class was generated from the following files: