proxygen
HTTPSessionTest.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2015-present, Facebook, Inc.
3  * All rights reserved.
4  *
5  * This source code is licensed under the BSD-style license found in the
6  * LICENSE file in the root directory of this source tree. An additional grant
7  * of patent rights can be found in the PATENTS file in the same directory.
8  *
9  */
10 #pragma once
11 
12 #include <folly/Memory.h>
19 
20 template <class MyCodec, class Version>
21 typename std::enable_if<
23  std::unique_ptr<MyCodec> >::type
25  return std::make_unique<MyCodec>(
27 }
28 
29 template <class MyCodec, class Version>
31  std::unique_ptr<MyCodec>>::type
32 makeClientCodec(Version /*version*/) {
33  return std::make_unique<MyCodec>(
35 }
36 
37 template <class MyCodec, class Version>
39  std::unique_ptr<MyCodec>>::type
40 makeClientCodec(Version /*version*/) {
41  return std::make_unique<MyCodec>(
43 }
44 
45 template <class MyCodec, class Version>
47  std::unique_ptr<MyCodec>>::type
48 makeClientCodec(Version /*version*/) {
49  return std::make_unique<MyCodec>();
50 }
51 
52 template <class MyCodec, class Version>
53 typename std::enable_if<
55  std::unique_ptr<MyCodec> >::type
57  return std::make_unique<MyCodec>(
59  (Version)version);
60 }
61 
62 template <class MyCodec, class Version>
64  std::unique_ptr<MyCodec>>::type
65 makeServerCodec(Version /*version*/) {
66  return std::make_unique<MyCodec>(
68 }
69 
70 template <class MyCodec, class Version>
72  std::unique_ptr<MyCodec>>::type
73 makeServerCodec(Version /*version*/) {
74  return std::make_unique<MyCodec>(
76 }
77 
78 template <class MyCodec, class Version>
80  std::unique_ptr<MyCodec>>::type
81 makeServerCodec(Version /*version*/) {
82  return std::make_unique<MyCodec>();
83 }
PskType type
ProtocolVersion version
std::enable_if< std::is_enum< Version >::value, std::unique_ptr< MyCodec > >::type makeClientCodec(Version version)
static const char *const value
Definition: Conv.cpp:50
std::enable_if< std::is_enum< Version >::value, std::unique_ptr< MyCodec > >::type makeServerCodec(Version version)