ParameterIteration.h
1/* Distributed under the Apache License, Version 2.0.
2 See accompanying NOTICE file for details.*/
3
4#pragma once
5
6template <typename T>
8{
9public:
11 ParameterIteration(T min, T max, T step);
12 ParameterIteration(std::initializer_list<T> values, int sliceIdx = 0);
13 virtual ~ParameterIteration() = default;
14
15 bool Empty() const { return m_Values.size() == 0; }
16 void SetSliceIndex(size_t idx) { m_SliceIdx = idx; }
17 void SetValues(const std::vector<T>& values, int sliceIdx = 0);
18 void SetValues(std::initializer_list<T> values, int sliceIdx = 0);
19 void SetMinMaxStep(T min, T max, T step);
20
21 T GetSlice() const { return m_Values[m_SliceIdx]; }
22 bool HasValues() const { return m_Values.size() > 0; }
23 std::vector<T>& GetValues() { return m_Values; }
24 const std::vector<T>& GetValues() const { return m_Values; }
25
26protected:
27 size_t m_SliceIdx;
28 std::vector<T> m_Values;
29};
Definition: ParameterIteration.h:8
ParameterIteration()
Definition: ParameterIteration.cpp:8
bool Empty() const
Definition: ParameterIteration.h:15
bool HasValues() const
Definition: ParameterIteration.h:22
T GetSlice() const
Definition: ParameterIteration.h:21
size_t m_SliceIdx
Definition: ParameterIteration.h:27
void SetValues(const std::vector< T > &values, int sliceIdx=0)
Definition: ParameterIteration.cpp:43
void SetSliceIndex(size_t idx)
Definition: ParameterIteration.h:16
std::vector< T > & GetValues()
Definition: ParameterIteration.h:23
void SetMinMaxStep(T min, T max, T step)
Definition: ParameterIteration.cpp:26
std::vector< T > m_Values
Definition: ParameterIteration.h:28
virtual ~ParameterIteration()=default
const std::vector< T > & GetValues() const
Definition: ParameterIteration.h:24

Distributed under the Apache License, Version 2.0.

See accompanying NOTICE file for details.