clang-metatool
A framework for reusing code in clang tools
Public Member Functions | List of all members
clangmetatool::propagation::PropagationResult< ResultType > Class Template Reference

#include <clangmetatool/propagation/propagation_result.h>

Public Member Functions

 PropagationResult ()
 
 PropagationResult (const ResultType &result)
 
bool isUnresolved () const
 
const ResultType & getResult () const
 
void print (std::ostream &stream) const
 
bool operator< (const PropagationResult< ResultType > &rhs) const
 
bool operator== (const PropagationResult< ResultType > &rhs) const
 
bool operator!= (const PropagationResult< ResultType > &rhs) const
 

Detailed Description

template<typename ResultType>
class clangmetatool::propagation::PropagationResult< ResultType >

Type to represent the result in propagation, since a value may either be unresolved in the case that it's value at some point in the code is non-deterministic, or it may have a deterministic value

Definition at line 15 of file propagation_result.h.

Constructor & Destructor Documentation

◆ PropagationResult() [1/2]

template<typename ResultType>
clangmetatool::propagation::PropagationResult< ResultType >::PropagationResult ( )
inline

Default constructor to produce an unresolved value

Definition at line 24 of file propagation_result.h.

◆ PropagationResult() [2/2]

template<typename ResultType>
clangmetatool::propagation::PropagationResult< ResultType >::PropagationResult ( const ResultType &  result)
inline

Constructor taking ResultType to produce a resolved value

Definition at line 29 of file propagation_result.h.

Member Function Documentation

◆ getResult()

template<typename ResultType>
const ResultType& clangmetatool::propagation::PropagationResult< ResultType >::getResult ( ) const
inline

Get the resolved result.

Calling this function before the result has been determined to indeed be resolved with a call to isUnresolved() is undefined behaviour.

Definition at line 43 of file propagation_result.h.

◆ isUnresolved()

template<typename ResultType>
bool clangmetatool::propagation::PropagationResult< ResultType >::isUnresolved ( ) const
inline

Check if the result is unresolved.

Definition at line 35 of file propagation_result.h.

◆ operator!=()

template<typename ResultType>
bool clangmetatool::propagation::PropagationResult< ResultType >::operator!= ( const PropagationResult< ResultType > &  rhs) const
inline

Definition at line 70 of file propagation_result.h.

◆ operator<()

template<typename ResultType>
bool clangmetatool::propagation::PropagationResult< ResultType >::operator< ( const PropagationResult< ResultType > &  rhs) const
inline

Definition at line 58 of file propagation_result.h.

◆ operator==()

template<typename ResultType>
bool clangmetatool::propagation::PropagationResult< ResultType >::operator== ( const PropagationResult< ResultType > &  rhs) const
inline

Definition at line 61 of file propagation_result.h.

◆ print()

template<typename ResultType>
void clangmetatool::propagation::PropagationResult< ResultType >::print ( std::ostream &  stream) const
inline

Print the result to a stream.

When the result is undefined, it will output "<UNRESOLVED>".

Definition at line 50 of file propagation_result.h.


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