GRASP rci-qed
Public Member Functions | Protected Member Functions | List of all members
cpptoml::base Class Referenceabstract

#include <cpptoml.h>

Inheritance diagram for cpptoml::base:
Inheritance graph
[legend]
Collaboration diagram for cpptoml::base:
Collaboration graph
[legend]

Public Member Functions

virtual ~base ()=default
 
virtual std::shared_ptr< baseclone () const =0
 
virtual bool is_value () const
 
virtual bool is_table () const
 
std::shared_ptr< tableas_table ()
 
virtual bool is_array () const
 
std::shared_ptr< arrayas_array ()
 
virtual bool is_table_array () const
 
std::shared_ptr< table_arrayas_table_array ()
 
template<class T >
std::shared_ptr< value< T > > as ()
 
template<class T >
std::shared_ptr< const value< T > > as () const
 
template<class Visitor , class... Args>
void accept (Visitor &&visitor, Args &&... args) const
 
template<>
std::shared_ptr< value< double > > as ()
 
template<>
std::shared_ptr< const value< double > > as () const
 

Protected Member Functions

 base ()
 

Detailed Description

A generic base TOML value used for type erasure.

Constructor & Destructor Documentation

◆ ~base()

virtual cpptoml::base::~base ( )
virtualdefault

◆ base()

cpptoml::base::base ( )
inlineprotected

Member Function Documentation

◆ accept()

template<class Visitor , class... Args>
void cpptoml::base::accept ( Visitor &&  visitor,
Args &&...  args 
) const

base implementation of accept() that calls visitor.visit() on the concrete class.

Here is the caller graph for this function:

◆ as() [1/4]

template<class T >
std::shared_ptr< value< T > > cpptoml::base::as ( )
inline

Attempts to coerce the TOML element into a concrete TOML value of type T.

Here is the caller graph for this function:

◆ as() [2/4]

template<class T >
std::shared_ptr< const value< T > > cpptoml::base::as ( ) const
inline

◆ as() [3/4]

template<>
std::shared_ptr<value<double> > cpptoml::base::as ( )
inline

◆ as() [4/4]

template<>
std::shared_ptr<const value<double> > cpptoml::base::as ( ) const
inline

◆ as_array()

std::shared_ptr<array> cpptoml::base::as_array ( )
inline

Converts the TOML element to an array.

◆ as_table()

std::shared_ptr<table> cpptoml::base::as_table ( )
inline

Converts the TOML element into a table.

◆ as_table_array()

std::shared_ptr<table_array> cpptoml::base::as_table_array ( )
inline

Converts the TOML element into a table array.

◆ clone()

virtual std::shared_ptr<base> cpptoml::base::clone ( ) const
pure virtual

◆ is_array()

virtual bool cpptoml::base::is_array ( ) const
inlinevirtual

Determines if the TOML element is an array of "leaf" elements.

Reimplemented in cpptoml::array.

◆ is_table()

virtual bool cpptoml::base::is_table ( ) const
inlinevirtual

Determines if the given TOML element is a table.

Reimplemented in cpptoml::table.

Here is the caller graph for this function:

◆ is_table_array()

virtual bool cpptoml::base::is_table_array ( ) const
inlinevirtual

Determines if the given TOML element is an array of tables.

Reimplemented in cpptoml::table_array.

Here is the caller graph for this function:

◆ is_value()

virtual bool cpptoml::base::is_value ( ) const
inlinevirtual

Determines if the given TOML element is a value.

Reimplemented in cpptoml::value< T >.


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