Skip to content

scram::core::WeakIntrusivePtr

A weak pointer to store in BDD unique tables. More...

#include <bdd.h>

Inherits from boost::noncopyable

Public Functions

Name
WeakIntrusivePtr()<br>Default constructor is to allow initialization in tables.
WeakIntrusivePtr(const IntrusivePtr< T > & ptr)<br>Constructs from the shared pointer.
WeakIntrusivePtr &operator=(const IntrusivePtr< T > & ptr)<br>Copy assignment from shared pointers for convenient initialization with operator[] in hash tables.
~WeakIntrusivePtr()<br>Communicates the pointer destruction to the vertex.
boolexpired() const
IntrusivePtr< T >lock() const
T *get() const

Friends

Name
classVertex< T >

Detailed Description

cpp
template <class T >
class scram::core::WeakIntrusivePtr;

A weak pointer to store in BDD unique tables.

Template Parameters:

  • T The type of the main functional BDD vertex.

This weak pointer is unique pointer as well because vertices should not be easily shared among multiple BDDs.

Public Functions Documentation

function WeakIntrusivePtr

cpp
inline WeakIntrusivePtr()

Default constructor is to allow initialization in tables.

function WeakIntrusivePtr

cpp
inline explicit WeakIntrusivePtr(
    const IntrusivePtr< T > & ptr
)

Constructs from the shared pointer.

Parameters:

  • ptr Fully initialized intrusive pointer.

However, there is no weak-to-shared constructor.

function operator=

cpp
inline WeakIntrusivePtr & operator=(
    const IntrusivePtr< T > & ptr
)

Copy assignment from shared pointers for convenient initialization with operator[] in hash tables.

Parameters:

  • ptr Fully initialized intrusive pointer.

Return: Reference to this.

function ~WeakIntrusivePtr

cpp
inline ~WeakIntrusivePtr()

Communicates the pointer destruction to the vertex.

function expired

cpp
inline bool expired() const

Return: true if the managed vertex is deleted or not initialized.

function lock

cpp
inline IntrusivePtr< T > lock() const

Return: The intrusive pointer of the vertex. nullptr if the vertex is deleted or not initialized.

function get

cpp
inline T * get() const

Return: The raw pointer to the vertex. nullptr if the vertex is deleted or not initialized.

Friends

friend Vertex< T >

cpp
friend class Vertex< T >(
    Vertex< T > 
);

Updated on 2025-11-11 at 16:51:08 +0000