CSupplierActivationProxyComp.h
Go to the documentation of this file.
1 #ifndef iinsp_CSupplierActivationProxyComp_included
2 #define iinsp_CSupplierActivationProxyComp_included
3 
4 
5 // ACF includes
7 #include <icomp/CComponentBase.h>
9 
10 // ACF-Solutions includes
12 
13 
14 namespace iinsp
15 {
16 
17 
23  public icomp::CComponentBase,
24  virtual public iinsp::IEnableableSupplier
25 {
26 public:
28 
29  I_BEGIN_COMPONENT(CSupplierActivationProxyComp);
30  I_REGISTER_INTERFACE(iinsp::ISupplier);
31  I_REGISTER_INTERFACE(iinsp::IEnableableSupplier);
32  I_ASSIGN(m_slaveSupplierCompPtr, "SlaveSupplier", "Source supplier to be activated/deactivated", true, "SlaveSupplier");
33  I_ASSIGN_TO(m_slaveSupplierModelCompPtr, m_slaveSupplierCompPtr, true);
34  I_ASSIGN(m_supplierEnabledParamCompPtr, "SupplierActivator", "Enabling parameter used for supplier activation", true, "SupplierActivator");
35  I_ASSIGN_TO(m_supplierEnabledParamModelCompPtr, m_supplierEnabledParamCompPtr, true);
36  I_ASSIGN(m_isStateFixedAttrPtr, "StateFixed", "If enabled, the activation state of suppler cannot be modified from outside", true, false);
37  I_END_COMPONENT;
38 
40 
41  // reimplemented (iinsp::IEnableableSupplier)
42  virtual bool SetSupplierEnabled(bool isEnabled = true);
43  virtual bool IsSupplierEnabled() const;
44  virtual bool IsStateFixed() const;
45 
46  // reimplemented (iinsp::ISupplier)
47  virtual int GetWorkStatus() const;
48  virtual imod::IModel* GetWorkStatusModel() const;
49  virtual void InvalidateSupplier();
50  virtual void EnsureWorkInitialized();
51  virtual void EnsureWorkFinished();
52  virtual void ClearWorkResults();
53  virtual const ilog::IMessageContainer* GetWorkMessages(int messageType) const;
54  virtual iprm::IParamsSet* GetModelParametersSet() const;
55 
56 protected:
57  // reimplemented (icomp::CComponentBase)
58  virtual void OnComponentCreated();
59  virtual void OnComponentDestroyed();
60 
61 private:
62  I_REF(iinsp::ISupplier, m_slaveSupplierCompPtr);
63  I_REF(imod::IModel, m_slaveSupplierModelCompPtr);
64  I_REF(iprm::IEnableableParam, m_supplierEnabledParamCompPtr);
65  I_REF(imod::IModel, m_supplierEnabledParamModelCompPtr);
66  I_ATTR(bool, m_isStateFixedAttrPtr);
67 
68  imod::CModelUpdateBridge m_updateBridge;
69 };
70 
71 
72 } // namespace iinsp
73 
74 
75 #endif // !iinsp_CSupplierActivationProxyComp_included
76 
77 
virtual void EnsureWorkInitialized()
Force the supplier to initialize its work.
virtual int GetWorkStatus() const
Get status of last work.
virtual bool IsStateFixed() const
Get true if the state of the supplier is fixed and cannot be changed.
virtual void EnsureWorkFinished()
Ensure that all objects are produced.
virtual void ClearWorkResults()
Remove all stored work results.
virtual bool IsSupplierEnabled() const
Get activation state of the supplier.
virtual void InvalidateSupplier()
Called to signalize that this supplier is invalid.
virtual imod::IModel * GetWorkStatusModel() const
Get access to the status model of the supplier.
virtual bool SetSupplierEnabled(bool isEnabled=true)
Set supplier's activation state.
virtual const ilog::IMessageContainer * GetWorkMessages(int messageType) const
Get messages outputted by this work.
Extension of ISupplier interface with possiblity to activate/deactivate supplier's producing logic...
Base interface for suppliers providing calculating of objects on demand ("pull data" model)...
Definition: ISupplier.h:22
virtual iprm::IParamsSet * GetModelParametersSet() const
Get parameter set using by this supplier.

© 2007-2017 Witold Gantzke and Kirill Lepskiy