Doxygen
Loading...
Searching...
No Matches
ScopedTypeVariant Class Reference

#include <src/scopedtypevariant.h>

+ Collaboration diagram for ScopedTypeVariant:

Classes

struct  DummyDef
 

Public Types

using GlobalDef = const Definition *
 
using Variant = std::variant<DummyDef,LocalDef,GlobalDef>
 

Public Member Functions

 ScopedTypeVariant (GlobalDef d=nullptr)
 
 ScopedTypeVariant (const QCString &name)
 
QCString name () const
 
LocalDeflocalDef ()
 
const LocalDeflocalDef () const
 
const DefinitionglobalDef () const
 
bool isDummy () const
 

Private Attributes

QCString m_name
 
Variant m_variant
 

Detailed Description

Variant class for a scoped type.

Variants:

  • DummyDef: a type used for hiding a global type.
  • LocalDef: a locally defined type (e.g. found inside a function)
  • GlobalDef: a globally defined type (processed by doxygen in an earlier pass).

Definition at line 46 of file scopedtypevariant.h.

Member Typedef Documentation

◆ GlobalDef

Definition at line 50 of file scopedtypevariant.h.

◆ Variant

Definition at line 51 of file scopedtypevariant.h.

Constructor & Destructor Documentation

◆ ScopedTypeVariant() [1/2]

ScopedTypeVariant::ScopedTypeVariant ( GlobalDef d = nullptr)
inlineexplicit

Definition at line 52 of file scopedtypevariant.h.

53 : m_name(d ? d->name() : QCString()), m_variant(d ? Variant(d) : Variant(DummyDef())) {}
std::variant< DummyDef, LocalDef, GlobalDef > Variant

References m_name, m_variant, and name().

◆ ScopedTypeVariant() [2/2]

ScopedTypeVariant::ScopedTypeVariant ( const QCString & name)
inlineexplicit

Definition at line 54 of file scopedtypevariant.h.

55 : m_name(name), m_variant(LocalDef()) {}
QCString name() const

References m_name, m_variant, and name().

Member Function Documentation

◆ globalDef()

const Definition * ScopedTypeVariant::globalDef ( ) const
inline

Definition at line 59 of file scopedtypevariant.h.

59{ auto pp = std::get_if<GlobalDef>(&m_variant); return pp ? *pp : nullptr; }

References m_variant.

Referenced by writeObjCMethodCall().

◆ isDummy()

bool ScopedTypeVariant::isDummy ( ) const
inline

Definition at line 60 of file scopedtypevariant.h.

60{ return std::holds_alternative<DummyDef>(m_variant); }

References m_variant.

Referenced by generateClassOrGlobalLink(), generateClassOrGlobalLink(), generateMemberLink(), and setCallContextForVar().

◆ localDef() [1/2]

LocalDef * ScopedTypeVariant::localDef ( )
inline

Definition at line 57 of file scopedtypevariant.h.

57{ return std::get_if<LocalDef>(&m_variant); }

References m_variant.

Referenced by generateFunctionLink(), generateFunctionLink(), generateMemberLink(), and getLinkInScope().

◆ localDef() [2/2]

const LocalDef * ScopedTypeVariant::localDef ( ) const
inline

Definition at line 58 of file scopedtypevariant.h.

58{ return std::get_if<LocalDef>(&m_variant); }

References m_variant.

◆ name()

QCString ScopedTypeVariant::name ( ) const
inline

Member Data Documentation

◆ m_name

QCString ScopedTypeVariant::m_name
private

Definition at line 63 of file scopedtypevariant.h.

Referenced by name(), ScopedTypeVariant(), and ScopedTypeVariant().

◆ m_variant

Variant ScopedTypeVariant::m_variant
private

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