Changeset 55523 in vbox
- Timestamp:
- Apr 29, 2015 2:33:39 PM (10 years ago)
- svn:sync-xref-src-repo-rev:
- 99882
- Location:
- trunk/src/VBox/Main
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/idl/VirtualBox.xidl
r55505 r55523 22055 22055 <interface 22056 22056 name="IVetoEvent" extends="IEvent" 22057 uuid=" 9a1a4130-69fe-472f-ac10-c6fa25d75007"22057 uuid="7c5e945f-2354-4267-883f-2f417d216519" 22058 22058 wsmap="managed" 22059 22059 > … … 22089 22089 <desc> 22090 22090 Array of reasons for veto provided by different event handlers. 22091 </desc> 22092 </param> 22093 </method> 22094 22095 <method name="addApproval"> 22096 <desc> 22097 Adds an approval on this event. 22098 </desc> 22099 <param name="reason" type="wstring" dir="in"> 22100 <desc> 22101 Reason for approval, could be null or empty string. 22102 </desc> 22103 </param> 22104 </method> 22105 22106 <method name="isApproved"> 22107 <desc> 22108 If this event was approved. 22109 </desc> 22110 <param name="result" type="boolean" dir="return" /> 22111 </method> 22112 22113 <method name="getApprovals"> 22114 <desc> 22115 Current approval reason list, if size is 0 - no approvals. 22116 </desc> 22117 <param name="result" type="wstring" dir="return" safearray="yes"> 22118 <desc> 22119 Array of reasons for approval provided by different event handlers. 22091 22120 </desc> 22092 22121 </param> -
trunk/src/VBox/Main/idl/comimpl.xsl
r53917 r55523 556 556 return mEvent->GetVetos(ComSafeArrayOutArg(aVetos)); 557 557 } 558 STDMETHOD(AddApproval)(IN_BSTR aReason) 559 { 560 return mEvent->AddApproval(aReason); 561 } 562 STDMETHOD(IsApproved)(BOOL *aResult) 563 { 564 return mEvent->IsApproved(aResult); 565 } 566 STDMETHOD(GetApprovals)(ComSafeArrayOut(BSTR, aReasons)) 567 { 568 return mEvent->GetApprovals(ComSafeArrayOutArg(aReasons)); 569 } 558 570 private: 559 571 ComObjPtr<VBoxVetoEvent> mEvent; -
trunk/src/VBox/Main/include/EventImpl.h
r52720 r55523 79 79 HRESULT isVetoed(BOOL *aResult); 80 80 HRESULT getVetos(std::vector<com::Utf8Str> &aResult); 81 HRESULT addApproval(const com::Utf8Str &aReason); 82 HRESULT isApproved(BOOL *aResult); 83 HRESULT getApprovals(std::vector<com::Utf8Str> &aResult); 81 84 82 85 struct Data; -
trunk/src/VBox/Main/src-all/EventImpl.cpp
r53160 r55523 228 228 229 229 typedef std::list<Utf8Str> VetoList; 230 typedef std::list<Utf8Str> ApprovalList; 230 231 struct VBoxVetoEvent::Data 231 232 { … … 236 237 BOOL mVetoed; 237 238 VetoList mVetoList; 239 ApprovalList mApprovalList; 238 240 }; 239 241 … … 272 274 m->mVetoed = FALSE; 273 275 m->mVetoList.clear(); 276 m->mApprovalList.clear(); 274 277 275 278 /* Confirm a successful initialization */ … … 350 353 return S_OK; 351 354 355 } 356 357 HRESULT VBoxVetoEvent::addApproval(const com::Utf8Str &aReason) 358 { 359 // AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); 360 m->mApprovalList.push_back(aReason); 361 return S_OK; 362 } 363 364 HRESULT VBoxVetoEvent::isApproved(BOOL *aResult) 365 { 366 // AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); 367 *aResult = !m->mApprovalList.empty(); 368 return S_OK; 369 } 370 371 HRESULT VBoxVetoEvent::getApprovals(std::vector<com::Utf8Str> &aResult) 372 { 373 // AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); 374 aResult.resize(m->mApprovalList.size()); 375 size_t i = 0; 376 for (ApprovalList::const_iterator it = m->mApprovalList.begin(); it != m->mApprovalList.end(); ++it, ++i) 377 aResult[i] = (*it); 378 return S_OK; 352 379 } 353 380
Note:
See TracChangeset
for help on using the changeset viewer.