.TH "cereal::detail::PolymorphicCaster" 3 "Sat Aug 29 2026 00:42:30" "cereal" \" -*- nroff -*- .ad l .nh .SH NAME cereal::detail::PolymorphicCaster \- Base type for polymorphic void casting\&. .SH SYNOPSIS .br .PP .PP \fR#include \fP .PP Inherited by \fBcereal::detail::PolymorphicVirtualCaster< Base, Derived >\fP\&. .SS "Public Member Functions" .in +1c .ti -1c .RI "\fBPolymorphicCaster\fP (const PolymorphicCaster &)=default" .br .ti -1c .RI "PolymorphicCaster & \fBoperator=\fP (const PolymorphicCaster &)=default" .br .ti -1c .RI "\fBPolymorphicCaster\fP (PolymorphicCaster &&) \fBCEREAL_NOEXCEPT\fP" .br .ti -1c .RI "PolymorphicCaster & \fBoperator=\fP (PolymorphicCaster &&) \fBCEREAL_NOEXCEPT\fP" .br .ti -1c .RI "virtual void const * \fBdowncast\fP (void const *const ptr) const =0" .br .RI "Downcasts to the proper derived type\&. " .ti -1c .RI "virtual void * \fBupcast\fP (void *const ptr) const =0" .br .RI "Upcast to proper base type\&. " .ti -1c .RI "virtual std::shared_ptr< void > \fBupcast\fP (std::shared_ptr< void > const &ptr) const =0" .br .RI "Upcast to proper base type, shared_ptr version\&. " .in -1c .SH "Detailed Description" .PP Base type for polymorphic void casting\&. Contains functions for casting between registered base and derived types\&. .PP This is necessary so that cereal can properly cast between polymorphic types even though void pointers are used, which normally have no type information\&. Runtime type information is used instead to index a compile-time made mapping that can perform the proper cast\&. In the case of multiple levels of inheritance, cereal will attempt to find the shortest path by using registered relationships to perform the cast\&. .PP This class will be allocated as a \fBStaticObject\fP and only referenced by pointer, allowing a templated derived version of it to define strongly typed functions that cast between registered base and derived types\&. .SH "Member Function Documentation" .PP .SS "virtual void const * cereal::detail::PolymorphicCaster::downcast (void const *const ptr) const\fR [pure virtual]\fP" .PP Downcasts to the proper derived type\&. .PP Implemented in \fBcereal::detail::PolymorphicVirtualCaster< Base, Derived >\fP\&. .SS "virtual std::shared_ptr< void > cereal::detail::PolymorphicCaster::upcast (std::shared_ptr< void > const & ptr) const\fR [pure virtual]\fP" .PP Upcast to proper base type, shared_ptr version\&. .PP Implemented in \fBcereal::detail::PolymorphicVirtualCaster< Base, Derived >\fP\&. .SS "virtual void * cereal::detail::PolymorphicCaster::upcast (void *const ptr) const\fR [pure virtual]\fP" .PP Upcast to proper base type\&. .PP Implemented in \fBcereal::detail::PolymorphicVirtualCaster< Base, Derived >\fP\&. .SH "Author" .PP Generated automatically by Doxygen for cereal from the source code\&.