mCRL2
Loading...
Searching...
No Matches
mcrl2::utilities::tagged_pointer< T > Class Template Reference

A pointer storage object that uses a least significant bit as a mark. Can be used by objects that are 8 bytes aligned in memory. More...

#include <tagged_pointer.h>

Public Member Functions

 tagged_pointer ()
 
 tagged_pointer (T *p)
 
bool tagged () const
 
void tag () const
 Apply a tag to the pointer that can be checked with tagged().
 
void untag () const
 Remove the tag.
 
bool defined () const
 
void operator= (std::nullptr_t)
 
bool operator== (std::nullptr_t) const
 
bool operator!= (std::nullptr_t) const
 
bool operator== (const tagged_pointer &other) const
 
bool operator!= (const tagged_pointer &other) const
 
bool operator< (const tagged_pointer &other) const noexcept
 
bool operator<= (const tagged_pointer &other) const noexcept
 
bool operator> (const tagged_pointer &other) const noexcept
 
bool operator>= (const tagged_pointer &other) const noexcept
 
const T & operator* () const
 
T & operator* ()
 
const T * operator-> () const
 
T * operator-> ()
 
const T * get () const
 
T * get ()
 
void swap (tagged_pointer< T > &other)
 

Private Attributes

std::conditional_t< detail::GlobalThreadSafe, detail::atomic_wrapper< T * >, T * > m_pointer = nullptr
 

Detailed Description

template<typename T>
class mcrl2::utilities::tagged_pointer< T >

A pointer storage object that uses a least significant bit as a mark. Can be used by objects that are 8 bytes aligned in memory.

Definition at line 65 of file tagged_pointer.h.

Constructor & Destructor Documentation

◆ tagged_pointer() [1/2]

template<typename T >
mcrl2::utilities::tagged_pointer< T >::tagged_pointer ( )
inline

Definition at line 68 of file tagged_pointer.h.

◆ tagged_pointer() [2/2]

template<typename T >
mcrl2::utilities::tagged_pointer< T >::tagged_pointer ( T *  p)
inlineexplicit

Definition at line 69 of file tagged_pointer.h.

Member Function Documentation

◆ defined()

template<typename T >
bool mcrl2::utilities::tagged_pointer< T >::defined ( ) const
inline

Definition at line 91 of file tagged_pointer.h.

◆ get() [1/2]

template<typename T >
T * mcrl2::utilities::tagged_pointer< T >::get ( )
inline

Definition at line 166 of file tagged_pointer.h.

◆ get() [2/2]

template<typename T >
const T * mcrl2::utilities::tagged_pointer< T >::get ( ) const
inline

Definition at line 161 of file tagged_pointer.h.

◆ operator!=() [1/2]

template<typename T >
bool mcrl2::utilities::tagged_pointer< T >::operator!= ( const tagged_pointer< T > &  other) const
inline

Definition at line 116 of file tagged_pointer.h.

◆ operator!=() [2/2]

template<typename T >
bool mcrl2::utilities::tagged_pointer< T >::operator!= ( std::nullptr_t  ) const
inline

Definition at line 106 of file tagged_pointer.h.

◆ operator*() [1/2]

template<typename T >
T & mcrl2::utilities::tagged_pointer< T >::operator* ( )
inline

Definition at line 146 of file tagged_pointer.h.

◆ operator*() [2/2]

template<typename T >
const T & mcrl2::utilities::tagged_pointer< T >::operator* ( ) const
inline

Definition at line 141 of file tagged_pointer.h.

◆ operator->() [1/2]

template<typename T >
T * mcrl2::utilities::tagged_pointer< T >::operator-> ( )
inline

Definition at line 156 of file tagged_pointer.h.

◆ operator->() [2/2]

template<typename T >
const T * mcrl2::utilities::tagged_pointer< T >::operator-> ( ) const
inline

Definition at line 151 of file tagged_pointer.h.

◆ operator<()

template<typename T >
bool mcrl2::utilities::tagged_pointer< T >::operator< ( const tagged_pointer< T > &  other) const
inlinenoexcept

Definition at line 121 of file tagged_pointer.h.

◆ operator<=()

template<typename T >
bool mcrl2::utilities::tagged_pointer< T >::operator<= ( const tagged_pointer< T > &  other) const
inlinenoexcept

Definition at line 126 of file tagged_pointer.h.

◆ operator=()

template<typename T >
void mcrl2::utilities::tagged_pointer< T >::operator= ( std::nullptr_t  )
inline

Definition at line 96 of file tagged_pointer.h.

◆ operator==() [1/2]

template<typename T >
bool mcrl2::utilities::tagged_pointer< T >::operator== ( const tagged_pointer< T > &  other) const
inline

Definition at line 111 of file tagged_pointer.h.

◆ operator==() [2/2]

template<typename T >
bool mcrl2::utilities::tagged_pointer< T >::operator== ( std::nullptr_t  ) const
inline

Definition at line 101 of file tagged_pointer.h.

◆ operator>()

template<typename T >
bool mcrl2::utilities::tagged_pointer< T >::operator> ( const tagged_pointer< T > &  other) const
inlinenoexcept

Definition at line 131 of file tagged_pointer.h.

◆ operator>=()

template<typename T >
bool mcrl2::utilities::tagged_pointer< T >::operator>= ( const tagged_pointer< T > &  other) const
inlinenoexcept

Definition at line 136 of file tagged_pointer.h.

◆ swap()

template<typename T >
void mcrl2::utilities::tagged_pointer< T >::swap ( tagged_pointer< T > &  other)
inline

Definition at line 171 of file tagged_pointer.h.

◆ tag()

template<typename T >
void mcrl2::utilities::tagged_pointer< T >::tag ( ) const
inline

Apply a tag to the pointer that can be checked with tagged().

Definition at line 80 of file tagged_pointer.h.

◆ tagged()

template<typename T >
bool mcrl2::utilities::tagged_pointer< T >::tagged ( ) const
inline
Returns
True iff this pointer has been tagged,

Definition at line 74 of file tagged_pointer.h.

◆ untag()

template<typename T >
void mcrl2::utilities::tagged_pointer< T >::untag ( ) const
inline

Remove the tag.

Definition at line 86 of file tagged_pointer.h.

Member Data Documentation

◆ m_pointer

template<typename T >
std::conditional_t<detail::GlobalThreadSafe, detail::atomic_wrapper<T*>, T*> mcrl2::utilities::tagged_pointer< T >::m_pointer = nullptr
mutableprivate

Definition at line 180 of file tagged_pointer.h.


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