CAF_Operation Class Reference

#include <CAF_Operation.h>

Inheritance diagram for CAF_Operation:

Inheritance graph

Public Types

enum  OperationState { Waiting, Running, Suspended }
enum  ExecStatus { Rejected, Accepted }
enum  Flags { None = 0x00, Transaction = 0x01 }

Public Slots

void start ()
 Starts operation.
void abort ()
 Aborts operation.
void commit ()
 Commits operation.
void resume ()
 Resumes operation.
void suspend ()
 Suspend operation.

Signals

void started (SUIT_Operation *)
void aborted (SUIT_Operation *)
void committed (SUIT_Operation *)
void stopped (SUIT_Operation *)
void resumed (SUIT_Operation *)
void suspended (SUIT_Operation *)
void callSlot ()

Public Member Functions

 CAF_Operation (SUIT_Application *)
virtual ~CAF_Operation ()
OperationState state () const
 Gets state of operation.
bool isActive () const
 Verifies whether operation is an active for study.
bool isRunning () const
 Verifies whether operation is an runned one (state()==Running).
SUIT_Studystudy () const
 Returns operation study.
virtual void setStudy (SUIT_Study *theStudy)
 Sets operation study.
SUIT_Applicationapplication () const
 Gets application.
virtual void setApplication (SUIT_Application *theApp)
 Sets application.
virtual bool isValid (SUIT_Operation *theOtherOp) const
 Verifies whether given operator is valid for this one.
virtual bool isGranted () const
 Verifies whether this operator can be always started above any already runnig one.
bool setSlot (const QObject *theReceiver, const char *theSlot)
 Sets slot which is called when operation is started.
void setFlags (const int)
 Sets the flags of operation.
void clearFlags (const int)
 Clears the flags of operation.
bool testFlags (const int) const
 Test the flags of operation.
virtual QString operationName () const
 Name of the operation.

Protected Member Functions

 Handle (TDocStd_Document) stdDoc() const
void start (SUIT_Operation *, const bool=false)
 Starts operator above this one.
virtual bool isReadyToStart () const
 Verifies whether operator is ready to start.
virtual void stopOperation ()
 Virtual method called when operation is started.
virtual void startOperation ()
 Virtual method called when operation is started.
virtual void abortOperation ()
 Virtual method called when operation aborted.
virtual void commitOperation ()
 Virtual method called when operation committed.
virtual void resumeOperation ()
 Virtual method called when operation resumed.
virtual void suspendOperation ()
 Virtual method called when operation suspended.
virtual bool openTransaction ()
 Opens transaction for data modifications.
virtual bool abortTransaction ()
 Aborts transaction and all performed data modifications.
virtual bool hasTransaction () const
 Returns TRUE if transaction is opened.
virtual bool commitTransaction (const QString &=QString::null)
 Commits transaction and all performed data modifications.
int execStatus () const
 Gets execution status.
void setExecStatus (const int)
 Sets execution status.
void setState (const OperationState)
 Sets state of operation.

Detailed Description

Base operation for all operations used in CAF package Operation has link to OCC OCAF std document


Member Enumeration Documentation

enum SUIT_Operation::OperationState [inherited]
 

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).

enum SUIT_Operation::ExecStatus [inherited]
 

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 SUIT_Operation::Flags [inherited]
 

Enum describes setting of the operation.

Enumerator:
None  None options.
Transaction  Automatically open (commit/abort) transaction during start (commit/abort).


Constructor & Destructor Documentation

CAF_Operation::CAF_Operation SUIT_Application theApp  ) 
 

Default constructor

CAF_Operation::~CAF_Operation  )  [virtual]
 

Destructor


Member Function Documentation

CAF_Operation.Handle TDocStd_Document   )  const [protected]
 

SUIT_Operation::OperationState SUIT_Operation::state  )  const [inherited]
 

Returns:
Value from OperationState enumeration
Gets state of operation (see OperationState enumeration)

bool SUIT_Operation::isActive  )  const [inherited]
 

Returns:
TRUE if operation is active, FALSE otherwise
Verifies whether operation is an active on. Returns TRUE if this operator is active for study

bool SUIT_Operation::isRunning  )  const [inherited]
 

Returns:
TRUE if operation is active, FALSE otherwise
Verifies whether operation is an running. Returns TRUE if state of operator is Running

SUIT_Study * SUIT_Operation::study  )  const [inherited]
 

Returns:
Pointer to study
Get study corresponding to this operation i.e. study which starts this operation.

void SUIT_Operation::setStudy SUIT_Study theStudy  )  [virtual, inherited]
 

Parameters:
theStudy - study corresponding to this operation
Sets study corresponding to this operation i.e. study which starts this operation.

SUIT_Application * SUIT_Operation::application  )  const [inherited]
 

Returns:
Pointer to application
Gets application for this operation

void SUIT_Operation::setApplication SUIT_Application theApp  )  [virtual, inherited]
 

Parameters:
theApp - application for this operation
Gets application for this operation

bool SUIT_Operation::isValid SUIT_Operation theOtherOp  )  const [virtual, inherited]
 

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::isGranted  )  const [virtual, inherited]
 

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::setSlot const QObject theReceiver,
const char *  theSlot
[inherited]
 

Parameters:
theReceiver - object containing slot
theSlot - slot of theReceiver object
Returns:
TR 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

void SUIT_Operation::setFlags const   int  )  [inherited]
 

Parameters:
f - flags of operation to be set
Sets flags of operation (see Flags enumeration)

void SUIT_Operation::clearFlags const   int  )  [inherited]
 

Parameters:
f - flags of operation to be cleared
Clears flags of operation (see Flags enumeration)

bool SUIT_Operation::testFlags const   int  )  const [inherited]
 

Parameters:
f - flags of operation to be tested
Returns TRUE if the specified flags setted in the operation (see Flags enumeration)

QString SUIT_Operation::operationName  )  const [virtual, inherited]
 

Returns string name of the operation. This name will be used for automatically commited transaction.

void SUIT_Operation.started SUIT_Operation  )  [signal, inherited]
 

void SUIT_Operation.aborted SUIT_Operation  )  [signal, inherited]
 

void SUIT_Operation.committed SUIT_Operation  )  [signal, inherited]
 

void SUIT_Operation.stopped SUIT_Operation  )  [signal, inherited]
 

void SUIT_Operation.resumed SUIT_Operation  )  [signal, inherited]
 

void SUIT_Operation.suspended SUIT_Operation  )  [signal, inherited]
 

void SUIT_Operation.callSlot  )  [signal, inherited]
 

void SUIT_Operation::start  )  [slot, inherited]
 

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.

void SUIT_Operation::start SUIT_Operation op,
const   bool = false
[protected, inherited]
 

Parameters:
theOp - operation to be started
Start operator above this one. Use this method if you want to call other operator from this one

void SUIT_Operation::abort  )  [slot, inherited]
 

Public slot. Aborts operation. This slot is not virtual and cannot be redefined. Redefine abortOperation method to change behavior of operation instead

void SUIT_Operation::commit  )  [slot, inherited]
 

Public slot. Commits operation. This slot is not virtual and cannot be redefined. Redefine commitOperation method to change behavior of operation instead

void SUIT_Operation::resume  )  [slot, inherited]
 

Public slot. Resumes operation. This slot is called when operation is resumed after previous suspending. This slot is not virtual and cannot be redefined. Redefine resumeOperation method to change behavior of operation instead

void SUIT_Operation::suspend  )  [slot, inherited]
 

Public slot. Suspend operation. This slot is called when operation is suspended (for starting other one, for example) This slot is not virtual and cannot be redefined. Redefine suspendOperation method to change behavior of operation instead

bool SUIT_Operation::isReadyToStart  )  const [protected, virtual, inherited]
 

Returns:
TRUE if operation is ready to start
Default implementation returns TRUE. Redefine this method to add own verifications

void SUIT_Operation::stopOperation  )  [protected, virtual, inherited]
 

Virtual method called when operation stopped - comitted or aborted.

void SUIT_Operation::startOperation  )  [protected, virtual, inherited]
 

Virtual method called when operation started (see start() method for more description)

Reimplemented in LightApp_Operation, and LightApp_ShowHideOp.

void SUIT_Operation::abortOperation  )  [protected, virtual, inherited]
 

Virtual method called when operation aborted (see abort() method for more description)

Reimplemented in LightApp_Operation.

void SUIT_Operation::commitOperation  )  [protected, virtual, inherited]
 

Virtual method called when operation committed (see commit() method for more description)

Reimplemented in LightApp_Operation.

void SUIT_Operation::resumeOperation  )  [protected, virtual, inherited]
 

Virtual method called when operation resumed (see resume() method for more description)

Reimplemented in LightApp_Operation.

void SUIT_Operation::suspendOperation  )  [protected, virtual, inherited]
 

Virtual method called when operation suspended (see suspend() method for more description)

Reimplemented in LightApp_Operation.

bool SUIT_Operation::openTransaction  )  [protected, virtual, inherited]
 

bool SUIT_Operation::abortTransaction  )  [protected, virtual, inherited]
 

bool SUIT_Operation::hasTransaction  )  const [protected, virtual, inherited]
 

bool SUIT_Operation::commitTransaction const QString &  = QString::null  )  [protected, virtual, inherited]
 

int SUIT_Operation::execStatus  )  const [protected, inherited]
 

Returns:
Execution status
Gets execution status

void SUIT_Operation::setExecStatus const   int  )  [protected, inherited]
 

Parameters:
theStatus - execution status
Sets myExecStatus to the given value

void SUIT_Operation::setState const   OperationState  )  [protected, inherited]
 

Parameters:
theState - state of operation to be set
Sets state of operation (see OperationState enumeration)