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

A property link ia a named connector between a node and a property, or between a node link and a property, in the graph. More...

#include <property_link.h>

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

Public Member Functions

property_link_handle detach_from_parent ()
 
link_name_t const & get_name () const
 
id_t get_parent_id () const
 
property_handle get_property () const
 
template<typename T >
property_handle_t< T > get_property_t (error_action_enum error_action_type) const
 Returns a handle to this property link's property, specified by type. More...
 
property_handle set_property (property_handle const &h_property)
 Replaces this property link's property with a specified property. More...
 

Static Public Member Functions

static property_link_handle create_property_link (link_name_t const &name, property_handle const &h_property)
 Creates and returns a handle to an instance of a property link with a specified name and child property, and no parent (node or node link). More...
 

Detailed Description

A property link ia a named connector between a node and a property, or between a node link and a property, in the graph.

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

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

A property link has 0 or 1 (non-null) node or node link parents and 1 (non-null) property child.

Object Diagram

dot_inline_dotgraph_335.png

Class Diagram

property_link.png

Member Function Documentation

◆ create_property_link()

property_link_handle cppgraph::property_link::create_property_link ( link_name_t const &  name,
property_handle const &  h_property 
)
static

Creates and returns a handle to an instance of a property link with a specified name and child property, and no parent (node or node link).

Parameters
nameName to assign as the property link's name.
h_propertyA property to be assigned to the property link.
Returns
A handle to the new property link instance. nullptr is returned if h_property is nullptr.

◆ detach_from_parent()

property_link_handle cppgraph::property_link::detach_from_parent ( )

Detaches this property link from its parent node or node link.

If this property link does not have a parent, no actions are performed. Otherwise, this property link is removed from its parent node or node link.

Returns
A property link handle to this property link.

◆ get_name()

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

Returns the property link's name.

Returns
The property link's name.

◆ get_parent_id()

id_t cppgraph::property_link::get_parent_id ( ) const

Returns this property link's parent ID.

Returns
This property link's parent ID.

◆ get_property()

property_handle cppgraph::property_link::get_property ( ) const

Returns a handle to the property link's property.

Returns
A handle to the property link's property. It is guranteed not to be nullptr.

◆ get_property_t()

template<typename T >
property_handle_t< T > cppgraph::property_link::get_property_t ( error_action_enum  error_action_type) const

Returns a handle to this property link's property, specified by type.

Template Parameters
TType of the property.
Parameters
error_action_typeSpecifies whether or not to assert if this node link's property is not of type T.
Returns
A handle to this property link's property. If there is no such property, nullptr is returned.
Exceptions
exceptionhe property is not of type T AND error_action_type == error_action_enum::e_assert

◆ set_property()

property_handle cppgraph::property_link::set_property ( property_handle const &  h_property)

Replaces this property link's property with a specified property.

Parameters
h_propertyA property to replace this property link's property. If it is nullptr, the existing property is not replaced.
Returns
The existing property which is guaranteed not to be nullptr.
Exceptions
exceptionh_property is nullptr.`

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