OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef SERVICES_FILES_C_LIB_FD_TABLE_H_ | 5 #ifndef SERVICES_FILES_C_LIB_FD_TABLE_H_ |
6 #define SERVICES_FILES_C_LIB_FD_TABLE_H_ | 6 #define SERVICES_FILES_C_LIB_FD_TABLE_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
11 #include <vector> | 11 #include <vector> |
12 | 12 |
13 #include "files/public/c/lib/fd_impl.h" | 13 #include "files/c/lib/fd_impl.h" |
14 #include "mojo/public/cpp/system/macros.h" | 14 #include "mojo/public/cpp/system/macros.h" |
15 | 15 |
16 namespace mojio { | 16 namespace mojio { |
17 | 17 |
18 class ErrnoImpl; | 18 class ErrnoImpl; |
19 | 19 |
20 // A simple (thread-unsafe) implementation of an FD (file descriptor) table, | 20 // A simple (thread-unsafe) implementation of an FD (file descriptor) table, |
21 // mapping FDs (integers) to |FDImpl|s. (Note that on failure, all the methods | 21 // mapping FDs (integers) to |FDImpl|s. (Note that on failure, all the methods |
22 // set "errno" using the |ErrnoImpl| provided to the constructor.) | 22 // set "errno" using the |ErrnoImpl| provided to the constructor.) |
23 class FDTable { | 23 class FDTable { |
(...skipping 23 matching lines...) Expand all Loading... |
47 private: | 47 private: |
48 ErrnoImpl* const errno_impl_; | 48 ErrnoImpl* const errno_impl_; |
49 std::vector<std::unique_ptr<FDImpl>> table_; | 49 std::vector<std::unique_ptr<FDImpl>> table_; |
50 | 50 |
51 MOJO_DISALLOW_COPY_AND_ASSIGN(FDTable); | 51 MOJO_DISALLOW_COPY_AND_ASSIGN(FDTable); |
52 }; | 52 }; |
53 | 53 |
54 } // namespace mojio | 54 } // namespace mojio |
55 | 55 |
56 #endif // SERVICES_FILES_C_LIB_FD_TABLE_H_ | 56 #endif // SERVICES_FILES_C_LIB_FD_TABLE_H_ |
OLD | NEW |