IPSDK  4_1_0_2
IPSDK : Image Processing Software Development Kit
Public Member Functions | Protected Types | Protected Member Functions | Friends | List of all members
ipsdk::core::BaseAction Class Referenceabstract

Base class for library actions. More...

#include <BaseAction.h>

Inheritance diagram for ipsdk::core::BaseAction:
ipsdk::SerializationObjectWithGuid ipsdk::BaseToolTip ipsdk::BaseSerializationObject ipsdk::BaseDynamicObject ipsdk::core::BaseComplexAction ipsdk::core::BaseSimpleAction ipsdk::processor::BaseProcessor ipsdk::core::AskForRemoteAction ipsdk::core::RegisterComputerInfo ipsdk::core::RegisterRemoteProvider ipsdk::core::RequestRemoteCancellation ipsdk::core::UpdatePendingAction ipsdk::core::UpdateRemoteAction ipsdk::processor::BaseAsyncProcessor ipsdk::processor::BaseSyncProcessor ipsdk::processor::BaseAsync1Processor ipsdk::processor::BaseAsync2Processor ipsdk::processor::BaseAsync3Processor ipsdk::processor::BaseAsync4Processor ipsdk::processor::BaseIterativeAsync1Processor ipsdk::processor::BaseIterativeAsync2Processor ipsdk::processor::BaseRepeatedAsync1Processor ipsdk::processor::BaseRepeatedAsync2Processor ipsdk::processor::BaseGpuProcessingAlgorithm ipsdk::processor::BaseProcessingAlgorithm

Public Member Functions

virtual ~BaseAction ()=0
 Destructor.
 
virtual bool isComplexAction () const =0
 retrieve action main complexity flag
 
bool isInit () const
 retrieve object initialization flag
 
eExecutionStatus getStatus () const
 check for action execution status More...
 
const ePrioritygetActionPriority () const
 get priority associated to action (default : ePriority::eP_Normal)
 
void setActionPriority (const BasePriority &actionPriority)
 set priority associated to action More...
 
void addCompletionCB (const ActionCompletionCB &completionCB)
 add a completion callback for execution completion notifications More...
 
ExecResult run (const eSynchroType &synchroType=eSynchroType::eST_Default)
 launch execution More...
 
void requestCancellation ()
 action execution cancellation request More...
 
bool isCancellationRequested () const
 check whether a cancellation has been requested More...
 
void waitForCompletion ()
 method allowing to wait for execution end More...
 
ExecResult getActionResult () const
 retrieve action execution result More...
 
double getFullActionDuration () const
 retrieve elasped execution duration between call to run and termination More...
 
double getExecutionActionDuration () const
 retrieve elasped execution duration for action (waits not taken into account) More...
 
BoolResult clear ()
 clear of execution data More...
 
Network interface

These methods are used to handle actions which are sent/received through network operations

bool hasSocketGuid () const
 check whether action has an associated socket guid
 
void setSocketGuid (const Guid &socketGuid)
 set socket guid associated to action
 
const GuidgetSocketGuid () const
 access to socket guid associated to action More...
 
- Public Member Functions inherited from ipsdk::SerializationObjectWithGuid
const GuidgetGuid () const
 retrieve object guid
 
 SerializationObjectWithGuid ()
 
virtual ~SerializationObjectWithGuid ()=0
 
- Public Member Functions inherited from ipsdk::BaseSerializationObject
 BaseSerializationObject ()
 Default constructor.
 
virtual ~BaseSerializationObject ()=0
 destructor
 
- Public Member Functions inherited from ipsdk::BaseDynamicObject
virtual const std::string & getClassName () const
 method allowing to retrieve object class name
 
virtual BaseDynamicObjectcreateNew () const =0
 method allowing to create new instance of current object type
 
virtual DynamicObjectPtr createShared () const =0
 method allowing to create new shared instance of current object type
 
virtual bool hasCopySupport () const =0
 check whether objet has copy support
 
virtual BaseDynamicObjectduplicate () const =0
 method allowing to duplicate current object More...
 
virtual DynamicObjectPtr duplicateShared () const =0
 method allowing shared duplication of current object More...
 
 BaseDynamicObject ()
 
virtual ~BaseDynamicObject ()=0
 
- Public Member Functions inherited from ipsdk::BaseToolTip
virtual const std::string & getObjectName () const =0
 retrieve object name
 
virtual const std::string & getToolTip () const =0
 retrieve object tool tip
 
 BaseToolTip ()
 
virtual ~BaseToolTip ()=0
 

Protected Types

enum  eCleanReason { eCR_Failure, eCR_Exception, eCR_Cancellation }
 Enumerate describing clean reason. More...
 
enum  eExecutionResultDerived { eERD_Success, eERD_Failure, eERD_Canceled, eERD_Running }
 Enumerate describing execution status after call to runDerived. More...
 
typedef ProcessingResult< eExecutionResultDerivedExecResultDerived
 returned type for runDerived method
 

Protected Member Functions

 BaseAction ()
 Constructor.
 
bool isSynchronismForced () const
 retrieve flag indicating whether action should be executed synchronously More...
 
BoolResult initBase (const BasePriority &defaultPriority=NormalPriority())
 base class initialization method This method should be called by derived class during their initialization. Derived class should call this method before any update of derived data More...
 
virtual BoolResult globalCleanDerived ()
 method called to clean execution data in derived class before initialization or during call to clear More...
 
virtual BoolResult cleanOnErrorDerived (const eCleanReason &cleanReason)
 method called to clean execution data after an error in derived class This method is called on three cases : More...
 
virtual ExecResultDerived runDerived ()=0
 internal run method overloaded in derived classes More...
 
virtual void requestCancellationdDerived ()
 action execution cancellation request in derived classes
 
void notifyCompletion (const ExecResult &bCompletionResult)
 method used by derived classes to notify of execution completion after an assynchronous run in derived class More...
 
ExecResultDerived toExecResultDerived (const ExecResult &execResult) const
 method allowing to transform an ExecResult to an ExecResultDerived
 
virtual BoolResult syncInputDataDerived (const Guid &processingSocketGuid)
 method allowing to synchronize input data for object in derived class
 
virtual BoolResult syncOutputDataDerived (const Guid &processingSocketGuid)
 method allowing to synchronize output data for object in derived class
 
virtual void clearInputData ()
 method allowing to clear input data for object
 
virtual void clearIntermediateData ()
 method allowing to clear intermediate data for object
 
virtual void clearOutputData ()
 method allowing to clear output data for object More...
 
- Protected Member Functions inherited from ipsdk::BaseSerializationObject
virtual BoolResult write (BaseOArchive &ar) const
 method allowing to ensure serialization write part for object
 
virtual BoolResult read (BaseIArchive &ar)
 method allowing to ensure serialization read part for object
 
- Protected Member Functions inherited from ipsdk::BaseDynamicObject
virtual void initCtorCopy (const BaseDynamicObject &object)
 
virtual void copy (const BaseDynamicObject &object)
 method allowing to copy data from another object
 

Friends

class LocalActionRequest
 
class RemoteActionRequest
 
class PendingActionRequest
 

Additional Inherited Members

- Static Public Member Functions inherited from ipsdk::BaseSerializationObject
static ipUInt32 getVersion ()
 method allowing to retrieve class version information for serialization
 
- Static Public Member Functions inherited from ipsdk::BaseDynamicObject
static const std::string & getTypeName ()
 method allowing to retrieve name associated to class
 
- Protected Attributes inherited from ipsdk::SerializationObjectWithGuid
Guid _guid
 guid associated to object
 

Detailed Description

Base class for library actions.

Author
E. Noirfalise
Date
2013/12/17

Member Enumeration Documentation

◆ eCleanReason

Enumerate describing clean reason.

Note
This object is associated to a strong enumerate definition
See also
IPSDK_Enum
Enumerator
eCR_Failure 

Clean after an execution failure.

eCR_Exception 

Clean after exception thrown during execution.

eCR_Cancellation 

Clean after a cancellation request.

◆ eExecutionResultDerived

Enumerate describing execution status after call to runDerived.

Note
This object is associated to a strong enumerate definition
See also
IPSDK_Enum
Enumerator
eERD_Success 

Execution is complete and successfull.

eERD_Failure 

Execution failed.

eERD_Canceled 

Execution has been canceled.

eERD_Running 

Execution is running assynchronously.

Member Function Documentation

◆ getStatus()

eExecutionStatus ipsdk::core::BaseAction::getStatus ( ) const

check for action execution status

Exceptions
ipsdk::core::IPSDKCoreExceptionif isInit() == false

◆ setActionPriority()

void ipsdk::core::BaseAction::setActionPriority ( const BasePriority actionPriority)

set priority associated to action

Exceptions
ipsdk::core::IPSDKCoreExceptionif getStatus() != eExecutionStatus::eES_NotStarted

◆ addCompletionCB()

void ipsdk::core::BaseAction::addCompletionCB ( const ActionCompletionCB completionCB)

add a completion callback for execution completion notifications

Exceptions
ipsdk::core::IPSDKCoreExceptionif getStatus() != eExecutionStatus::eES_NotStarted && getStatus() != eExecutionStatus::eES_WaitingForExecution

◆ getSocketGuid()

const Guid& ipsdk::core::BaseAction::getSocketGuid ( ) const

access to socket guid associated to action

Exceptions
ipsdk::core::IPSDKCoreExceptionif hasSocketGuid() == false

◆ run()

ExecResult ipsdk::core::BaseAction::run ( const eSynchroType synchroType = eSynchroType::eST_Default)

launch execution

Exceptions
ipsdk::core::IPSDKCoreExceptionif getStatus() != eExecutionStatus::eES_NotStarted

◆ requestCancellation()

void ipsdk::core::BaseAction::requestCancellation ( )

action execution cancellation request

Exceptions
ipsdk::core::IPSDKCoreExceptionif isInit() == false

◆ isCancellationRequested()

bool ipsdk::core::BaseAction::isCancellationRequested ( ) const

check whether a cancellation has been requested

Exceptions
ipsdk::core::IPSDKCoreExceptionif isInit() == false

◆ waitForCompletion()

void ipsdk::core::BaseAction::waitForCompletion ( )

method allowing to wait for execution end

Exceptions
ipsdk::core::IPSDKCoreExceptionif getStatus() == eExecutionStatus::eES_NotStarted

◆ getActionResult()

ExecResult ipsdk::core::BaseAction::getActionResult ( ) const

retrieve action execution result

Exceptions
ipsdk::core::IPSDKCoreExceptionif getStatus() != eExecutionStatus::eES_Completed

◆ getFullActionDuration()

double ipsdk::core::BaseAction::getFullActionDuration ( ) const

retrieve elasped execution duration between call to run and termination

Exceptions
ipsdk::core::IPSDKCoreExceptionif getActionResult().getResult() != eExecutionResult::eER_Successful

◆ getExecutionActionDuration()

double ipsdk::core::BaseAction::getExecutionActionDuration ( ) const

retrieve elasped execution duration for action (waits not taken into account)

Exceptions
ipsdk::core::IPSDKCoreExceptionif getActionResult().getResult() != eExecutionResult::eER_Successful

◆ clear()

BoolResult ipsdk::core::BaseAction::clear ( )

clear of execution data

Returns
false in case of failure
Exceptions
ipsdk::core::IPSDKCoreExceptionif (isInit() == true) && (getStatus() == eExecutionStatus::eES_WaitingForExecution || getStatus() == eExecutionStatus::eES_Running)

◆ isSynchronismForced()

bool ipsdk::core::BaseAction::isSynchronismForced ( ) const
protected

retrieve flag indicating whether action should be executed synchronously

Exceptions
ipsdk::core::IPSDKCoreExceptionif getStatus() != eExecutionStatus::eES_Running

◆ initBase()

BoolResult ipsdk::core::BaseAction::initBase ( const BasePriority defaultPriority = NormalPriority())
protected

base class initialization method This method should be called by derived class during their initialization. Derived class should call this method before any update of derived data

Returns
result of clean()
Exceptions
ipsdk::core::IPSDKCoreExceptionif (isInit() == true) && (getStatus() == eExecutionStatus::eES_WaitingForExecution || getStatus() == eExecutionStatus::eES_Running)

◆ globalCleanDerived()

virtual BoolResult ipsdk::core::BaseAction::globalCleanDerived ( )
inlineprotectedvirtual

method called to clean execution data in derived class before initialization or during call to clear

After this call object is left un-initialized

Returns
false in case of failure

Reimplemented in ipsdk::core::RegisterComputerInfo, and ipsdk::core::UpdateRemoteAction.

◆ cleanOnErrorDerived()

virtual BoolResult ipsdk::core::BaseAction::cleanOnErrorDerived ( const eCleanReason cleanReason)
inlineprotectedvirtual

method called to clean execution data after an error in derived class This method is called on three cases :

  • Failure of execution
  • An exception has been thrown during execution
  • A cancellation request hes been issued during execution
    Returns
    false in case of failure

◆ runDerived()

virtual ExecResultDerived ipsdk::core::BaseAction::runDerived ( )
protectedpure virtual

◆ notifyCompletion()

void ipsdk::core::BaseAction::notifyCompletion ( const ExecResult bCompletionResult)
protected

method used by derived classes to notify of execution completion after an assynchronous run in derived class

Exceptions
ipsdk::core::IPSDKCoreExceptionif getStatus() != eExecutionStatus::eES_Running

◆ clearOutputData()

virtual void ipsdk::core::BaseAction::clearOutputData ( )
inlineprotectedvirtual

method allowing to clear output data for object

Note
in/out data will also be cleared

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