ICF 3.1.1.10
Technical documentation of ICF Libraries
iinsp::CSupplierCompBase Class Referenceabstract

Base implementation of interface iinsp::ISupplier for iinsp::TSupplierCompWrap. More...

#include <CSupplierCompBase.h>

Inheritance diagram for iinsp::CSupplierCompBase:
Collaboration diagram for iinsp::CSupplierCompBase:

Classes

class  Status
 
class  Timer
 

Public Types

enum  MessageId { MI_DURATION_TIME = 0x077a1b , MI_GEOMETRICAL_RESULT , MI_SUPPLIER_RESULTS_STATUS , MI_INTERMEDIATE }
 ID of messages. More...
 
typedef ilog::CLoggerComponentBase BaseClass
 
- Public Types inherited from ilog::TLoggerCompWrap< Base >
enum  MessageId { MI_BAD_DEPENDENCY = 0x8a340 }
 
typedef Base BaseClass
 
typedef ilog::CLoggerBase BaseClass2
 
- Public Types inherited from iinsp::ISupplier
enum  WorkStatus {
  WS_INVALID , WS_INIT , WS_LOCKED , WS_OK ,
  WS_CANCELED , WS_FAILED
}
 
enum  ChangeFlags { CF_SUPPLIER_RESULTS = 0x6326415 }
 Data model change notification flags. More...
 
enum  MessageContainerType { MCT_RESULTS , MCT_TEMP , MTC_LAST = MCT_TEMP }
 
- Public Types inherited from istd::IChangeable
enum  ChangeFlags {
  CF_ICF_INTERNAL = 0 , CF_ALL_DATA , CF_ANY , CF_DESTROYING ,
  CF_DELEGATED , CF_NO_UNDO
}
 Data model change notification flags. More...
 
enum  SupportedOperations {
  SO_NONE = 0 , SO_OBSERVE = 1 << 0 , SO_COPY = 1 << 1 , SO_CLONE = 1 << 2 ,
  SO_COMPARE = 1 << 3 , SO_RESET = 1 << 4 , SO_CHANGE_LOCK = 1 << 5
}
 Flags for supported operations. More...
 
enum  CompatibilityMode { CM_STRICT , CM_WITHOUT_REFS , CM_WITH_REFS , CM_CONVERT }
 Control how relationship betweeen objects are interpreted. More...
 

Public Member Functions

 CSupplierCompBase ()
 
int GetWorkStatus () const override
 Get status of last work.
 
imod::IModelGetWorkStatusModel () const override
 Get access to the status model of the supplier.
 
void InvalidateSupplier () override
 Called to signalize that this supplier is invalid.
 
void EnsureWorkInitialized () override
 Force the supplier to initialize its work.
 
void EnsureWorkFinished () override
 Ensure that all objects are produced.
 
void ClearWorkResults () override
 Remove all stored work results.
 
const ilog::IMessageContainerGetWorkMessages (int containerType) const override
 Get messages outputted by this work.
 
iprm::IParamsSetGetModelParametersSet () const override
 Get parameter set using by this supplier.
 
- Public Member Functions inherited from ilog::CLoggerBase
 CLoggerBase ()
 
const QByteArray & GetVerboseSenderId () const
 Get sender ID for verbose messages.
 
void SetVerboseSenderId (const QByteArray &id)
 Set sender ID for verbose messages.
 
void SetLogPtr (ilog::IMessageConsumer *logPtr) override
 Install log.
 
ilog::IMessageConsumerGetLogPtr () const override
 Get log.
 
- Public Member Functions inherited from ilog::ILoggable
- Public Member Functions inherited from iinsp::ISupplier
- Public Member Functions inherited from istd::IChangeable
virtual int GetSupportedOperations () const
 Get set of flags for supported operations.
 
virtual bool CopyFrom (const IChangeable &object, CompatibilityMode mode=CM_WITHOUT_REFS)
 Copy this object from another one.
 
virtual bool IsEqual (const IChangeable &object) const
 Compare this object with another object.
 
virtual std::unique_ptr< IChangeableCloneMe (CompatibilityMode mode=CM_WITHOUT_REFS) const
 Make a copy of this object.
 
virtual bool ResetData (CompatibilityMode mode=CM_WITHOUT_REFS)
 Reset data to its default state.
 
virtual QMutex * GetChangesLock () const
 Get mutex beeing locked during changes, if available.
 
virtual void BeginChanges (const ChangeSet &changeSet)
 Starts the change transaction.
 
virtual void EndChanges (const ChangeSet &changeSet)
 Ends the change transaction.
 
virtual void BeginChangeGroup (const ChangeSet &changeSet)
 Starts group of changes.
 
virtual void EndChangeGroup (const ChangeSet &changeSet)
 Ends group of changes.
 

Protected Types

typedef imod::TModelWrap< StatusStatusModel
 
typedef imod::TModelWrap< ilog::CMessageContainerMessageContainer
 

Protected Member Functions

virtual bool InitializeWork ()
 Called if the new work should be initialized.
 
virtual void OnParametersChanged ()
 Called if the supplier parameters was changed.
 
virtual void RegisterSupplierInput (imod::IModel *modelPtr, ISupplier *supplierPtr=nullptr)
 Register supplier input.
 
virtual void UnregisterSupplierInput (imod::IModel *modelPtr)
 Unregister supplier input.
 
virtual QString GetDiagnosticName () const
 Get supplier name used for diagnostic reasons.
 
virtual bool IsMessageContainerSupported (int containerType) const
 Check if message container is supported.
 
virtual void AddMessage (const istd::IInformationProvider *messagePtr, int containerType=MCT_RESULTS) const
 Add ilog::CMessage to the internal message container (also from const functions).
 
void OnComponentCreated () override
 
void OnComponentDestroyed () override
 
virtual int ProcessWorkOutput ()=0
 
- Protected Member Functions inherited from ilog::TLoggerCompWrap< Base >
void DecorateMessage (istd::IInformationProvider::InformationCategory category, int id, int flags, QString &message, QString &messageSource) const override
 Decorate message parts before outputting.
 
void OnComponentCreated () override
 
void OnComponentDestroyed () override
 
- Protected Member Functions inherited from ilog::CLoggerBase
bool IsVerboseEnabled () const
 Check if verbose messages are enabled.
 
bool SendVerboseMessage (const QString &message, const QString &messageSource=QString()) const
 Send verbose message.
 
bool SendInfoMessage (int id, const QString &message, const QString &messageSource=QString(), int flags=0) const
 Send info message to log.
 
bool SendWarningMessage (int id, const QString &message, const QString &messageSource=QString(), int flags=0) const
 Send warning message to log.
 
bool SendErrorMessage (int id, const QString &message, const QString &messageSource=QString(), int flags=0) const
 Send error message to log.
 
bool SendCriticalMessage (int id, const QString &message, const QString &messageSource=QString(), int flags=0) const
 Send critical message to log.
 
bool SendInfoMessageOnce (int id, const QString &message, const QString &messageSource=QString(), int flags=0) const
 Send once info message to log.
 
bool SendWarningMessageOnce (int id, const QString &message, const QString &messageSource=QString(), int flags=0) const
 Send once warning message to log.
 
bool SendErrorMessageOnce (int id, const QString &message, const QString &messageSource=QString(), int flags=0) const
 Send once error message to log.
 
bool SendCriticalMessageOnce (int id, const QString &message, const QString &messageSource=QString(), int flags=0) const
 Send once critical message to log.
 
bool SendUserMessage (const istd::IInformationProvider *messagePtr) const
 Send message with user object.
 
bool AllowMessageOnceAgain (int id)
 Reset message lock.
 
bool IsLogConsumed (const istd::IInformationProvider::InformationCategory *categoryPtr=nullptr, const int *flagsPtr=nullptr) const override
 Check if any log message is consumed.
 
bool SendLogMessage (istd::IInformationProvider::InformationCategory category, int id, const QString &message, const QString &messageSource, int flags=0) const override
 Send any message to log.
 
- Protected Member Functions inherited from istd::ILogger
- Protected Member Functions inherited from istd::IChangeable
virtual void OnBeginChanges ()
 Callback function for begin change event.
 
virtual void OnEndChanges (const ChangeSet &changeSet)
 Callback function for end change event.
 

Protected Attributes

MessageContainer m_messageContainers [MTC_LAST+1]
 
- Protected Attributes inherited from ilog::CLoggerBase
QSet< int > m_onceMessageIds
 

Additional Inherited Members

- Static Public Member Functions inherited from istd::IChangeable
static const ChangeSetGetNoChanges ()
 Get empty set of changes.
 
static const ChangeSetGetAnyChange ()
 Get anonymous change set.
 
static const ChangeSetGetAllChanges ()
 Get anonymous change set.
 
static const ChangeSetGetDelegatedChanges ()
 Get delegated change set.
 

Detailed Description

Base implementation of interface iinsp::ISupplier for iinsp::TSupplierCompWrap.

Definition at line 28 of file CSupplierCompBase.h.

Member Typedef Documentation

◆ BaseClass

◆ MessageContainer

◆ StatusModel

Member Enumeration Documentation

◆ MessageId

ID of messages.

See also
istd::IInformationProvider
Enumerator
MI_DURATION_TIME 

The message contains product calculation time.

MI_GEOMETRICAL_RESULT 

The message describes main geometrical result.

MI_SUPPLIER_RESULTS_STATUS 

The message describes status of the supplier results.

See also
istd::IInformationProvider
MI_INTERMEDIATE 

Id for intermediate results.

Definition at line 39 of file CSupplierCompBase.h.

Constructor & Destructor Documentation

◆ CSupplierCompBase()

iinsp::CSupplierCompBase::CSupplierCompBase ( )

Member Function Documentation

◆ AddMessage()

virtual void iinsp::CSupplierCompBase::AddMessage ( const istd::IInformationProvider * messagePtr,
int containerType = MCT_RESULTS ) const
protectedvirtual

Add ilog::CMessage to the internal message container (also from const functions).

Parameters
messagePtrpointer to the new message object. It cannot be nullptr. It takes owneship of this object.
containerTypetype of message container,
See also
iinsp::ISupplier::MessageContainerType. If this container is not supported, message object will be deleted.

◆ ClearWorkResults()

◆ EnsureWorkFinished()

void iinsp::CSupplierCompBase::EnsureWorkFinished ( )
overridevirtual

Ensure that all objects are produced.

Implements iinsp::ISupplier.

◆ EnsureWorkInitialized()

void iinsp::CSupplierCompBase::EnsureWorkInitialized ( )
overridevirtual

Force the supplier to initialize its work.

First if work is initialized, new calculation can be done.

Implements iinsp::ISupplier.

◆ GetDiagnosticName()

virtual QString iinsp::CSupplierCompBase::GetDiagnosticName ( ) const
protectedvirtual

Get supplier name used for diagnostic reasons.

◆ GetModelParametersSet()

iprm::IParamsSet * iinsp::CSupplierCompBase::GetModelParametersSet ( ) const
overridevirtual

Get parameter set using by this supplier.

The pointed object will not be relocated - no reconnect is needed if it is observed. If the supplier doesn't support parameters, it returns nullptr.

Implements iinsp::ISupplier.

◆ GetWorkMessages()

const ilog::IMessageContainer * iinsp::CSupplierCompBase::GetWorkMessages ( int containerType) const
overridevirtual

Get messages outputted by this work.

The pointed object will not be relocated - no reconnect is needed if it is observed. If the supplier doesn't support list of messages, it returns nullptr.

Parameters
containerTypetype of message container,
See also
MessageContainerType.

Implements iinsp::ISupplier.

◆ GetWorkStatus()

int iinsp::CSupplierCompBase::GetWorkStatus ( ) const
overridevirtual

Get status of last work.

Please note, that this status is not a part of supplier model and can be changed without any notification. If you want to observe the status model of the supplier, please use the GetWorkStatusModel method.

Returns
work status defined in iinsp::ISupplier::WorkStatus.
See also
GetWorkStatusModel

Implements iinsp::ISupplier.

◆ GetWorkStatusModel()

imod::IModel * iinsp::CSupplierCompBase::GetWorkStatusModel ( ) const
overridevirtual

Get access to the status model of the supplier.

Implements iinsp::ISupplier.

◆ InitializeWork()

virtual bool iinsp::CSupplierCompBase::InitializeWork ( )
protectedvirtual

Called if the new work should be initialized.

Default implementation do nothing. It is dedicated to be overridden.

Reimplemented in icam::CCameraSnapSupplierCompBase, icam::CMultiCameraBitmapSupplierComp, icam::CMultiSourceSnapBitmapSupplierComp, icam::CSnapMultiPageBitmapSupplierComp, and iipr::CSearchBasedFeaturesSupplierComp.

◆ InvalidateSupplier()

void iinsp::CSupplierCompBase::InvalidateSupplier ( )
overridevirtual

Called to signalize that this supplier is invalid.

This signal will be transfered to all supplier which are registered as output.

Returns
true, if initialization could be done.

Implements iinsp::ISupplier.

◆ IsMessageContainerSupported()

virtual bool iinsp::CSupplierCompBase::IsMessageContainerSupported ( int containerType) const
protectedvirtual

Check if message container is supported.

Parameters
containerTypetype of message container,
See also
iinsp::ISupplier::MessageContainerType.

◆ OnComponentCreated()

void iinsp::CSupplierCompBase::OnComponentCreated ( )
overrideprotected

◆ OnComponentDestroyed()

void iinsp::CSupplierCompBase::OnComponentDestroyed ( )
overrideprotected

◆ OnParametersChanged()

virtual void iinsp::CSupplierCompBase::OnParametersChanged ( )
protectedvirtual

Called if the supplier parameters was changed.

Default implementation do nothing. It is dedicated to be overridden.

◆ ProcessWorkOutput()

◆ RegisterSupplierInput()

virtual void iinsp::CSupplierCompBase::RegisterSupplierInput ( imod::IModel * modelPtr,
ISupplier * supplierPtr = nullptr )
protectedvirtual

Register supplier input.

Changes of supplier input will force this supplier invalidate. All registered inputs will be unregistered during component destruction (OnComponentDestryed method).

Parameters
modelPtrinput model. It cannot be nullptr.
supplierPtroptional supplier corresponding to the input model. It will be automatically initialized for new work.

◆ UnregisterSupplierInput()

virtual void iinsp::CSupplierCompBase::UnregisterSupplierInput ( imod::IModel * modelPtr)
protectedvirtual

Unregister supplier input.

Changes of this input will no more invalidate this supplier.

Member Data Documentation

◆ m_messageContainers

MessageContainer iinsp::CSupplierCompBase::m_messageContainers[MTC_LAST+1]
mutableprotected

Definition at line 171 of file CSupplierCompBase.h.


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

© Witold Gantzke and Kirill Lepskiy