winget-cli

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

ApplyConfigurationUnitResult.cpp (2633B)


      1 // Copyright (c) Microsoft Corporation.
      2 // Licensed under the MIT License.
      3 #include "pch.h"
      4 #include "ApplyConfigurationUnitResult.h"
      5 #include "ApplyConfigurationUnitResult.g.cpp"
      6 
      7 namespace winrt::Microsoft::Management::Configuration::implementation
      8 {
      9     ApplyConfigurationUnitResult::ApplyConfigurationUnitResult() :
     10         m_resultInformation(make_self<wil::details::module_count_wrapper<implementation::ConfigurationUnitResultInformation>>())
     11     {
     12     }
     13 
     14     void ApplyConfigurationUnitResult::Initialize(const IApplySettingsResult& result)
     15     {
     16         m_unit = result.Unit();
     17         THROW_HR_IF(E_POINTER, !m_unit);
     18         m_resultInformation->Initialize(result.ResultInformation());
     19     }
     20 
     21     void ApplyConfigurationUnitResult::Initialize(const IApplyGroupMemberSettingsResult& unitResult)
     22     {
     23         m_unit = unitResult.Unit();
     24         THROW_HR_IF(E_POINTER, !m_unit);
     25         m_resultInformation->Initialize(unitResult.ResultInformation());
     26         m_state = unitResult.State();
     27         m_previouslyInDesiredState = unitResult.PreviouslyInDesiredState();
     28         m_rebootRequired = unitResult.RebootRequired();
     29     }
     30 
     31     ConfigurationUnit ApplyConfigurationUnitResult::Unit()
     32     {
     33         return m_unit;
     34     }
     35 
     36     void ApplyConfigurationUnitResult::Unit(ConfigurationUnit value)
     37     {
     38         m_unit = std::move(value);
     39     }
     40 
     41     ConfigurationUnitState ApplyConfigurationUnitResult::State() const
     42     {
     43         return m_state.load();
     44     }
     45 
     46     void ApplyConfigurationUnitResult::State(ConfigurationUnitState value)
     47     {
     48         m_state.store(value);
     49     }
     50 
     51     bool ApplyConfigurationUnitResult::PreviouslyInDesiredState() const
     52     {
     53         return m_previouslyInDesiredState;
     54     }
     55 
     56     void ApplyConfigurationUnitResult::PreviouslyInDesiredState(bool value)
     57     {
     58         m_previouslyInDesiredState = value;
     59     }
     60 
     61     bool ApplyConfigurationUnitResult::RebootRequired() const
     62     {
     63         return m_rebootRequired;
     64     }
     65 
     66     void ApplyConfigurationUnitResult::RebootRequired(bool value)
     67     {
     68         m_rebootRequired = value;
     69     }
     70 
     71     IConfigurationUnitResultInformation ApplyConfigurationUnitResult::ResultInformation()
     72     {
     73         return *m_resultInformation;
     74     }
     75 
     76     void ApplyConfigurationUnitResult::ResultInformation(const Configuration::IConfigurationUnitResultInformation& value)
     77     {
     78         m_resultInformation->Initialize(value);
     79     }
     80 
     81     ApplyConfigurationUnitResult::ResultInformationT ApplyConfigurationUnitResult::ResultInformationInternal()
     82     {
     83         return m_resultInformation;
     84     }
     85 }