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 475 of file property.h.

Constructor & Destructor Documentation

◆ TYPE_CAST()

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

Definition at line 478 of file property.h.

479  {
480  }

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 494 of file property.h.

495  {
496  return TYPE_HASH( Base );
497  }
#define TYPE_HASH(x)
Definition: property.h:59

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 499 of file property.h.

500  {
501  return TYPE_HASH( Derived );
502  }
#define TYPE_HASH(x)
Definition: property.h:59

References TYPE_HASH.

◆ operator()() [1/2]

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

Implements TYPE_CAST_BASE.

Definition at line 482 of file property.h.

483  {
484  Base* base = reinterpret_cast<Base*>( aPointer );
485  return static_cast<Derived*>( base );
486  }

◆ operator()() [2/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 488 of file property.h.

489  {
490  const Base* base = reinterpret_cast<const Base*>( aPointer );
491  return static_cast<const Derived*>( base );
492  }

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