Version: 8.3.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
SUIT_Study Class Reference

#include <SUIT_Study.h>

Inheritance diagram for SUIT_Study:
Inheritance graph

Signals

void studyModified (SUIT_Study *)
 

Public Member Functions

 SUIT_Study (SUIT_Application *)
 
virtual ~SUIT_Study ()
 
virtual int id () const
 
SUIT_DataObjectroot () const
 
virtual QString studyName () const
 
SUIT_Applicationapplication () const
 
virtual bool isSaved () const
 
virtual bool isModified () const
 
virtual void Modified ()
 
virtual void closeDocument (bool=true)
 
virtual bool openDocument (const QString &)
 
virtual bool createDocument (const QString &)
 
bool saveDocument ()
 
virtual bool saveDocumentAs (const QString &)
 
virtual void update ()
 
virtual void sendChangesNotification ()
 
SUIT_OperationactiveOperation () const
 
virtual void abortAllOperations ()
 
const QList< SUIT_Operation * > & operations () const
 Get all started operations. More...
 
virtual SUIT_OperationblockingOperation (SUIT_Operation *) const
 Verifies whether operation can be activated above already started ones. More...
 
bool start (SUIT_Operation *, const bool check=true)
 Starts operation. More...
 
bool abort (SUIT_Operation *)
 Aborts operation. More...
 
bool commit (SUIT_Operation *)
 Commits operation. More...
 
bool suspend (SUIT_Operation *)
 Commits operation. More...
 
bool resume (SUIT_Operation *)
 Resumes operation. More...
 
virtual void restoreState (int savePoint)
 Restores the study state. More...
 

Protected Member Functions

virtual void setIsSaved (const bool)
 
virtual void setIsModified (const bool)
 
virtual void setRoot (SUIT_DataObject *)
 
virtual void setStudyName (const QString &)
 
virtual void operationStarted (SUIT_Operation *)
 Perform some actions when operation starting. More...
 
virtual void operationAborted (SUIT_Operation *)
 Perform some actions when operation aborted. More...
 
virtual void operationStopped (SUIT_Operation *)
 Perform some actions when operation stopped. More...
 
virtual void operationCommited (SUIT_Operation *)
 Perform some actions when operation commited. More...
 
virtual bool openTransaction ()
 Opens transaction for data modifications. More...
 
virtual bool abortTransaction ()
 Aborts transaction and all performed data modifications. More...
 
virtual bool hasTransaction () const
 Returns true if transaction is opened. More...
 
virtual bool commitTransaction (const QString &=QString())
 Commits transaction and all performed data modifications. More...
 

Private Types

typedef QList< SUIT_Operation * > Operations
 

Private Member Functions

void stop (SUIT_Operation *)
 Stops operation. More...
 

Private Attributes

int myId
 
SUIT_ApplicationmyApp
 
SUIT_DataObjectmyRoot
 
QString myName
 
bool myIsSaved
 
bool myIsModified
 
Operations myOperations
 
bool myBlockChangeState
 

Friends

class SUIT_Operation
 

Detailed Description

Support study management. Object management. Operation management.

Member Typedef Documentation

Constructor & Destructor Documentation

SUIT_Study::SUIT_Study ( SUIT_Application app)

Constructor.

References myId, and myRoot.

SUIT_Study::~SUIT_Study ( )
virtual

Destructor.

References myRoot.

Member Function Documentation

bool SUIT_Study::abort ( SUIT_Operation theOp)
Parameters
theOp- operation to be aborted
Returns
true if operation is aborted successfully

Verifies whether operation already started and aborts it in this case (sets execution status to Rejected and stops operation)

References SUIT_Operation::aborted(), SUIT_Operation::abortOperation(), myOperations, operationAborted(), SUIT_Operation::Rejected, SUIT_Operation::setExecStatus(), and stop().

void SUIT_Study::abortAllOperations ( )
virtual

*Abort all operations.

References myBlockChangeState, and myOperations.

bool SUIT_Study::abortTransaction ( )
protectedvirtual

Reimplemented in CAF_Study.

SUIT_Operation * SUIT_Study::activeOperation ( ) const
Return values
activeoperation.

References myOperations.

SUIT_Application * SUIT_Study::application ( ) const
Return values
Application.

References myApp.

SUIT_Operation * SUIT_Study::blockingOperation ( SUIT_Operation theOp) const
virtual
Parameters
theOp- operation to be checked
Returns
NULL if operation can be activated, pointer to operation which denies starting tested operation

Verifies whether operation can be activated above already started ones. This method is called from SUIT_Study::start() and SUIT_Study::resume() methods.

References SUIT_Operation::isGranted(), SUIT_Operation::isValid(), and myOperations.

void SUIT_Study::closeDocument ( bool  = true)
virtual

*Close document. NOT IMPLEMENTED.

Reimplemented in LightApp_Study, SalomeApp_Study, CAF_Study, and CAM_Study.

bool SUIT_Study::commit ( SUIT_Operation theOp)
Parameters
theOp- operation to be committed
Returns
true if operation is committed successfully

Verifies whether operation already started and commits it in this case (sets execution status to Accepted and stops operation)

References SUIT_Operation::Accepted, SUIT_Operation::commitOperation(), SUIT_Operation::committed(), myOperations, operationCommited(), SUIT_Operation::setExecStatus(), stop(), and studyModified().

bool SUIT_Study::commitTransaction ( const QString &  = QString())
protectedvirtual

Reimplemented in CAF_Study.

bool SUIT_Study::createDocument ( const QString &  )
virtual

Custom document initialization to be performed
within onNewDoc() handler can be put here

Reimplemented in LightApp_Study, SalomeApp_Study, and CAF_Study.

bool SUIT_Study::hasTransaction ( ) const
protectedvirtual

Reimplemented in CAF_Study.

int SUIT_Study::id ( ) const
virtual
Return values
studyid.

Reimplemented in SalomeApp_Study.

References myId.

bool SUIT_Study::isModified ( ) const
virtual
Return values
\ctrue - if study modified, else false.

Reimplemented in LightApp_Study, SalomeApp_Study, and CAF_Study.

References myIsModified.

bool SUIT_Study::isSaved ( ) const
virtual
Return values
\ctrue - if study saved, else false.

Reimplemented in LightApp_Study, SalomeApp_Study, and CAF_Study.

References myIsSaved.

void SUIT_Study::Modified ( )
virtual

Set study modified to on.

Reimplemented in SalomeApp_Study.

References sendChangesNotification(), and setIsModified().

bool SUIT_Study::openDocument ( const QString &  fileName)
virtual

Open document. Sets file name. return true.

Reimplemented in LightApp_Study, CAF_Study, and SalomeApp_Study.

References myIsModified, myIsSaved, and myName.

bool SUIT_Study::openTransaction ( )
protectedvirtual

Reimplemented in CAF_Study.

void SUIT_Study::operationAborted ( SUIT_Operation op)
protectedvirtual
const QList< SUIT_Operation * > & SUIT_Study::operations ( ) const
Returns
List of all started operations

References myOperations.

void SUIT_Study::operationStarted ( SUIT_Operation op)
protectedvirtual
void SUIT_Study::operationStopped ( SUIT_Operation )
protectedvirtual
void SUIT_Study::restoreState ( int  savePoint)
virtual

Reimplemented in SalomeApp_Study.

bool SUIT_Study::resume ( SUIT_Operation theOp)
Parameters
theOp- operation to be resumed
Returns
true if operation is aborted successfully

Verifies whether operation already started but suspended and resumesit in this case.

References blockingOperation(), myOperations, SUIT_Operation::resumed(), SUIT_Operation::resumeOperation(), SUIT_Operation::Running, SUIT_Operation::setState(), SUIT_Operation::state(), and suspend().

SUIT_DataObject * SUIT_Study::root ( ) const
Return values
rootdata object.

References myRoot.

bool SUIT_Study::saveDocument ( )
Return values
\ctrue - if document saved successful, else false.

References myName, and saveDocumentAs().

bool SUIT_Study::saveDocumentAs ( const QString &  fileName)
virtual

Save document as fileName. Set file name.

Reimplemented in LightApp_Study, SalomeApp_Study, and CAF_Study.

References myIsModified, myIsSaved, and myName.

void SUIT_Study::sendChangesNotification ( )
virtual

Emit study modified.

References studyModified().

void SUIT_Study::setIsModified ( const bool  on)
protectedvirtual

Set study modified to on.

References myIsModified.

void SUIT_Study::setIsSaved ( const bool  on)
protectedvirtual

Set study saved to on.

References myIsSaved.

void SUIT_Study::setRoot ( SUIT_DataObject obj)
protectedvirtual

Set root object.

References myRoot, obj, and SUIT_DataObject::reparentChildren().

void SUIT_Study::setStudyName ( const QString &  name)
protectedvirtual

Set study name.

References myName.

bool SUIT_Study::start ( SUIT_Operation theOp,
const bool  toCheck = true 
)
Parameters
theOp- operation to be started
toCheck- if parameters is equal true then checking performed whether all already started operations allow to start this operation above them (default value is true
Returns
true if operation is started, false otherwise

Verifies whether theOp operation can be started above already started ones (if toCheck parameter is equal true) and starts it

References activeOperation(), application(), blockingOperation(), SUIT_Operation::isReadyToStart(), myOperations, operationStarted(), SUIT_MessageBox::question(), SUIT_Operation::Rejected, SUIT_Operation::Running, SUIT_Operation::setExecStatus(), SUIT_Operation::setState(), SUIT_Operation::setStudy(), SUIT_Operation::started(), SUIT_Operation::startOperation(), SUIT_Operation::Suspended, and SUIT_Operation::suspendOperation().

void SUIT_Study::stop ( SUIT_Operation theOp)
private
Parameters
theOp- operation to be stopped

Stops operation. This private method is called from abort() and commit() ones to perform common actions when operation is stopped

References blockingOperation(), myOperations, operationStopped(), resume(), SUIT_Operation::setState(), SUIT_Operation::stopOperation(), SUIT_Operation::stopped(), and SUIT_Operation::Waiting.

void SUIT_Study::studyModified ( SUIT_Study )
signal
QString SUIT_Study::studyName ( ) const
virtual
Return values
studyname

Reimplemented in SalomeApp_Study.

References myName.

bool SUIT_Study::suspend ( SUIT_Operation theOp)
Parameters
theOp- operation to be committed
Returns
true if operation is suspended successfully

Verifies whether operation already started and suspends it in this case. Operations ususlly are suspended to start other one above them.

References myOperations, SUIT_Operation::setState(), SUIT_Operation::state(), SUIT_Operation::Suspended, SUIT_Operation::suspended(), and SUIT_Operation::suspendOperation().

void SUIT_Study::update ( )
virtual

Update study. NOT IMPLEMENTED HERE.

Friends And Related Function Documentation

friend class SUIT_Operation
friend

Member Data Documentation

SUIT_Application* SUIT_Study::myApp
private
bool SUIT_Study::myBlockChangeState
private
int SUIT_Study::myId
private
bool SUIT_Study::myIsModified
private
bool SUIT_Study::myIsSaved
private
QString SUIT_Study::myName
private
Operations SUIT_Study::myOperations
private
SUIT_DataObject* SUIT_Study::myRoot
private

The documentation for this class was generated from the following files: