proxygen
LogName.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 #pragma once
17 
18 #include <folly/Range.h>
19 
20 namespace folly {
21 
29 class LogName {
30  public:
39 
46  static size_t hash(folly::StringPiece name);
47 
56  static int cmp(folly::StringPiece nameA, folly::StringPiece nameB);
57 
69 
73  struct Hash {
74  size_t operator()(folly::StringPiece key) const {
75  return LogName::hash(key);
76  }
77  };
78 
82  struct Equals {
84  return LogName::cmp(a, b) == 0;
85  }
86  };
87 };
88 } // namespace folly
static int cmp(folly::StringPiece nameA, folly::StringPiece nameB)
Definition: LogName.cpp:81
static folly::StringPiece getParent(folly::StringPiece name)
Definition: LogName.cpp:126
char b
—— Concurrent Priority Queue Implementation ——
Definition: AtomicBitSet.h:29
size_t operator()(folly::StringPiece key) const
Definition: LogName.h:74
static size_t hash(folly::StringPiece name)
Definition: LogName.cpp:52
const char * name
Definition: http_parser.c:437
static std::string canonicalize(folly::StringPiece name)
Definition: LogName.cpp:26
bool operator()(folly::StringPiece a, folly::StringPiece b) const
Definition: LogName.h:83
char a
const char * string
Definition: Conv.cpp:212