Public Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
tesseract_common::AnyPoly Class Reference

#include <any_poly.h>

Public Member Functions

 AnyPoly ()=default
 
 AnyPoly (AnyPoly &&other) noexcept=default
 
 AnyPoly (const AnyInterface &impl)
 
 AnyPoly (const AnyPoly &other)
 
template<typename T , typename std::enable_if_t<!std::is_base_of_v< AnyInterface, T > &&!std::is_same_v< std::decay_t< T >, AnyPoly >, bool > = true>
 AnyPoly (const T &value)
 
template<typename T , typename std::enable_if_t<!std::is_base_of_v< AnyInterface, T > &&!std::is_same_v< std::decay_t< T >, AnyPoly >, bool > = true>
 AnyPoly (T &&value)
 
template<typename T , typename std::enable_if_t< std::is_base_of_v< AnyInterface, T >, bool > = true>
T & as ()
 
template<typename T , typename std::enable_if_t<!std::is_base_of_v< AnyInterface, T >, bool > = true>
T & as ()
 
template<typename T , typename std::enable_if_t< std::is_base_of_v< AnyInterface, T >, bool > = true>
const T & as () const
 
template<typename T , typename std::enable_if_t<!std::is_base_of_v< AnyInterface, T >, bool > = true>
const T & as () const
 
AnyInterfaceget ()
 Get the instruction being stored. More...
 
const AnyInterfaceget () const
 
std::type_index getType () const
 Get the stored derived type. More...
 
bool isNull () const
 Check if the poly type is null. More...
 
bool operator!= (const AnyPoly &rhs) const
 
AnyPolyoperator= (AnyPoly &&other) noexcept=default
 
AnyPolyoperator= (const AnyPoly &other)
 
template<typename T , typename std::enable_if_t<!std::is_base_of_v< AnyInterface, T > &&!std::is_same_v< std::decay_t< T >, AnyPoly >, bool > = true>
AnyPolyoperator= (const T &value)
 
template<typename T , typename std::enable_if_t<!std::is_base_of_v< AnyInterface, T > &&!std::is_same_v< std::decay_t< T >, AnyPoly >, bool > = true>
AnyPolyoperator= (T &&value)
 
bool operator== (const AnyPoly &rhs) const
 
 ~AnyPoly ()=default
 

Private Member Functions

template<class Archive >
void serialize (Archive &ar, const unsigned int version)
 

Private Attributes

std::unique_ptr< AnyInterfaceimpl_
 

Friends

class boost::serialization::access
 
struct tesseract_common::Serialization
 

Detailed Description

Definition at line 113 of file any_poly.h.

Constructor & Destructor Documentation

◆ AnyPoly() [1/6]

tesseract_common::AnyPoly::AnyPoly ( )
default

◆ ~AnyPoly()

tesseract_common::AnyPoly::~AnyPoly ( )
default

◆ AnyPoly() [2/6]

tesseract_common::AnyPoly::AnyPoly ( const AnyPoly other)

Definition at line 55 of file any_poly.cpp.

◆ AnyPoly() [3/6]

tesseract_common::AnyPoly::AnyPoly ( AnyPoly &&  other)
defaultnoexcept

◆ AnyPoly() [4/6]

tesseract_common::AnyPoly::AnyPoly ( const AnyInterface impl)

Definition at line 69 of file any_poly.cpp.

◆ AnyPoly() [5/6]

template<typename T , typename std::enable_if_t<!std::is_base_of_v< AnyInterface, T > &&!std::is_same_v< std::decay_t< T >, AnyPoly >, bool > = true>
tesseract_common::AnyPoly::AnyPoly ( T &&  value)
inline

Template Constructor for Moving Arbitrary Values

Definition at line 128 of file any_poly.h.

◆ AnyPoly() [6/6]

template<typename T , typename std::enable_if_t<!std::is_base_of_v< AnyInterface, T > &&!std::is_same_v< std::decay_t< T >, AnyPoly >, bool > = true>
tesseract_common::AnyPoly::AnyPoly ( const T &  value)
inline

Template Constructor for Copying Arbitrary Values

Definition at line 145 of file any_poly.h.

Member Function Documentation

◆ as() [1/4]

template<typename T , typename std::enable_if_t< std::is_base_of_v< AnyInterface, T >, bool > = true>
T& tesseract_common::AnyPoly::as ( )
inline

Definition at line 181 of file any_poly.h.

◆ as() [2/4]

template<typename T , typename std::enable_if_t<!std::is_base_of_v< AnyInterface, T >, bool > = true>
T& tesseract_common::AnyPoly::as ( )
inline

Definition at line 192 of file any_poly.h.

◆ as() [3/4]

template<typename T , typename std::enable_if_t< std::is_base_of_v< AnyInterface, T >, bool > = true>
const T& tesseract_common::AnyPoly::as ( ) const
inline

Definition at line 203 of file any_poly.h.

◆ as() [4/4]

template<typename T , typename std::enable_if_t<!std::is_base_of_v< AnyInterface, T >, bool > = true>
const T& tesseract_common::AnyPoly::as ( ) const
inline

Definition at line 214 of file any_poly.h.

◆ get() [1/2]

const AnyInterface & tesseract_common::AnyPoly::get ( )

Get the instruction being stored.

Returns
The instruction
Exceptions
Ifnull

Definition at line 80 of file any_poly.cpp.

◆ get() [2/2]

const AnyInterface& tesseract_common::AnyPoly::get ( ) const

◆ getType()

std::type_index tesseract_common::AnyPoly::getType ( ) const

Get the stored derived type.

Returns
The derived type index

Definition at line 71 of file any_poly.cpp.

◆ isNull()

bool tesseract_common::AnyPoly::isNull ( ) const

Check if the poly type is null.

Returns
True if null, otherwise false

Definition at line 79 of file any_poly.cpp.

◆ operator!=()

bool tesseract_common::AnyPoly::operator!= ( const AnyPoly rhs) const

Definition at line 97 of file any_poly.cpp.

◆ operator=() [1/4]

AnyPoly& tesseract_common::AnyPoly::operator= ( AnyPoly &&  other)
defaultnoexcept

◆ operator=() [2/4]

AnyPoly & tesseract_common::AnyPoly::operator= ( const AnyPoly other)

Definition at line 61 of file any_poly.cpp.

◆ operator=() [3/4]

template<typename T , typename std::enable_if_t<!std::is_base_of_v< AnyInterface, T > &&!std::is_same_v< std::decay_t< T >, AnyPoly >, bool > = true>
AnyPoly& tesseract_common::AnyPoly::operator= ( const T &  value)
inline

Templated Copy Assignment Operator

Definition at line 153 of file any_poly.h.

◆ operator=() [4/4]

template<typename T , typename std::enable_if_t<!std::is_base_of_v< AnyInterface, T > &&!std::is_same_v< std::decay_t< T >, AnyPoly >, bool > = true>
AnyPoly& tesseract_common::AnyPoly::operator= ( T &&  value)
inline

Definition at line 135 of file any_poly.h.

◆ operator==()

bool tesseract_common::AnyPoly::operator== ( const AnyPoly rhs) const

Definition at line 83 of file any_poly.cpp.

◆ serialize()

template<class Archive >
void tesseract_common::AnyPoly::serialize ( Archive &  ar,
const unsigned int  version 
)
private

Definition at line 101 of file any_poly.cpp.

Friends And Related Function Documentation

◆ boost::serialization::access

friend class boost::serialization::access
friend

Definition at line 231 of file any_poly.h.

◆ tesseract_common::Serialization

friend struct tesseract_common::Serialization
friend

Definition at line 232 of file any_poly.h.

Member Data Documentation

◆ impl_

std::unique_ptr<AnyInterface> tesseract_common::AnyPoly::impl_
private

Definition at line 229 of file any_poly.h.


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


tesseract_common
Author(s): Levi Armstrong
autogenerated on Sun May 18 2025 03:01:40