Vcsn  2.8
Be Rational
vcsn::detail::config::value Class Reference

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

#include <configuration.hh>

Collaboration diagram for vcsn::detail::config::value:

Classes

class  BadNode
 

Public Types

using iterator = Node::iterator
 

Public Member Functions

 value (Node n)
 
 value (const config &)
 
 value (const value &other)
 
valueoperator= (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...
 
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 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 (value &first, value &second)
 

Detailed Description

The class returned by [] operators.

Definition at line 28 of file configuration.hh.

Member Typedef Documentation

◆ iterator

using vcsn::detail::config::value::iterator = Node::iterator

Definition at line 60 of file configuration.hh.

Constructor & Destructor Documentation

◆ value() [1/3]

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

Definition at line 47 of file configuration.cc.

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

◆ value() [2/3]

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

Definition at line 55 of file configuration.cc.

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

◆ value() [3/3]

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

Definition at line 51 of file configuration.cc.

References node_.

Member Function Documentation

◆ as()

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

Definition at line 42 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::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::value::end ( )

Definition at line 110 of file configuration.cc.

References node_.

◆ gen_keys()

std::unique_ptr< std::vector< std::string > > vcsn::detail::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::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::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::value::merge ( const value from)

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

Definition at line 115 of file configuration.cc.

References node_.

◆ operator=()

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

Assign a new value to this key.

Definition at line 60 of file configuration.cc.

References swap.

◆ operator[]()

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

Definition at line 72 of file configuration.cc.

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

Referenced by as().

Here is the call graph for this function:

◆ print()

std::ostream & vcsn::detail::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::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::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::value first,
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::value::keys_
mutableprivate

Definition at line 73 of file configuration.hh.

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

◆ node_

Node vcsn::detail::config::value::node_
private

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