Changeset 755


Ignore:
Timestamp:
03/14/18 23:52:40 (7 years ago)
Author:
Maciej Komosinski
Message:

Renamed ParamTree::Node -> ParamTree::ParamTreeNode? to avoid name conflicts with js

Location:
cpp/frams
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • cpp/frams/_demos/paramtree_print.cpp

    r723 r755  
    2020#endif
    2121
    22 static void printLines(ParamTree::Node *n, bool first = true)
     22static void printLines(ParamTree::ParamTreeNode *n, bool first = true)
    2323{
    2424        if (n->parent)
     
    2929}
    3030
    31 void printTree(ParamTree::Node *n)
     31void printTree(ParamTree::ParamTreeNode *n)
    3232{
    3333        while (n != NULL)
  • cpp/frams/_demos/paramtree_print.h

    r723 r755  
    44#include <frams/param/paramtree.h>
    55
    6 void printTree(ParamTree::Node *n);
     6void printTree(ParamTree::ParamTreeNode *n);
    77
    88#endif
  • cpp/frams/param/paramtree.cpp

    r744 r755  
    55#include "paramtree.h"
    66
    7 ParamTree::Node *ParamTree::addNode(ParamTree::Node* parent, const string& name, int group)
     7ParamTree::ParamTreeNode *ParamTree::addNode(ParamTree::ParamTreeNode* parent, const string& name, int group)
    88{
    9         std::shared_ptr<Node> new_it(new Node(this, parent, name, group));
    10         Node *last = parent->first_child.get();
     9        std::shared_ptr<ParamTreeNode> new_it(new ParamTreeNode(this, parent, name, group));
     10        ParamTreeNode *last = parent->first_child.get();
    1111        if (last)
    1212        {
    13                 Node *next;
     13                ParamTreeNode *next;
    1414                while (true)
    1515                {
     
    2525}
    2626
    27 ParamTree::Node *ParamTree::findNode(ParamTree::Node *parent, const string& name)
     27ParamTree::ParamTreeNode *ParamTree::findNode(ParamTree::ParamTreeNode *parent, const string& name)
    2828{
    29         for (ParamTree::Node *it = parent->first_child.get(); it != NULL; it = it->next_sibling.get())
     29        for (ParamTree::ParamTreeNode *it = parent->first_child.get(); it != NULL; it = it->next_sibling.get())
    3030                if (it->name == name) return it;
    3131        return NULL;
     
    5858
    5959                        string name = grname; // "abc:def:ghi"
    60                         Node *parentnode = &root;
     60                        ParamTreeNode *parentnode = &root;
    6161                        int i = 0;
    6262                        // search for parentnode for level 'level'
     
    6767                                string prefix = name.substr(0, i);
    6868                                // search for parent node in listview ('prefix')
    69                                 Node *it = findNode(parentnode, prefix);
     69                                ParamTreeNode *it = findNode(parentnode, prefix);
    7070                                name = name.substr(i + 1);
    7171                                if (it) parentnode = it;
  • cpp/frams/param/paramtree.h

    r744 r755  
    3535{
    3636public:
    37         class Node;
    38         typedef std::shared_ptr<Node> NodePtr;
    39         class Node
     37        class ParamTreeNode;
     38        typedef std::shared_ptr<ParamTreeNode> NodePtr;
     39        class ParamTreeNode
    4040        {
    4141        public:
    4242                ParamTree *tree;
    43                 Node *parent;
     43                ParamTreeNode *parent;
    4444                string name; //path component name
    4545                int group_index; //original group index or -1 for dummy nodes
     
    4747                NodePtr next_sibling;
    4848
    49                 Node(ParamTree *_tree = NULL, Node *_parent = NULL, const string &_name = "", int _group_index = -1)
     49                ParamTreeNode(ParamTree *_tree = NULL, ParamTreeNode *_parent = NULL, const string &_name = "", int _group_index = -1)
    5050                        :tree(_tree), parent(_parent), name(_name), group_index(_group_index) {}
    5151        };
    52         Node root;
     52        ParamTreeNode root;
    5353        ParamInterface &pi;
    5454
    55         Node *addNode(Node* parent, const string &name, int group);
    56         Node *findNode(Node *parent, const string& name);
     55        ParamTreeNode *addNode(ParamTreeNode* parent, const string &name, int group);
     56        ParamTreeNode *findNode(ParamTreeNode *parent, const string& name);
    5757
    5858        ParamTree(ParamInterface *_pi);
Note: See TracChangeset for help on using the changeset viewer.