Provides standard C++ iteration functionality for the parameters stored by an IParamBlock2.
More...
#include <C:/adskgit/3dsmax/3dsmax/3dswin/src/maxsdk/include/iparamb2.h>
Provides standard C++ iteration functionality for the parameters stored by an IParamBlock2.
- Iterator Validity
- The iterator remains valid if parameters are either added or removed from the parameter block, but will continue referring to the same parameter index, and therefore may fall out of bounds in the process.
- See also
- IParamBlock2::begin(), IParamBlock2::end()
◆ ParameterIterator()
Constructs an iterator for the given parameter index of the given parameter block.
253 : m_param_block(¶m_block),
254 m_num_params(std::max(param_block.
NumParams(), 0)),
255 m_parameter_index(std::min(parameter_index, m_num_params))
256{
257}
virtual int NumParams()=0
◆ operator*()
Dereferences the iterator, returning a ParamDef.
Like standard C++ iterators, this should not be called on out-of-bounds iterators.
260{
261 DbgAssert(m_parameter_index < m_num_params);
262 const ParamDef* param_def = m_param_block->GetParamDefByIndex(m_parameter_index);
263
264
266 return *param_def;
267}
#define DbgAssert(expr)
Definition assert1.h:83
◆ operator++() [1/2]
270{
271 if(
DbgVerify(m_parameter_index < m_num_params))
272 {
273 ++m_parameter_index;
274 }
275 return *this;
276}
#define DbgVerify(expr)
Definition assert1.h:85
◆ operator++() [2/2]
279{
281 if(
DbgVerify(m_parameter_index < m_num_params))
282 {
283 ++m_parameter_index;
284 }
285 return ret;
286}
ParameterIterator(IParamBlock2 ¶m_block, const unsigned int parameter_index)
Constructs an iterator for the given parameter index of the given parameter block.
Definition iparamb2.inline.h:252
◆ operator==()
289{
290 return (m_param_block == rhs.m_param_block) && (m_parameter_index == rhs.m_parameter_index);
291}
◆ operator!=()
294{
295 return !(*this == rhs);
296}