MAIA bb96820c
Multiphysics at AIA
Loading...
Searching...
No Matches
cpptoml::table_array Class Reference

#include <cpptoml.h>

Inheritance diagram for cpptoml::table_array:
[legend]
Collaboration diagram for cpptoml::table_array:
[legend]

Public Types

using size_type = std::size_t
 
using iterator = std::vector< std::shared_ptr< table > >::iterator
 
using const_iterator = std::vector< std::shared_ptr< table > >::const_iterator
 

Public Member Functions

std::shared_ptr< baseclone () const override
 
iterator begin ()
 
const_iterator begin () const
 
iterator end ()
 
const_iterator end () const
 
MBool is_table_array () const override
 
std::vector< std::shared_ptr< table > > & get ()
 
const std::vector< std::shared_ptr< table > > & get () const
 
void push_back (const std::shared_ptr< table > &val)
 
iterator insert (iterator position, const std::shared_ptr< table > &value)
 
iterator erase (iterator position)
 
void clear ()
 
void reserve (size_type n)
 
 table_array (const table_array &obj)=delete
 
table_arrayoperator= (const table_array &rhs)=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

 table_array ()
 
 table_array ()
 

Private Attributes

std::vector< std::shared_ptr< table > > array_
 

Friends

class table
 
std::shared_ptr< table_arraymake_table_array ()
 

Additional Inherited Members

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

Detailed Description

Definition at line 911 of file cpptoml.h.

Member Typedef Documentation

◆ const_iterator

using cpptoml::table_array::const_iterator = std::vector<std::shared_ptr<table> >::const_iterator

arrays can be iterated over. Const version.

Definition at line 928 of file cpptoml.h.

◆ iterator

using cpptoml::table_array::iterator = std::vector<std::shared_ptr<table> >::iterator

arrays can be iterated over

Definition at line 923 of file cpptoml.h.

◆ size_type

using cpptoml::table_array::size_type = std::size_t

Definition at line 918 of file cpptoml.h.

Constructor & Destructor Documentation

◆ table_array() [1/3]

cpptoml::table_array::table_array ( )
inlineprivate

Definition at line 973 of file cpptoml.h.

974 // nothing
975 }

◆ table_array() [2/3]

cpptoml::table_array::table_array ( )
inlineprivate

Definition at line 977 of file cpptoml.h.

977 {
978 // nothing
979 }

◆ table_array() [3/3]

cpptoml::table_array::table_array ( const table_array obj)
delete

Member Function Documentation

◆ begin() [1/2]

iterator cpptoml::table_array::begin ( )
inline

Definition at line 930 of file cpptoml.h.

930{ return array_.begin(); }
std::vector< std::shared_ptr< table > > array_
Definition: cpptoml.h:987

◆ begin() [2/2]

const_iterator cpptoml::table_array::begin ( ) const
inline

Definition at line 932 of file cpptoml.h.

932{ return array_.begin(); }

◆ clear()

void cpptoml::table_array::clear ( )
inline

Clear the array

Definition at line 962 of file cpptoml.h.

962{ array_.clear(); }

◆ clone()

std::shared_ptr< base > cpptoml::table_array::clone ( ) const
inlineoverridevirtual

Implements cpptoml::base.

Definition at line 1445 of file cpptoml.h.

1445 {
1446 auto result = make_table_array();
1447 result->reserve(array_.size());
1448 for(const auto& ptr : array_)
1449 result->array_.push_back(ptr->clone()->as_table());
1450 return result;
1451}
friend std::shared_ptr< table_array > make_table_array()
Definition: cpptoml.h:999

◆ end() [1/2]

iterator cpptoml::table_array::end ( )
inline

Definition at line 934 of file cpptoml.h.

934{ return array_.end(); }

◆ end() [2/2]

const_iterator cpptoml::table_array::end ( ) const
inline

Definition at line 936 of file cpptoml.h.

936{ return array_.end(); }

◆ erase()

iterator cpptoml::table_array::erase ( iterator  position)
inline

Erase an element from the array

Definition at line 957 of file cpptoml.h.

957{ return array_.erase(position); }

◆ get() [1/2]

std::vector< std::shared_ptr< table > > & cpptoml::table_array::get ( )
inline

Definition at line 940 of file cpptoml.h.

940{ return array_; }

◆ get() [2/2]

const std::vector< std::shared_ptr< table > > & cpptoml::table_array::get ( ) const
inline

Definition at line 942 of file cpptoml.h.

942{ return array_; }

◆ insert()

iterator cpptoml::table_array::insert ( iterator  position,
const std::shared_ptr< table > &  value 
)
inline

Insert a table into the array

Definition at line 952 of file cpptoml.h.

952{ return array_.insert(position, value); }

◆ is_table_array()

MBool cpptoml::table_array::is_table_array ( ) const
inlineoverridevirtual

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

Reimplemented from cpptoml::base.

Definition at line 938 of file cpptoml.h.

938{ return true; }

◆ operator=()

table_array & cpptoml::table_array::operator= ( const table_array rhs)
delete

◆ push_back()

void cpptoml::table_array::push_back ( const std::shared_ptr< table > &  val)
inline

Add a table to the end of the array

Definition at line 947 of file cpptoml.h.

947{ array_.push_back(val); }

◆ reserve()

void cpptoml::table_array::reserve ( size_type  n)
inline

Reserve space for n tables.

Definition at line 967 of file cpptoml.h.

967{ array_.reserve(n); }

Friends And Related Function Documentation

◆ make_table_array

std::shared_ptr< table_array > make_table_array ( )
friend

Definition at line 999 of file cpptoml.h.

999 {
1000#if not defined(MAIA_INTEL_COMPILER)
1001 struct make_shared_enabler : public table_array {
1002 make_shared_enabler() = default;
1003 };
1004
1005 return std::make_shared<make_shared_enabler>();
1006#else
1007 return std::make_shared<TABLE_ARRAY_::make_shared_enabler>();
1008#endif
1009}

◆ table

friend class table
friend

Definition at line 912 of file cpptoml.h.

Member Data Documentation

◆ array_

std::vector<std::shared_ptr<table> > cpptoml::table_array::array_
private

Definition at line 987 of file cpptoml.h.


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