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

Class modeling an immutable map of configuration entries. More...

#include <config.hh>

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

Public Types

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

 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.
 

Friends

class ConfigMap
 

Detailed Description

Class modeling an immutable map of configuration entries.

Constructor & Destructor Documentation

◆ ConstConfigMap()

Clingo::ConstConfigMap::ConstConfigMap ( clingo_config_t const 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::ConstConfigMap::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::ConstConfigMap::begin ( ) const -> iterator
inline

Get an iterator to the beginning of the map.

Returns
an iterator to the beginning of the map

◆ contains()

auto Clingo::ConstConfigMap::contains ( std::string_view  name) const -> bool
inline

Check if the map contains a configuration entry with the given name.

Parameters
namethe name of the configuration entry
Returns
true if the map contains an entry with the given name, false otherwise

◆ end()

auto Clingo::ConstConfigMap::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::ConstConfigMap::get ( std::string_view  name) const -> ConstConfig
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::ConstConfigMap::operator[] ( std::string_view  name) const -> ConstConfig
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

◆ size()

auto Clingo::ConstConfigMap::size ( ) const -> size_t
inline

Get the size of the map.

Returns
the size of the map

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