Go to the documentation of this file.
    5 template <
class Po
intee>
 
    8   using type = std::shared_ptr<Pointee>;
 
   10   template <
class Derived>
 
   11   static std::shared_ptr<Derived> 
cast(std::shared_ptr<Pointee> _pointer)
 
   13     return std::dynamic_pointer_cast<Derived>(std::move(_pointer));
 
   18 template <
class Po
intee>
 
   23   template <
class Derived>
 
   24   static Derived* 
cast(Pointee* _pointer)
 
   26     return dynamic_cast<Derived*
>(_pointer);
 
   32     template <
class> 
class Factory,
 
   33     template <
class> 
class Pointer,
 
   37   template <
class... Parameters>
 
   39       typename Pointer<BaseParameter>::type ,
 
   48     template <
class> 
class Factory,
 
   49     template <
class> 
class Pointer,
 
   59   template <
class... Parameters>
 
   61       typename Pointer<BaseParameter>::type _base, Parameters&&... _params)
 
   62       -> decltype(Factory<Arg>::create(
 
   63           Pointer<BaseParameter>::template cast<Arg>(_base),
 
   64           std::forward<Parameters>(_params)...))
 
   66     if (
auto derived = Pointer<BaseParameter>::template cast<Arg>(_base))
 
   68       return Factory<Arg>::create(
 
   69           std::move(derived), std::forward<Parameters>(_params)...);
 
   78           create(std::move(_base), std::forward<Parameters>(_params)...);
 
  
 
Pointee * type
Definition: metaprogramming-impl.hpp:21
 
Format of serialized trajectory in YAML.
Definition: algorithm.hpp:4
 
static std::shared_ptr< Derived > cast(std::shared_ptr< Pointee > _pointer)
Definition: metaprogramming-impl.hpp:11
 
Helper template class necessary to use std::shared_ptr as the pointer type in DynamicCastFactory.
Definition: metaprogramming-impl.hpp:6
 
static Derived * cast(Pointee *_pointer)
Definition: metaprogramming-impl.hpp:24
 
Wrapper for a variadic template parameter pack of types.
Definition: metaprogramming.hpp:13
 
static std::nullptr_t create(typename Pointer< BaseParameter >::type, Parameters &&...)
Definition: metaprogramming-impl.hpp:38
 
std::shared_ptr< Pointee > type
Definition: metaprogramming-impl.hpp:8
 
Call a template factory function based on runtime type of the first argument to a function.
Definition: metaprogramming.hpp:47
 
Helper template class necessary to use raw pointers as the pointer type in DynamicCastFactory.
Definition: metaprogramming-impl.hpp:19
 
static auto create(typename Pointer< BaseParameter >::type _base, Parameters &&... _params) -> decltype(Factory< Arg >::create(Pointer< BaseParameter >::template cast< Arg >(_base), std::forward< Parameters >(_params)...))
Definition: metaprogramming-impl.hpp:60