A class to define a polymorphic member in an N-Array tree.
More...
#include <StructuredTypes.h>
|
|
using | NodePtr = std::shared_ptr< Node > |
| |
|
| | Node (const std::shared_ptr< Container > &container) |
| | Create a node and add it to a Container. More...
|
| |
|
virtual std::string_view | nodeId () const noexcept |
| |
|
void | setId (const Id &nodeId) noexcept |
| | Set Id.
|
| |
|
std::string_view | getId () const |
| | Get Id.
|
| |
|
IdPath | getIdPath () const |
| | Get the Id Path.
|
| |
| virtual void | addedToContainer () |
| | Called when a Node is added to a Container. More...
|
| |
|
std::shared_ptr< Container > | container () |
| |
|
std::shared_ptr< Container > | container () const |
| |
|
template<typename C > |
| std::shared_ptr< C > | containerAs () |
| |
|
template<typename C > |
| std::shared_ptr< C > | containerAs () const |
| |
| std::shared_ptr< const Node > | getNode () const |
| | Get a const std::shared_ptr to this node. More...
|
| |
| std::shared_ptr< Node > | getNode () |
| | Get a std::shared_ptr to this node. More...
|
| |
| template<typename NodeType > |
| std::shared_ptr< const Node > | getNode () const |
| | Get a std::shared_ptr<const NodeType> to this node. More...
|
| |
| template<typename NodeType > |
| std::shared_ptr< NodeType > | getNode () |
| | Get a std::shared_ptr<NodeType> to this node. More...
|
| |
|
std::shared_ptr< Node > | remove () |
| |
|
| template<typename NodeType > |
| static std::shared_ptr< NodeType > | create () |
| | Create a Node with no arguments. More...
|
| |
| template<typename NodeType , typename ... Args> |
| static std::shared_ptr< NodeType > | create (Args ... args) |
| | Create a Node with arguments. More...
|
| |
| template<typename NodeType , typename ContainerType , typename ... Args> |
| static std::shared_ptr< NodeType > | add (ContainerType container, Args ... args) |
| | Create a Node with arguments and add to a Container. More...
|
| |
|
|
static constexpr std::string_view | id = "Node" |
| |
A class to define a polymorphic member in an N-Array tree.
◆ Node()
| rose::Node::Node |
( |
const std::shared_ptr< Container > & |
container | ) |
|
|
explicit |
Create a node and add it to a Container.
- Parameters
-
◆ add()
template<typename NodeType , typename ContainerType , typename ... Args>
| static std::shared_ptr<NodeType> rose::Node::add |
( |
ContainerType |
container, |
|
|
Args ... |
args |
|
) |
| |
|
inlinestatic |
Create a Node with arguments and add to a Container.
- Template Parameters
-
| NodeType | The type of Node to create. |
| ContainerType | The type of Container the Node is added to. |
| Args | The argument parameter pack type. |
- Parameters
-
| container | The Container. |
| args | The argument parameter pack data. |
- Returns
- A std::shared_ptr to the NodeType created.
◆ addedToContainer()
| virtual void rose::Node::addedToContainer |
( |
| ) |
|
|
inlinevirtual |
◆ create() [1/2]
template<typename NodeType >
| static std::shared_ptr<NodeType> rose::Node::create |
( |
| ) |
|
|
inlinestatic |
Create a Node with no arguments.
- Template Parameters
-
| NodeType | The type of Node to create. |
- Returns
- A std::shared_ptr to the NodeType created.
◆ create() [2/2]
template<typename NodeType , typename ... Args>
| static std::shared_ptr<NodeType> rose::Node::create |
( |
Args ... |
args | ) |
|
|
inlinestatic |
Create a Node with arguments.
- Template Parameters
-
| NodeType | The type of Node to create. |
| Args | The argument parameter pack type. |
- Parameters
-
| args | The argument parameter pack data. |
- Returns
- A std::shared_ptr to the NodeType created.
◆ getNode() [1/4]
| std::shared_ptr<const Node> rose::Node::getNode |
( |
| ) |
const |
|
inline |
Get a const std::shared_ptr to this node.
- Returns
- std::shared_ptr<const Node>
◆ getNode() [2/4]
| std::shared_ptr<Node> rose::Node::getNode |
( |
| ) |
|
|
inline |
Get a std::shared_ptr to this node.
- Returns
- std::shared_ptr<const Node>
◆ getNode() [3/4]
template<typename NodeType >
| std::shared_ptr<const Node> rose::Node::getNode |
( |
| ) |
const |
|
inline |
Get a std::shared_ptr<const NodeType> to this node.
- Template Parameters
-
- Returns
- std::shared_ptr<const NodeType> which will be empty if this Node is not a NodeType or derived from NodeType.
◆ getNode() [4/4]
template<typename NodeType >
| std::shared_ptr<NodeType> rose::Node::getNode |
( |
| ) |
|
|
inline |
Get a std::shared_ptr<NodeType> to this node.
- Template Parameters
-
- Returns
- std::shared_ptr<NodeType> which will be empty if this Node is not a NodeType or derived from NodeType.
◆ mContainer
| std::weak_ptr<Container> rose::Node::mContainer {} |
|
protected |
The documentation for this class was generated from the following files: