proxygen
test_functions.h
Go to the documentation of this file.
1 /*
2  * Copyright 2011-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 
17 #pragma once
18 
19 #include <exception>
20 #include <functional>
21 #include <string>
22 
23 #include <folly/Function.h>
24 
25 class Exception : public std::exception {
26  public:
27  explicit Exception(const std::string& value) : value_(value) {}
28  ~Exception() noexcept override {}
29 
30  const char* what() const noexcept override {
31  return value_.c_str();
32  }
33 
34  private:
36 };
37 
38 void doNothing();
39 
40 std::exception_ptr returnExceptionPtr();
41 void exceptionPtrReturnParam(std::exception_ptr* excReturn);
44 int returnCode(int value);
45 int returnCodeNoExcept(int value) noexcept;
46 void invoke(std::function<void()>);
47 void invoke(folly::Function<void()>);
48 
49 class TestClass {
50  public:
51  void doNothing();
52 };
53 
54 class VirtualClass {
55  public:
56  virtual ~VirtualClass();
57  virtual void doNothing();
58 };
59 
60 class LargeClass {
61  public:
62  LargeClass();
63  void operator()() const; // do nothing
64  private:
65  // Avoid small object optimization.
66  char data[1024];
67 };
const char * what() const noexceptoverride
A polymorphic function wrapper that is not copyable and does not require the wrapped function to be c...
std::string returnString()
void invoke(std::function< void()>)
Exception(const std::string &value)
int returnCode(int value)
std::string value_
STL namespace.
—— Concurrent Priority Queue Implementation ——
Definition: AtomicBitSet.h:29
requires E e noexcept(noexcept(s.error(std::move(e))))
int returnCodeNoExcept(int value) noexcept
std::exception_ptr returnExceptionPtr()
void doNothing()
static const char *const value
Definition: Conv.cpp:50
~Exception() noexceptoverride
void exceptionPtrReturnParam(std::exception_ptr *excReturn)
const char * string
Definition: Conv.cpp:212
const
Definition: upload.py:398
std::string returnStringNoExcept() noexcept
static constexpr uint64_t data[1]
Definition: Fingerprint.cpp:43