- Timestamp:
- Feb 7, 2014 8:05:47 PM (11 years ago)
- Location:
- trunk/src/VBox/Main
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/include/AdditionsFacilityImpl.h
r40212 r50370 4 4 5 5 /* 6 * Copyright (C) 201 2Oracle Corporation6 * Copyright (C) 2014 Oracle Corporation 7 7 * 8 8 * This file is part of VirtualBox Open Source Edition (OSE), as … … 21 21 #include <iprt/time.h> 22 22 23 #include " VirtualBoxBase.h"23 #include "AdditionsFacilityWrap.h" 24 24 25 25 class Guest; 26 26 27 27 class ATL_NO_VTABLE AdditionsFacility : 28 public VirtualBoxBase, 29 VBOX_SCRIPTABLE_IMPL(IAdditionsFacility) 28 public AdditionsFacilityWrap 30 29 { 31 30 public: 32 VIRTUALBOXBASE_ADD_ERRORINFO_SUPPORT(AdditionsFacility, IAdditionsFacility)33 34 DECLARE_NOT_AGGREGATABLE(AdditionsFacility)35 36 DECLARE_PROTECT_FINAL_CONSTRUCT()37 38 BEGIN_COM_MAP(AdditionsFacility)39 VBOX_DEFAULT_INTERFACE_ENTRIES(IAdditionsFacility)40 END_COM_MAP()41 31 42 32 DECLARE_EMPTY_CTOR_DTOR(AdditionsFacility) … … 50 40 void FinalRelease(); 51 41 52 // IAdditionsFacility properties53 STDMETHOD(COMGETTER(ClassType))(AdditionsFacilityClass_T *aClass);54 STDMETHOD(COMGETTER(LastUpdated))(LONG64 *aTimestamp);55 STDMETHOD(COMGETTER(Name))(BSTR *aName);56 STDMETHOD(COMGETTER(Status))(AdditionsFacilityStatus_T *aStatus);57 STDMETHOD(COMGETTER(Type))(AdditionsFacilityType_T *aType);58 42 59 43 public: … … 71 55 72 56 // public internal methods 73 static const AdditionsFacility::FacilityInfo & typeToInfo(AdditionsFacilityType_T aType);74 AdditionsFacilityClass_T getClass() const;75 LONG64 getLastUpdated() const;76 BstrgetName() const;77 AdditionsFacilityStatus_T getStatus() const;78 AdditionsFacilityType_T getType() const;79 void update(AdditionsFacilityStatus_T a_enmStatus, uint32_t a_fFlags, PCRTTIMESPEC a_pTimeSpecTS);57 static const AdditionsFacility::FacilityInfo &i_typeToInfo(AdditionsFacilityType_T aType); 58 AdditionsFacilityClass_T i_getClass() const; 59 LONG64 i_getLastUpdated() const; 60 com::Utf8Str i_getName() const; 61 AdditionsFacilityStatus_T i_getStatus() const; 62 AdditionsFacilityType_T i_getType() const; 63 void i_update(AdditionsFacilityStatus_T a_enmStatus, uint32_t a_fFlags, PCRTTIMESPEC a_pTimeSpecTS); 80 64 81 65 private: 66 67 // Wrapped IAdditionsFacility properties 68 HRESULT getClassType(AdditionsFacilityClass_T *aClassType); 69 HRESULT getLastUpdated(LONG64 *aLastUpdated); 70 HRESULT getName(com::Utf8Str &aName); 71 HRESULT getStatus(AdditionsFacilityStatus_T *aStatus); 72 HRESULT getType(AdditionsFacilityType_T *aType); 73 82 74 /** A structure for keeping a facility status 83 75 * set at a certain time. Good for book-keeping. */ -
trunk/src/VBox/Main/src-client/AdditionsFacilityImpl.cpp
r40212 r50370 5 5 6 6 /* 7 * Copyright (C) 201 2Oracle Corporation7 * Copyright (C) 2014 Oracle Corporation 8 8 * 9 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 99 99 } 100 100 101 STDMETHODIMP AdditionsFacility::COMGETTER(ClassType)(AdditionsFacilityClass_T *aClass) 102 { 103 LogFlowThisFuncEnter(); 104 105 CheckComArgOutPointerValid(aClass); 106 107 AutoCaller autoCaller(this); 108 if (FAILED(autoCaller.rc())) return autoCaller.rc(); 109 110 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); 111 112 *aClass = getClass(); 113 114 return S_OK; 115 } 116 117 STDMETHODIMP AdditionsFacility::COMGETTER(Name)(BSTR *aName) 118 { 119 LogFlowThisFuncEnter(); 120 121 CheckComArgOutPointerValid(aName); 122 123 AutoCaller autoCaller(this); 124 if (FAILED(autoCaller.rc())) return autoCaller.rc(); 125 126 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); 127 128 Bstr(getName()).cloneTo(aName); 129 130 return S_OK; 131 } 132 133 STDMETHODIMP AdditionsFacility::COMGETTER(LastUpdated)(LONG64 *aTimestamp) 134 { 135 LogFlowThisFuncEnter(); 136 137 CheckComArgOutPointerValid(aTimestamp); 138 139 AutoCaller autoCaller(this); 140 if (FAILED(autoCaller.rc())) return autoCaller.rc(); 141 142 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); 143 144 *aTimestamp = getLastUpdated(); 145 146 return S_OK; 147 } 148 149 STDMETHODIMP AdditionsFacility::COMGETTER(Status)(AdditionsFacilityStatus_T *aStatus) 150 { 151 LogFlowThisFuncEnter(); 152 153 CheckComArgOutPointerValid(aStatus); 154 155 AutoCaller autoCaller(this); 156 if (FAILED(autoCaller.rc())) return autoCaller.rc(); 157 158 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); 159 160 *aStatus = getStatus(); 161 162 return S_OK; 163 } 164 165 STDMETHODIMP AdditionsFacility::COMGETTER(Type)(AdditionsFacilityType_T *aType) 166 { 167 LogFlowThisFuncEnter(); 168 169 CheckComArgOutPointerValid(aType); 170 171 AutoCaller autoCaller(this); 172 if (FAILED(autoCaller.rc())) return autoCaller.rc(); 173 174 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); 175 176 *aType = getType(); 177 178 return S_OK; 179 } 180 181 const AdditionsFacility::FacilityInfo &AdditionsFacility::typeToInfo(AdditionsFacilityType_T aType) 101 HRESULT AdditionsFacility::getClassType(AdditionsFacilityClass_T *aClassType) 102 { 103 LogFlowThisFuncEnter(); 104 105 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); 106 107 *aClassType = i_getClass(); 108 109 return S_OK; 110 } 111 112 HRESULT AdditionsFacility::getName(com::Utf8Str &aName) 113 { 114 LogFlowThisFuncEnter(); 115 116 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); 117 118 aName = i_getName(); 119 120 return S_OK; 121 } 122 123 HRESULT AdditionsFacility::getLastUpdated(LONG64 *aLastUpdated) 124 { 125 LogFlowThisFuncEnter(); 126 127 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); 128 129 *aLastUpdated = i_getLastUpdated(); 130 131 return S_OK; 132 } 133 134 HRESULT AdditionsFacility::getStatus(AdditionsFacilityStatus_T *aStatus) 135 { 136 LogFlowThisFuncEnter(); 137 138 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); 139 140 *aStatus = i_getStatus(); 141 142 return S_OK; 143 } 144 145 HRESULT AdditionsFacility::getType(AdditionsFacilityType_T *aType) 146 { 147 LogFlowThisFuncEnter(); 148 149 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); 150 151 *aType = i_getType(); 152 153 return S_OK; 154 } 155 156 const AdditionsFacility::FacilityInfo &AdditionsFacility::i_typeToInfo(AdditionsFacilityType_T aType) 182 157 { 183 158 for (size_t i = 0; i < RT_ELEMENTS(s_aFacilityInfo); ++i) … … 189 164 } 190 165 191 AdditionsFacilityClass_T AdditionsFacility:: getClass() const192 { 193 return AdditionsFacility:: typeToInfo(mData.mType).mClass;194 } 195 196 Bstr AdditionsFacility::getName() const197 { 198 return AdditionsFacility:: typeToInfo(mData.mType).mName;199 } 200 201 LONG64 AdditionsFacility:: getLastUpdated() const166 AdditionsFacilityClass_T AdditionsFacility::i_getClass() const 167 { 168 return AdditionsFacility::i_typeToInfo(mData.mType).mClass; 169 } 170 171 com::Utf8Str AdditionsFacility::i_getName() const 172 { 173 return AdditionsFacility::i_typeToInfo(mData.mType).mName; 174 } 175 176 LONG64 AdditionsFacility::i_getLastUpdated() const 202 177 { 203 178 if (mData.mStates.size()) … … 208 183 } 209 184 210 AdditionsFacilityStatus_T AdditionsFacility:: getStatus() const185 AdditionsFacilityStatus_T AdditionsFacility::i_getStatus() const 211 186 { 212 187 if (mData.mStates.size()) … … 217 192 } 218 193 219 AdditionsFacilityType_T AdditionsFacility:: getType() const194 AdditionsFacilityType_T AdditionsFacility::i_getType() const 220 195 { 221 196 return mData.mType; … … 225 200 * Method used by IGuest::facilityUpdate to make updates. 226 201 */ 227 void AdditionsFacility:: update(AdditionsFacilityStatus_T a_enmStatus, uint32_t a_fFlags, PCRTTIMESPEC a_pTimeSpecTS)202 void AdditionsFacility::i_update(AdditionsFacilityStatus_T a_enmStatus, uint32_t a_fFlags, PCRTTIMESPEC a_pTimeSpecTS) 228 203 { 229 204 FacilityState state; -
trunk/src/VBox/Main/src-client/GuestImpl.cpp
r49389 r50370 5 5 6 6 /* 7 * Copyright (C) 2006-201 3Oracle Corporation7 * Copyright (C) 2006-2014 Oracle Corporation 8 8 * 9 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 760 760 AdditionsFacility *pFacility = it->second; 761 761 ComAssert(pFacility); 762 *aStatus = pFacility-> getStatus();762 *aStatus = pFacility->i_getStatus(); 763 763 if (aTimestamp) 764 *aTimestamp = pFacility-> getLastUpdated();764 *aTimestamp = pFacility->i_getLastUpdated(); 765 765 } 766 766 else … … 1110 1110 { 1111 1111 AdditionsFacility *pFac = it->second; 1112 return (pFac-> getStatus() == AdditionsFacilityStatus_Active);1112 return (pFac->i_getStatus() == AdditionsFacilityStatus_Active); 1113 1113 } 1114 1114 return false; … … 1125 1125 { 1126 1126 AdditionsFacility *pFac = it->second; 1127 pFac-> update((AdditionsFacilityStatus_T)a_enmStatus, a_fFlags, a_pTimeSpecTS);1127 pFac->i_update((AdditionsFacilityStatus_T)a_enmStatus, a_fFlags, a_pTimeSpecTS); 1128 1128 } 1129 1129 else -
trunk/src/VBox/Main/src-client/xpcom/module.cpp
r48282 r50370 5 5 6 6 /* 7 * Copyright (C) 2006-201 2Oracle Corporation7 * Copyright (C) 2006-2014 Oracle Corporation 8 8 * 9 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 107 107 NS_IMPL_THREADSAFE_ISUPPORTS1_CI(ExtPackManager, IExtPackManager) 108 108 #endif 109 NS_DECL_CLASSINFO(AdditionsFacility)110 NS_IMPL_THREADSAFE_ISUPPORTS1_CI(AdditionsFacility, IAdditionsFacility)111 109 112 110 NS_DECL_CLASSINFO(Console)
Note:
See TracChangeset
for help on using the changeset viewer.