GRASP rci-qed
Public Types | Public Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
cpptoml::table_array Class Reference

#include <cpptoml.h>

Inheritance diagram for cpptoml::table_array:
Inheritance graph
[legend]
Collaboration diagram for cpptoml::table_array:
Collaboration graph
[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
 
virtual bool 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)
 
bool is_inline () const
 
- Public Member Functions inherited from cpptoml::base
virtual ~base ()=default
 
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 ()
 
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
 

Private Member Functions

 table_array (bool is_inline=false)
 
 table_array (const table_array &obj)=delete
 
table_arrayoperator= (const table_array &rhs)=delete
 

Private Attributes

std::vector< std::shared_ptr< table > > array_
 
const bool is_inline_ = false
 

Friends

class table
 
std::shared_ptr< table_arraymake_table_array (bool)
 

Additional Inherited Members

- Protected Member Functions inherited from cpptoml::base
 base ()
 

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.

◆ iterator

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

arrays can be iterated over

◆ size_type

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

Constructor & Destructor Documentation

◆ table_array() [1/2]

cpptoml::table_array::table_array ( bool  is_inline = false)
inlineprivate

◆ table_array() [2/2]

cpptoml::table_array::table_array ( const table_array obj)
privatedelete

Member Function Documentation

◆ begin() [1/2]

iterator cpptoml::table_array::begin ( )
inline

◆ begin() [2/2]

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

◆ clear()

void cpptoml::table_array::clear ( )
inline

Clear the array

◆ clone()

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

Implements cpptoml::base.

Here is the call graph for this function:

◆ end() [1/2]

iterator cpptoml::table_array::end ( )
inline

◆ end() [2/2]

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

◆ erase()

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

Erase an element from the array

◆ get() [1/2]

std::vector<std::shared_ptr<table> >& cpptoml::table_array::get ( )
inline
Here is the caller graph for this function:

◆ get() [2/2]

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

◆ insert()

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

Insert a table into the array

◆ is_inline()

bool cpptoml::table_array::is_inline ( ) const
inline

Whether or not the table array is declared inline. This mostly matters for parsing, where statically defined arrays cannot be appended to using the array-of-table syntax.

◆ is_table_array()

virtual bool cpptoml::table_array::is_table_array ( ) const
inlineoverridevirtual

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

Reimplemented from cpptoml::base.

◆ operator=()

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

◆ push_back()

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

Add a table to the end of the array

◆ reserve()

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

Reserve space for n tables.

Friends And Related Function Documentation

◆ make_table_array

std::shared_ptr<table_array> make_table_array ( bool  is_inline = false)
friend

◆ table

friend class table
friend

Member Data Documentation

◆ array_

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

◆ is_inline_

const bool cpptoml::table_array::is_inline_ = false
private

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