Drake
wrap_function_test.cc File Reference
#include "drake/bindings/pydrake/util/wrap_function.h"
#include <functional>
#include <type_traits>
#include <gtest/gtest.h>
Include dependency graph for wrap_function_test.cc:

Namespaces

 drake
 
 drake::pydrake
 

Typedefs

template<typename T >
using wrap_change_t = detail::wrap_function_impl< wrap_change >::wrap_type_t< T >
 
using Callback = std::function< const double &(MyClassChange *, const int &)>
 
using CallbackWrapped = std::function< const_ptr< double >(ptr< MyClassChange >, const int *)>
 

Functions

template<typename Func >
auto WrapIdentity (Func &&func)
 
void Void ()
 
void IntToVoid (int)
 
int ReturnInt ()
 
int IntToInt (int value)
 
 GTEST_TEST (WrapFunction, FunctionPointer)
 
 GTEST_TEST (WrapFunction, Lambda)
 
 GTEST_TEST (WrapFunction, Methods)
 
void ArgMoveOnly (MoveOnlyValue arg)
 
const intArgMoveOnlyConst (const MoveOnlyValue &arg)
 
intArgMoveOnlyMutable (MoveOnlyValue &arg)
 
 GTEST_TEST (WrapFunction, ArgMoveOnly)
 
 GTEST_TEST (WrapFunction, MoveOnlyFunctor)
 
 GTEST_TEST (WrapFunction, ConstFunctor)
 
template<typename Func >
auto WrapChange (Func &&func)
 
template<typename Actual , typename Expected >
void check_type ()
 
 GTEST_TEST (WrapFunction, ChangeTypeCheck)
 
intChangeBasic (const int &a, const double &b, int *x, double *y)
 
 GTEST_TEST (WrapFunction, ChangeBasic)
 
 GTEST_TEST (WrapFunction, ChangeComprehensive)
 
Callback ChangeCallback (const Callback &)
 
 GTEST_TEST (WrapFunction, ChangeCallback)
 
void ChangeCallbackNested (const std::function< Callback(const Callback &)> &)
 
 GTEST_TEST (WrapFunction, ChangeCallbackNested)
 
template<typename Func >
auto WrapChangeCallbackOnly (Func &&func)
 
Callback ChangeCallbackOnly (double *, Callback, const Callback &)
 
 GTEST_TEST (WrapFunction, ChangeCallbackOnly)