CBMC
response_or_errort< smtt > Class Template Referencefinal

Holds either a valid parsed response or response sub-tree of type. More...

#include <response_or_error.h>

Public Member Functions

 response_or_errort (smtt smt)
 
 response_or_errort (std::vector< std::string > messages)
 
const smtt * get_if_valid () const
 Gets the smt response if the response is valid, or returns nullptr otherwise. More...
 
const std::vector< std::string > * get_if_error () const
 Gets the error messages if the response is invalid, or returns nullptr otherwise. More...
 

Private Attributes

std::variant< smtt, std::vector< std::string > > smt_or_messages
 

Detailed Description

template<class smtt>
class response_or_errort< smtt >

Holds either a valid parsed response or response sub-tree of type.

Template Parameters
smttor a collection of message strings explaining why the given input was not valid.

Definition at line 16 of file response_or_error.h.

Constructor & Destructor Documentation

◆ response_or_errort() [1/2]

template<class smtt >
response_or_errort< smtt >::response_or_errort ( smtt  smt)
inlineexplicit

Definition at line 19 of file response_or_error.h.

◆ response_or_errort() [2/2]

template<class smtt >
response_or_errort< smtt >::response_or_errort ( std::vector< std::string >  messages)
inlineexplicit

Definition at line 23 of file response_or_error.h.

Member Function Documentation

◆ get_if_error()

template<class smtt >
const std::vector<std::string>* response_or_errort< smtt >::get_if_error ( ) const
inline

Gets the error messages if the response is invalid, or returns nullptr otherwise.

Definition at line 37 of file response_or_error.h.

◆ get_if_valid()

template<class smtt >
const smtt* response_or_errort< smtt >::get_if_valid ( ) const
inline

Gets the smt response if the response is valid, or returns nullptr otherwise.

Definition at line 30 of file response_or_error.h.

Member Data Documentation

◆ smt_or_messages

template<class smtt >
std::variant<smtt, std::vector<std::string> > response_or_errort< smtt >::smt_or_messages
private

Definition at line 43 of file response_or_error.h.


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