Skip to content

Commit ab71550

Browse files
authored
Definition for SDK projection / object model (microsoft#40121)
1 parent d89742f commit ab71550

38 files changed

Lines changed: 1756 additions & 137 deletions

src/windows/WslcSDK/winrt/CMakeLists.txt

Lines changed: 32 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,46 @@ add_idl_winrt(wslcsdkwinrtidl "wslcsdk.idl")
22
set_target_properties(wslcsdkwinrtidl PROPERTIES FOLDER windows)
33

44
set(SOURCES
5+
Container.cpp
6+
ContainerNamedVolume.cpp
7+
ContainerPortMapping.cpp
8+
ContainerSettings.cpp
9+
ContainerVolume.cpp
10+
ImageInfo.cpp
11+
ImageProgress.cpp
12+
InstallProgress.cpp
13+
Process.cpp
14+
ProcessSettings.cpp
15+
PullImageOptions.cpp
16+
PushImageOptions.cpp
17+
ServiceVersion.cpp
518
Session.cpp
619
SessionSettings.cpp
7-
VhdRequirements.cpp
20+
TagImageOptions.cpp
21+
VhdOptions.cpp
22+
WslcService.cpp
823
)
924

1025
set(HEADERS
26+
Container.h
27+
ContainerNamedVolume.h
28+
ContainerPortMapping.h
29+
ContainerSettings.h
30+
ContainerVolume.h
1131
Helpers.h
32+
ImageInfo.h
33+
ImageProgress.h
34+
InstallProgress.h
35+
Process.h
36+
ProcessSettings.h
37+
PullImageOptions.h
38+
PushImageOptions.h
39+
ServiceVersion.h
1240
Session.h
1341
SessionSettings.h
14-
VhdRequirements.h
42+
TagImageOptions.h
43+
VhdOptions.h
44+
WslcService.h
1545
)
1646

1747
add_library(wslcsdkwinrt STATIC ${SOURCES} ${HEADERS})
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
/*++
2+
3+
Copyright (c) Microsoft. All rights reserved.
4+
5+
Module Name:
6+
7+
Container.cpp
8+
9+
Abstract:
10+
11+
This file contains the implementation of the WinRT wrapper for the WSLC SDK Container class.
12+
13+
--*/
14+
15+
#include "precomp.h"
16+
#include "Container.h"
17+
#include "Microsoft.WSL.Containers.Container.g.cpp"
18+
19+
namespace winrt::Microsoft::WSL::Containers::implementation {
20+
void Container::Start(winrt::Microsoft::WSL::Containers::ContainerStartFlags const& flags)
21+
{
22+
throw hresult_not_implemented();
23+
}
24+
void Container::Stop(winrt::Microsoft::WSL::Containers::Signal const& signal, uint32_t timeoutSeconds)
25+
{
26+
throw hresult_not_implemented();
27+
}
28+
void Container::Delete(winrt::Microsoft::WSL::Containers::DeleteContainerFlags const& flags)
29+
{
30+
throw hresult_not_implemented();
31+
}
32+
winrt::Microsoft::WSL::Containers::Process Container::CreateProcess(winrt::Microsoft::WSL::Containers::ProcessSettings const& newProcessSettings)
33+
{
34+
throw hresult_not_implemented();
35+
}
36+
hstring Container::Inspect()
37+
{
38+
throw hresult_not_implemented();
39+
}
40+
hstring Container::Id()
41+
{
42+
throw hresult_not_implemented();
43+
}
44+
winrt::Microsoft::WSL::Containers::Process Container::InitProcess()
45+
{
46+
throw hresult_not_implemented();
47+
}
48+
winrt::Microsoft::WSL::Containers::ContainerState Container::State()
49+
{
50+
throw hresult_not_implemented();
51+
}
52+
} // namespace winrt::Microsoft::WSL::Containers::implementation
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
/*++
2+
3+
Copyright (c) Microsoft. All rights reserved.
4+
5+
Module Name:
6+
7+
Container.h
8+
9+
Abstract:
10+
11+
This file contains the definition of the WinRT wrapper for the WSLC SDK Container class.
12+
13+
--*/
14+
15+
#pragma once
16+
#include "Microsoft.WSL.Containers.Container.g.h"
17+
18+
namespace winrt::Microsoft::WSL::Containers::implementation {
19+
struct Container : ContainerT<Container>
20+
{
21+
Container() = default;
22+
23+
void Start(winrt::Microsoft::WSL::Containers::ContainerStartFlags const& flags);
24+
void Stop(winrt::Microsoft::WSL::Containers::Signal const& signal, uint32_t timeoutSeconds);
25+
void Delete(winrt::Microsoft::WSL::Containers::DeleteContainerFlags const& flags);
26+
winrt::Microsoft::WSL::Containers::Process CreateProcess(winrt::Microsoft::WSL::Containers::ProcessSettings const& newProcessSettings);
27+
hstring Inspect();
28+
hstring Id();
29+
winrt::Microsoft::WSL::Containers::Process InitProcess();
30+
winrt::Microsoft::WSL::Containers::ContainerState State();
31+
};
32+
} // namespace winrt::Microsoft::WSL::Containers::implementation
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
/*++
2+
3+
Copyright (c) Microsoft. All rights reserved.
4+
5+
Module Name:
6+
7+
ContainerNamedVolume.cpp
8+
9+
Abstract:
10+
11+
This file contains the implementation of the WinRT wrapper for the WSLC SDK ContainerNamedVolume class.
12+
13+
--*/
14+
15+
#include "precomp.h"
16+
#include "ContainerNamedVolume.h"
17+
#include "Microsoft.WSL.Containers.ContainerNamedVolume.g.cpp"
18+
19+
namespace winrt::Microsoft::WSL::Containers::implementation {
20+
ContainerNamedVolume::ContainerNamedVolume(hstring const& name, hstring const& containerPath, bool readOnly)
21+
{
22+
throw hresult_not_implemented();
23+
}
24+
hstring ContainerNamedVolume::Name()
25+
{
26+
throw hresult_not_implemented();
27+
}
28+
void ContainerNamedVolume::Name(hstring const& value)
29+
{
30+
throw hresult_not_implemented();
31+
}
32+
hstring ContainerNamedVolume::ContainerPath()
33+
{
34+
throw hresult_not_implemented();
35+
}
36+
void ContainerNamedVolume::ContainerPath(hstring const& value)
37+
{
38+
throw hresult_not_implemented();
39+
}
40+
bool ContainerNamedVolume::ReadOnly()
41+
{
42+
throw hresult_not_implemented();
43+
}
44+
void ContainerNamedVolume::ReadOnly(bool value)
45+
{
46+
throw hresult_not_implemented();
47+
}
48+
} // namespace winrt::Microsoft::WSL::Containers::implementation
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
/*++
2+
3+
Copyright (c) Microsoft. All rights reserved.
4+
5+
Module Name:
6+
7+
ContainerNamedVolume.h
8+
9+
Abstract:
10+
11+
This file contains the definition of the WinRT wrapper for the WSLC SDK ContainerNamedVolume class.
12+
13+
--*/
14+
15+
#pragma once
16+
#include "Microsoft.WSL.Containers.ContainerNamedVolume.g.h"
17+
18+
namespace winrt::Microsoft::WSL::Containers::implementation {
19+
struct ContainerNamedVolume : ContainerNamedVolumeT<ContainerNamedVolume>
20+
{
21+
ContainerNamedVolume() = default;
22+
23+
ContainerNamedVolume(hstring const& name, hstring const& containerPath, bool readOnly);
24+
hstring Name();
25+
void Name(hstring const& value);
26+
hstring ContainerPath();
27+
void ContainerPath(hstring const& value);
28+
bool ReadOnly();
29+
void ReadOnly(bool value);
30+
};
31+
} // namespace winrt::Microsoft::WSL::Containers::implementation
32+
namespace winrt::Microsoft::WSL::Containers::factory_implementation {
33+
struct ContainerNamedVolume : ContainerNamedVolumeT<ContainerNamedVolume, implementation::ContainerNamedVolume>
34+
{
35+
};
36+
} // namespace winrt::Microsoft::WSL::Containers::factory_implementation
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
/*++
2+
3+
Copyright (c) Microsoft. All rights reserved.
4+
5+
Module Name:
6+
7+
ContainerPortMapping.cpp
8+
9+
Abstract:
10+
11+
This file contains the implementation of the WinRT wrapper for the WSLC SDK ContainerPortMapping class.
12+
13+
--*/
14+
15+
#include "precomp.h"
16+
#include "ContainerPortMapping.h"
17+
#include "Microsoft.WSL.Containers.ContainerPortMapping.g.cpp"
18+
19+
namespace winrt::Microsoft::WSL::Containers::implementation {
20+
ContainerPortMapping::ContainerPortMapping(uint16_t windowsPort, uint16_t containerPort, winrt::Microsoft::WSL::Containers::PortProtocol const& protocol)
21+
{
22+
throw hresult_not_implemented();
23+
}
24+
uint16_t ContainerPortMapping::WindowsPort()
25+
{
26+
throw hresult_not_implemented();
27+
}
28+
void ContainerPortMapping::WindowsPort(uint16_t value)
29+
{
30+
throw hresult_not_implemented();
31+
}
32+
uint16_t ContainerPortMapping::ContainerPort()
33+
{
34+
throw hresult_not_implemented();
35+
}
36+
void ContainerPortMapping::ContainerPort(uint16_t value)
37+
{
38+
throw hresult_not_implemented();
39+
}
40+
winrt::Microsoft::WSL::Containers::PortProtocol ContainerPortMapping::Protocol()
41+
{
42+
throw hresult_not_implemented();
43+
}
44+
void ContainerPortMapping::Protocol(winrt::Microsoft::WSL::Containers::PortProtocol const& value)
45+
{
46+
throw hresult_not_implemented();
47+
}
48+
winrt::Windows::Networking::HostName ContainerPortMapping::WindowsAddress()
49+
{
50+
throw hresult_not_implemented();
51+
}
52+
void ContainerPortMapping::WindowsAddress(winrt::Windows::Networking::HostName const& value)
53+
{
54+
throw hresult_not_implemented();
55+
}
56+
} // namespace winrt::Microsoft::WSL::Containers::implementation
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
/*++
2+
3+
Copyright (c) Microsoft. All rights reserved.
4+
5+
Module Name:
6+
7+
ContainerPortMapping.h
8+
9+
Abstract:
10+
11+
This file contains the definition of the WinRT wrapper for the WSLC SDK ContainerPortMapping class.
12+
13+
--*/
14+
15+
#pragma once
16+
#include "Microsoft.WSL.Containers.ContainerPortMapping.g.h"
17+
18+
namespace winrt::Microsoft::WSL::Containers::implementation {
19+
struct ContainerPortMapping : ContainerPortMappingT<ContainerPortMapping>
20+
{
21+
ContainerPortMapping() = default;
22+
23+
ContainerPortMapping(uint16_t windowsPort, uint16_t containerPort, winrt::Microsoft::WSL::Containers::PortProtocol const& protocol);
24+
uint16_t WindowsPort();
25+
void WindowsPort(uint16_t value);
26+
uint16_t ContainerPort();
27+
void ContainerPort(uint16_t value);
28+
winrt::Microsoft::WSL::Containers::PortProtocol Protocol();
29+
void Protocol(winrt::Microsoft::WSL::Containers::PortProtocol const& value);
30+
winrt::Windows::Networking::HostName WindowsAddress();
31+
void WindowsAddress(winrt::Windows::Networking::HostName const& value);
32+
};
33+
} // namespace winrt::Microsoft::WSL::Containers::implementation
34+
namespace winrt::Microsoft::WSL::Containers::factory_implementation {
35+
struct ContainerPortMapping : ContainerPortMappingT<ContainerPortMapping, implementation::ContainerPortMapping>
36+
{
37+
};
38+
} // namespace winrt::Microsoft::WSL::Containers::factory_implementation

0 commit comments

Comments
 (0)