master
h 62 lines 2.27 KB
Raw
1 /*++
2
3 Copyright (c) Microsoft. All rights reserved.
4
5 Module Name:
6
7 SessionSettings.h
8
9 Abstract:
10
11 This file contains the definition of the WinRT wrapper for the WSLC SDK SessionSettings class.
12
13 --*/
14
15 #pragma once
16 #include "Microsoft.WSL.Containers.SessionSettings.g.h"
17 #include "VhdOptions.h"
18 #include "Helpers.h"
19
20 namespace winrt::Microsoft::WSL::Containers::implementation {
21 struct SessionSettings : SessionSettingsT<SessionSettings>
22 {
23 SessionSettings() = default;
24
25 SessionSettings(hstring const& name, hstring const& storagePath);
26 hstring Name();
27 void Name(hstring const& value);
28 hstring StoragePath();
29 void StoragePath(hstring const& value);
30 winrt::Windows::Foundation::IReference<uint32_t> CpuCount();
31 void CpuCount(winrt::Windows::Foundation::IReference<uint32_t> const& value);
32 winrt::Windows::Foundation::IReference<uint32_t> MemorySizeInMB();
33 void MemorySizeInMB(winrt::Windows::Foundation::IReference<uint32_t> const& value);
34 winrt::Windows::Foundation::IReference<winrt::Windows::Foundation::TimeSpan> Timeout();
35 void Timeout(winrt::Windows::Foundation::IReference<winrt::Windows::Foundation::TimeSpan> const& value);
36 winrt::Microsoft::WSL::Containers::VhdOptions VhdRequirements();
37 void VhdRequirements(winrt::Microsoft::WSL::Containers::VhdOptions const& value);
38 bool EnableGpu();
39 void EnableGpu(bool value);
40
41 WslcSessionSettings* ToStructPointer();
42
43 private:
44 std::wstring m_name;
45 std::wstring m_storagePath;
46 winrt::Windows::Foundation::IReference<uint32_t> m_cpuCount{nullptr};
47 winrt::Windows::Foundation::IReference<uint32_t> m_memorySizeInMB{nullptr};
48 winrt::Windows::Foundation::IReference<winrt::Windows::Foundation::TimeSpan> m_timeout{nullptr};
49 winrt::Microsoft::WSL::Containers::VhdOptions m_vhdRequirements{nullptr};
50 WslcSessionFeatureFlags m_featureFlags{WSLC_SESSION_FEATURE_FLAG_NONE};
51
52 std::unique_ptr<WslcSessionSettings> m_sessionSettings;
53 };
54 } // namespace winrt::Microsoft::WSL::Containers::implementation
55
56 namespace winrt::Microsoft::WSL::Containers::factory_implementation {
57 struct SessionSettings : SessionSettingsT<SessionSettings, implementation::SessionSettings>
58 {
59 };
60 } // namespace winrt::Microsoft::WSL::Containers::factory_implementation
61
62 DEFINE_TYPE_HELPERS(SessionSettings);