CIRCT  19.0.0git
Public Types | Public Member Functions | Private Attributes | List of all members
circt::firrtl::FIRRTLTypeSwitch< T, ResultT > Class Template Reference

This class implements the same functionality as TypeSwitch except that it uses firrtl::type_dyn_cast for dynamic cast. More...

#include <FIRRTLTypes.h>

Inheritance diagram for circt::firrtl::FIRRTLTypeSwitch< T, ResultT >:
Inheritance graph
[legend]
Collaboration diagram for circt::firrtl::FIRRTLTypeSwitch< T, ResultT >:
Collaboration graph
[legend]

Public Types

using BaseT = llvm::detail::TypeSwitchBase< FIRRTLTypeSwitch< T, ResultT >, T >
 

Public Member Functions

 FIRRTLTypeSwitch (FIRRTLTypeSwitch &&other)=default
 
template<typename CaseT , typename CallableT >
FIRRTLTypeSwitch< T, ResultT > & Case (CallableT &&caseFn)
 Add a case on the given type. More...
 
template<typename CallableT >
ResultT Default (CallableT &&defaultFn)
 As a default, invoke the given callable within the root value. More...
 
ResultT Default (ResultT defaultResult)
 As a default, return the given value. More...
 
 operator ResultT ()
 

Private Attributes

std::optional< ResultT > result
 The pointer to the result of this switch statement, once known, null before that. More...
 

Detailed Description

template<typename T, typename ResultT = void>
class circt::firrtl::FIRRTLTypeSwitch< T, ResultT >

This class implements the same functionality as TypeSwitch except that it uses firrtl::type_dyn_cast for dynamic cast.

llvm::TypeSwitch is not customizable so this class currently duplicates the code.

Definition at line 517 of file FIRRTLTypes.h.

Member Typedef Documentation

◆ BaseT

template<typename T , typename ResultT = void>
using circt::firrtl::FIRRTLTypeSwitch< T, ResultT >::BaseT = llvm::detail::TypeSwitchBase<FIRRTLTypeSwitch<T, ResultT>, T>

Definition at line 520 of file FIRRTLTypes.h.

Constructor & Destructor Documentation

◆ FIRRTLTypeSwitch()

template<typename T , typename ResultT = void>
circt::firrtl::FIRRTLTypeSwitch< T, ResultT >::FIRRTLTypeSwitch ( FIRRTLTypeSwitch< T, ResultT > &&  other)
default

Member Function Documentation

◆ Case()

template<typename T , typename ResultT = void>
template<typename CaseT , typename CallableT >
FIRRTLTypeSwitch<T, ResultT>& circt::firrtl::FIRRTLTypeSwitch< T, ResultT >::Case ( CallableT &&  caseFn)
inline

◆ Default() [1/2]

template<typename T , typename ResultT = void>
template<typename CallableT >
ResultT circt::firrtl::FIRRTLTypeSwitch< T, ResultT >::Default ( CallableT &&  defaultFn)
inline

As a default, invoke the given callable within the root value.

Definition at line 541 of file FIRRTLTypes.h.

References circt::firrtl::FIRRTLTypeSwitch< T, ResultT >::result.

◆ Default() [2/2]

template<typename T , typename ResultT = void>
ResultT circt::firrtl::FIRRTLTypeSwitch< T, ResultT >::Default ( ResultT  defaultResult)
inline

As a default, return the given value.

Definition at line 549 of file FIRRTLTypes.h.

References circt::firrtl::FIRRTLTypeSwitch< T, ResultT >::result.

◆ operator ResultT()

template<typename T , typename ResultT = void>
circt::firrtl::FIRRTLTypeSwitch< T, ResultT >::operator ResultT ( )
inline

Member Data Documentation

◆ result

template<typename T , typename ResultT = void>
std::optional<ResultT> circt::firrtl::FIRRTLTypeSwitch< T, ResultT >::result
private

The pointer to the result of this switch statement, once known, null before that.

Definition at line 563 of file FIRRTLTypes.h.

Referenced by circt::firrtl::FIRRTLTypeSwitch< T, ResultT >::Case(), circt::firrtl::FIRRTLTypeSwitch< T, ResultT >::Default(), and circt::firrtl::FIRRTLTypeSwitch< T, ResultT >::operator ResultT().


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