KiCad PCB EDA Suite
TYPE_CAST< Base, Derived > Class Template Reference

#include <property.h>

Inheritance diagram for TYPE_CAST< Base, Derived >:
TYPE_CAST_BASE

Public Member Functions

 TYPE_CAST ()
 
void * operator() (void *aPointer) const override
 
const void * operator() (const void *aPointer) const override
 
size_t BaseHash () const override
 
size_t DerivedHash () const override
 

Detailed Description

template<typename Base, typename Derived>
class TYPE_CAST< Base, Derived >

Definition at line 538 of file property.h.

Constructor & Destructor Documentation

◆ TYPE_CAST()

template<typename Base , typename Derived >
TYPE_CAST< Base, Derived >::TYPE_CAST ( )
inline

Definition at line 541 of file property.h.

542 {
543 }

Member Function Documentation

◆ BaseHash()

template<typename Base , typename Derived >
size_t TYPE_CAST< Base, Derived >::BaseHash ( ) const
inlineoverridevirtual

Implements TYPE_CAST_BASE.

Definition at line 557 of file property.h.

558 {
559 return TYPE_HASH( Base );
560 }
#define TYPE_HASH(x)
Definition: property.h:62

References TYPE_HASH.

◆ DerivedHash()

template<typename Base , typename Derived >
size_t TYPE_CAST< Base, Derived >::DerivedHash ( ) const
inlineoverridevirtual

Implements TYPE_CAST_BASE.

Definition at line 562 of file property.h.

563 {
564 return TYPE_HASH( Derived );
565 }

References TYPE_HASH.

◆ operator()() [1/2]

template<typename Base , typename Derived >
const void * TYPE_CAST< Base, Derived >::operator() ( const void *  aPointer) const
inlineoverridevirtual

Implements TYPE_CAST_BASE.

Definition at line 551 of file property.h.

552 {
553 const Base* base = reinterpret_cast<const Base*>( aPointer );
554 return static_cast<const Derived*>( base );
555 }

◆ operator()() [2/2]

template<typename Base , typename Derived >
void * TYPE_CAST< Base, Derived >::operator() ( void *  aPointer) const
inlineoverridevirtual

Implements TYPE_CAST_BASE.

Definition at line 545 of file property.h.

546 {
547 Base* base = reinterpret_cast<Base*>( aPointer );
548 return static_cast<Derived*>( base );
549 }

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