clang  3.9.0
Classes | Public Member Functions | List of all members
clang::ast_matchers::dynamic::VariantValue Class Reference

Variant value class. More...

#include <VariantValue.h>

Public Member Functions

 VariantValue ()
 
 VariantValue (const VariantValue &Other)
 
 ~VariantValue ()
 
VariantValueoperator= (const VariantValue &Other)
 
 VariantValue (unsigned Unsigned)
 Specific constructors for each supported type. More...
 
 VariantValue (StringRef String)
 
 VariantValue (const VariantMatcher &Matchers)
 
 operator bool () const
 Returns true iff this is not an empty value. More...
 
bool hasValue () const
 
bool isUnsigned () const
 Unsigned value functions. More...
 
unsigned getUnsigned () const
 
void setUnsigned (unsigned Unsigned)
 
bool isString () const
 String value functions. More...
 
const std::string & getString () const
 
void setString (StringRef String)
 
bool isMatcher () const
 Matcher value functions. More...
 
const VariantMatchergetMatcher () const
 
void setMatcher (const VariantMatcher &Matcher)
 
bool isConvertibleTo (ArgKind Kind, unsigned *Specificity) const
 Determines if the contained value can be converted to Kind. More...
 
bool isConvertibleTo (ArrayRef< ArgKind > Kinds, unsigned *Specificity) const
 Determines if the contained value can be converted to any kind in Kinds. More...
 
std::string getTypeAsString () const
 String representation of the type of the value. More...
 

Detailed Description

Variant value class.

Basically, a tagged union with value type semantics. It is used by the registry as the return value and argument type for the matcher factory methods. It can be constructed from any of the supported types. It supports copy/assignment.

Supported types:

Definition at line 247 of file VariantValue.h.

Constructor & Destructor Documentation

clang::ast_matchers::dynamic::VariantValue::VariantValue ( )
inline

Definition at line 249 of file VariantValue.h.

clang::ast_matchers::dynamic::VariantValue::VariantValue ( const VariantValue Other)

Definition at line 244 of file VariantValue.cpp.

clang::ast_matchers::dynamic::VariantValue::~VariantValue ( )

Definition at line 260 of file VariantValue.cpp.

clang::ast_matchers::dynamic::VariantValue::VariantValue ( unsigned  Unsigned)

Specific constructors for each supported type.

Definition at line 248 of file VariantValue.cpp.

References setUnsigned().

clang::ast_matchers::dynamic::VariantValue::VariantValue ( StringRef  String)

Definition at line 252 of file VariantValue.cpp.

References setString().

clang::ast_matchers::dynamic::VariantValue::VariantValue ( const VariantMatcher Matchers)

Definition at line 256 of file VariantValue.cpp.

References setMatcher().

Member Function Documentation

const VariantMatcher & clang::ast_matchers::dynamic::VariantValue::getMatcher ( ) const
const std::string & clang::ast_matchers::dynamic::VariantValue::getString ( ) const
std::string clang::ast_matchers::dynamic::VariantValue::getTypeAsString ( ) const
unsigned clang::ast_matchers::dynamic::VariantValue::getUnsigned ( ) const

Definition at line 302 of file VariantValue.cpp.

References isUnsigned().

Referenced by operator=().

bool clang::ast_matchers::dynamic::VariantValue::hasValue ( ) const
inline

Definition at line 262 of file VariantValue.h.

Referenced by operator bool().

bool clang::ast_matchers::dynamic::VariantValue::isConvertibleTo ( ArgKind  Kind,
unsigned Specificity 
) const
bool clang::ast_matchers::dynamic::VariantValue::isConvertibleTo ( ArrayRef< ArgKind Kinds,
unsigned Specificity 
) const

Determines if the contained value can be converted to any kind in Kinds.

Parameters
Kindsthe requested destination types.
Specificityvalue corresponding to the "specificity" of the convertion. It is the maximum specificity of all the possible conversions.

Definition at line 365 of file VariantValue.cpp.

References isConvertibleTo(), and max().

bool clang::ast_matchers::dynamic::VariantValue::isMatcher ( ) const
bool clang::ast_matchers::dynamic::VariantValue::isString ( ) const
bool clang::ast_matchers::dynamic::VariantValue::isUnsigned ( ) const

Unsigned value functions.

Definition at line 298 of file VariantValue.cpp.

Referenced by getUnsigned(), clang::ast_matchers::dynamic::internal::ArgTypeTraits< unsigned >::is(), and isConvertibleTo().

clang::ast_matchers::dynamic::VariantValue::operator bool ( ) const
inlineexplicit

Returns true iff this is not an empty value.

Definition at line 261 of file VariantValue.h.

References hasValue().

VariantValue & clang::ast_matchers::dynamic::VariantValue::operator= ( const VariantValue Other)
void clang::ast_matchers::dynamic::VariantValue::setMatcher ( const VariantMatcher Matcher)

Definition at line 337 of file VariantValue.cpp.

Referenced by operator=(), and VariantValue().

void clang::ast_matchers::dynamic::VariantValue::setString ( StringRef  String)

Definition at line 322 of file VariantValue.cpp.

Referenced by operator=(), and VariantValue().

void clang::ast_matchers::dynamic::VariantValue::setUnsigned ( unsigned  Unsigned)

Definition at line 307 of file VariantValue.cpp.

Referenced by operator=(), and VariantValue().


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