Files
deighton-ar/mobile/ios/ViroKit.framework/Headers/VROTree.h
2018-03-27 17:46:15 -07:00

35 lines
552 B
C++

//
// VROTree.h
// ViroKit
//
// Created by Raj Advani on 8/1/17.
// Copyright © 2017 Viro Media. All rights reserved.
//
#ifndef VROTree_h
#define VROTree_h
#include <vector>
#include <functional>
template< typename T >
struct tree {
public:
T value;
std::vector<tree> children;
tree() {}
tree(T val) : value(val) {}
void walkTree(std::function<void(T)> action) {
action(value);
for (tree &node : children) {
node.walkTree(action);
}
}
};
#endif /* VROTree_h */