Oxygen Engine
Modern C++ 3D Engine using OpenGL
Loading...
Searching...
No Matches
oe::scene::NodePtr Struct Reference

Wrapper to a node reference to use pointers to node even if the actual node moves in memory. More...

#include <OxygenEngine/scene/node_ptr.h>

+ Collaboration diagram for oe::scene::NodePtr:

Public Types

using NodeType = Node
 
using SceneType = Scene
 

Public Member Functions

NodeTypeoperator* () const
 
NodeTypeoperator-> () const
 
bool operator== (const NodePtr &other) const
 Equality operator.
 
NodeTypeget () const noexcept
 Returns a pointer to the referenced node.
 
 operator bool () const noexcept
 

Public Attributes

SceneTypescene = nullptr
 Scene containing the Node.
 
uint64_t id_node = 0
 Node id, unique to the scene.
 

Detailed Description

Wrapper to a node reference to use pointers to node even if the actual node moves in memory.

Note
The scene should always keep same address

This will compare to nullptr when the node is removed

Member Function Documentation

◆ get()

NodeType * oe::scene::NodePtr::get ( ) const
noexcept

Returns a pointer to the referenced node.

It is not recomended to store the resulting pointer as the node address may change during the scene lifetime

Todo:
when template, remove implementation and let class specialization overload it

The documentation for this struct was generated from the following file: