Clingo
Loading...
Searching...
No Matches
CppClingo::Control::ClingoConfig::Entry Class Reference

A configuration entry interface to interact with configuration entries. More...

#include <config.hh>

Public Types

using ValueFlags = ClingoConfig::ValueFlags
 Enumeration of value flags for configuration entries.
 
using KeyType = ClingoConfig::KeyType
 Type used for indexing array entries.
 

Public Member Functions

 Entry ()=default
 Constructor for Entry.
 
 Entry (Entry &&other)=delete
 Prevent copying and moving of Entries.
 
auto operator= (Entry &&other) -> Entry &=delete
 Prevent copying and moving of Entries.
 
virtual ~Entry ()=default
 Destructor for Entry.
 
auto value_info () -> ValueFlags
 Get information about the value of the entry.
 
auto get_value (std::optional< IndexType > index, std::string &value) -> bool
 Get the value of the entry.
 
void set_value (std::optional< KeyType > index, std::string_view value)
 Set a new value for the entry.
 
auto size_array () -> std::optional< int >
 Returns the number of elements of an array entry.
 

Detailed Description

A configuration entry interface to interact with configuration entries.

This interface provides methods to check the value type of an entry, get and set values, and retrieve the size of array entries.

Array handling is special. Configuration entries are arranged in a tree structure, where each path to a leave can have at most one array entry. If an entry has a parent that is an array, the index is passed to methods that require it.

Member Function Documentation

◆ size_array()

auto CppClingo::Control::ClingoConfig::Entry::size_array ( ) -> std::optional<int>
inline

Returns the number of elements of an array entry.

Returns std::nullopt if the entry is not an array.


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