- Timestamp:
- Apr 20, 2022 11:52:14 AM (3 years ago)
- Location:
- trunk/src/VBox/Main
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/include/UpdateAgentImpl.h
r94648 r94650 41 41 }; 42 42 43 class ATL_NO_VTABLE UpdateAgent 44 : public UpdateAgentWrap 43 class UpdateAgentBase 44 { 45 protected: /* Not directly instancable. */ 46 47 UpdateAgentBase() 48 : m_VirtualBox(NULL) 49 , m(new settings::UpdateAgent) { } 50 51 virtual ~UpdateAgentBase() { } 52 53 public: 54 55 /** @name Pure virtual public methods for internal purposes only 56 * (ensure there is a caller and a read lock before calling them!) 57 * @{ */ 58 virtual HRESULT i_loadSettings(const settings::UpdateAgent &data) = 0; 59 virtual HRESULT i_saveSettings(settings::UpdateAgent &data) = 0; 60 61 virtual HRESULT i_setCheckCount(ULONG aCount) = 0; 62 virtual HRESULT i_setLastCheckDate(const com::Utf8Str &aDate) = 0; 63 /** @} */ 64 65 protected: 66 67 /** @name Pure virtual internal task callbacks. 68 * @{ */ 69 friend UpdateAgentTask; 70 virtual DECLCALLBACK(HRESULT) i_updateTask(UpdateAgentTask *pTask) = 0; 71 /** @} */ 72 73 /** @name Static helper methods. 74 * @{ */ 75 static Utf8Str i_getPlatformInfo(void); 76 /** @} */ 77 78 protected: 79 VirtualBox * const m_VirtualBox; 80 81 /** @name Data members. 82 * @{ */ 83 settings::UpdateAgent *m; 84 85 struct Data 86 { 87 UpdateAgentTaskResult m_lastResult; 88 89 Utf8Str m_strName; 90 bool m_fHidden; 91 UpdateState_T m_enmState; 92 uint32_t m_uOrder; 93 94 Data(void) 95 { 96 m_fHidden = true; 97 m_enmState = UpdateState_Invalid; 98 m_uOrder = UINT32_MAX; 99 } 100 } mData; 101 /** @} */ 102 }; 103 104 class ATL_NO_VTABLE UpdateAgent : 105 public UpdateAgentWrap, 106 public UpdateAgentBase 45 107 { 46 108 public: … … 97 159 virtual HRESULT getLastCheckDate(com::Utf8Str &aData); 98 160 /** @} */ 99 100 /** @name Internal task callbacks.101 * @{ */102 friend UpdateAgentTask;103 virtual DECLCALLBACK(HRESULT) i_updateTask(UpdateAgentTask *pTask) = 0;104 /** @} */105 106 /** @name Static helper methods.107 * @{ */108 static Utf8Str i_getPlatformInfo(void);109 /** @} */110 111 protected:112 VirtualBox * const m_VirtualBox;113 114 /** @name Data members.115 * @{ */116 settings::UpdateAgent *m;117 118 struct Data119 {120 UpdateAgentTaskResult m_lastResult;121 122 Utf8Str m_strName;123 bool m_fHidden;124 UpdateState_T m_enmState;125 uint32_t m_uOrder;126 127 Data(void)128 {129 m_fHidden = true;130 m_enmState = UpdateState_Invalid;131 m_uOrder = UINT32_MAX;132 }133 } mData;134 /** @} */135 161 }; 136 162 … … 155 181 /** @name Implemented (pure) virtual methods from UpdateAgent. 156 182 * @{ */ 157 virtual HRESULT check(ComPtr<IProgress> &aProgress) RT_OVERRIDE;183 HRESULT check(ComPtr<IProgress> &aProgress); 158 184 159 virtual DECLCALLBACK(HRESULT) i_updateTask(UpdateAgentTask *pTask) RT_OVERRIDE;185 DECLCALLBACK(HRESULT) i_updateTask(UpdateAgentTask *pTask); 160 186 /** @} */ 161 187 -
trunk/src/VBox/Main/src-server/UpdateAgentImpl.cpp
r94648 r94650 55 55 { 56 56 public: 57 UpdateAgentTask(UpdateAgent *aThat, Progress *aProgress)57 UpdateAgentTask(UpdateAgentBase *aThat, Progress *aProgress) 58 58 : m_pParent(aThat) 59 59 , m_pProgress(aProgress) … … 67 67 68 68 /** Weak pointer to parent (update agent). */ 69 UpdateAgent 69 UpdateAgentBase *m_pParent; 70 70 /** Smart pointer to the progress object for this job. */ 71 71 ComObjPtr<Progress> m_pProgress; … … 76 76 void UpdateAgentTask::handler(void) 77 77 { 78 UpdateAgent *pUpdateAgent = this->m_pParent;78 UpdateAgentBase *pUpdateAgent = this->m_pParent; 79 79 AssertPtr(pUpdateAgent); 80 80 … … 92 92 *********************************************************************************************************************************/ 93 93 UpdateAgent::UpdateAgent() 94 : m_VirtualBox(NULL)95 , m(new settings::UpdateAgent)96 94 { 97 95 } … … 377 375 378 376 /* static */ 379 Utf8Str UpdateAgent ::i_getPlatformInfo(void)377 Utf8Str UpdateAgentBase::i_getPlatformInfo(void) 380 378 { 381 379 /* Prepare platform report: */
Note:
See TracChangeset
for help on using the changeset viewer.