Toast Engine
Loading...
Searching...
No Matches
node.hpp File Reference

Base object type for the scene graph. More...

#include "box.hpp"
#include "control_box.hpp"
#include <list>
#include <memory>
#include <optional>
#include <string>
#include <string_view>
#include <toast/assets/prefab.hpp>
#include <toast/engine_defs.hpp>
#include <toast/events/listener.hpp>
#include <toast/events/signals.hpp>
#include <toast/export.hpp>
#include <toast/log.hpp>
#include <toast/reflect/reflect_node.hpp>
#include <toast/uid.hpp>
#include <toast/world/node_owner.hpp>
#include <toast/events/signals.inl>
Include dependency graph for node.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  toast::NodeMessage
class  toast::Node

Namespaces

namespace  toast::_detail
 Member-robber pattern used by the generated reflection code.

Enumerations

enum class  toast::NodeState : uint8_t {
  null , root , cached , global ,
  loading , destroy
}
enum class  toast::NodeType : uint8_t { null , child , root , world_root }

Functions

template<typename T>
auto reflect_cast (toast::Node *n) -> T *
 null-safe RTTI replacement; walks the NodeInfo chain instead of dynamic_cast

Detailed Description

Base object type for the scene graph.

Author
Dante Harper & Xein
Date
29 Apr 2026

All lifecycle dispatch goes through NodeInfo so subclasses avoid vtable overhead

TODO: handle on_enable / on_disable / begin / end with event::Listener nodes in cache should be disabled always

Enumeration Type Documentation

◆ NodeState

enum class toast::NodeState : uint8_t
strong
Enumerator
root 

The node is currently in use within world::root_node.

cached 

The node is loaded in memory but not in use.

global 

The node is currently in use within world::global[].

loading 

The node is in the load queue.

destroy 

The node is in the destroy queue.

◆ NodeType

enum class toast::NodeType : uint8_t
strong
Enumerator
child 

This node is a regular node.

root 

This node is a root node.

world_root 

This node is the root that resides in the world.