IPSDK  4_1_0_2
IPSDK : Image Processing Software Development Kit
Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | List of all members
ipsdk::processor::BaseProcessor Class Referenceabstract

Base class for processor class. More...

#include <BaseProcessor.h>

Inheritance diagram for ipsdk::processor::BaseProcessor:
ipsdk::core::BaseComplexAction ipsdk::core::BaseAction ipsdk::SerializationObjectWithGuid ipsdk::BaseToolTip ipsdk::BaseSerializationObject ipsdk::BaseDynamicObject 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 ~BaseProcessor ()=0
 Destructor.
 
virtual eProcessorType getProcessorType () const =0
 retrieve processor type
 
BoolResult init (const eProcessorRulePolicy rulePolicy=eProcessorRulePolicy::ePRP_DisableSubRules)
 initialization of object More...
 
const eProcessorRulePolicygetProcessorRulePolicy () const
 retrieve processor rule policy More...
 
std::string getFullInfoStr () const
 retrieve full processor informations string including attributes tooltip, rules and initialization informations More...
 
const BaseRulegetGlobalRule () const
 retrieve global rule associated to processor class More...
 
const ProcessorDispatchPolicygetDispatchPolicy () const
 retrieve dispatch policy associated to processor More...
 
void restrictDispatchPolicy (const ProcessorDispatchPolicy &policy)
 method allowing to restrict dispatch policy associated to processor More...
 
bool isProgressAvailable () const
 method indicating if the processor progression is available More...
 
ipsdk::processor::eProcessorProgressAvailability getProgressAvailability () const
 method indicating the processor progression availability type More...
 
ipsdk::ipUInt64 getTotalNbIterations () const
 method indicating the processor total number of iterations Returns 0 for unknown number of iterations (ITER_ASYNC and REP_ASYNC) More...
 
Processor header
bool existsHeaderKey (const std::string &key) const
 check whether a given key exists into header
 
ItemNames getHeaderKeys () const
 retrieve header key list
 
const BaseDataItemgetHeaderItem (const std::string &key) const
 retrieve a header item given associated key More...
 
BaseDataItemgetHeaderItem (const std::string &key)
 retrieve a header item given associated key More...
 
void addHeaderItem (const std::string &key, const DataItemPtr &pItem)
 add data item to header given associated key More...
 
void removeHeaderItem (const std::string &key)
 remove item from header given associated key More...
 
void clearHeader ()
 check whether a given key exists into header
 
Processor attributes
ipUInt32 getNbAttributes () const
 retrieve number of attributes associated to processor More...
 
const BaseAttributegetAttribute (ipUInt32 index) const
 retrieve an attribute given its index More...
 
BaseAttributegetAttribute (ipUInt32 index)
 retrieve an attribute given its index More...
 
bool existsAttribute (const std::string &attributeName) const
 test whether a given named attribute exists More...
 
StringVector getAttributeNameColl () const
 retrieve attribute names collection More...
 
const BaseAttributegetAttribute (const std::string &attributeName) const
 retrieve an attribute given its name More...
 
BaseAttributegetAttribute (const std::string &attributeName)
 retrieve an attribute given its name More...
 
Processor output attribute initializers
bool hasOutputInitializer (const std::string &attributeName) const
 check whether a given attribute has en output initializer More...
 
const BaseOutputInitializergetOutputInitializer (const std::string &attributeName) const
 retrieve output initializer associated to a given attribute More...
 
- Public Member Functions inherited from ipsdk::core::BaseComplexAction
virtual ~BaseComplexAction ()=0
 Destructor.
 
bool isComplexAction () const
 retrieve action main complexity flag
 
- Public Member Functions inherited from ipsdk::core::BaseAction
virtual ~BaseAction ()=0
 Destructor.
 
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...
 
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

typedef std::vector< AttributePtrAttributeColl
 collection of attributes
 
typedef std::map< std::string, OutputInitializerPtrOutputInitializerColl
 collection of output attribute initializers
 
- Protected Types inherited from ipsdk::core::BaseAction
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

 BaseProcessor ()
 Constructor.
 
virtual BoolResult initDerived (AttributeColl &attributeColl, OutputInitializerColl &outputInitializerColl, ProcessorDispatchPolicy &dispatchPolicy, RulePtr &pGlobalRule, const eProcessorRulePolicy &rulePolicy)=0
 initialization method in derived classes More...
 
- Protected Member Functions inherited from ipsdk::core::BaseComplexAction
 BaseComplexAction ()
 Constructor.
 
ExecResult execInitProcess ()
 method allowing to execute init process
 
ExecResult execEndProcess ()
 method allowing to execute end process
 
- Protected Member Functions inherited from ipsdk::core::BaseAction
 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 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 void clearIntermediateData ()
 method allowing to clear intermediate data for object
 
- 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
 

Protected Attributes

eProcessorProgressAvailability _processorProgressAvailability
 Progression availability.
 
ipUInt32 _nbIter
 expected number of iterations for provider execution (0 if unknown)
 
- Protected Attributes inherited from ipsdk::SerializationObjectWithGuid
Guid _guid
 guid associated to object
 

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
 

Detailed Description

Base class for processor class.

Author
E. Noirfalise
Date
2013/8/8

Member Function Documentation

◆ init()

BoolResult ipsdk::processor::BaseProcessor::init ( const eProcessorRulePolicy  rulePolicy = eProcessorRulePolicy::ePRP_DisableSubRules)

initialization of object

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

◆ getProcessorRulePolicy()

const eProcessorRulePolicy& ipsdk::processor::BaseProcessor::getProcessorRulePolicy ( ) const

retrieve processor rule policy

Exceptions
ipsdk::processor::IPSDKBaseProcessingExceptionif isInit() == false

◆ getFullInfoStr()

std::string ipsdk::processor::BaseProcessor::getFullInfoStr ( ) const

retrieve full processor informations string including attributes tooltip, rules and initialization informations

Exceptions
ipsdk::processor::IPSDKBaseProcessingExceptionif isInit() == false

◆ getHeaderItem() [1/2]

const BaseDataItem& ipsdk::processor::BaseProcessor::getHeaderItem ( const std::string &  key) const

retrieve a header item given associated key

Exceptions
ipsdk::IPSDKBaseDataExceptionif existsItem(itemName) == false

◆ getHeaderItem() [2/2]

BaseDataItem& ipsdk::processor::BaseProcessor::getHeaderItem ( const std::string &  key)

retrieve a header item given associated key

Exceptions
ipsdk::IPSDKBaseDataExceptionif existsItem(itemName) == false

◆ addHeaderItem()

void ipsdk::processor::BaseProcessor::addHeaderItem ( const std::string &  key,
const DataItemPtr pItem 
)

add data item to header given associated key

Exceptions
ipsdk::processor::IPSDKBaseProcessingExceptionif pItem->get() == 0
ipsdk::processor::IPSDKBaseProcessingExceptionif existsHeaderKey(key) == true

◆ removeHeaderItem()

void ipsdk::processor::BaseProcessor::removeHeaderItem ( const std::string &  key)

remove item from header given associated key

insert a new item into map

Exceptions
ipsdk::IPSDKBaseDataExceptionif existsItem(itemName) == false

◆ getNbAttributes()

ipUInt32 ipsdk::processor::BaseProcessor::getNbAttributes ( ) const

retrieve number of attributes associated to processor

Exceptions
ipsdk::processor::IPSDKBaseProcessingExceptionif isInit() == false

◆ getAttribute() [1/4]

const BaseAttribute& ipsdk::processor::BaseProcessor::getAttribute ( ipUInt32  index) const

retrieve an attribute given its index

Exceptions
ipsdk::processor::IPSDKBaseProcessingExceptionif index >= getNbAttributes()

◆ getAttribute() [2/4]

BaseAttribute& ipsdk::processor::BaseProcessor::getAttribute ( ipUInt32  index)

retrieve an attribute given its index

Exceptions
ipsdk::processor::IPSDKBaseProcessingExceptionif index >= getNbAttributes()

◆ existsAttribute()

bool ipsdk::processor::BaseProcessor::existsAttribute ( const std::string &  attributeName) const

test whether a given named attribute exists

Exceptions
ipsdk::processor::IPSDKBaseProcessingExceptionif isInit() == false

◆ getAttributeNameColl()

StringVector ipsdk::processor::BaseProcessor::getAttributeNameColl ( ) const

retrieve attribute names collection

Exceptions
ipsdk::processor::IPSDKBaseProcessingExceptionif isInit() == false

◆ getAttribute() [3/4]

const BaseAttribute& ipsdk::processor::BaseProcessor::getAttribute ( const std::string &  attributeName) const

retrieve an attribute given its name

Exceptions
ipsdk::processor::IPSDKBaseProcessingExceptionif existsAttribute(attributeName) == false

◆ getAttribute() [4/4]

BaseAttribute& ipsdk::processor::BaseProcessor::getAttribute ( const std::string &  attributeName)

retrieve an attribute given its name

Exceptions
ipsdk::processor::IPSDKBaseProcessingExceptionif existsAttribute(attributeName) == false

◆ hasOutputInitializer()

bool ipsdk::processor::BaseProcessor::hasOutputInitializer ( const std::string &  attributeName) const

check whether a given attribute has en output initializer

Exceptions
ipsdk::processor::IPSDKBaseProcessingExceptionif existsAttribute(attributeName) == false

◆ getOutputInitializer()

const BaseOutputInitializer& ipsdk::processor::BaseProcessor::getOutputInitializer ( const std::string &  attributeName) const

retrieve output initializer associated to a given attribute

Exceptions
ipsdk::processor::IPSDKBaseProcessingExceptionif hasOutputInitializer(attributeName) == false

◆ getGlobalRule()

const BaseRule& ipsdk::processor::BaseProcessor::getGlobalRule ( ) const

retrieve global rule associated to processor class

Exceptions
ipsdk::processor::IPSDKBaseProcessingExceptionif getProcessorRulePolicy() == eProcessorRulePolicy::ePRP_DisableAll

◆ getDispatchPolicy()

const ProcessorDispatchPolicy& ipsdk::processor::BaseProcessor::getDispatchPolicy ( ) const

retrieve dispatch policy associated to processor

Exceptions
ipsdk::processor::IPSDKBaseProcessingExceptionif isInit() == false

◆ restrictDispatchPolicy()

void ipsdk::processor::BaseProcessor::restrictDispatchPolicy ( const ProcessorDispatchPolicy policy)

method allowing to restrict dispatch policy associated to processor

Note
if dispatch location type are not compatible, previous dispatch location type is left unchanged
Exceptions
ipsdk::processor::IPSDKBaseProcessingExceptionif isInit() == false

◆ isProgressAvailable()

bool ipsdk::processor::BaseProcessor::isProgressAvailable ( ) const

method indicating if the processor progression is available

Exceptions
ipsdk::processor::IPSDKBaseProcessingExceptionif isInit() == false

◆ getProgressAvailability()

ipsdk::processor::eProcessorProgressAvailability ipsdk::processor::BaseProcessor::getProgressAvailability ( ) const

method indicating the processor progression availability type

Exceptions
ipsdk::processor::IPSDKBaseProcessingExceptionif isInit() == false

◆ getTotalNbIterations()

ipsdk::ipUInt64 ipsdk::processor::BaseProcessor::getTotalNbIterations ( ) const

method indicating the processor total number of iterations Returns 0 for unknown number of iterations (ITER_ASYNC and REP_ASYNC)

Exceptions
ipsdk::processor::IPSDKBaseProcessingExceptionif isInit() == false

◆ initDerived()

virtual BoolResult ipsdk::processor::BaseProcessor::initDerived ( AttributeColl attributeColl,
OutputInitializerColl outputInitializerColl,
ProcessorDispatchPolicy dispatchPolicy,
RulePtr pGlobalRule,
const eProcessorRulePolicy rulePolicy 
)
protectedpure virtual

initialization method in derived classes

Returns
false in case of failure

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