+ m_allowedValueIndex = 0;
+ }
+}
+
+AttributeCombinationGen::AttributeCombinationGen(
+ const std::vector<SimulatorResourceModel::Attribute> &attributes)
+{
+ for (auto &attr : attributes)
+ {
+ AttributeGenerator attrGen(attr);
+ m_attrGenList.push_back(attr);
+ }
+
+ m_index = -1;
+}
+
+bool AttributeCombinationGen::next(SimulatorResourceModel &resModel)
+{
+ if (!m_attrGenList.size())
+ {
+ return false;
+ }
+
+ std::lock_guard<std::mutex> lock(m_lock);
+
+ // This block will execute for only first time
+ if (-1 == m_index)
+ {
+ for (int index = 0; index < m_attrGenList.size(); index++)
+ {
+ // Add the attribute on resource model
+ addAttributeToModel(index);
+ }
+
+ m_index = m_attrGenList.size() - 1;
+ resModel = m_resModel;
+ return true;
+ }
+
+ // Get the next attribute from statck top element
+ if (m_attrGenList[m_index].hasNext())
+ {
+ addAttributeToModel(m_index);
+ resModel = m_resModel;
+ return true;
+ }
+ else
+ {
+ for (int index = m_index; index >= 0; index--)
+ {
+ if (!m_attrGenList[index].hasNext())
+ {
+ if (!index)
+ return false;
+
+ m_attrGenList[index].reset();
+ addAttributeToModel(index);
+ }
+ else
+ {
+ addAttributeToModel(index);
+ break;
+ }
+ }
+
+ resModel = m_resModel;