2022-01-07 16:56:26 +01:00
|
|
|
#ifndef NODE_TREE_H
|
|
|
|
#define NODE_TREE_H
|
|
|
|
|
|
|
|
#include "core/object.h"
|
2022-02-09 19:04:11 +01:00
|
|
|
#include "core/threading/rw_lock.h"
|
2022-01-07 16:56:26 +01:00
|
|
|
|
2022-01-07 19:28:16 +01:00
|
|
|
class Node;
|
2022-01-07 16:56:26 +01:00
|
|
|
|
|
|
|
class NodeTree : public Object {
|
2022-01-08 10:04:12 +01:00
|
|
|
RCPP_OBJECT(NodeTree, Object);
|
|
|
|
|
2022-01-07 16:56:26 +01:00
|
|
|
public:
|
2022-01-07 19:28:16 +01:00
|
|
|
Node *get_root();
|
|
|
|
virtual void set_root(Node *root);
|
|
|
|
|
2022-02-10 16:47:18 +01:00
|
|
|
virtual void update();
|
2022-01-07 19:28:16 +01:00
|
|
|
|
2022-02-09 19:04:11 +01:00
|
|
|
void request_write_lock();
|
|
|
|
|
2022-01-07 16:56:26 +01:00
|
|
|
NodeTree();
|
|
|
|
~NodeTree();
|
|
|
|
|
|
|
|
protected:
|
2022-02-10 16:47:18 +01:00
|
|
|
virtual void _send_update();
|
|
|
|
|
2022-01-07 19:28:16 +01:00
|
|
|
Node *_root_node;
|
|
|
|
float _update_interval;
|
2022-02-10 16:47:18 +01:00
|
|
|
|
2022-02-09 19:04:11 +01:00
|
|
|
bool _write_lock_requested;
|
|
|
|
RWLock _rw_lock;
|
2022-01-07 16:56:26 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|