Public Member Functions | Private Attributes | List of all members
lvr2::BaseOptionalHandle< IdxT, NonOptionalT > Class Template Reference

Base class for optional handles (handles that can be "null" or "None"). More...

#include <BaseHandle.hpp>

Public Member Functions

 BaseOptionalHandle ()
 
 BaseOptionalHandle (BaseHandle< IdxT > handle)
 
 BaseOptionalHandle (boost::optional< BaseHandle< IdxT >> handle)
 
 BaseOptionalHandle (IdxT idx)
 
 operator bool () const
 
bool operator! () const
 
bool operator!= (const BaseOptionalHandle &other) const
 
bool operator== (const BaseOptionalHandle &other) const
 
void setIdx (IdxT idx)
 
NonOptionalT unwrap () const
 Extracts the handle. If this doesn't hold a handle (is "None"), this method panics. More...
 

Private Attributes

IdxT m_idx
 

Detailed Description

template<typename IdxT, typename NonOptionalT>
class lvr2::BaseOptionalHandle< IdxT, NonOptionalT >

Base class for optional handles (handles that can be "null" or "None").

This class is semantically equivalent to boost::optional<BaseHandle>. This class uses a special index value to store the "None" value. This saves memory.

Definition at line 79 of file BaseHandle.hpp.

Constructor & Destructor Documentation

◆ BaseOptionalHandle() [1/4]

template<typename IdxT , typename NonOptionalT >
lvr2::BaseOptionalHandle< IdxT, NonOptionalT >::BaseOptionalHandle ( )

◆ BaseOptionalHandle() [2/4]

template<typename IdxT , typename NonOptionalT >
lvr2::BaseOptionalHandle< IdxT, NonOptionalT >::BaseOptionalHandle ( BaseHandle< IdxT >  handle)

◆ BaseOptionalHandle() [3/4]

template<typename IdxT , typename NonOptionalT >
lvr2::BaseOptionalHandle< IdxT, NonOptionalT >::BaseOptionalHandle ( boost::optional< BaseHandle< IdxT >>  handle)

◆ BaseOptionalHandle() [4/4]

template<typename IdxT , typename NonOptionalT >
lvr2::BaseOptionalHandle< IdxT, NonOptionalT >::BaseOptionalHandle ( IdxT  idx)
explicit

Member Function Documentation

◆ operator bool()

template<typename IdxT , typename NonOptionalT >
lvr2::BaseOptionalHandle< IdxT, NonOptionalT >::operator bool ( ) const
explicit

◆ operator!()

template<typename IdxT , typename NonOptionalT >
bool lvr2::BaseOptionalHandle< IdxT, NonOptionalT >::operator! ( ) const

◆ operator!=()

template<typename IdxT , typename NonOptionalT >
bool lvr2::BaseOptionalHandle< IdxT, NonOptionalT >::operator!= ( const BaseOptionalHandle< IdxT, NonOptionalT > &  other) const

◆ operator==()

template<typename IdxT , typename NonOptionalT >
bool lvr2::BaseOptionalHandle< IdxT, NonOptionalT >::operator== ( const BaseOptionalHandle< IdxT, NonOptionalT > &  other) const

◆ setIdx()

template<typename IdxT , typename NonOptionalT >
void lvr2::BaseOptionalHandle< IdxT, NonOptionalT >::setIdx ( IdxT  idx)

◆ unwrap()

template<typename IdxT , typename NonOptionalT >
NonOptionalT lvr2::BaseOptionalHandle< IdxT, NonOptionalT >::unwrap ( ) const

Extracts the handle. If this doesn't hold a handle (is "None"), this method panics.

Member Data Documentation

◆ m_idx

template<typename IdxT , typename NonOptionalT >
IdxT lvr2::BaseOptionalHandle< IdxT, NonOptionalT >::m_idx
private

Definition at line 102 of file BaseHandle.hpp.


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


lvr2
Author(s): Thomas Wiemann , Sebastian Pütz , Alexander Mock , Lars Kiesow , Lukas Kalbertodt , Tristan Igelbrink , Johan M. von Behren , Dominik Feldschnieders , Alexander Löhr
autogenerated on Wed Mar 2 2022 00:37:27