VirtualBox

Changeset 50370 in vbox for trunk


Ignore:
Timestamp:
Feb 7, 2014 8:05:47 PM (11 years ago)
Author:
vboxsync
Message:

6813 src-client/AdditionsFacilityImpl.cpp

Location:
trunk/src/VBox/Main
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/include/AdditionsFacilityImpl.h

    r40212 r50370  
    44
    55/*
    6  * Copyright (C) 2012 Oracle Corporation
     6 * Copyright (C) 2014 Oracle Corporation
    77 *
    88 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    2121#include <iprt/time.h>
    2222
    23 #include "VirtualBoxBase.h"
     23#include "AdditionsFacilityWrap.h"
    2424
    2525class Guest;
    2626
    2727class ATL_NO_VTABLE AdditionsFacility :
    28     public VirtualBoxBase,
    29     VBOX_SCRIPTABLE_IMPL(IAdditionsFacility)
     28    public AdditionsFacilityWrap
    3029{
    3130public:
    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()
    4131
    4232    DECLARE_EMPTY_CTOR_DTOR(AdditionsFacility)
     
    5040    void FinalRelease();
    5141
    52     // IAdditionsFacility properties
    53     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);
    5842
    5943public:
     
    7155
    7256    // public internal methods
    73     static const AdditionsFacility::FacilityInfo &typeToInfo(AdditionsFacilityType_T aType);
    74     AdditionsFacilityClass_T getClass() const;
    75     LONG64 getLastUpdated() const;
    76     Bstr getName() 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);
    8064
    8165private:
     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
    8274    /** A structure for keeping a facility status
    8375     *  set at a certain time. Good for book-keeping. */
  • trunk/src/VBox/Main/src-client/AdditionsFacilityImpl.cpp

    r40212 r50370  
    55
    66/*
    7  * Copyright (C) 2012 Oracle Corporation
     7 * Copyright (C) 2014 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    9999}
    100100
    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)
     101HRESULT 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
     112HRESULT 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
     123HRESULT 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
     134HRESULT 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
     145HRESULT 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
     156const AdditionsFacility::FacilityInfo &AdditionsFacility::i_typeToInfo(AdditionsFacilityType_T aType)
    182157{
    183158    for (size_t i = 0; i < RT_ELEMENTS(s_aFacilityInfo); ++i)
     
    189164}
    190165
    191 AdditionsFacilityClass_T AdditionsFacility::getClass() const
    192 {
    193     return AdditionsFacility::typeToInfo(mData.mType).mClass;
    194 }
    195 
    196 Bstr AdditionsFacility::getName() const
    197 {
    198     return AdditionsFacility::typeToInfo(mData.mType).mName;
    199 }
    200 
    201 LONG64 AdditionsFacility::getLastUpdated() const
     166AdditionsFacilityClass_T AdditionsFacility::i_getClass() const
     167{
     168    return AdditionsFacility::i_typeToInfo(mData.mType).mClass;
     169}
     170
     171com::Utf8Str AdditionsFacility::i_getName() const
     172{
     173    return AdditionsFacility::i_typeToInfo(mData.mType).mName;
     174}
     175
     176LONG64 AdditionsFacility::i_getLastUpdated() const
    202177{
    203178    if (mData.mStates.size())
     
    208183}
    209184
    210 AdditionsFacilityStatus_T AdditionsFacility::getStatus() const
     185AdditionsFacilityStatus_T AdditionsFacility::i_getStatus() const
    211186{
    212187    if (mData.mStates.size())
     
    217192}
    218193
    219 AdditionsFacilityType_T AdditionsFacility::getType() const
     194AdditionsFacilityType_T AdditionsFacility::i_getType() const
    220195{
    221196    return mData.mType;
     
    225200 * Method used by IGuest::facilityUpdate to make updates.
    226201 */
    227 void AdditionsFacility::update(AdditionsFacilityStatus_T a_enmStatus, uint32_t a_fFlags, PCRTTIMESPEC a_pTimeSpecTS)
     202void AdditionsFacility::i_update(AdditionsFacilityStatus_T a_enmStatus, uint32_t a_fFlags, PCRTTIMESPEC a_pTimeSpecTS)
    228203{
    229204    FacilityState state;
  • trunk/src/VBox/Main/src-client/GuestImpl.cpp

    r49389 r50370  
    55
    66/*
    7  * Copyright (C) 2006-2013 Oracle Corporation
     7 * Copyright (C) 2006-2014 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    760760        AdditionsFacility *pFacility = it->second;
    761761        ComAssert(pFacility);
    762         *aStatus = pFacility->getStatus();
     762        *aStatus = pFacility->i_getStatus();
    763763        if (aTimestamp)
    764             *aTimestamp = pFacility->getLastUpdated();
     764            *aTimestamp = pFacility->i_getLastUpdated();
    765765    }
    766766    else
     
    11101110    {
    11111111        AdditionsFacility *pFac = it->second;
    1112         return (pFac->getStatus() == AdditionsFacilityStatus_Active);
     1112        return (pFac->i_getStatus() == AdditionsFacilityStatus_Active);
    11131113    }
    11141114    return false;
     
    11251125    {
    11261126        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);
    11281128    }
    11291129    else
  • trunk/src/VBox/Main/src-client/xpcom/module.cpp

    r48282 r50370  
    55
    66/*
    7  * Copyright (C) 2006-2012 Oracle Corporation
     7 * Copyright (C) 2006-2014 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    107107NS_IMPL_THREADSAFE_ISUPPORTS1_CI(ExtPackManager, IExtPackManager)
    108108 #endif
    109 NS_DECL_CLASSINFO(AdditionsFacility)
    110 NS_IMPL_THREADSAFE_ISUPPORTS1_CI(AdditionsFacility, IAdditionsFacility)
    111109
    112110NS_DECL_CLASSINFO(Console)
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette