Clingo
Loading...
Searching...
No Matches
Clingo::ConfigMap Class Reference

Class modeling a mutable map of configuration entries. More...

#include <config.hh>

Inheritance diagram for Clingo::ConfigMap:
Clingo::ConstConfigMap

Public Types

using key_type = std::string_view
 The key type.
 
using mapped_type = Config
 The mapped type.
 
using value_type = std::pair< key_type, mapped_type >
 The value type.
 
using size_type = std::size_t
 The size type.
 
using difference_type = std::ptrdiff_t
 The difference type.
 
using reference = value_type
 The reference type.
 
using pointer = Detail::ArrowProxy< value_type >
 The pointer type.
 
using iterator = Detail::RandomAccessIterator< ConfigMap >
 The iterator type.
 
- Public Types inherited from Clingo::ConstConfigMap
using key_type = std::string_view
 The key type.
 
using mapped_type = ConstConfig
 The mapped type.
 
using value_type = std::pair< key_type, mapped_type >
 The value type.
 
using size_type = std::size_t
 The size type.
 
using difference_type = std::ptrdiff_t
 The difference type.
 
using reference = value_type
 The reference type.
 
using pointer = Detail::ArrowProxy< value_type >
 The pointer type.
 
using iterator = Detail::RandomAccessIterator< ConstConfigMap >
 The iterator type.
 

Public Member Functions

 ConfigMap (clingo_config_t *stats, ProgramId key)
 Construct from the underlying C API type and a key.
 
auto at (size_t index) const -> value_type
 Get the name configuration entry pair at the given index in the map.
 
auto get (std::string_view name) const -> Config
 Get the configuration entry with the given name in the map.
 
auto operator[] (std::string_view name) const -> Config
 Get the configuration entry with the given name in the map.
 
auto begin () const -> iterator
 Get an iterator to the beginning of the map.
 
auto end () const -> iterator
 Get an iterator to the end of the map.
 
- Public Member Functions inherited from Clingo::ConstConfigMap
 ConstConfigMap (clingo_config_t const *stats, ProgramId key)
 Construct from the underlying C API type and a key.
 
auto size () const -> size_t
 Get the size of the map.
 
auto at (size_t index) const -> value_type
 Get the name configuration entry pair at the given index in the map.
 
auto get (std::string_view name) const -> ConstConfig
 Get the configuration entry with the given name in the map.
 
auto operator[] (std::string_view name) const -> ConstConfig
 Get the configuration entry with the given name in the map.
 
auto contains (std::string_view name) const -> bool
 Check if the map contains a configuration entry with the given name.
 
auto begin () const -> iterator
 Get an iterator to the beginning of the map.
 
auto end () const -> iterator
 Get an iterator to the end of the map.
 

Detailed Description

Class modeling a mutable map of configuration entries.

Constructor & Destructor Documentation

◆ ConfigMap()

Clingo::ConfigMap::ConfigMap ( clingo_config_t stats,
ProgramId  key 
)
inlineexplicit

Construct from the underlying C API type and a key.

Parameters
statsthe underlying C API type
keythe key of the configuration entry

Member Function Documentation

◆ at()

auto Clingo::ConfigMap::at ( size_t  index) const -> value_type
inline

Get the name configuration entry pair at the given index in the map.

Parameters
indexthe index of the configuration entry
Returns
the name configuration entry pair at the given index

◆ begin()

auto Clingo::ConfigMap::begin ( ) const -> iterator
inline

Get an iterator to the beginning of the map.

Returns
an iterator to the beginning of the map

◆ end()

auto Clingo::ConfigMap::end ( ) const -> iterator
inline

Get an iterator to the end of the map.

Returns
an iterator to the end of the map

◆ get()

auto Clingo::ConfigMap::get ( std::string_view  name) const -> Config
inline

Get the configuration entry with the given name in the map.

Parameters
namethe name of the configuration entry
Returns
the configuration entry with the given name

◆ operator[]()

auto Clingo::ConfigMap::operator[] ( std::string_view  name) const -> Config
inline

Get the configuration entry with the given name in the map.

Parameters
namethe name of the configuration entry
Returns
the configuration entry with the given name

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