master
h 25 lines 871 Bytes
Raw
1 // Copyright (C) Microsoft Corporation. All rights reserved.
2 #pragma once
3
4 namespace p9fs {
5
6 // Interface for running the Plan 9 server.
7 // N.B. The main reason this is an interface, despite not needing COM like the Windows equivalent,
8 // is so consumers can just include this header rather than needing most of the library's
9 // headers and needing to compile with coroutine support, which would be required to directly
10 // use the implementation of this interface.
11 class IPlan9FileSystem
12 {
13 public:
14 virtual ~IPlan9FileSystem() noexcept = default;
15
16 virtual void AddShare(const std::string& name, int rootFd) = 0;
17 virtual void Pause() = 0;
18 virtual void Resume() = 0;
19 virtual void Teardown() = 0;
20 virtual bool HasConnections() const noexcept = 0;
21 };
22
23 std::unique_ptr<IPlan9FileSystem> CreateFileSystem(int socket);
24
25 } // namespace p9fs