cereal
A C++11 library for serialization
Loading...
Searching...
No Matches
cereal::detail::PolymorphicVirtualCaster< Base, Derived > Struct Template Reference

Strongly typed derivation of PolymorphicCaster. More...

#include </build/libcereal-p0YfAJ/libcereal-1.3.2+dfsg/include/cereal/details/polymorphic_impl.hpp>

Inheritance diagram for cereal::detail::PolymorphicVirtualCaster< Base, Derived >:
cereal::detail::PolymorphicCaster

Public Member Functions

 PolymorphicVirtualCaster ()
 Inserts an entry in the polymorphic casting map for this pairing.
void const * downcast (void const *const ptr) const override
 Performs the proper downcast with the templated types.
void * upcast (void *const ptr) const override
 Performs the proper upcast with the templated types.
std::shared_ptr< void > upcast (std::shared_ptr< void > const &ptr) const override
 Performs the proper upcast with the templated types (shared_ptr version).
Public Member Functions inherited from cereal::detail::PolymorphicCaster
 PolymorphicCaster (const PolymorphicCaster &)=default
PolymorphicCaster & operator= (const PolymorphicCaster &)=default
 PolymorphicCaster (PolymorphicCaster &&) CEREAL_NOEXCEPT
PolymorphicCaster & operator= (PolymorphicCaster &&) CEREAL_NOEXCEPT

Detailed Description

template<class Base, class Derived>
struct cereal::detail::PolymorphicVirtualCaster< Base, Derived >

Strongly typed derivation of PolymorphicCaster.

Constructor & Destructor Documentation

◆ PolymorphicVirtualCaster()

template<class Base, class Derived>
cereal::detail::PolymorphicVirtualCaster< Base, Derived >::PolymorphicVirtualCaster ( )
inline

Inserts an entry in the polymorphic casting map for this pairing.

Creates an explicit mapping between Base and Derived in both upwards and downwards directions, allowing void pointers to either to be properly cast assuming dynamic type information is available

Member Function Documentation

◆ downcast()

template<class Base, class Derived>
void const * cereal::detail::PolymorphicVirtualCaster< Base, Derived >::downcast ( void const *const ptr) const
inlineoverridevirtual

Performs the proper downcast with the templated types.

Implements cereal::detail::PolymorphicCaster.

◆ upcast() [1/2]

template<class Base, class Derived>
std::shared_ptr< void > cereal::detail::PolymorphicVirtualCaster< Base, Derived >::upcast ( std::shared_ptr< void > const & ptr) const
inlineoverridevirtual

Performs the proper upcast with the templated types (shared_ptr version).

Implements cereal::detail::PolymorphicCaster.

◆ upcast() [2/2]

template<class Base, class Derived>
void * cereal::detail::PolymorphicVirtualCaster< Base, Derived >::upcast ( void *const ptr) const
inlineoverridevirtual

Performs the proper upcast with the templated types.

Implements cereal::detail::PolymorphicCaster.


The documentation for this struct was generated from the following file: