WPILibC++  2020.3.2-60-g3011ebe
wpi::PointerUnion4< PT1, PT2, PT3, PT4 > Class Template Reference

A pointer union of four pointer types. More...

#include <PointerUnion.h>

Public Types

using InnerUnion1 = PointerUnion< PT1, PT2 >
 
using InnerUnion2 = PointerUnion< PT3, PT4 >
 
using ValTy = PointerUnion< InnerUnion1, InnerUnion2 >
 

Public Member Functions

 PointerUnion4 (PT1 V)
 
 PointerUnion4 (PT2 V)
 
 PointerUnion4 (PT3 V)
 
 PointerUnion4 (PT4 V)
 
bool isNull () const
 Test if the pointer held in the union is null, regardless of which type it is.
 
 operator bool () const
 
template<typename T >
int is () const
 Test if the Union currently holds the type matching T.
 
template<typename T >
get () const
 Returns the value of the specified pointer type. More...
 
template<typename T >
dyn_cast () const
 Returns the current pointer if it is of the specified pointer type, otherwises returns null.
 
const PointerUnion4operator= (std::nullptr_t)
 Assignment from nullptr which just clears the union.
 
const PointerUnion4operator= (const PT1 &RHS)
 Assignment operators - Allow assigning into this union from either pointer type, setting the discriminator to remember what it came from.
 
const PointerUnion4operator= (const PT2 &RHS)
 
const PointerUnion4operator= (const PT3 &RHS)
 
const PointerUnion4operator= (const PT4 &RHS)
 
void * getOpaqueValue () const
 

Static Public Member Functions

static PointerUnion4 getFromOpaqueValue (void *VP)
 

Detailed Description

template<typename PT1, typename PT2, typename PT3, typename PT4>
class wpi::PointerUnion4< PT1, PT2, PT3, PT4 >

A pointer union of four pointer types.

See documentation for PointerUnion for usage.

Member Function Documentation

◆ get()

template<typename PT1, typename PT2, typename PT3, typename PT4>
template<typename T >
T wpi::PointerUnion4< PT1, PT2, PT3, PT4 >::get ( ) const
inline

Returns the value of the specified pointer type.

If the specified pointer type is incorrect, assert.


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