diff --git a/core/SCsub b/core/SCsub index 1b9429e..846975f 100644 --- a/core/SCsub +++ b/core/SCsub @@ -16,6 +16,7 @@ env.add_source_files(env.core_sources, "./database/*.cpp") env.add_source_files(env.core_sources, "./os/*.cpp") env.add_source_files(env.core_sources, "./threading/*.cpp") env.add_source_files(env.core_sources, "./settings/*.cpp") +env.add_source_files(env.core_sources, "./nodes/*.cpp") # Build it all as a library lib = env.add_library("core", env.core_sources) diff --git a/core/nodes/node.cpp b/core/nodes/node.cpp new file mode 100644 index 0000000..e41089f --- /dev/null +++ b/core/nodes/node.cpp @@ -0,0 +1,10 @@ + +#include "node.h" + +#include "request.h" + +Node::Node() : Object() { +} + +Node::~Node() { +} \ No newline at end of file diff --git a/core/nodes/node.h b/core/nodes/node.h new file mode 100644 index 0000000..4c2eaad --- /dev/null +++ b/core/nodes/node.h @@ -0,0 +1,14 @@ +#ifndef NODE_H +#define NODE_H + +#include "core/object.h" + +class Node : public Object { +public: + Node(); + ~Node(); + +protected: +}; + +#endif \ No newline at end of file diff --git a/core/nodes/node_tree.cpp b/core/nodes/node_tree.cpp new file mode 100644 index 0000000..72a2c93 --- /dev/null +++ b/core/nodes/node_tree.cpp @@ -0,0 +1,8 @@ + +#include "node_tree.h" + +NodeTree::NodeTree() : Object() { +} + +NodeTree::~NodeTree() { +} \ No newline at end of file diff --git a/core/nodes/node_tree.h b/core/nodes/node_tree.h new file mode 100644 index 0000000..d6df762 --- /dev/null +++ b/core/nodes/node_tree.h @@ -0,0 +1,37 @@ +#ifndef NODE_TREE_H +#define NODE_TREE_H + +#include "core/object.h" + +//should be a template +//It should be inherited from +//Similar idea to godot's scenetree +//Should handle all functionality of base nodes +//refreshes etc -> good for web nodes aswell -> can use dirtying if there are updates, or clearing caches +//Should have a root node (templated) +//Nodes should have a tree set into them (not templated) -> set() should be virtual + +//For the web: +//The webserver could be a webtree, the nodes themselves could handle routing with their hierarchy (easy to cache) would have the same speed +//Routing could be overridable per node +//MIddlewares can be handled by the tree before sending the request to the tree, also files (that could be a middleware aswell) +//WebTree : public NodeTree +//and then Server : public WebTree +//This way webapps could be build like guis in godot. + +//WebTree +// - WebRoot (Normal WebNode - if uri is '/news/...' if it has a news node, pushes the uri stack and forwards the request to that node. Else 404 +// ---- news (News node f.e. - handles request, stops forwarding) +// ---- projects (Projects node, either forwards, or if /projects sends back a list etc) +// -------- p1 +//etc + +class NodeTree : public Object { +public: + NodeTree(); + ~NodeTree(); + +protected: +}; + +#endif \ No newline at end of file