Clio develop
The XRP Ledger API server.
Loading...
Searching...
No Matches
util::config::ArrayView Class Reference

View for array structure for config. More...

#include <ArrayView.hpp>

Classes

struct  ArrayIterator
 Custom iterator class which contains config object or value underneath ArrayView. More...
 

Public Member Functions

template<typename T >
auto begin () const
 Returns an iterator to the beginning of the Array.
 
template<typename T >
auto end () const
 Returns an iterator to the end of the Array.
 
 ArrayView (std::string_view prefix, ClioConfigDefinition const &configDef)
 Constructs an ArrayView with the given prefix and config definition.
 
ObjectView objectAt (std::size_t idx) const
 Returns an ObjectView at the specified index.
 
ValueView valueAt (std::size_t idx) const
 Returns a ValueView at the specified index.
 
size_t size () const
 Returns the number of elements in the array.
 

Detailed Description

View for array structure for config.

This class provides a view into an array structure within ClioConfigDefinition. It allows accessing individual elements of the array as either values or objects, and is used within the ClioConfigDefinition to represent multiple potential values.

Constructor & Destructor Documentation

◆ ArrayView()

util::config::ArrayView::ArrayView ( std::string_view prefix,
ClioConfigDefinition const & configDef )

Constructs an ArrayView with the given prefix and config definition.

Parameters
prefixThe prefix for the array view.
configDefThe ClioConfigDefinition instance.

Member Function Documentation

◆ begin()

template<typename T >
auto util::config::ArrayView::begin ( ) const
inlinenodiscard

Returns an iterator to the beginning of the Array.

Returns
Iterator to the beginning of the Array

◆ end()

template<typename T >
auto util::config::ArrayView::end ( ) const
inlinenodiscard

Returns an iterator to the end of the Array.

Returns
Iterator to the end of the Array

◆ objectAt()

ObjectView util::config::ArrayView::objectAt ( std::size_t idx) const
nodiscard

Returns an ObjectView at the specified index.

Parameters
idxIndex of the object to retrieve.
Returns
ObjectView at the specified index.

◆ size()

size_t util::config::ArrayView::size ( ) const
nodiscard

Returns the number of elements in the array.

Returns
Number of elements in the array.

◆ valueAt()

ValueView util::config::ArrayView::valueAt ( std::size_t idx) const
nodiscard

Returns a ValueView at the specified index.

Parameters
idxIndex of the value to retrieve.
Returns
ValueView at the specified index.

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