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 |
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.
lvr2::BaseOptionalHandle< IdxT, NonOptionalT >::BaseOptionalHandle | ( | ) |
lvr2::BaseOptionalHandle< IdxT, NonOptionalT >::BaseOptionalHandle | ( | BaseHandle< IdxT > | handle | ) |
lvr2::BaseOptionalHandle< IdxT, NonOptionalT >::BaseOptionalHandle | ( | boost::optional< BaseHandle< IdxT >> | handle | ) |
|
explicit |
|
explicit |
bool lvr2::BaseOptionalHandle< IdxT, NonOptionalT >::operator! | ( | ) | const |
bool lvr2::BaseOptionalHandle< IdxT, NonOptionalT >::operator!= | ( | const BaseOptionalHandle< IdxT, NonOptionalT > & | other | ) | const |
bool lvr2::BaseOptionalHandle< IdxT, NonOptionalT >::operator== | ( | const BaseOptionalHandle< IdxT, NonOptionalT > & | other | ) | const |
void lvr2::BaseOptionalHandle< IdxT, NonOptionalT >::setIdx | ( | IdxT | idx | ) |
NonOptionalT lvr2::BaseOptionalHandle< IdxT, NonOptionalT >::unwrap | ( | ) | const |
Extracts the handle. If this
doesn't hold a handle (is "None"), this method panics.
|
private |
Definition at line 102 of file BaseHandle.hpp.