TeDDy 4.1.0
Decision diagram library.
Loading...
Searching...
No Matches
Public Types | Public Member Functions | List of all members
teddy::diagram< Data, Degree > Class Template Reference

Cheap wrapper for the internal diagram node type. More...

#include <diagram.hpp>

Public Types

using node_t = node< Data, Degree >
 

Public Member Functions

 diagram ()=default
 Default constructed diagram. Points to no node and should not be used.
 
 diagram (node_t *root)
 Wraps internal node representation. You should probably don't use this one unless you know what you are doing.
 
 diagram (diagram const &other)
 Cheap copy constructor.
 
 diagram (diagram &&other) noexcept
 Cheap move constructor.
 
 ~diagram ()
 Destructor. Ensures correct reference counting using RAII pattern.
 
auto operator= (diagram other) -> diagram &
 Assigns pointer from the other diagram.
 
auto swap (diagram &other) -> void
 Swaps pointers in this and other diagram.
 
auto equals (diagram const &other) const -> bool
 Compares node pointers in this and other diagram.
 
auto unsafe_get_root () const -> node_t *
 Returns pointer to internal node type. You should probably don't use this one unless you know what you are doing.
 

Detailed Description

template<class Data, class Degree>
class teddy::diagram< Data, Degree >

Cheap wrapper for the internal diagram node type.

Instance of the diagram holds pointer to an internal node. Therefore, it is a cheap value type. Multiple diagrams can point to a same node i.e. represent the same function.

Constructor & Destructor Documentation

◆ diagram() [1/4]

template<class Data , class Degree >
teddy::diagram< Data, Degree >::diagram ( )
default

Default constructed diagram. Points to no node and should not be used.

Technically, this constructor does not need to exists at all but for the library user it might be useful to create e.g. vector of empty diagrams and assign them later.

◆ diagram() [2/4]

template<class Data , class Degree >
teddy::diagram< Data, Degree >::diagram ( node_t root)

Wraps internal node representation. You should probably don't use this one unless you know what you are doing.

Parameters
rootroot node of the diagram

◆ diagram() [3/4]

template<class Data , class Degree >
teddy::diagram< Data, Degree >::diagram ( diagram< Data, Degree > const &  other)

Cheap copy constructor.

Parameters
otherDiagram to be copied

◆ diagram() [4/4]

template<class Data , class Degree >
teddy::diagram< Data, Degree >::diagram ( diagram< Data, Degree > &&  other)
noexcept

Cheap move constructor.

Parameters
otherDiagram to be moved from.

Member Function Documentation

◆ operator=()

template<class Data , class Degree >
auto teddy::diagram< Data, Degree >::operator= ( diagram< Data, Degree >  other) -> diagram&

Assigns pointer from the other diagram.

Parameters
otherDiagram to be assigned into this one.
Returns
Reference to this diagram.

◆ swap()

template<class Data , class Degree >
auto teddy::diagram< Data, Degree >::swap ( diagram< Data, Degree > &  other) -> void

Swaps pointers in this and other diagram.

Parameters
otherDiagram to be swapped with this one.

◆ equals()

template<class Data , class Degree >
auto teddy::diagram< Data, Degree >::equals ( diagram< Data, Degree > const &  other) const -> bool

Compares node pointers in this and other diagram.

Parameters
otherDiagram to be compared with this one.
Returns
true iif diagrams represent the same function.

◆ unsafe_get_root()

template<class Data , class Degree >
auto teddy::diagram< Data, Degree >::unsafe_get_root

Returns pointer to internal node type. You should probably don't use this one unless you know what you are doing.

Returns
Pointer to node root node of the diagram.

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