MAIA bb96820c
Multiphysics at AIA
Loading...
Searching...
No Matches
cpptoml::value< T > Class Template Reference

#include <cpptoml.h>

Inheritance diagram for cpptoml::value< T >:
[legend]
Collaboration diagram for cpptoml::value< T >:
[legend]

Classes

struct  make_shared_enabler
 

Public Member Functions

std::shared_ptr< baseclone () const override
 
 value (const make_shared_enabler &, const T &val)
 
MBool is_value () const override
 
T & get ()
 
const T & get () const
 
 value (const value &val)=delete
 
valueoperator= (const value &val)=delete
 
- Public Member Functions inherited from cpptoml::base
virtual ~base ()=default
 
virtual std::shared_ptr< baseclone () const =0
 
virtual MBool is_value () const
 
virtual MBool is_table () const
 
std::shared_ptr< tableas_table ()
 
virtual MBool is_array () const
 
std::shared_ptr< arrayas_array ()
 
virtual MBool 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
 
base_type type () const
 
template<>
std::shared_ptr< value< double > > as ()
 
template<>
std::shared_ptr< const value< double > > as () const
 

Private Member Functions

 value (const T &val)
 
 value (const T &val)
 

Private Attributes

data_
 

Friends

template<class U >
std::shared_ptr< typename value_traits< U >::typecpptoml::make_value (U &&val)
 

Additional Inherited Members

- Protected Member Functions inherited from cpptoml::base
 base (const base_type t)
 
 base ()
 

Detailed Description

template<class T>
class cpptoml::value< T >

A concrete TOML value representing the "leaves" of the "tree".

Definition at line 538 of file cpptoml.h.

Constructor & Destructor Documentation

◆ value() [1/4]

template<class T >
cpptoml::value< T >::value ( const make_shared_enabler ,
const T &  val 
)
inline

Definition at line 553 of file cpptoml.h.

553 : value(val) {
554 // nothing; note that users cannot actually invoke this function
555 // because they lack access to the make_shared_enabler.
556 }
value(const make_shared_enabler &, const T &val)
Definition: cpptoml.h:553

◆ value() [2/4]

template<class T >
cpptoml::value< T >::value ( const T &  val)
inlineexplicitprivate

Constructs a value from the given data.

Definition at line 577 of file cpptoml.h.

577: base(base_type_traits<T>::type), data_(val) {}

◆ value() [3/4]

template<class T >
cpptoml::value< T >::value ( const T &  val)
inlineexplicitprivate

Definition at line 579 of file cpptoml.h.

579: data_(val) {}

◆ value() [4/4]

template<class T >
cpptoml::value< T >::value ( const value< T > &  val)
delete

Member Function Documentation

◆ clone()

template<class T >
std::shared_ptr< base > cpptoml::value< T >::clone
overridevirtual

Implements cpptoml::base.

Definition at line 1433 of file cpptoml.h.

1433 {
1434 return make_value(data_);
1435}
friend std::shared_ptr< typename value_traits< U >::type > cpptoml::make_value(U &&val)

◆ get() [1/2]

template<class T >
T & cpptoml::value< T >::get ( )
inline

Gets the data associated with this value.

Definition at line 563 of file cpptoml.h.

563{ return data_; }

◆ get() [2/2]

template<class T >
const T & cpptoml::value< T >::get ( ) const
inline

Gets the data associated with this value. Const version.

Definition at line 568 of file cpptoml.h.

568{ return data_; }

◆ is_value()

template<class T >
MBool cpptoml::value< T >::is_value ( ) const
inlineoverridevirtual

Determines if the given TOML element is a value.

Reimplemented from cpptoml::base.

Definition at line 558 of file cpptoml.h.

558{ return true; }

◆ operator=()

template<class T >
value & cpptoml::value< T >::operator= ( const value< T > &  val)
delete

Friends And Related Function Documentation

◆ cpptoml::make_value

template<class T >
template<class U >
std::shared_ptr< typename value_traits< U >::type > cpptoml::make_value ( U &&  val)
friend

Member Data Documentation

◆ data_

template<class T >
T cpptoml::value< T >::data_
private

Definition at line 571 of file cpptoml.h.


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