proxygen
CodingDetail.h
Go to the documentation of this file.
1 /*
2  * Copyright 2017-present Facebook, Inc.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
23 #pragma once
24 
25 #include <stddef.h>
26 
27 namespace folly {
28 namespace compression {
29 namespace detail {
30 
38 template <size_t>
40  protected:
41  explicit ForwardPointers(const unsigned char* ptr) : forwardPointers_(ptr) {}
42  const unsigned char* const forwardPointers_;
43 };
44 template <>
45 class ForwardPointers<0> {
46  protected:
47  explicit ForwardPointers(const unsigned char*) {}
48  constexpr static const unsigned char* const forwardPointers_{};
49 };
50 
51 template <size_t>
52 class SkipPointers {
53  protected:
54  explicit SkipPointers(const unsigned char* ptr) : skipPointers_(ptr) {}
55  const unsigned char* const skipPointers_;
56 };
57 template <>
58 class SkipPointers<0> {
59  protected:
60  explicit SkipPointers(const unsigned char*) {}
61  constexpr static const unsigned char* const skipPointers_{};
62 };
63 } // namespace detail
64 } // namespace compression
65 } // namespace folly
void * ptr
—— Concurrent Priority Queue Implementation ——
Definition: AtomicBitSet.h:29
ForwardPointers(const unsigned char *ptr)
Definition: CodingDetail.h:41
const unsigned char *const forwardPointers_
Definition: CodingDetail.h:42
SkipPointers(const unsigned char *ptr)
Definition: CodingDetail.h:54
const unsigned char *const skipPointers_
Definition: CodingDetail.h:55