* Author: Daniel Felipe Gonzalez Obando
*/
#include "modelCDMIProjectTreeNode.h"
+#include <algorithm>
-bool modelCDMIProjectTreeNode::CompareNodeItem(const modelCDMIProjectTreeNode& x, const modelCDMIProjectTreeNode& y)
+bool modelCDMIProjectTreeNode::CompareNodeItem(const modelCDMIProjectTreeNode* x, const modelCDMIProjectTreeNode* y)
{
bool returnValue;
bool noWinner = true;
unsigned int i = 0;
- std::string xName = x.GetName();
- std::string yName = y.GetName();
- unsigned char xType = x.GetType();
- unsigned char yType = y.GetType();
+ std::string xName = x->GetName();
+ std::string yName = y->GetName();
+ unsigned char xType = x->GetType();
+ unsigned char yType = y->GetType();
while ((i < xName.length()) && (i < yName.length()))
{
this->id = id;
}
+void modelCDMIProjectTreeNode::SortChildren()
+{
+ std::sort(this->children.begin(), this->children.end(), CompareNodeItem);
+}
+
void modelCDMIProjectTreeNode::SetChildren(
const std::vector<modelCDMIProjectTreeNode*>& children)
{