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

Constructor & Destructor Documentation

◆ TYPE_CAST()

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

Definition at line 485 of file property.h.

486  {
487  }

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

502  {
503  return TYPE_HASH( Base );
504  }
#define TYPE_HASH(x)
Macro to generate unique identifier for a type
Definition: property.h:53

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

507  {
508  return TYPE_HASH( Derived );
509  }
#define TYPE_HASH(x)
Macro to generate unique identifier for a type
Definition: property.h:53

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

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

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

496  {
497  const Base* base = reinterpret_cast<const Base*>( aPointer );
498  return static_cast<const Derived*>( base );
499  }

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