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

Base class for action providers. More...

#include <BaseActionProvider.h>

Inheritance diagram for ipsdk::core::BaseActionProvider:
ipsdk::core::RemoteActionProvider ipsdk::core::SingleActionProvider ipsdk::processor::BaseProcessorDispatcher ipsdk::processor::BaseDynamicProcessorDispatcher ipsdk::processor::BaseStaticProcessorDispatcher ipsdk::processor::DynamicProcessorDispatcher< TProcessor > ipsdk::processor::StaticProcessorDispatcher< TProcessor >

Public Member Functions

bool isInit () const
 retrieve object initialization flag
 
const GuidgetGuid () const
 retrieve guid associated to provider More...
 
const ePrioritygetActionsPriority () const
 retrieve priority associated to provided actions More...
 
eExecutionStatus getStatus () const
 check for provider execution status More...
 
void addCompletionCB (const ProviderCompletionCB &completionCB)
 add a completion callback associated to action provider More...
 
bool areActionsPending () const
 check whether additional actions potentially are pending More...
 
void waitForCompletion ()
 method allowing to wait for execution completion More...
 
bool waitForCompletion (const boost::chrono::milliseconds &duration)
 method allowing to wait for a given duration for execution completion More...
 
bool waitForCompletion (const boost::chrono::system_clock::time_point &deadLineTime)
 method allowing to wait until a given time point for execution completion More...
 
void requestCancellation ()
 method allowing to request cancellation More...
 
bool isCancellationRequested () const
 check whether a cancellation has been requested More...
 
ExecResult getGlobalResult () const
 retrieve execution global result More...
 
double getFullExecutionDuration () const
 retrieve full execution time More...
 
void clear ()
 clear of object data More...
 
Constructors and destructors
 BaseActionProvider ()
 
virtual ~BaseActionProvider ()=0
 

Protected Member Functions

BoolResult initBase (const BasePriority &actionsPriority, const Guid &providerGuid=Guid())
 base class initialization method More...
 
bool existsRemoteProvider (const Guid &socketGuid)
 check whether a remote provider exists for a given socket guid More...
 
void addRemoteProvider (const Guid &socketGuid)
 define a new remote provider for a given socket guid More...
 
bool unRegisterRemoteProvider (const Guid &socketGuid)
 un register a remote provider for a given socket guid More...
 
BoolResult registerRemoteProvider (const Guid &socketGuid)
 instantly register a new remote provider for a given socket guid More...
 
BoolResult registerRemoteProviders ()
 register remote providers associated to object More...
 
virtual QueryResult queryNextAction (const BaseRequestOrigin &requestOrigin, ActionRequestPtr &pActionRequest, bool &bProcessCompletionCheck, SerializationObjectPtr &pCbAdditionalData)=0
 query for next action to be processed in derived class More...
 
virtual bool hasPendingAction () const =0
 method allowing to check whether actions are pending in derived class
 
virtual BoolResult notifyDerived (const ActionRequestPtr &pActionRequest, const SerializationObjectConstPtr &pCbAdditionalData, bool &bRestartProvider)
 method used to notify of execution completion for a given request More...
 
virtual void clearDerived ()
 clear of data in derived class
 
virtual void requestCancellationDerived ()
 method allowing to request cancellation in derived classes
 

Friends

class processor::BaseAsyncProcessor
 
class ThreadManager
 
class ProviderManager
 
class AskForRemoteAction
 
class UpdateRemoteAction
 
class UpdatePendingAction
 

Detailed Description

Base class for action providers.

Author
E. Noirfalise
Date
2013/12/18

Member Function Documentation

◆ getGuid()

const Guid& ipsdk::core::BaseActionProvider::getGuid ( ) const

retrieve guid associated to provider

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

◆ getActionsPriority()

const ePriority& ipsdk::core::BaseActionProvider::getActionsPriority ( ) const

retrieve priority associated to provided actions

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

◆ getStatus()

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

check for provider execution status

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

◆ addCompletionCB()

void ipsdk::core::BaseActionProvider::addCompletionCB ( const ProviderCompletionCB completionCB)

add a completion callback associated to action provider

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

◆ areActionsPending()

bool ipsdk::core::BaseActionProvider::areActionsPending ( ) const

check whether additional actions potentially are pending

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

◆ waitForCompletion() [1/3]

void ipsdk::core::BaseActionProvider::waitForCompletion ( )

method allowing to wait for execution completion

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

◆ waitForCompletion() [2/3]

bool ipsdk::core::BaseActionProvider::waitForCompletion ( const boost::chrono::milliseconds &  duration)

method allowing to wait for a given duration for execution completion

Exceptions
ipsdk::core::IPSDKCoreExceptionif isInit() == false
Returns
false if time out has been reached

◆ waitForCompletion() [3/3]

bool ipsdk::core::BaseActionProvider::waitForCompletion ( const boost::chrono::system_clock::time_point &  deadLineTime)

method allowing to wait until a given time point for execution completion

Exceptions
ipsdk::core::IPSDKCoreExceptionif isInit() == false
Returns
false if time out has been reached

◆ requestCancellation()

void ipsdk::core::BaseActionProvider::requestCancellation ( )

method allowing to request cancellation

Note
this method doesn't wait for termination, use waitForCompletion for this purpose
Exceptions
ipsdk::core::IPSDKCoreExceptionif isInit() == false

◆ isCancellationRequested()

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

check whether a cancellation has been requested

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

◆ getGlobalResult()

ExecResult ipsdk::core::BaseActionProvider::getGlobalResult ( ) const

retrieve execution global result

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

◆ getFullExecutionDuration()

double ipsdk::core::BaseActionProvider::getFullExecutionDuration ( ) const

retrieve full execution time

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

◆ clear()

void ipsdk::core::BaseActionProvider::clear ( )

clear of object data

Exceptions
ipsdk::core::IPSDKCoreExceptionif isInit() == true && getStatus() == eExecutionStatus::eES_Running

◆ initBase()

BoolResult ipsdk::core::BaseActionProvider::initBase ( const BasePriority actionsPriority,
const Guid providerGuid = Guid() 
)
protected

base class initialization method

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

◆ existsRemoteProvider()

bool ipsdk::core::BaseActionProvider::existsRemoteProvider ( const Guid socketGuid)
protected

check whether a remote provider exists for a given socket guid

Note
this method is protected against concurrent accesses
Exceptions
ipsdk::core::IPSDKCoreExceptionif isInit() == false

◆ addRemoteProvider()

void ipsdk::core::BaseActionProvider::addRemoteProvider ( const Guid socketGuid)
protected

define a new remote provider for a given socket guid

Note
this method is protected against concurrent accesses
remote provider registration will be defered to automatic registerRemoteProviders method call by ThreadManager
Exceptions
ipsdk::core::IPSDKCoreExceptionif getStatus() != eExecutionStatus::eES_NotStarted
ipsdk::core::IPSDKCoreExceptionif existsRemoteProvider(socketGuid) == true

◆ unRegisterRemoteProvider()

bool ipsdk::core::BaseActionProvider::unRegisterRemoteProvider ( const Guid socketGuid)
protected

un register a remote provider for a given socket guid

Warning
this method is NOT protected against concurrent accesses
Exceptions
ipsdk::core::IPSDKCoreExceptionif isInit() == true
Returns
false is remote provider does not exists

◆ registerRemoteProvider()

BoolResult ipsdk::core::BaseActionProvider::registerRemoteProvider ( const Guid socketGuid)
protected

instantly register a new remote provider for a given socket guid

Note
this method is protected against concurrent accesses
Exceptions
ipsdk::core::IPSDKCoreExceptionif getStatus() != eExecutionStatus::eES_Running
ipsdk::core::IPSDKCoreExceptionif existsRemoteProvider(socketGuid) == true
Returns
false in case of failure

◆ registerRemoteProviders()

BoolResult ipsdk::core::BaseActionProvider::registerRemoteProviders ( )
protected

register remote providers associated to object

Exceptions
ipsdk::core::IPSDKCoreExceptionif getStatus() != eExecutionStatus::eES_NotStarted
Returns
false if at least a registration failed

◆ queryNextAction()

virtual QueryResult ipsdk::core::BaseActionProvider::queryNextAction ( const BaseRequestOrigin requestOrigin,
ActionRequestPtr pActionRequest,
bool &  bProcessCompletionCheck,
SerializationObjectPtr pCbAdditionalData 
)
protectedpure virtual

query for next action to be processed in derived class

Note
this method is protected against concurrent accesses
Returns
query result. Returned action request must not be null nor uninitialized

Implemented in ipsdk::core::SingleActionProvider, and ipsdk::core::RemoteActionProvider.

◆ notifyDerived()

virtual BoolResult ipsdk::core::BaseActionProvider::notifyDerived ( const ActionRequestPtr pActionRequest,
const SerializationObjectConstPtr pCbAdditionalData,
bool &  bRestartProvider 
)
inlineprotectedvirtual

method used to notify of execution completion for a given request

Returns
should return false is execution may be stopped for an other reason than execution failure

Reimplemented in ipsdk::core::RemoteActionProvider.


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