SHOGUN  6.1.3
List of all members | Classes | Public Member Functions | Friends
Any Class Reference

Detailed Description

Allows to store objects of arbitrary types by using a BaseAnyPolicy and provides a type agnostic API. See its usage in CSGObject::Self, CSGObject::set(), CSGObject::get() and CSGObject::has().

Definition at line 290 of file any.h.

Classes

struct  Empty
 

Public Member Functions

 Any ()
 
template<typename T >
 Any (const T &v)
 
 Any (BaseAnyPolicy *the_policy, void *the_storage)
 
 Any (const Any &other)
 
Anyoperator= (const Any &other)
 
 ~Any ()
 
template<typename T >
T & as () const
 
template<typename T >
bool same_type () const
 
template<typename T >
bool same_type_fallback () const
 
bool empty () const
 
const std::type_info & type_info () const
 

Friends

bool operator== (const Any &lhs, const Any &rhs)
 
bool operator!= (const Any &lhs, const Any &rhs)
 

Constructor & Destructor Documentation

◆ Any() [1/4]

Any ( )

Empty value constructor

Definition at line 297 of file any.h.

◆ Any() [2/4]

Any ( const T &  v)
explicit

Constructor to copy value

Definition at line 303 of file any.h.

◆ Any() [3/4]

Any ( BaseAnyPolicy the_policy,
void *  the_storage 
)

Base constructor

Definition at line 309 of file any.h.

◆ Any() [4/4]

Any ( const Any other)

Copy constructor

Definition at line 315 of file any.h.

◆ ~Any()

~Any ( )

Destructor

Definition at line 349 of file any.h.

Member Function Documentation

◆ as()

T& as ( ) const

Casts hidden value to provided type, fails otherwise.

Returns
type-casted value

Definition at line 358 of file any.h.

◆ empty()

bool empty ( ) const
Returns
true if Any object is empty.

Definition at line 389 of file any.h.

◆ operator=()

Any& operator= ( const Any other)

Assignment operator

Parameters
otheranother Any object
Returns
Any object

Definition at line 325 of file any.h.

◆ same_type()

bool same_type ( ) const
Returns
true if type is same.

Definition at line 374 of file any.h.

◆ same_type_fallback()

bool same_type_fallback ( ) const
Returns
true if type-id is same.

Definition at line 383 of file any.h.

◆ type_info()

const std::type_info& type_info ( ) const

Definition at line 394 of file any.h.

Friends And Related Function Documentation

◆ operator!=

bool operator!= ( const Any lhs,
const Any rhs 
)
friend

Inequality operator

Parameters
lhsAny object on left hand side
rhsAny object on right hand side
Returns
false if both are equal

Definition at line 423 of file any.h.

◆ operator==

bool operator== ( const Any lhs,
const Any rhs 
)
friend

Equality operator

Parameters
lhsAny object on left hand side
rhsAny object on right hand side
Returns
true if both are equal

Definition at line 415 of file any.h.


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

SHOGUN Machine Learning Toolbox - Documentation