OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 SANDBOX_LINUX_BPF_DSL_BPF_DSL_H_ | 5 #ifndef SANDBOX_LINUX_BPF_DSL_BPF_DSL_H_ |
6 #define SANDBOX_LINUX_BPF_DSL_BPF_DSL_H_ | 6 #define SANDBOX_LINUX_BPF_DSL_BPF_DSL_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <utility> | 10 #include <utility> |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
80 | 80 |
81 // Forward declarations of classes; see below for proper documentation. | 81 // Forward declarations of classes; see below for proper documentation. |
82 class Elser; | 82 class Elser; |
83 template <typename T> | 83 template <typename T> |
84 class Caser; | 84 class Caser; |
85 namespace internal { | 85 namespace internal { |
86 class ResultExprImpl; | 86 class ResultExprImpl; |
87 class BoolExprImpl; | 87 class BoolExprImpl; |
88 } | 88 } |
89 | 89 |
| 90 } // namespace bpf_dsl |
| 91 } // namespace sandbox |
| 92 |
| 93 extern template class SANDBOX_EXPORT |
| 94 scoped_refptr<const sandbox::bpf_dsl::internal::BoolExprImpl>; |
| 95 extern template class SANDBOX_EXPORT |
| 96 scoped_refptr<const sandbox::bpf_dsl::internal::ResultExprImpl>; |
| 97 |
| 98 namespace sandbox { |
| 99 namespace bpf_dsl { |
| 100 |
90 // ResultExpr is an opaque reference to an immutable result expression tree. | 101 // ResultExpr is an opaque reference to an immutable result expression tree. |
91 typedef scoped_refptr<const internal::ResultExprImpl> ResultExpr; | 102 typedef scoped_refptr<const internal::ResultExprImpl> ResultExpr; |
92 | 103 |
93 // BoolExpr is an opaque reference to an immutable boolean expression tree. | 104 // BoolExpr is an opaque reference to an immutable boolean expression tree. |
94 typedef scoped_refptr<const internal::BoolExprImpl> BoolExpr; | 105 typedef scoped_refptr<const internal::BoolExprImpl> BoolExpr; |
95 | 106 |
96 // Helper class to make writing policies easier. | 107 // Helper class to make writing policies easier. |
97 class SANDBOX_EXPORT SandboxBPFDSLPolicy : public SandboxBPFPolicy { | 108 class SANDBOX_EXPORT SandboxBPFDSLPolicy : public SandboxBPFPolicy { |
98 public: | 109 public: |
99 SandboxBPFDSLPolicy() : SandboxBPFPolicy() {} | 110 SandboxBPFDSLPolicy() : SandboxBPFPolicy() {} |
(...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
347 } | 358 } |
348 | 359 |
349 template <typename T> | 360 template <typename T> |
350 ResultExpr Caser<T>::Default(ResultExpr result) const { | 361 ResultExpr Caser<T>::Default(ResultExpr result) const { |
351 return elser_.Else(result); | 362 return elser_.Else(result); |
352 } | 363 } |
353 | 364 |
354 } // namespace bpf_dsl | 365 } // namespace bpf_dsl |
355 } // namespace sandbox | 366 } // namespace sandbox |
356 | 367 |
357 extern template class SANDBOX_EXPORT | |
358 scoped_refptr<const sandbox::bpf_dsl::internal::BoolExprImpl>; | |
359 extern template class SANDBOX_EXPORT | |
360 scoped_refptr<const sandbox::bpf_dsl::internal::ResultExprImpl>; | |
361 | |
362 #endif // SANDBOX_LINUX_BPF_DSL_BPF_DSL_H_ | 368 #endif // SANDBOX_LINUX_BPF_DSL_BPF_DSL_H_ |
OLD | NEW |