CppGraph Application Framework©
Copyright © 2004-202x Geoff Goldberg
Public Member Functions | Static Public Attributes | List of all members
cppgraph::node_link Struct Reference

A node link is a named connector, with properties, between a parent and a child node in a graph. More...

#include <node_link.h>

Inheritance diagram for cppgraph::node_link:
Inheritance graph
[legend]

Public Member Functions

 ~node_link ()
 
node_handle get_child () const noexcept
 
template<typename T >
node_handle_t< T > get_child_t (error_action_enum error_action_type) const
 
id_t get_id () const override
 
link_name_t const & get_name () const
 
node_handle get_node (relationship_enum relationship_type, error_action_enum error_action_type) const
 
node_id_and_node_id_key_t get_node_link_id () const
 
node_handle get_parent (error_action_enum error_action_type) const
 
node_id_t get_parent_node_id (error_action_enum error_action_type) const
 
template<typename T >
node_handle_t< T > get_parent_t (error_action_enum error_action_type) const
 
- Public Member Functions inherited from cppgraph::properties_parent
property_link_handle add_property_link (link_name_t const &link_name, property_handle const &h_property) const
 Attaches a specified property to this object using a specified name for the new property link. More...
 
template<typename T >
property_link_handle find_or_add_property_link_t (link_name_t const &link_name) const
 Returns the property link of this node whose property is of a specified type, and whose link name matches a specfied name. If it doesn't currently exist, the link, with name link_name and a default-constructed property of type T, is created and added. More...
 
property_handle_list find_properties (node_handle_t< property_filter > const &h_filter=nullptr) const
 Returns a container of all child properties of this object that pass an optionally-specified property filter,. More...
 
property_handle_list find_properties (link_name_t const &link_name, error_action_enum error_action_type, selection_multiplicity_enum selection_multiplicity_type, node_handle_t< property_filter > const &h_filter=nullptr) const
 Returns a container of all child properties of this object that pass an optionally-specified property filter, and whose property link has a specified name. More...
 
template<typename T >
property_handle_list find_properties_t (error_action_enum error_action_type, selection_multiplicity_enum selection_multiplicity_type, node_handle_t< property_filter > const &h_filter=nullptr) const
 Returns a container of all child properties of this object that pass an optionally-specified property filter, and that are of a specified type. More...
 
template<typename T >
property_handle_list find_properties_t (link_name_t const &link_name, error_action_enum error_action_type, selection_multiplicity_enum selection_multiplicity_type, node_handle_t< property_filter > const &h_filter=nullptr) const
 Returns a container of all child properties of this object, that pass an optionally-specified property filter, that are of a specified type, and whose property link has a specified name. More...
 
property_handle find_property (link_name_t const &link_name, error_action_enum error_action_type, node_handle_t< property_filter > const &h_filter=nullptr) const
 Returns the property of this object that passes an optionally specified filter, and whose property link has a specified name. More...
 
property_link_handle find_property_link (link_name_t const &link_name, error_action_enum error_action_type, node_handle_t< property_link_filter > const &h_filter=nullptr) const
 Returns the property link of this node that passes an optionally specified property link filter, and whose link name matches a specfied name. More...
 
template<typename T >
property_link_handle find_property_link_t (error_action_enum error_action_type, node_handle_t< property_link_filter > const &h_filter=nullptr) const
 Returns the property link of this node that passes an optionally specified property link filter and whose property is of a specified type. More...
 
template<typename T >
property_link_handle find_property_link_t (link_name_t const &link_name, error_action_enum error_action_type, node_handle_t< property_link_filter > const &h_filter=nullptr) const
 Returns the property link of this node that passes an optionally specified property link filter, whose property is of a specified type, and whose link name matches a specfied name. More...
 
property_link_handle_list find_property_links (node_handle_t< property_link_filter > const &h_filter=nullptr) const
 Returns a container of all property links of this object, selected by an optionally-specified property link filter. More...
 
property_link_handle_list find_property_links (link_name_t const &link_name, error_action_enum error_action_type, selection_multiplicity_enum selection_multiplicity_type, node_handle_t< property_link_filter > const &h_filter=nullptr) const
 Returns a container of all property links of this node, that pass an optionally-specified property link filter, and that have a specified name. More...
 
template<typename T >
property_link_handle_list find_property_links_t (error_action_enum error_action_type, selection_multiplicity_enum selection_multiplicity_type, node_handle_t< property_link_filter > const &h_filter=nullptr) const
 Returns the property links of this node that pass an optionally specified property link filter and whose property is of a specified type. More...
 
template<typename T >
property_link_handle_list find_property_links_t (link_name_t const &link_name, error_action_enum error_action_type, selection_multiplicity_enum selection_multiplicity_type, node_handle_t< property_link_filter > const &h_filter=nullptr) const
 Returns the property links of this node that pass an optionally specified property link filter, whose property is of a specified type, and whose link name matches a specfied name. More...
 
template<typename T >
property_handle_t< T > find_property_t (error_action_enum error_action_type, node_handle_t< property_filter > const &h_filter=nullptr) const
 Returns the property of this object having a specified type, that passes an optionally specified filter. More...
 
template<typename T >
property_handle_t< T > find_property_t (link_name_t const &link_name, error_action_enum error_action_type, node_handle_t< property_filter > const &h_filter=nullptr) const
 Returns the property of this object having a specified type, that passes an optionally specified filter, and whose property link has a specified name. More...
 
property_handle replace_property (property_handle const &h_current_property, property_handle const &h_new_property, error_action_enum error_action_type)
 Replaces an existing property with a specified property, re-using the property link to the existing property. More...
 
property_link_handle_list set_properties (link_name_t const &link_name, property_handle_list const &properties) const
 Attaches specified properties to this object, using a specified link name. More...
 
void set_property_link (property_link_handle const &h_link) const
 Attaches a specified property link to this object. More...
 
void set_property_links (property_link_handle_list const &links) const
 Attaches specified property links to this object. More...
 
template<typename T >
property_link_handle set_user_property_t (link_name_t const &link_name, T const &value) const
 Attaches a specified user property to this object using a specified name for the new property_link" "property link". More...
 

Static Public Attributes

static link_name_t unnamed_link_name { "unnamed" }
 

Detailed Description

A node link is a named connector, with properties, between a parent and a child node in a graph.

When a node link is created, its reference count is incremented. When the node link is destroyed, its reference count is decremented.

A node link has a parent node ID, a child node handle, a name, and arbitrary properties.

A node link's properties can be shared with those of other node links and nodes.

A node link has 0 or 1 node parents and 1 node child.

Object Diagram

dot_inline_dotgraph_285.png

Class Diagram

node_link.png

Constructor & Destructor Documentation

◆ ~node_link()

cppgraph::node_link::~node_link ( )

Destructor.

Member Function Documentation

◆ get_child()

node_handle cppgraph::node_link::get_child ( ) const
noexcept

Returns a node handle to this node link's child node.

Returns
A node handle to this node link's child node. It is guaranteed (by node_link::set_child()) not to be nullptr.

◆ get_child_t()

template<typename T >
node_handle_t< T > cppgraph::node_link::get_child_t ( error_action_enum  error_action_type) const
inline

Returns this node link's typed child node.

Template Parameters
TType of the child node.
Parameters
error_action_typeSpecifies whether or not to assert if the child node is not of the specified type.
Returns
This node link's child node, or nullptr if the child node is not of type T.
Exceptions
exceptionThis node link's child node is not of type T AND error_action_type == error_action_enum::e_assert

◆ get_id()

id_t cppgraph::node_link::get_id ( ) const
overridevirtual

Returns this node link's guid.

Returns
This node link's guid.

Implements cppgraph::properties_parent.

◆ get_name()

link_name_t const & cppgraph::node_link::get_name ( ) const

Returns this node link's name.

Returns
This node link's name.

◆ get_node()

node_handle cppgraph::node_link::get_node ( relationship_enum  relationship_type,
error_action_enum  error_action_type 
) const

Returns this node link's parent or child node.

Parameters
relationship_typeSpecifies whether the parent or child node is to be returned.
error_action_typeSpecifies whether or not to assert if the parent node was requested and there is no parent node.
Returns
This node link's parent or child node, as specified by relationship_type, or nullptr if there is no such node.
Exceptions
exceptionrelationship_type is relationship_enum::e_parent AND this node link's parent node is nullptr AND error_action_type == error_action_enum::e_assert

◆ get_node_link_id()

node_id_and_node_id_key_t cppgraph::node_link::get_node_link_id ( ) const
Returns
This node link's guid.

◆ get_parent()

node_handle cppgraph::node_link::get_parent ( error_action_enum  error_action_type) const

Returns this node link's parent node.

Parameters
error_action_typeSpecifies whether or not to assert if there is no parent node.
Returns
This node link's parent node, or nullptr if there is no parent node.
Exceptions
exceptionThis node link's parent node is nullptr AND error_action_type == error_action_enum::e_assert

◆ get_parent_node_id()

node_id_t cppgraph::node_link::get_parent_node_id ( error_action_enum  error_action_type) const

Returns The node ID of this this node link's parent node.

Returns
The node ID of this this node link's parent node. If there is no parent node, the returned value evaluates to false in a boolean expression.
Parameters
error_action_typeSpecifies whether or not to assert if there is no parent node.
Exceptions
exceptionThis node link's parent node is nullptr AND error_action_type == error_action_enum::e_assert

◆ get_parent_t()

template<typename T >
node_handle_t< T > cppgraph::node_link::get_parent_t ( error_action_enum  error_action_type) const
inline

Returns this node link's typed parent node.

Template Parameters
TType of the parent node.
Parameters
error_action_typeSpecifies whether or not to assert if there is no parent node or the parent node is not of the specified type.
Returns
This node link's parent node, or nullptr if there is no parent node or the parent node is not of type T.
Exceptions
exceptionThis node link's parent node is nullptr or not of type T AND error_action_type == error_action_enum::e_assert

Member Data Documentation

◆ unnamed_link_name

link_name_t cppgraph::node_link::unnamed_link_name { "unnamed" }
inlinestatic

The name given to a link when an empty link name is provided.


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