The Battle for Wesnoth  1.19.19+dev
Public Member Functions | Static Private Member Functions | Private Attributes | Friends | List of all members
wfl::variant_map Class Reference

#include <variant_value.hpp>

Inheritance diagram for wfl::variant_map:

Public Member Functions

 variant_map (const variant_map_raw &map)
 
 variant_map (variant_map_raw &&map)
 
const variant_map_rawget_container () const
 
virtual formula_variant::type get_type () const override
 Returns the id of the variant type. More...
 
virtual variant deref_iterator (const utils::any &) const override
 Implements the dereference functionality of variant_iterator for a value of this type. More...
 
- Public Member Functions inherited from wfl::variant_container< variant_map >
virtual bool is_empty () const override
 Whether the stored value is considered empty or not. More...
 
virtual std::size_t num_elements () const override
 Returns the number of elements in a type. More...
 
virtual bool as_bool () const override
 Returns a bool expression of the variant value. More...
 
virtual std::string string_cast () const override
 Returns the stored variant value in plain string form. More...
 
virtual std::string get_serialized_string () const override
 Returns the stored variant value in formula syntax. More...
 
virtual std::string get_debug_string (formula_seen_stack &seen, bool verbose) const override
 Returns debug info for the variant value. More...
 
bool contains (const variant &member) const
 
virtual boost::iterator_range< variant_iteratormake_iterator () const override
 Creates an iterator pair that can be used for iteration. More...
 
virtual void iterator_inc (utils::any &) const override
 Implements the increment functionality of variant_iterator for a value of this type. More...
 
virtual void iterator_dec (utils::any &) const override
 Implements the decrement functionality of variant_iterator for a value of this type. More...
 
virtual bool iterator_equals (const utils::any &first, const utils::any &second) const override
 Implements the equality functionality of variant_iterator for a value of this type. More...
 
virtual bool equals (const variant_value_base &other) const override
 Inherited from variant_value_base. More...
 
virtual bool less_than (const variant_value_base &other) const override
 Inherited from variant_value_base. More...
 
- Public Member Functions inherited from wfl::variant_value_base
virtual ~variant_value_base ()
 

Static Private Member Functions

static std::string to_string_detail (const variant_map_raw::value_type &value, const to_string_op &op)
 Helper for variant_container::to_string_impl. More...
 

Private Attributes

variant_map_raw container_
 

Friends

class variant_container< variant_map >
 

Additional Inherited Members

- Protected Types inherited from wfl::variant_container< variant_map >
using to_string_op = std::function< std::string(const variant &)>
 
- Protected Member Functions inherited from wfl::variant_container< variant_map >
 variant_container ()=default
 Only derived classes can instantiate this class. More...
 

Detailed Description

Definition at line 528 of file variant_value.hpp.

Constructor & Destructor Documentation

◆ variant_map() [1/2]

wfl::variant_map::variant_map ( const variant_map_raw map)
inlineexplicit

Definition at line 533 of file variant_value.hpp.

◆ variant_map() [2/2]

wfl::variant_map::variant_map ( variant_map_raw &&  map)
inlineexplicit

Definition at line 538 of file variant_value.hpp.

Member Function Documentation

◆ deref_iterator()

variant wfl::variant_map::deref_iterator ( const utils::any &  iter) const
overridevirtual

Implements the dereference functionality of variant_iterator for a value of this type.

Parameters
iterThe opaque reference that was passed to the variant_iterator by make_iterator.

Reimplemented from wfl::variant_value_base.

Definition at line 316 of file variant_value.cpp.

References p.

◆ get_container()

const variant_map_raw& wfl::variant_map::get_container ( ) const
inline

Definition at line 543 of file variant_value.hpp.

References container_.

Referenced by wfl::variant::operator+().

◆ get_type()

virtual formula_variant::type wfl::variant_map::get_type ( ) const
inlineoverridevirtual

Returns the id of the variant type.

Reimplemented from wfl::variant_value_base.

Definition at line 549 of file variant_value.hpp.

◆ to_string_detail()

std::string wfl::variant_map::to_string_detail ( const variant_map_raw::value_type &  value,
const to_string_op op 
)
staticprivate

Helper for variant_container::to_string_impl.

Definition at line 305 of file variant_value.cpp.

Friends And Related Function Documentation

◆ variant_container< variant_map >

friend class variant_container< variant_map >
friend

Definition at line 524 of file variant_value.hpp.

Member Data Documentation

◆ container_

variant_map_raw wfl::variant_map::container_
private

Definition at line 560 of file variant_value.hpp.

Referenced by get_container().


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