You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

Node.h 756B

1234567891011121314151617181920212223242526272829303132
  1. #ifndef NODE_H
  2. #define NODE_H
  3. #include "../../interfaces/components/Component.h"
  4. #include <memory>
  5. #include <vector>
  6. #include <functional>
  7. #include <string>
  8. #include <sstream>
  9. #include <iostream>
  10. enum class NodeType {
  11. ROOT,
  12. TAG,
  13. TEXT
  14. };
  15. class Node {
  16. public:
  17. Node(NodeType type);
  18. virtual ~Node();
  19. NodeType nodeType;
  20. std::shared_ptr<Node> parent;
  21. std::vector<std::shared_ptr<Node>> children;
  22. std::shared_ptr<Component> component;
  23. static std::shared_ptr<Node> findTagNodeParent(std::string tag, std::shared_ptr<Node> node);
  24. static void findTagNodeChild(std::string tag, std::shared_ptr<Node> node, std::vector< std::shared_ptr<Node> > &results);
  25. virtual std::vector<std::string> getSourceList();
  26. };
  27. #endif