Vcsn  2.5.dev
Be Rational
vcsn::detail::config::config_value Class Reference

The class returned by [] operators. More...

#include <configuration.hh>

Collaboration diagram for vcsn::detail::config::config_value:

Classes

class  BadNode
 

Public Types

using iterator = Node::iterator
 

Public Member Functions

 config_value (Node n)
 
 config_value (const config &)
 
 config_value (const config_value &other)
 
config_valueoperator= (config_value rhs)
 Assign a new value to this key. More...
 
template<typename T >
as () const
 
std::string str () const
 Get the node value as a string. More...
 
config_value operator[] (const std::string &key) const
 
std::vector< std::string > keys () const
 
bool is_valid (const std::string &key) const
 Check that this node refers to a key that exists in the tree. More...
 
void remove (const std::string &key)
 Remove a key. More...
 
iterator begin ()
 
iterator end ()
 
void merge (const config_value &from)
 Merge a value into another one - and modify the first. More...
 
std::ostream & print (std::ostream &out) const
 

Private Member Functions

std::unique_ptr< std::vector< std::string > > gen_keys () const
 

Private Attributes

std::unique_ptr< const std::vector< std::string > > keys_
 
Node node_
 

Friends

void swap (config_value &first, config_value &second)
 

Detailed Description

The class returned by [] operators.

Definition at line 27 of file configuration.hh.

Member Typedef Documentation

◆ iterator

Definition at line 59 of file configuration.hh.

Constructor & Destructor Documentation

◆ config_value() [1/3]

vcsn::detail::config::config_value::config_value ( Node  n)

Definition at line 47 of file configuration.cc.

Referenced by operator[](), and vcsn::detail::config::operator[]().

◆ config_value() [2/3]

vcsn::detail::config::config_value::config_value ( const config c)

Definition at line 55 of file configuration.cc.

References vcsn::detail::config::config_tree_.

◆ config_value() [3/3]

vcsn::detail::config::config_value::config_value ( const config_value other)

Definition at line 51 of file configuration.cc.

References node_.

Member Function Documentation

◆ as()

template<typename T >
T vcsn::detail::config::config_value::as ( ) const
inline

Definition at line 41 of file configuration.hh.

References is_valid(), keys(), node_, operator[](), and str().

Here is the call graph for this function:

◆ begin()

auto vcsn::detail::config::config_value::begin ( )

Definition at line 104 of file configuration.cc.

References node_, and vcsn::require().

Here is the call graph for this function:

◆ end()

auto vcsn::detail::config::config_value::end ( )

Definition at line 110 of file configuration.cc.

References node_.

◆ gen_keys()

std::unique_ptr< std::vector< std::string > > vcsn::detail::config::config_value::gen_keys ( ) const
private

Definition at line 128 of file configuration.cc.

References node_, vcsn::require(), vcsn::res, and vcsn::sort().

Referenced by keys().

Here is the call graph for this function:

◆ is_valid()

bool vcsn::detail::config::config_value::is_valid ( const std::string &  key) const

Check that this node refers to a key that exists in the tree.

Definition at line 90 of file configuration.cc.

References node_.

Referenced by as().

◆ keys()

std::vector< std::string > vcsn::detail::config::config_value::keys ( ) const

Definition at line 82 of file configuration.cc.

References gen_keys(), and keys_.

Referenced by as(), vcsn::detail::dot_impl< Aut >::print_prologue_(), and vcsn::detail::dot_impl< Aut >::print_states_().

Here is the call graph for this function:

◆ merge()

void vcsn::detail::config::config_value::merge ( const config_value from)

Merge a value into another one - and modify the first.

Definition at line 115 of file configuration.cc.

References node_.

◆ operator=()

config::config_value & vcsn::detail::config::config_value::operator= ( config_value  rhs)

Assign a new value to this key.

Definition at line 60 of file configuration.cc.

References swap.

◆ operator[]()

config::config_value vcsn::detail::config::config_value::operator[] ( const std::string &  key) const

Definition at line 72 of file configuration.cc.

References config_value(), node_, and vcsn::require().

Referenced by as().

Here is the call graph for this function:

◆ print()

std::ostream & vcsn::detail::config::config_value::print ( std::ostream &  out) const

Definition at line 122 of file configuration.cc.

References node_.

Referenced by vcsn::detail::operator<<().

◆ remove()

void vcsn::detail::config::config_value::remove ( const std::string &  key)

Remove a key.

Definition at line 95 of file configuration.cc.

References node_.

◆ str()

std::string vcsn::detail::config::config_value::str ( ) const

Get the node value as a string.

Definition at line 66 of file configuration.cc.

Referenced by as().

Friends And Related Function Documentation

◆ swap

void swap ( config::config_value first,
config::config_value second 
)
friend

Definition at line 141 of file configuration.cc.

Referenced by operator=(), and vcsn::detail::swap().

Member Data Documentation

◆ keys_

std::unique_ptr<const std::vector<std::string> > vcsn::detail::config::config_value::keys_
mutableprivate

Definition at line 72 of file configuration.hh.

Referenced by keys(), and vcsn::detail::swap().

◆ node_

Node vcsn::detail::config::config_value::node_
private

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