The Sparta Modeling Framework
Loading...
Searching...
No Matches
sparta::ParameterBase::ParameterValueIterator Class Reference

Generic value iterator for a SINGLE parameter which represents values ONLY as std::string. More...

#include <Parameter.hpp>

Public Member Functions

 ParameterValueIterator (const ParameterBase *pb, size_t idx)
 Full Constructor.
 
 ParameterValueIterator (const ParameterValueIterator &rhp)
 Copy Constructor.
 
bool operator== (const ParameterValueIterator &rhp)
 Equality test.
 
bool operator!= (const ParameterValueIterator &rhp)
 Inequality test.
 
const std::string operator* () const
 Dereference operator.
 
const ParameterValueIteratoroperator++ ()
 Preincrement operator.
 
const ParameterValueIterator operator++ (int i)
 Postincrement operator.
 

Detailed Description

Generic value iterator for a SINGLE parameter which represents values ONLY as std::string.

Note
Can be used on any parameter.
Useful for displaying parameter contents without knowing parameter type.
See also
sparta::ParameterBase::isVector
sparta::ParameterBase::begin()

For Scalar parameters (including std::string), this itererator will cover exactly 1 element. For vector parameters, this iterator will cover any number of elements.

Iterates values in a ParameterBase by index.

Definition at line 138 of file Parameter.hpp.

Constructor & Destructor Documentation

◆ ParameterValueIterator() [1/2]

sparta::ParameterBase::ParameterValueIterator::ParameterValueIterator ( const ParameterBase pb,
size_t  idx 
)
inline

Full Constructor.

Parameters
pbParameterBase whose values will be retrieved by index during iteration
idxmust be > 0. Typically, this should a value representing the beginning or end of iteration such as 0 or the size of the relevant ParameterBase <pb>.

Definition at line 150 of file Parameter.hpp.

◆ ParameterValueIterator() [2/2]

sparta::ParameterBase::ParameterValueIterator::ParameterValueIterator ( const ParameterValueIterator rhp)
inline

Copy Constructor.

Parameters
rhpIterator whose values will be copied

Definition at line 161 of file Parameter.hpp.

Member Function Documentation

◆ operator!=()

bool sparta::ParameterBase::ParameterValueIterator::operator!= ( const ParameterValueIterator rhp)
inline

Inequality test.

Parameters
rhpOther iterator to compare
See also
operator==
Returns
true if iterators differ

Iterators are compared using logical NOT on operator==

Definition at line 186 of file Parameter.hpp.

◆ operator*()

const std::string sparta::ParameterBase::ParameterValueIterator::operator* ( ) const
inline

Dereference operator.

Returns
The value of the parameter currently referenced by the iterator.
Exceptions
ParameterExceptionif this iterator is invalid (does not refer to a value within the referenced ParameterBase).

Definition at line 197 of file Parameter.hpp.

Here is the call graph for this function:

◆ operator++() [1/2]

const ParameterValueIterator & sparta::ParameterBase::ParameterValueIterator::operator++ ( )
inline

Preincrement operator.

Returns
An iterator which is equivalent this incremented by one.
Exceptions
ParameterExceptionif this iterator is invalid (does not refer to a value within the referenced ParameterBase).

Definition at line 210 of file Parameter.hpp.

Here is the call graph for this function:

◆ operator++() [2/2]

const ParameterValueIterator sparta::ParameterBase::ParameterValueIterator::operator++ ( int  i)
inline

Postincrement operator.

Returns
An iterator which is equivalent this, but NOT incremented
Exceptions
ParameterExceptionif this iterator is invalid (does not refer to a value within the referenced ParameterBase).

Definition at line 224 of file Parameter.hpp.

◆ operator==()

bool sparta::ParameterBase::ParameterValueIterator::operator== ( const ParameterValueIterator rhp)
inline

Equality test.

Parameters
rhpOther iterator to compare
Returns
true if iterators are the equal

Iterators are considered equal IFF referenced ParameterBases match by address and index matches exactly.

Definition at line 174 of file Parameter.hpp.


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