13#include <memory_resource>
17#include <unordered_set>
26 size_t operator()(
const std::string& str)
const {
return str.size(); }
74 virtual int call(
int arg) = 0;
107 int add(
int a,
int b) {
return a + b; }
108 void addOut(
int a,
int b,
int& out) { out =
a + b; }
110 int mapSize(
const std::map<std::string, std::string>&
map) {
return map.size(); }
127 int passFn(std::function<
int()> fn) {
return fn(); }
131 std::vector<std::unique_ptr<Bar>> result;
133 for (
int i = 0; i < n; ++i) result.push_back(std::make_unique<SimpleBar>(i));
A second, arbitrary interface used to test returning a list of interface objects.
virtual int callExtended(int arg)=0
virtual int call(int arg)=0
virtual ~FooCallback()=default
void addOut(int a, int b, int &out)
std::function< int(int)> m_int_fn
int callbackSaved(int arg)
void passMutable(FooMutable &foo)
FooEmpty passEmpty(FooEmpty foo)
int passFn(std::function< int()> fn)
std::shared_ptr< FooCallback > m_callback
std::function< void()> m_fn
int callbackShared(std::shared_ptr< FooCallback > callback, int arg)
void addInOut(int x, int &sum)
FooMessage callMessageAsync()
void raise(FooStruct foo)
int callbackUnique(std::unique_ptr< FooCallback > callback, int arg)
FooEnum passEnum(FooEnum foo)
double passDouble(double value)
int callIntFnAsync(int arg)
FooMessage passMessage(FooMessage foo)
int callback(FooCallback &callback, int arg)
std::vector< std::unique_ptr< Bar > > listBars(int n)
FooStruct pass(FooStruct foo)
std::vector< FooDataRef > passDataPointers(std::vector< FooDataRef > values)
FooCustom passCustom(FooCustom foo)
void saveCallback(std::shared_ptr< FooCallback > callback)
FooData passData(FooData foo)
int callbackExtended(ExtendedCallback &callback, int arg)
int mapSize(const std::map< std::string, std::string > &map)
Concrete Bar that returns a fixed value, used by listBars tests.
std::shared_ptr< const FooData > FooDataRef
std::vector< char > FooData
Functions to serialize / deserialize common bitcoin types.
static const int64_t values[]
A selection of numbers that do not trigger int64_t overflow when added/subtracted.
Hash function used to test std::unordered_set with a custom hash.
size_t operator()(const std::string &str) const
std::set< int, std::greater<> > set_int_desc
std::unordered_set< std::string, FooHash > unordered_set_string_hash
std::pmr::vector< int > pmr_vector_int
std::map< std::string, int > map_string_int
std::unordered_set< int > unordered_set_int
std::map< std::string, int, std::greater<> > map_string_int_desc
std::optional< int > optional_int
std::vector< bool > vector_bool
constexpr auto Ticks(Dur2 d)
Helper to count the seconds of a duration/time_point.